diff --git a/module/task/control.php b/module/task/control.php index b12b1af383..b0ddf70f91 100644 --- a/module/task/control.php +++ b/module/task/control.php @@ -217,11 +217,6 @@ class task extends control foreach(explode(',', $this->config->task->customCreateFields) as $field) $customFields[$field] = $this->lang->task->$field; if($execution->type == 'ops') unset($customFields['story']); - $this->loadModel('gitlab'); - $allGitlabs = $this->gitlab->getPairs(); - $gitlabProjects = $this->gitlab->getProjectsByExecution($executionID); - foreach($allGitlabs as $id => $name) if($id and !isset($gitlabProjects[$id])) unset($allGitlabs[$id]); - $this->view->customFields = $customFields; $this->view->showFields = $this->config->task->custom->createFields; $this->view->showAllModule = $showAllModule; @@ -237,8 +232,6 @@ class task extends control $this->view->members = $members; $this->view->blockID = $blockID; $this->view->moduleOptionMenu = $moduleOptionMenu; - $this->view->gitlabList = $allGitlabs; - $this->view->gitlabProjects = $gitlabProjects; $this->display(); } @@ -1299,11 +1292,6 @@ class task extends control } else { - /* Delete related issue in gitlab. */ - $this->loadModel('gitlab'); - $relation = $this->gitlab->getRelationByObject('task', $taskID); - if(!empty($relation)) $this->gitlab->deleteIssue('task', $taskID, $relation->issueID); - $this->task->delete(TABLE_TASK, $taskID); if($task->parent > 0) { diff --git a/module/task/js/create.js b/module/task/js/create.js index f47496be8d..a0e2460ed1 100644 --- a/module/task/js/create.js +++ b/module/task/js/create.js @@ -479,23 +479,6 @@ $(document).ready(function() $('#moduleIdBox #module').val(moduleID).attr('onchange', "setStories(this.value, " + executionID + ")").chosen(); }); }); - - $('#gitlab').change(function() - { - host = $('#gitlab').val(); - if(host == '') return false; - projects = ''; - $.each(gitlabProjects[host], function(id, obj){projects = projects + ',' + obj.gitlabProject}); - url = createLink('repo', 'ajaxgetgitlabprojects', "host=" + host + "&projects=" + projects); - - $.get(url, function(response) - { - $('#gitlabProject').html('').append(response); - $('#gitlabProject').chosen().trigger("chosen:updated");; - }); - - }); - }); $(document).on('click', '#testStory_chosen,#story_chosen', function() diff --git a/module/task/model.php b/module/task/model.php index 020133c482..975633e381 100644 --- a/module/task/model.php +++ b/module/task/model.php @@ -121,10 +121,6 @@ class taskModel extends model $taskID = $this->dao->lastInsertID(); - /* Sync this task to gitlab issue. */ - $object = $this->getByID($taskID); - $this->loadModel('gitlab')->apiCreateIssue($this->post->gitlab, $this->post->gitlabProject, 'task', $taskID, $object); - /* Mark design version.*/ if(isset($task->design) && !empty($task->design)) { @@ -385,10 +381,6 @@ class taskModel extends model $taskID = $this->dao->lastInsertID(); - /* Sync this task to gitlab issue. */ - $object = $this->getByID($taskID); - $this->loadModel('gitlab')->apiCreateIssue($this->post->gitlab, $this->post->gitlabProject,'task', $taskID, $object); - $taskSpec = new stdClass(); $taskSpec->task = $taskID; $taskSpec->version = $task->version; @@ -981,11 +973,6 @@ class taskModel extends model ->batchCheckIF($task->closedReason == 'cancel', 'finishedBy, finishedDate', 'empty') ->where('id')->eq((int)$taskID)->exec(); - /* update task to gitlab issue. */ - $this->loadModel('gitlab'); - $relation = $this->gitlab->getRelationByObject('task', $taskID); - if(!empty($relation)) $this->gitlab->apiUpdateIssue($relation->gitlabID, $relation->projectID, $relation->issueID, 'task', $task, $taskID); - if(!dao::isError()) { /* Mark design version.*/ @@ -1220,15 +1207,6 @@ class taskModel extends model $tasks[$taskID] = $task; } - $this->loadModel('gitlab'); - $issues = $this->gitlab->getIssueListByObjects('task', $taskID); - foreach($tasks as $taskID => $task) - { - $issue = zget($issues, $taskID, 0); - if(!$issue) continue; - $this->gitlab->apiUpdateIssue($issue->gitlabID, $issue->projectID, $issue->issueID, $task); - } - /* Check field not empty. */ foreach($tasks as $taskID => $task) { @@ -1298,11 +1276,6 @@ class taskModel extends model if($task->status == 'done') $this->loadModel('score')->create('task', 'finish', $taskID); if($task->status == 'closed') $this->loadModel('score')->create('task', 'close', $taskID); $allChanges[$taskID] = common::createChanges($oldTask, $task); - - /* Update task to gitlab issue. */ - $this->loadModel('gitlab'); - $relation = $this->gitlab->getRelationByObject('task', $taskID); - if(!empty($relation)) $this->gitlab->apiUpdateIssue($relation->gitlabID, $relation->projectID, $relation->issueID, 'task', $task, $taskID); } else { @@ -1387,11 +1360,8 @@ class taskModel extends model ->data($task) ->autoCheck() ->check('left', 'float') - ->where('id')->eq($taskID)->exec(); - - $task = $this->getById($taskID); - $relation = $this->loadModel('gitlab')->getRelationByObject('task', $taskID); - if(!empty($relation)) $this->gitlab->apiUpdateIssue($relation->gitlabID, $relation->projectID, $relation->issueID, 'task', $task, $taskID); + ->where('id')->eq($taskID) + ->exec(); if(!dao::isError()) return common::createChanges($oldTask, $task); } @@ -1728,14 +1698,6 @@ class taskModel extends model ->where('id')->eq((int)$taskID) ->exec(); - $this->loadModel('gitlab'); - $relation = $this->gitlab->getRelationByObject('task', $taskID); - if(!empty($relation)) - { - $currentIssue = $this->gitlab->apiGetSingleIssue($relation->gitlabID, $relation->projectID, $relation->issueID); - if($currentIssue->state != 'closed') $this->gitlab->apiUpdateIssue($relation->gitlabID, $relation->projectID, $relation->issueID, 'task', $task, $taskID); - } - if($oldTask->parent > 0) $this->updateParentStatus($taskID); if($oldTask->story) $this->loadModel('story')->setStage($oldTask->story); if($task->status == 'done' && !dao::isError()) $this->loadModel('score')->create('task', 'finish', $taskID); @@ -1792,14 +1754,6 @@ class taskModel extends model $this->dao->update(TABLE_TASK)->data($task)->autoCheck()->where('id')->eq((int)$taskID)->exec(); - $this->loadModel('gitlab'); - $relation = $this->gitlab->getRelationByObject('task', $taskID); - if(!empty($relation)) - { - $currentIssue = $this->gitlab->apiGetSingleIssue($relation->gitlabID, $relation->projectID, $relation->issueID); - if($currentIssue->state != 'closed') $this->gitlab->apiUpdateIssue($relation->gitlabID, $relation->projectID, $relation->issueID, 'bug', $task, $taskID); - } - if(!dao::isError()) { if($oldTask->parent > 0) $this->updateParentStatus($taskID); @@ -1844,14 +1798,6 @@ class taskModel extends model } if($oldTask->story) $this->loadModel('story')->setStage($oldTask->story); - $this->loadModel('gitlab'); - $relation = $this->gitlab->getRelationByObject('task', $taskID); - if(!empty($relation)) - { - $currentIssue = $this->gitlab->apiGetSingleIssue($relation->gitlabID, $relation->projectID, $relation->issueID); - if($currentIssue->state != 'closed') $this->gitlab->apiUpdateIssue($relation->gitlabID, $relation->projectID, $relation->issueID, 'task', $task, $taskID); - } - if(!dao::isError()) return common::createChanges($oldTask, $task); } @@ -1917,10 +1863,6 @@ class taskModel extends model } if($oldTask->story) $this->loadModel('story')->setStage($oldTask->story); - $this->loadModel('gitlab'); - $relation = $this->gitlab->getRelationByObject('task', $taskID); - if(!empty($relation)) $this->gitlab->apiUpdateIssue($relation->gitlabID, $relation->projectID, $relation->issueID, 'task', $task, $taskID); - if(!dao::isError()) return common::createChanges($oldTask, $task); }