* Finished import gitlab issue to task.

This commit is contained in:
dingguodong
2021-07-06 17:35:02 +08:00
parent 790ba783da
commit d241e218ce
3 changed files with 18 additions and 11 deletions
+12 -7
View File
@@ -274,9 +274,7 @@ class gitlab extends control
if($executionID)
{
$objectType = $this->config->gitlab->objectTypes[$objectTypeList[$issueID]];
$issue = $this->gitlab->apiGetSingleIssue($gitlabID, $projectID, $issueID);
$originalIssue = $issue;
$issue->objectType = $objectType;
$issue->objectID = 0; // meet the required parameters for issueToZentaoObject.
if(isset($issue->assignee)) $issue->assignee_id = $issue->assignee->id;
@@ -296,17 +294,24 @@ class gitlab extends control
{
}
$object->id = $objectID;
$this->gitlab->saveImportedIssue($gitlabID, $projectID, $objectType, $objectID, $originalIssue, $object);
$object->id = $objectID;
$object->product = $productList[$issueID];
$object->execution = $executionID;
$this->gitlab->saveImportedIssue($gitlabID, $projectID, $objectType, $objectID, $issue, $object);
}
}
else
{
if($productList[$issueID] != 0) $this->send(array('result' => 'fail', 'message' => $this->lang->gitlab->importIssueError, 'locate' => $this->server->http_referer));
}
}
$this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $this->server->http_referer));
}
$savedIssueIDList = $this->dao->select('BID as issueID')->from(TABLE_RELATION)
->where('relation')->eq('gitlab')
->fetchAll('issueID');
->where('relation')->eq('gitlab')
->andWhere('product')->in($productIDList)
->fetchAll('issueID');
$iids = '';
foreach($savedIssueIDList as $savedIssueID) $iids = $iids . $savedIssueID->issueID . ',';
$options = '&not[iids]=' . trim($iids, ',');