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