diff --git a/module/story/model.php b/module/story/model.php index 6d4c9572aa..9ca2b9d80c 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -2143,9 +2143,12 @@ class storyModel extends model foreach($releases as $branch) $stages[$branch] = 'released'; $currentStory = $this->dao->findById($storyID)->from(TABLE_STORY)->fetch(); - foreach($executions as $executionID => $branch) + if($story->stage != $currentStory->stage) { - $this->kanban->updateLane($executionID, 'story', $storyID); + foreach($executions as $executionID => $branch) + { + $this->kanban->updateLane($executionID, 'story', $storyID); + } } if(empty($stages)) return; @@ -2179,6 +2182,7 @@ class storyModel extends model $this->dao->update(TABLE_STORY)->set('stage')->eq(current($stages))->where('id')->eq($storyID)->exec(); } + $currentStory = $this->dao->findById($storyID)->from(TABLE_STORY)->fetch(); if($story->stage != $currentStory->stage) { foreach($executions as $executionID => $branch) diff --git a/module/task/model.php b/module/task/model.php index 8b9d059cbf..37a2ee60d1 100644 --- a/module/task/model.php +++ b/module/task/model.php @@ -1477,8 +1477,8 @@ class taskModel extends model if($oldTask->story) $this->loadModel('story')->setStage($oldTask->story); $this->loadModel('kanban'); - if(!isset($output['toColID'])) $this->kanban->updateLane($oldTask->execution, 'task', $taskID); - if(isset($output['toColID'])) $this->kanban->moveCard($taskID, $output['fromColID'], $output['toColID'], $output['fromLaneID'], $output['toLaneID']); + if(!isset($output['toColID']) or $task->status == 'done') $this->kanban->updateLane($oldTask->execution, 'task', $taskID); + if(isset($output['toColID']) and $task->status == 'doing') $this->kanban->moveCard($taskID, $output['fromColID'], $output['toColID'], $output['fromLaneID'], $output['toLaneID']); if(!dao::isError()) return common::createChanges($oldTask, $task); }