From bc03600b0320bfe3ca35a29b9206aa8e2cfe65d7 Mon Sep 17 00:00:00 2001 From: tianshujie Date: Wed, 16 Mar 2022 10:50:08 +0800 Subject: [PATCH 1/2] * Fix bug #19289. --- module/execution/control.php | 31 ++++++++++++++----------------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/module/execution/control.php b/module/execution/control.php index 0df74d6ab4..c9f1c7a3e3 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -1312,8 +1312,8 @@ class execution extends control } } - if(!empty($projectID) and $project->model == 'kanban' and $this->app->tab == 'project') return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $this->createLink('project', 'index', "projectID=$projectID"))); - if(!empty($projectID) and $project->model == 'kanban') return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => inlink('kanban', "executionID=$executionID"))); + if(!empty($projectID) and $project->model == 'kanban' and $this->app->tab == 'project') return $this->send(array('result' => 'success', 'locate' => $this->createLink('project', 'index', "projectID=$projectID"))); + if(!empty($projectID) and $project->model == 'kanban') return $this->send(array('result' => 'success', 'locate' => inlink('kanban', "executionID=$executionID"))); $this->view->title = $this->lang->execution->tips; $this->view->tips = $this->fetch('execution', 'tips', "executionID=$executionID"); @@ -1406,27 +1406,24 @@ class execution extends control } } - if(!empty($projectID) and $project->model == 'kanban') - { - $execution = $this->execution->getById($executionID); - $this->loadModel('kanban')->createRDKanban($execution); - - if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError())); - - $link= $this->config->vision != 'lite' ? $this->createLink('project', 'index', "projectID=$projectID") : $this->createLink('project', 'execution', "status=all&projectID=$projectID"); - if($this->app->tab == 'project') return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $link)); - - return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => inlink('kanban', "executionID=$executionID"))); - } - if(!empty($planID)) { return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => inlink('create', "projectID=$projectID&executionID=$executionID©ExecutionID=&planID=$planID&confirm=no"))); } else { - if(!empty($projectID) and $project->model == 'kanban' and $this->app->tab == 'project') return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $this->createLink('project', 'index', "projectID=$projectID"))); - if(!empty($projectID) and $project->model == 'kanban') return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => inlink('kanban', "executionID=$executionID"))); + if(!empty($projectID) and $project->model == 'kanban') + { + $execution = $this->execution->getById($executionID); + $this->loadModel('kanban')->createRDKanban($execution); + + if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError())); + + $link = $this->config->vision != 'lite' ? $this->createLink('project', 'index', "projectID=$projectID") : $this->createLink('project', 'execution', "status=all&projectID=$projectID"); + if($this->app->tab == 'project') return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $link)); + + return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => inlink('kanban', "executionID=$executionID"))); + } return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => inlink('create', "projectID=$projectID&executionID=$executionID"))); } } From 74548de746ca2374d7ff25de45bccba76c5b2b0d Mon Sep 17 00:00:00 2001 From: tianshujie Date: Wed, 16 Mar 2022 12:54:13 +0800 Subject: [PATCH 2/2] * Fix the problem of no Kanban after Kanban execution creation. --- module/execution/control.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/module/execution/control.php b/module/execution/control.php index c9f1c7a3e3..e00bc81332 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -1406,6 +1406,12 @@ class execution extends control } } + if(!empty($projectID) and $project->model == 'kanban') + { + $execution = $this->execution->getById($executionID); + $this->loadModel('kanban')->createRDKanban($execution); + } + if(!empty($planID)) { return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => inlink('create', "projectID=$projectID&executionID=$executionID©ExecutionID=&planID=$planID&confirm=no"))); @@ -1414,9 +1420,6 @@ class execution extends control { if(!empty($projectID) and $project->model == 'kanban') { - $execution = $this->execution->getById($executionID); - $this->loadModel('kanban')->createRDKanban($execution); - if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError())); $link = $this->config->vision != 'lite' ? $this->createLink('project', 'index', "projectID=$projectID") : $this->createLink('project', 'execution', "status=all&projectID=$projectID");