Merge branch 'jihu' of https://gitlab.zcorp.cc/easycorp/zentaopms into jihu
This commit is contained in:
@@ -321,4 +321,5 @@ $filter->gitlab->importissue->get['gitlab'] = 'int';
|
||||
$filter->gitlab->importissue->get['product'] = 'int';
|
||||
$filter->gitlab->importissue->get['product'] = 'string';
|
||||
$filter->gitlab->importissue->get['project'] = 'int';
|
||||
$filter->gitlab->importissue->get['repo'] = 'int';
|
||||
|
||||
|
||||
@@ -247,7 +247,7 @@ class gitlab extends control
|
||||
a($relations);exit;
|
||||
$issue = $this->gitlab->taskToIssue($gitlabID, $projectID, $task);
|
||||
$issue = $this->gitlab->apiCreateIssue($gitlabID, $projectID, $issue);
|
||||
$this->gitlab->saveSyncedIssue('task', $task, $gitlabID, $issue);
|
||||
$this->gitlab->saveIssueRelation('task', $task, $gitlabID, $issue);
|
||||
exit;
|
||||
}
|
||||
|
||||
@@ -259,10 +259,10 @@ class gitlab extends control
|
||||
*/
|
||||
public function importIssue()
|
||||
{
|
||||
$productIDList = explode(',', $this->get->product);
|
||||
$gitlabID = $this->get->gitlab;
|
||||
$projectID = $this->get->project;
|
||||
|
||||
$repo = $this->loadModel('repo')->getRepoByID($this->get->repo);
|
||||
$productIDList = explode(',', $repo->product);
|
||||
$gitlabID = $repo->gitlab;
|
||||
$projectID = $repo->project;
|
||||
|
||||
if($_POST)
|
||||
{
|
||||
|
||||
+12
-3
@@ -546,6 +546,15 @@ class gitlabModel extends model
|
||||
$aaa = json_decode(commonModel::http($url));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get gitlab issues by api.
|
||||
*
|
||||
* @param int $gitlabID
|
||||
* @param int $projectID
|
||||
* @param string $options
|
||||
* @access public
|
||||
* @return object
|
||||
*/
|
||||
public function apiGetIssues($gitlabID, $projectID, $options = null)
|
||||
{
|
||||
// TODO(dingguodong) not pagination yet.
|
||||
@@ -588,7 +597,7 @@ class gitlabModel extends model
|
||||
$response = json_decode(commonModel::http($url, $issue));
|
||||
if(!$response) return false;
|
||||
|
||||
return $this->saveSyncedIssue($objectType, $object, $gitlabID, $response);
|
||||
return $this->saveIssueRelation($objectType, $object, $gitlabID, $response);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -901,7 +910,7 @@ class gitlabModel extends model
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function saveSyncedIssue($objectType, $object, $gitlabID, $issue)
|
||||
public function saveIssueRelation($objectType, $object, $gitlabID, $issue)
|
||||
{
|
||||
if(empty($issue->iid) or empty($issue->project_id)) return false;
|
||||
|
||||
@@ -939,7 +948,7 @@ class gitlabModel extends model
|
||||
$apiRoot = $this->getApiRoot($gitlabID);
|
||||
$url = sprintf($apiRoot, "/projects/{$projectID}/issues/{$issue->iid}");
|
||||
commonModel::http($url, $data, $options = array(CURLOPT_CUSTOMREQUEST => 'PUT'));
|
||||
$this->saveSyncedIssue($objectType, $object, $gitlabID, $issue);
|
||||
$this->saveIssueRelation($objectType, $object, $gitlabID, $issue);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
<td class='text-left c-actions'>
|
||||
<?php
|
||||
common::printIcon('repo', 'edit', "repoID=$repo->id&objectID=$objectID", '', 'list', 'edit');
|
||||
common::printIcon('gitlab', 'importissue', "product={$repo->product}&gitlab={$repo->gitlab}&project={$repo->project}", '', 'list', 'link');
|
||||
common::printIcon('gitlab', 'importissue', "repo={$repo->id}", '', 'list', 'link');
|
||||
if(common::hasPriv('repo', 'delete')) echo html::a($this->createLink('repo', 'delete', "repoID=$repo->id&objectID=$objectID"), '<i class="icon-trash"></i>', 'hiddenwin', "title='{$lang->repo->delete}' class='btn'");
|
||||
?>
|
||||
</td>
|
||||
|
||||
@@ -26,6 +26,7 @@ $config->task->editor->activate = array('id' => 'comment', 'tools' => 'simpleToo
|
||||
$config->task->editor->cancel = array('id' => 'comment', 'tools' => 'simpleTools');
|
||||
$config->task->editor->pause = array('id' => 'comment', 'tools' => 'simpleTools');
|
||||
|
||||
$config->task->removeFields = 'objectTypeList,productList,executionList,gitlabID,gitlabProjectID,after,files,labels,assignedTo,uid,storyEstimate,storyDesc,storyPri,team,teamEstimate,teamMember,multiple,teams,contactListMenu,selectTestStory,testStory,testPri,testEstStarted,testDeadline,testAssignedTo,testEstimate,sync';
|
||||
$config->task->exportFields = '
|
||||
id, execution, module, story,
|
||||
name, desc,
|
||||
|
||||
@@ -489,7 +489,7 @@ class taskModel extends model
|
||||
->cleanINT('execution,story,module')
|
||||
->stripTags($this->config->task->editor->create['id'], $this->config->allowedTags)
|
||||
->join('mailto', ',')
|
||||
->remove('objectTypeList,productList,executionList,gitlabID,gitlabProjectID,after,files,labels,assignedTo,uid,storyEstimate,storyDesc,storyPri,team,teamEstimate,teamMember,multiple,teams,contactListMenu,selectTestStory,testStory,testPri,testEstStarted,testDeadline,testAssignedTo,testEstimate,sync')
|
||||
->remove($this->config->task->removeFields)
|
||||
->add('version', 1)
|
||||
->get();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user