* Fix issues bugs.

This commit is contained in:
lichengjun
2021-07-02 11:04:50 +08:00
parent 7b52b61439
commit a951e67f59
2 changed files with 6 additions and 5 deletions
+2 -1
View File
@@ -16,7 +16,8 @@ $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->color = new stdclass;
$config->gitlab->zentaoObjectLabel->color = new stdclass;
$config->gitlab->zentaoObjectLabel->color->task = '#0033CC';
$config->gitlab->zentaoObjectLabel->color->story = '#69D100';
$config->gitlab->zentaoObjectLabel->color->bug = '#D10069';
+4 -4
View File
@@ -748,7 +748,7 @@ class gitlabModel extends model
{
$label = new stdclass;
$label->name = sprintf($this->config->gitlab->zentaoObjectLabel->name, $objectType, $objectID);
$label->color = $this->config->gitlab->zentaoObjectLabel->colors->$objectType;
$label->color = $this->config->gitlab->zentaoObjectLabel->color->$objectType;
$label->description = common::getSysURL() . helper::createLink($objectType, 'view', "id={$objectID}");
return $this->apiCreateLabel($gitlabID, $projectID, $label);
@@ -834,7 +834,7 @@ class gitlabModel extends model
if($syncedIssue) return $this->apiUpdateIssue($gitlabID, $projectID, $syncedIssue->issueID, $issue);
$label = $this->createZentaoObjectLabel($gitlabID, $projectID, $objectType, $objectID);
$issue->labels = $label->name;
$issue->labels = isset($label->name) ? $label->name : '';
$issue = $this->apiCreateIssue($gitlabID, $projectID, $issue);
if($issue) $this->saveSyncedIssue($objectType, $object, $gitlabID, $issue);
@@ -914,7 +914,7 @@ class gitlabModel extends model
if($value) $issue->$field = $value;
}
if($issue->assignee_id == 'closed') unset($issue->assignee_id);
if($isset($issue->assignee_id) and $issue->assignee_id == 'closed') unset($issue->assignee_id);
/* issue->state is null when creating it, we should put status_event when updating it. */
if(isset($issue->state) and $issue->state == 'closed') $issue->state_event='close';
@@ -1053,7 +1053,7 @@ class gitlabModel extends model
if($value) $issue->$field = $value;
}
if($issue->assignee_id == 'closed') unset($issue->assignee_id);
if(isset($issue->assignee_id) and $issue->assignee_id == 'closed') unset($issue->assignee_id);
/* issue->state is null when creating it, we should put status_event when updating it. */
if(isset($issue->state) and $issue->state == 'closed') $issue->state_event='close';