* Simplify function for createZentaoObjectLabel.

This commit is contained in:
dingguodong
2021-07-01 16:15:19 +08:00
parent d4d8185131
commit 56e66eb40a
2 changed files with 8 additions and 21 deletions
+6 -6
View File
@@ -14,12 +14,12 @@ $config->gitlab->actions = array();
$config->gitlab->actions['issue'] = array();
$config->gitlab->zentaoObjectLabel = new stdclass();
$config->gitlab->zentaoObjectLabel->name = "zentao_%s/%s";
$config->gitlab->zentaoObjectLabel->description = "%s";
$config->gitlab->zentaoObjectLabel->taskColor = '#0033CC';
$config->gitlab->zentaoObjectLabel->storyColor = '#69D100';
$config->gitlab->zentaoObjectLabel->bugColor = '#D10069';
$config->gitlab->zentaoObjectLabel->priority = "0";
$config->gitlab->zentaoObjectLabel->name = "zentao_%s/%s";
$config->gitlab->zentaoObjectLabel->description = "%s";
$config->gitlab->zentaoObjectLabel->color->task = '#0033CC';
$config->gitlab->zentaoObjectLabel->color->story = '#69D100';
$config->gitlab->zentaoObjectLabel->color->bug = '#D10069';
$config->gitlab->zentaoObjectLabel->priority = "0";
$config->gitlab->webhookURL = "%s/api.php?m=gitlab&f=webhook&product=%s&gitlab=%s";
+2 -15
View File
@@ -749,21 +749,8 @@ class gitlabModel extends model
{
$label = new stdclass;
$label->name = sprintf($this->config->gitlab->zentaoObjectLabel->name, $objectType, $objectID);
if($objectType == 'task')
{
$label->color = $this->config->gitlab->zentaoObjectLabel->colors->$objectType;
$label->description = common::getSysURL() . helper::createLink($objectType, 'view', "taskID={$objectID}");
}
elseif($objectType == 'bug')
{
$label->color = $this->config->gitlab->zentaoObjectLabel->taskColor;
$label->description = common::getSysURL() . helper::createLink('bug', 'view', "bugID={$objectID}");
}
elseif($objectType == 'story')
{
$label->color = $this->config->gitlab->zentaoObjectLabel->taskColor;
$label->description = common::getSysURL() . helper::createLink('story', 'view', "storyID={$objectID}");
}
$label->color = $this->config->gitlab->zentaoObjectLabel->colors->$objectType;
$label->description = common::getSysURL() . helper::createLink($objectType, 'view', "id={$objectID}");
return $this->apiCreateLabel($gitlabID, $projectID, $label);
}