From 75d4bc213c2f999a4cf3cbbdc83cf9d386c86c3e Mon Sep 17 00:00:00 2001 From: xieqiyu Date: Thu, 7 Jul 2022 09:49:15 +0800 Subject: [PATCH] * Code for task#59546. Update batch create story and change story. --- module/story/control.php | 39 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 37 insertions(+), 2 deletions(-) diff --git a/module/story/control.php b/module/story/control.php index 8c192953c8..ad97952255 100644 --- a/module/story/control.php +++ b/module/story/control.php @@ -500,7 +500,25 @@ class story extends control if($this->viewType == 'json') return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'idList' => $stories)); - if(isonlybody()) return print(js::closeModal('parent.parent', 'this')); + if(isonlybody()) + { + $executionID = $executionID ? $executionID : $this->session->execution; + $execution = $this->execution->getByID($executionID); + if($this->app->tab == 'execution' and $execution->type == 'kanban') + { + $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($executionID, $execLaneType, 'id_desc', 0, $execGroupBy, $rdSearchValue); + $kanbanData = json_encode($kanbanData); + + return print(js::closeModal('parent.parent', '', "parent.parent.updateKanban($kanbanData)")); + } + else + { + return print(js::reload('parent.parent')); + } + } if($storyID) { @@ -1022,7 +1040,24 @@ class story extends control $module = $this->app->tab == 'project' ? 'projectstory' : 'story'; - if(isonlybody()) return print(js::reload('parent.parent')); + if(isonlybody()) + { + $execution = $this->execution->getByID($this->session->execution); + if($this->app->tab == 'execution' and $execution->type == 'kanban') + { + $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($this->session->execution, $execLaneType, 'id_desc', 0, $execGroupBy, $rdSearchValue); + $kanbanData = json_encode($kanbanData); + + return print(js::closeModal('parent.parent', '', "parent.parent.updateKanban($kanbanData)")); + } + else + { + return print(js::reload('parent.parent')); + } + } if(defined('RUN_MODE') && RUN_MODE == 'api') return $this->send(array('status' => 'success')); return print(js::locate($this->createLink($module, 'view', "storyID=$storyID"), 'parent'));