From 375b0c2a6f30455e83430b0e4e05d881c11c01cc Mon Sep 17 00:00:00 2001 From: xieqiyu Date: Fri, 8 Jul 2022 13:25:39 +0800 Subject: [PATCH] * Code for task#59543. --- module/bug/control.php | 42 +++++++++++++++++++++++++++++++--------- module/story/control.php | 21 +++++++++++++++----- 2 files changed, 49 insertions(+), 14 deletions(-) diff --git a/module/bug/control.php b/module/bug/control.php index 478ce03b7d..b69ba372bb 100755 --- a/module/bug/control.php +++ b/module/bug/control.php @@ -1416,13 +1416,26 @@ class bug extends control { $bug = $this->bug->getById($bugID); $execution = $this->loadModel('execution')->getByID($bug->execution); - if(isset($execution->type) and $execution->type == 'kanban' and $this->app->tab == 'execution') + if($this->app->tab == 'execution') { + $execLaneType = $this->session->execLaneType ? $this->session->execLaneType : 'all'; + $execGroupBy = $this->session->execGroupBy ? $this->session->execGroupBy : 'default'; $rdSearchValue = $this->session->rdSearchValue ? $this->session->rdSearchValue : ''; - $kanbanData = $this->loadModel('kanban')->getRDKanban($bug->execution, $this->session->execLaneType ? $this->session->execLaneType : 'all', 'id_desc', 0, $kanbanGroup, $rdSearchValue); - $kanbanData = json_encode($kanbanData); - return print(js::closeModal('parent.parent', '', "parent.parent.updateKanban($kanbanData)")); + if(isset($execution->type) and $execution->type == 'kanban') + { + $kanbanData = $this->loadModel('kanban')->getRDKanban($bug->execution, $execLaneType, 'id_desc', 0, $kanbanGroup, $rdSearchValue); + $kanbanData = json_encode($kanbanData); + return print(js::closeModal('parent.parent', '', "parent.parent.updateKanban($kanbanData)")); + } + else + { + $kanbanData = $this->loadModel('kanban')->getExecutionKanban($bug->execution, $execLaneType, $execGroupBy, $rdSearchValue); + $kanbanType = $execLaneType == 'all' ? 'bug' : key($kanbanData); + $kanbanData = $kanbanData[$kanbanType]; + $kanbanData = json_encode($kanbanData); + return print(js::closeModal('parent.parent', '', "parent.parent.updateKanban(\"bug\", $kanbanData)")); + } } else { @@ -1853,16 +1866,27 @@ class bug extends control if(isonlybody()) { $execution = $this->loadModel('execution')->getByID($bug->execution); - if(isset($execution->type) and $execution->type == 'kanban' and $this->app->tab == 'execution') + if($this->app->tab == 'execution') { - $regionID = !empty($output['regionID']) ? $output['regionID'] : 0; $execLaneType = $this->session->execLaneType ? $this->session->execLaneType : 'all'; $execGroupBy = $this->session->execGroupBy ? $this->session->execGroupBy : 'default'; $rdSearchValue = $this->session->rdSearchValue ? $this->session->rdSearchValue : ''; - $kanbanData = $this->loadModel('kanban')->getRDKanban($bug->execution, $execLaneType, 'id_desc', $regionID, $execGroupBy, $rdSearchValue); - $kanbanData = json_encode($kanbanData); - return print(js::closeModal('parent.parent', '', "parent.parent.updateKanban($kanbanData, $regionID)")); + if(isset($execution->type) and $execution->type == 'kanban') + { + $regionID = !empty($output['regionID']) ? $output['regionID'] : 0; + $kanbanData = $this->loadModel('kanban')->getRDKanban($bug->execution, $execLaneType, 'id_desc', $regionID, $execGroupBy, $rdSearchValue); + $kanbanData = json_encode($kanbanData); + return print(js::closeModal('parent.parent', '', "parent.parent.updateKanban($kanbanData, $regionID)")); + } + else + { + $kanbanData = $this->loadModel('kanban')->getExecutionKanban($bug->execution, $execLaneType, $execGroupBy, $rdSearchValue); + $kanbanType = $execLaneType == 'all' ? 'bug' : key($kanbanData); + $kanbanData = $kanbanData[$kanbanType]; + $kanbanData = json_encode($kanbanData); + return print(js::closeModal('parent.parent', '', "parent.parent.updateKanban(\"bug\", $kanbanData)")); + } } else { diff --git a/module/story/control.php b/module/story/control.php index bcd74ba356..b82d400136 100644 --- a/module/story/control.php +++ b/module/story/control.php @@ -1873,14 +1873,25 @@ class story extends control if(isonlybody()) { $execution = $this->execution->getByID($this->session->execution); - if($this->app->tab == 'execution' and $execution->type == 'kanban') + if($this->app->tab == 'execution') { $execLaneType = $this->session->execLaneType ? $this->session->execLaneType : 'all'; $rdSearchValue = $this->session->rdSearchValue ? $this->session->rdSearchValue : ''; - $kanbanData = $this->loadModel('kanban')->getRDKanban($this->session->execution, $execLaneType, 'id_desc', 0, $kanbanGroup, $rdSearchValue); - $kanbanData = json_encode($kanbanData); - - return print(js::closeModal('parent.parent', '', "parent.parent.updateKanban($kanbanData)")); + $execGroupBy = $this->session->execGroupBy ? $this->session->execGroupBy : 'default'; + if($execution->type == 'kanban') + { + $kanbanData = $this->loadModel('kanban')->getRDKanban($this->session->execution, $execLaneType, 'id_desc', 0, $kanbanGroup, $rdSearchValue); + $kanbanData = json_encode($kanbanData); + return print(js::closeModal('parent.parent', '', "parent.parent.updateKanban($kanbanData)")); + } + else + { + $kanbanData = $this->loadModel('kanban')->getExecutionKanban($execution->id, $execLaneType, $execGroupBy, $rdSearchValue); + $kanbanType = $execLaneType == 'all' ? 'story' : key($kanbanData); + $kanbanData = $kanbanData[$kanbanType]; + $kanbanData = json_encode($kanbanData); + return print(js::closeModal('parent.parent', '', "parent.parent.updateKanban(\"story\", $kanbanData)")); + } } else {