* Update ajaxGetMRUserPairs function.

This commit is contained in:
dingguodong
2021-09-01 10:29:03 +08:00
parent 3209790874
commit e679938379
+11 -2
View File
@@ -417,16 +417,25 @@ class gitlab extends control
/**
* AJAX: Get MR user pairs to select assignee_ids and reviewer_ids.
* Attention: The user must be a member of the GitLab project.
*
* @param int $gitlabID
* @param int $projectID
* @access public
* @return void
*/
public function ajaxGetMRUserPairs($gitlabID)
public function ajaxGetMRUserPairs($gitlabID, $projectID)
{
if(!$gitlabID) return $this->send(array('message' => array()));
$users = $this->gitlab->getUserIdRealnamePairs($gitlabID);
$bindedUsers = $this->gitlab->getUserIdRealnamePairs($gitlabID);
$rawProjectUsers = $this->gitlab->apiGetProjectUsers($gitlabID, $projectID);
$users = array();
foreach($rawProjectUsers as $rawProjectUser)
{
if(!empty($bindedUsers[$rawProjectUser->id])) $users[$rawProjectUser->id] = $bindedUsers[$rawProjectUser->id];
}
$options = "<option value=''></option>";
foreach($users as $index => $user)
{