From 8c0902868547e1ed0636c537f180ccc2be46639f Mon Sep 17 00:00:00 2001 From: Zongjun Lan Date: Sat, 2 Apr 2022 13:13:35 +0800 Subject: [PATCH 1/3] * fix bug #21422 --- extension/lite/task/ext/view/create.html.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extension/lite/task/ext/view/create.html.php b/extension/lite/task/ext/view/create.html.php index 11d1d0dcfc..82727f8ed7 100644 --- a/extension/lite/task/ext/view/create.html.php +++ b/extension/lite/task/ext/view/create.html.php @@ -337,7 +337,7 @@ id);?> ';?> From 1542533e4401a1e04483aaf2c598480262bab4e8 Mon Sep 17 00:00:00 2001 From: Zongjun Lan Date: Sat, 2 Apr 2022 14:36:13 +0800 Subject: [PATCH 2/3] * fix bug #21455#21413 --- module/execution/js/kanban.js | 2 +- module/execution/model.php | 36 +++++++++++++++++++++++++++++++++++ module/kanban/control.php | 3 ++- 3 files changed, 39 insertions(+), 2 deletions(-) diff --git a/module/execution/js/kanban.js b/module/execution/js/kanban.js index 9bb93112e6..1a147c3d9d 100644 --- a/module/execution/js/kanban.js +++ b/module/execution/js/kanban.js @@ -1007,7 +1007,7 @@ function deleteCard(objectType, objectID, regionID) url: url, success: function(data) { - updateRegion(regionID, data[regionID]); + updateRegion(regionID, data[regionID]); } }); } diff --git a/module/execution/model.php b/module/execution/model.php index f14c3cc059..11ed818930 100644 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -3005,6 +3005,42 @@ class executionModel extends model } $parents = $this->dao->select('*')->from(TABLE_TASK)->where('id')->in($parents)->fetchAll('id'); + if ($this->config->vision == 'lite') { + $lanes = array(); + $cardsWhere = ''; + foreach($tasks as $task) + { + if(empty($cardsWhere)) + { + $cardsWhere = "cards like '%,{$task->id},%'"; + } + else + { + $cardsWhere .= " or cards like '%,{$task->id},%'"; + } + } + $executionID = zget(array_column($tasks, 'execution'), 0, 0); + $lanes = $this->dao->select('t1.lane,t2.name,t1.cards') + ->from(TABLE_KANBANCELL)->alias('t1') + ->leftJoin(TABLE_KANBANLANE)->alias('t2')->on('t1.lane = t2.id') + ->where('t1.kanban')->eq($executionID) + ->andWhere('t2.deleted')->eq(0) + ->andWhere("($cardsWhere)") + ->fetchAll(); + + foreach($tasks as $task) + { + $task->lane = ''; + if(!empty($lanes)) + { + foreach($lanes as $lane) + { + if(strpos($lane->cards, ",{$task->id},") !== false) $task->lane = $lane->name; + } + } + } + } + foreach($tasks as $task) { if($task->parent > 0) diff --git a/module/kanban/control.php b/module/kanban/control.php index 68b493e551..94f5b70d70 100644 --- a/module/kanban/control.php +++ b/module/kanban/control.php @@ -1404,7 +1404,8 @@ class kanban extends control if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError())); $kanbanID = $this->kanban->getKanbanIDByregion($regionID); - $kanbanGroup = $this->kanban->getRDKanban($kanbanID); + $$browseType = $this->config->vision == 'lite' ? 'task' : 'all'; + $kanbanGroup = $this->kanban->getRDKanban($kanbanID, $$browseType); return print(json_encode($kanbanGroup)); } From 6865f5cdd68cad219be162c8a1d883f487f6229b Mon Sep 17 00:00:00 2001 From: Zongjun Lan Date: Sat, 2 Apr 2022 14:52:33 +0800 Subject: [PATCH 3/3] * fix bug --- module/execution/model.php | 36 ------------------------------------ 1 file changed, 36 deletions(-) diff --git a/module/execution/model.php b/module/execution/model.php index 11ed818930..f14c3cc059 100644 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -3005,42 +3005,6 @@ class executionModel extends model } $parents = $this->dao->select('*')->from(TABLE_TASK)->where('id')->in($parents)->fetchAll('id'); - if ($this->config->vision == 'lite') { - $lanes = array(); - $cardsWhere = ''; - foreach($tasks as $task) - { - if(empty($cardsWhere)) - { - $cardsWhere = "cards like '%,{$task->id},%'"; - } - else - { - $cardsWhere .= " or cards like '%,{$task->id},%'"; - } - } - $executionID = zget(array_column($tasks, 'execution'), 0, 0); - $lanes = $this->dao->select('t1.lane,t2.name,t1.cards') - ->from(TABLE_KANBANCELL)->alias('t1') - ->leftJoin(TABLE_KANBANLANE)->alias('t2')->on('t1.lane = t2.id') - ->where('t1.kanban')->eq($executionID) - ->andWhere('t2.deleted')->eq(0) - ->andWhere("($cardsWhere)") - ->fetchAll(); - - foreach($tasks as $task) - { - $task->lane = ''; - if(!empty($lanes)) - { - foreach($lanes as $lane) - { - if(strpos($lane->cards, ",{$task->id},") !== false) $task->lane = $lane->name; - } - } - } - } - foreach($tasks as $task) { if($task->parent > 0)