From b9a37d04a2302e0e30a7f80af1cd75ed10b2d633 Mon Sep 17 00:00:00 2001 From: tianshujie Date: Wed, 1 Jun 2022 11:08:51 +0800 Subject: [PATCH] * Finish task #55675. --- module/execution/control.php | 6 +++--- module/kanban/model.php | 4 ++++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/module/execution/control.php b/module/execution/control.php index 2c228fe1ba..eb95a9f98a 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -2199,16 +2199,16 @@ class execution extends control * @access public * @return void */ - public function taskKanban($executionID, $browseType = '', $orderBy = 'order_asc', $groupBy = '') + public function taskKanban($executionID, $browseType = 'all', $orderBy = 'order_asc', $groupBy = '') { - if(empty($browseType)) $browseType = $this->session->kanbanType ? $this->session->kanbanType : 'all'; if(empty($groupBy)) $groupBy = 'default'; /* Save to session. */ $uri = $this->app->getURI(true); $this->app->session->set('taskList', $uri, 'execution'); $this->app->session->set('bugList', $uri, 'qa'); - $this->app->session->set('kanbanType', $browseType, 'execution'); + $this->app->session->set('execLaneType', $browseType); + $this->app->session->set('execGroupBy', $groupBy); /* Load language. */ $this->app->loadLang('task'); diff --git a/module/kanban/model.php b/module/kanban/model.php index 05a625e814..afff540da2 100644 --- a/module/kanban/model.php +++ b/module/kanban/model.php @@ -1454,14 +1454,18 @@ class kanbanModel extends model $lanes = $this->getLanes4Group($executionID, $browseType, $groupBy, $cardList); if(empty($lanes)) return array(); + $execution = $this->loadModel('execution')->getByID($executionID); + $columns = $this->dao->select('t1.*, GROUP_CONCAT(t1.cards) as cards, t2.`type` as columnType, t2.limit, t2.name as columnName, t2.color')->from(TABLE_KANBANCELL)->alias('t1') ->leftJoin(TABLE_KANBANCOLUMN)->alias('t2')->on('t1.`column` = t2.id') ->leftJoin(TABLE_KANBANLANE)->alias('t3')->on('t1.lane = t3.id') ->leftJoin(TABLE_KANBANREGION)->alias('t4')->on('t1.kanban = t4.kanban') ->where('t1.kanban')->eq($executionID) ->andWhere('t1.`type`')->eq($browseType) + ->beginIF(isset($execution->type) and $execution->type == 'kanban') ->andWhere('t3.deleted')->eq(0) ->andWhere('t4.deleted')->eq(0) + ->fi() ->groupBy('columnType') ->orderBy('column_asc') ->fetchAll('columnType');