* Update function for editing a MR.
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user