From 05a1b2be02d3ae376419acaf0898d81a7f83d53d Mon Sep 17 00:00:00 2001 From: xieqiyu Date: Thu, 7 Jul 2022 17:52:30 +0800 Subject: [PATCH] * Code for task#59543. --- module/story/control.php | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/module/story/control.php b/module/story/control.php index 716a0f60f9..bcd74ba356 100644 --- a/module/story/control.php +++ b/module/story/control.php @@ -1357,7 +1357,36 @@ class story extends control $this->executeHooks($storyID); - if(isonlybody()) return print(js::reload('parent.parent')); + if(isonlybody()) + { + $execution = $this->execution->getByID($this->session->execution); + if($this->app->tab == 'execution') + { + $this->loadModel('kanban')->updateLane($this->session->execution, 'story', $storyID); + + $execLaneType = $this->session->execLaneType ? $this->session->execLaneType : 'all'; + $execGroupBy = $this->session->execGroupBy ? $this->session->execGroupBy : 'default'; + $rdSearchValue = $this->session->rdSearchValue ? $this->session->rdSearchValue : ''; + if($execution->type == 'kanban') + { + $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 + { + $kanbanData = $this->loadModel('kanban')->getExecutionKanban($this->session->execution, $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 + { + return print(js::closeModal('parent.parent', 'this', "function(){parent.parent.location.reload();}")); + } + } $module = $from == 'project' ? 'projectstory' : 'story'; if(defined('RUN_MODE') and RUN_MODE == 'api') return $this->send(array('status' => 'success', 'data' => $storyID));