From a6483ab2dc9ab0238a1c98271f5561e0f9d9d729 Mon Sep 17 00:00:00 2001 From: liyuchun Date: Thu, 4 Nov 2021 16:24:32 +0800 Subject: [PATCH 1/2] * Finish task #43935. --- module/kanban/model.php | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/module/kanban/model.php b/module/kanban/model.php index 176d3d0135..d6449615c7 100644 --- a/module/kanban/model.php +++ b/module/kanban/model.php @@ -358,12 +358,15 @@ class kanbanModel extends model $stories = $this->loadModel('story')->getExecutionStories($executionID); foreach($stories as $storyID => $story) { - if($lane->groupby and $story->{$lane->groupby} != $lane->extra) continue; - foreach($this->config->kanban->storyColumnStageList as $colType => $stage) { if(strpos(',ready,develop,test,', $colType) !== false) continue; - if($colType == 'backlog' and $story->stage == $stage and strpos($cardPairs['ready'], ",$storyID,") === false and strpos($cardPairs['backlog'], ",$storyID,") === false) + + if($lane->groupby and $story->{$lane->groupby} != $lane->extra) + { + $cardPairs[$colType] = str_replace(",$storyID,", ',', $cardPairs[$colType]); + } + elseif($colType == 'backlog' and $story->stage == $stage and strpos($cardPairs['ready'], ",$storyID,") === false and strpos($cardPairs['backlog'], ",$storyID,") === false) { $cardPairs['backlog'] = empty($cardPairs['backlog']) ? ",$storyID," : ",$storyID" . $cardPairs['backlog']; } @@ -383,12 +386,15 @@ class kanbanModel extends model $bugs = $this->loadModel('bug')->getExecutionBugs($executionID); foreach($bugs as $bugID => $bug) { - if($lane->groupby and $bug->{$lane->groupby} != $lane->extra) continue; - foreach($this->config->kanban->bugColumnStatusList as $colType => $status) { if(strpos(',resolving,fixing,test,testing,tested,', $colType) !== false) continue; - if($colType == 'unconfirmed' and $bug->status == $status and $bug->confirmed == 0 and strpos($cardPairs['unconfirmed'], ",$bugID,") === false and strpos($cardPairs['fixing'], ",$bugID,") === false) + + if($lane->groupby and $bug->{$lane->groupby} != $lane->extra) + { + $cardPairs[$colType] = str_replace(",$bugID,", ',', $cardPairs[$colType]); + } + elseif($colType == 'unconfirmed' and $bug->status == $status and $bug->confirmed == 0 and strpos($cardPairs['unconfirmed'], ",$bugID,") === false and strpos($cardPairs['fixing'], ",$bugID,") === false) { $cardPairs['unconfirmed'] = empty($cardPairs['unconfirmed']) ? ",$bugID," : ",$bugID" . $cardPairs['unconfirmed']; if(strpos($cardPairs['closed'], ",$bugID,") !== false) $cardPairs['closed'] = str_replace(",$bugID,", ',', $cardPairs['closed']); @@ -418,12 +424,15 @@ class kanbanModel extends model $tasks = $this->loadModel('execution')->getKanbanTasks($executionID); foreach($tasks as $taskID => $task) { - if($lane->groupby and $task->{$lane->groupby} != $lane->extra) continue; - foreach($this->config->kanban->taskColumnStatusList as $colType => $status) { if($colType == 'develop') continue; - if($task->status == $status and strpos($cardPairs[$colType], ",$taskID,") === false) + + if($lane->groupby and $task->{$lane->groupby} != $lane->extra) + { + $cardPairs[$colType] = str_replace(",$taskID,", ',', $cardPairs[$colType]); + } + elseif($task->status == $status and strpos($cardPairs[$colType], ",$taskID,") === false) { $cardPairs[$colType] = empty($cardPairs[$colType]) ? ",$taskID," : ",$taskID". $cardPairs[$colType]; } From 67f485736e6232c88d30b902f1e54164372b85a9 Mon Sep 17 00:00:00 2001 From: liyuchun Date: Thu, 4 Nov 2021 16:32:51 +0800 Subject: [PATCH 2/2] * Fix error of task #43935. --- module/kanban/model.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/kanban/model.php b/module/kanban/model.php index d6449615c7..b5dbd0465b 100644 --- a/module/kanban/model.php +++ b/module/kanban/model.php @@ -523,7 +523,7 @@ class kanbanModel extends model $laneName = $this->lang->kanban->noGroup; if($groupKey) { - $nameParis = strpos('module,story,assignedTo', $groupBy) !== false ? $objectPairs : $this->lang->$type->{$groupBy . 'List'}; + $namePairs = strpos('module,story,assignedTo', $groupBy) !== false ? $objectPairs : $this->lang->$type->{$groupBy . 'List'}; $laneName = zget($namePairs, $groupKey); }