Merge branch 'jihu' of https://gitlab.zcorp.cc/easycorp/zentaopms into jihu
This commit is contained in:
+26
-1
@@ -327,6 +327,31 @@ class gitlabModel extends model
|
||||
return json_decode($response);
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete a Label by labelName.
|
||||
*
|
||||
* @param int $gitlabID
|
||||
* @param int $projectID
|
||||
* @param string $labelName
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function apiDeleteLabel($gitlabID, $projectID, $labelName)
|
||||
{
|
||||
$labels = $this->apiGetLabels($gitlabID, $projectID);
|
||||
foreach($labels as $label)
|
||||
{
|
||||
if($label->name == $labelName) $labelID = $label->id;
|
||||
}
|
||||
|
||||
if(empty($labelID)) return false;
|
||||
|
||||
$apiRoot = $this->getApiRoot($gitlabID);
|
||||
$url = sprintf($apiRoot, "/projects/{$projectID}/labels/{$labelID}");
|
||||
|
||||
return json_decode(commonModel::http($url, $options = array(CURLOPT_CUSTOMREQUEST => 'DELETE')));
|
||||
}
|
||||
|
||||
/**
|
||||
* Create zentao object label for gitlab project.
|
||||
*
|
||||
@@ -835,7 +860,7 @@ class gitlabModel extends model
|
||||
*/
|
||||
public function issueToZentaoObject($issue, $gitlabID)
|
||||
{
|
||||
if(!isset($this->config->gitlab->maps->{$issue->objectType}) return null;
|
||||
if(!isset($this->config->gitlab->maps->{$issue->objectType})) return null;
|
||||
|
||||
$maps = $this->config->gitlab->maps->{$issue->objectType};
|
||||
$gitlabUsers = $this->getUserAccountIdPairs($gitlabID);
|
||||
|
||||
Reference in New Issue
Block a user