* Adj Code.

This commit is contained in:
lichengjun
2021-06-28 14:04:02 +08:00
parent 3907ff1ea7
commit be619512c4
3 changed files with 30 additions and 6 deletions
+26 -2
View File
@@ -597,13 +597,37 @@ class gitlabModel extends model
$issue = $this->bugToIssue($gitlab, $gitlabProject, $bug);
$this->createZentaoObjectLabel($gitlab, $gitlabProject, 'bug', $bugID);
sprintf($this->config->gitlab->zentaoObjectLabel->name, 'bug', $bugID);
$issue->labels = sprintf($this->config->gitlab->zentaoObjectLabel->name, 'bug', $bugID);
if($syncedIssue) $issue = $this->apiUpdateIssue($gitlab, $gitlabProject, $syncedIssue, $issue);
$issue = $this->apiCreateIssue($gitlab, $gitlabProject, $issue);
if($issue) $this->saveSyncedIssue('bug', $bug, $gitlab, $issue);
}
/**
* Push to gitlab issue.
*
* @param int $storyID
* @param int $gitlab
* @param int $gitlabProject
* @access public
* @return void
*/
public function PushToissue($ID, $gitlabID, $gitlabProject, $type)
{
$data = $this->loadModel($type)->getByID($ID);
$syncedIssue = $this->getSyncedIssue($objectType = $type, $objectID = $ID, $gitlabID);
$issue = $this->bugToIssue($gitlabID, $gitlabProject, $data);
$this->createZentaoObjectLabel($gitlabID, $gitlabProject, $type, $ID);
$issue->labels = sprintf($this->config->gitlab->zentaoObjectLabel->name, $type, $ID);
if($syncedIssue) $issue = $this->apiUpdateIssue($gitlabID, $gitlabProject, $syncedIssue, $issue);
$issue = $this->apiCreateIssue($gitlabID, $gitlabProject, $issue);
if($issue) $this->saveSyncedIssue($type, $data, $gitlabID, $issue);
}
/**
* Get synced issue from relation table.
*
@@ -735,7 +759,7 @@ class gitlabModel extends model
$value = '';
list($field, $optionType, $options) = explode('|', $config);
if($optionType == 'field') $value = $bug->$bugField;
if($optionType == 'fields') $value = $bug->$bugField . "\n\n" . $story->$options;
if($optionType == 'fields') $value = $bug->$bugField . "\n\n" . $bug->$options;
if($optionType == 'userPairs')
{
$value = zget($gitlabUsers, $bug->$bugField);