* Update function for editing a MR.

This commit is contained in:
dingguodong
2021-08-24 11:13:00 +08:00
parent be9a94087c
commit 4f94bcafc5
3 changed files with 11 additions and 2 deletions
+4
View File
@@ -64,10 +64,14 @@ class mr extends control
$targetBranchList = array();
foreach($branchList as $branch) $targetBranchList[$branch] = $branch;
$gitlabUsers = $this->gitlab->getUserAccountIdPairs($MR->gitlabID);
$this->view->MR = $MR;
$this->view->targetBranchList = $targetBranchList;
$this->view->title = $this->lang->mr->edit;
$this->view->users = array("" => "") + $this->loadModel('gitlab')->getUserIdRealnamePairs($MR->gitlabID); /* Get user list for assignee and reviewer. */
$this->view->assignee = zget($gitlabUsers, $MR->assignee, '');
$this->view->reviewer = zget($gitlabUsers, $MR->reviewer, '');
$this->display();
}
+5
View File
@@ -186,6 +186,11 @@ class mrModel extends model
$this->apiUpdateMR($oldMR->gitlabID, $oldMR->targetProject, $oldMR->mriid, $newMR);
/* Change gitlab user ID to zentao account. */
$gitlabUsers = $this->gitlab->getUserIdAccountPairs($oldMR->gitlabID);
$MR->assignee = zget($gitlabUsers, $MR->assignee, '');
$MR->reviewer = zget($gitlabUsers, $MR->reviewer, '');
/* Update MR in Zentao database. */
$this->dao->update(TABLE_MR)->data($MR)
->where('id')->eq($MRID)
+2 -2
View File
@@ -51,11 +51,11 @@
</tr>
<tr>
<th><?php echo $lang->mr->assignee;?></th>
<td><?php echo html::select('assignee', $users, $MR->assignee, "class='form-control chosen'")?></td>
<td><?php echo html::select('assignee', $users, $assignee, "class='form-control chosen'")?></td>
</tr>
<tr>
<th><?php echo $lang->mr->reviewer;?></th>
<td><?php echo html::select('reviewer', $users, $MR->reviewer, "class='form-control chosen'")?></td>
<td><?php echo html::select('reviewer', $users, $reviewer, "class='form-control chosen'")?></td>
</tr>
<tr>
<th></th>