From e03ce5b6771240cfd67bd8ce5079b3e640c2f35c Mon Sep 17 00:00:00 2001 From: tianshujie Date: Tue, 18 Jan 2022 09:32:07 +0800 Subject: [PATCH 1/3] * Fix bug #18575. --- module/execution/js/kanban.js | 2 +- module/execution/js/taskkanban.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/module/execution/js/kanban.js b/module/execution/js/kanban.js index 87ca334042..a86c2e5849 100644 --- a/module/execution/js/kanban.js +++ b/module/execution/js/kanban.js @@ -786,7 +786,7 @@ function changeCardColType(cardID, fromColID, toColID, fromLaneID, toLaneID, car } else if(toColType == 'developing') { - if((fromColType == 'pause' || fromColType == 'cancel' || fromColType == 'closed' || fromColType == 'developed') && priv.canActivateTask) + if((fromColType == 'pause' || fromColType == 'canceled' || fromColType == 'closed' || fromColType == 'developed') && priv.canActivateTask) { var link = createLink('task', 'activate', 'taskID=' + objectID + '&extra=fromColID=' + fromColID + ',toColID=' + toColID + ',fromLaneID=' + fromLaneID + ',toLaneID=' + toLaneID, '', true); showIframe = true; diff --git a/module/execution/js/taskkanban.js b/module/execution/js/taskkanban.js index b755eb2891..39c623e1fa 100644 --- a/module/execution/js/taskkanban.js +++ b/module/execution/js/taskkanban.js @@ -470,7 +470,7 @@ if(!window.kanbanDropRules) task: { 'wait': ['developing', 'developed', 'canceled', 'closed'], - 'developing': ['developed', 'pause'], + 'developing': ['developed', 'pause', 'canceled'], 'developed': ['canceled', 'closed'], 'pause': ['developing'], 'canceled': ['developing'], @@ -553,7 +553,7 @@ function changeCardColType(cardID, fromColID, toColID, fromLaneID, toLaneID, car } else if(toColType == 'developing') { - if((fromColType == 'pause' || fromColType == 'cancel' || fromColType == 'closed' || fromColType == 'developed') && priv.canActivateTask) + if((fromColType == 'pause' || fromColType == 'canceled' || fromColType == 'closed' || fromColType == 'developed') && priv.canActivateTask) { var link = createLink('task', 'activate', 'taskID=' + objectID, '', true); showIframe = true; From 1642b2b63fa3a2ac1f89a3721b9a1a680fc6d085 Mon Sep 17 00:00:00 2001 From: tianshujie Date: Tue, 18 Jan 2022 09:57:19 +0800 Subject: [PATCH 2/3] * Fixed the error of creating sub-columns and the update of task cards. --- module/kanban/model.php | 6 +++++- module/story/model.php | 4 ++-- module/task/model.php | 1 + 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/module/kanban/model.php b/module/kanban/model.php index 94a93ee3f2..26476389d2 100644 --- a/module/kanban/model.php +++ b/module/kanban/model.php @@ -343,7 +343,6 @@ class kanbanModel extends model foreach($data->name as $i => $name) { $childColumn = new stdclass(); - $childColumn->lane = $column->lane; $childColumn->parent = $column->id; $childColumn->region = $column->region; $childColumn->group = $column->group; @@ -389,6 +388,11 @@ class kanbanModel extends model if($i == 1) $this->dao->update(TABLE_KANBANCARD)->set('`column`')->eq($childColumnID)->where('`column`')->eq($columnID)->exec(); $this->dao->update(TABLE_KANBANCOLUMN)->set('type')->eq("column{$childColumnID}")->where('id')->eq($childColumnID)->exec(); $this->action->create('kanbanColumn', $childColumnID, 'created'); + $cellList = $this->dao->select('*')->from(TABLE_KANBANCELL)->where('`column`')->eq($column->id)->fetchAll(); + foreach($cellList as $cell) + { + $this->addKanbanCell($cell->kanban, $cell->lane, $childColumnID, 'common'); + } } } diff --git a/module/story/model.php b/module/story/model.php index c7047949a6..388842e6a6 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -1845,7 +1845,7 @@ class storyModel extends model $task = new stdclass(); $task->execution = $executionID; - $task->project = $projectID; + $task->project = $projectID ? $projectID : 0; $task->name = $story->title; $task->story = $story->id; $task->type = $data->type; @@ -2081,7 +2081,7 @@ class storyModel extends model /* Get current stage and set as default value. */ $currentStage = $story->stage; - $stage = $currentStage; + $stage = $currentStage; /* Cycle all tasks, get counts of every type and every status. */ $branchStatusList = array(); diff --git a/module/task/model.php b/module/task/model.php index b74aec64fe..9ce6660657 100644 --- a/module/task/model.php +++ b/module/task/model.php @@ -1609,6 +1609,7 @@ class taskModel extends model if($task->parent > 0) $this->updateParentStatus($task->id); if($task->story) $this->loadModel('story')->setStage($task->story); + $this->loadModel('kanban')->updateLane($task->execution, 'task', $taskID); if($task->status == 'done' and !dao::isError()) $this->loadModel('score')->create('task', 'finish', $taskID); return $changes; From a66f16dae6ded443215e72c0a368761e324c8470 Mon Sep 17 00:00:00 2001 From: tianshujie Date: Tue, 18 Jan 2022 10:02:40 +0800 Subject: [PATCH 3/3] * Modify the code. --- module/task/model.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/task/model.php b/module/task/model.php index 9ce6660657..8b9d059cbf 100644 --- a/module/task/model.php +++ b/module/task/model.php @@ -1609,7 +1609,7 @@ class taskModel extends model if($task->parent > 0) $this->updateParentStatus($task->id); if($task->story) $this->loadModel('story')->setStage($task->story); - $this->loadModel('kanban')->updateLane($task->execution, 'task', $taskID); + if(isset($data->status) and $task->status != $data->status) $this->loadModel('kanban')->updateLane($task->execution, 'task', $taskID); if($task->status == 'done' and !dao::isError()) $this->loadModel('score')->create('task', 'finish', $taskID); return $changes;