* Finished import gitlab issue to task.
This commit is contained in:
@@ -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 = '¬[iids]=' . trim($iids, ',');
|
||||
|
||||
@@ -36,6 +36,7 @@ $lang->gitlab->placeholder->name = '';
|
||||
$lang->gitlab->placeholder->url = "请填写Gitlab Server首页的访问地址,如:https://gitlab.zentao.net。";
|
||||
$lang->gitlab->placeholder->token = "请填写具有admin权限账户的access token";
|
||||
|
||||
$lang->gitlab->tokenError = "当前token非管理员权限。";
|
||||
$lang->gitlab->hostError = "无效的gitlab服务地址。";
|
||||
$lang->gitlab->bindUserError = "不能重复绑定用户 %s";
|
||||
$lang->gitlab->tokenError = "当前token非管理员权限。";
|
||||
$lang->gitlab->hostError = "无效的gitlab服务地址。";
|
||||
$lang->gitlab->bindUserError = "不能重复绑定用户 %s";
|
||||
$lang->gitlab->importIssueError = "未选择该议题所属的执行。";
|
||||
|
||||
@@ -543,7 +543,7 @@ class gitlabModel extends model
|
||||
*/
|
||||
public function apiGetSingleIssue($gitlabID, $projectID, $issueID)
|
||||
{
|
||||
$url = sprintf($this->getApiRoot($gitlabID), "/issues/{$issueID}");
|
||||
$url = sprintf($this->getApiRoot($gitlabID), "/projects/$projectID/issues/{$issueID}");
|
||||
return json_decode(commonModel::http($url));
|
||||
}
|
||||
|
||||
@@ -907,6 +907,7 @@ class gitlabModel extends model
|
||||
if(empty($issue->iid) or empty($issue->project_id)) return false;
|
||||
|
||||
$relation = new stdclass;
|
||||
$relation->product = zget($object, 'product', 0);
|
||||
$relation->execution = zget($object, 'execution', 0);
|
||||
$relation->AType = $objectType;
|
||||
$relation->AID = $object->id;
|
||||
|
||||
Reference in New Issue
Block a user