Merge branch 'jihuMR' of https://gitlab.zcorp.cc/easycorp/zentaopms into jihuMR

This commit is contained in:
lichengjun
2021-08-17 11:16:44 +00:00
5 changed files with 57 additions and 4 deletions
+21
View File
@@ -349,4 +349,25 @@ class gitlab extends control
}
return $this->send($options);
}
/**
* AJAX: Get project branches.
*
* @param int $gitlabID
* @param int $projectID
* @access public
* @return object
*/
public function ajaxGetProjectBranches($gitlabID, $projectID)
{
if(!$gitlabID or !$projectID) return $this->send(array('message' => array()));
$branches = $this->gitlab->apiGetBranches($gitlabID, $projectID);
$options = "<option value=''></option>";
foreach($branches as $index =>$branch)
{
$options .= "<option title='{$branch->name}' value='{$index}' data-name='{$branch->name}'>{$branch->name}</option>";
}
return $this->send($options);
}
}
+2 -2
View File
@@ -305,8 +305,8 @@ class gitlabModel extends model
public function getRefOptions($gitlabID, $projectID)
{
$refList = array();
$branches = $this->loadModel('gitlab')->apiGetBranches($gitlabID, $projectID);
$tags = $this->loadModel('gitlab')->apiGetTags($gitlabID, $projectID);
$branches = $this->apiGetBranches($gitlabID, $projectID);
$tags = $this->apiGetTags($gitlabID, $projectID);
foreach($branches as $branch) $refList[] = "Branch::" . $branch->name;
foreach($tags as $tag) $refList[] = "Tag::" . $tag->name;
return $refList;