From 4fea8898f1d51840dab03d0cab1d9c7f548ca661 Mon Sep 17 00:00:00 2001 From: hufangzhou <746775970@qq.com> Date: Fri, 26 Mar 2021 10:09:47 +0800 Subject: [PATCH 1/2] * Fix bug #11512. --- module/testtask/control.php | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/module/testtask/control.php b/module/testtask/control.php index 7dad4d4a42..a20e55cb50 100644 --- a/module/testtask/control.php +++ b/module/testtask/control.php @@ -629,7 +629,7 @@ class testtask extends control { /* Get task info. */ $task = $this->testtask->getById($taskID); - $productID = $this->product->saveState($task->product, $this->products); + $productID = $this->loadModel('product')->saveState($task->product, $this->products); if(!empty($_POST)) { @@ -643,11 +643,18 @@ class testtask extends control $this->executeHooks($taskID); - $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => 'parent')); + $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $this->session->testtaskList)); } /* Set menu. */ - $this->loadModel('qa')->setMenu($this->products, $productID, $task->branch, $taskID); + if($this->app->openApp == 'project') + { + $this->loadModel('project')->setMenu($this->session->project); + } + else + { + $this->loadModel('qa')->setMenu($this->products, $productID, $task->branch, $taskID); + } $this->view->title = $this->products[$productID] . $this->lang->colon . $this->lang->testtask->edit; $this->view->position[] = html::a($this->createLink('testtask', 'browse', "productID=$productID"), $this->products[$productID]); From bfd01999394e11b5c11a8f0248355ac1c1da4c42 Mon Sep 17 00:00:00 2001 From: Yagami <976204163@qq.com> Date: Fri, 26 Mar 2021 11:41:23 +0800 Subject: [PATCH 2/2] * Fix code error. --- module/block/control.php | 4 ++-- module/testtask/control.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/module/block/control.php b/module/block/control.php index b15959a9c6..15287825bd 100644 --- a/module/block/control.php +++ b/module/block/control.php @@ -253,11 +253,11 @@ class block extends control /* The list assigned to me jumps to the work page when click more button. */ $block->moreLink = $this->createLink($moduleName, $method, $vars); - if($moduleName = 'my' and strpos('task|story|requirement|bug|testcase|testtask|issue|risk', $method)) + if($moduleName == 'my' and strpos('task|story|requirement|bug|testcase|testtask|issue|risk', $method)) { $block->moreLink = $this->createLink($moduleName, 'work', 'mode=' . $method . '&' . $vars); } - elseif($moduleName = 'project') + elseif($moduleName == 'project') { $block->moreLink = $this->createLink('project', 'dynamic', "projectID={$this->session->project}"); } diff --git a/module/testtask/control.php b/module/testtask/control.php index a20e55cb50..8490486a3f 100644 --- a/module/testtask/control.php +++ b/module/testtask/control.php @@ -144,7 +144,7 @@ class testtask extends control $this->app->loadLang('tree'); /* Set menu. */ - $productID = $this->product->saveState($productID, $this->products); + $productID = $this->loadModel('product')->saveState($productID, $this->products); if($this->app->openApp == 'project') { $this->loadModel('project')->setMenu($this->session->project); @@ -1259,7 +1259,7 @@ class testtask extends control $productID = $productID ? $productID : key($this->products); $projectID = $this->lang->navGroup->testtask == 'qa' ? 0 : $this->session->project; - $executions = empty($productID) ? array() : $this->product->getExecutionPairsByProduct($productID, 0, 'id_desc', $projectID); + $executions = empty($productID) ? array() : $this->loadModel('product')->getExecutionPairsByProduct($productID, 0, 'id_desc', $projectID); $builds = empty($productID) ? array() : $this->loadModel('build')->getProductBuildPairs($productID, 0, 'notrunk'); $this->view->title = $this->products[$productID] . $this->lang->colon . $this->lang->testtask->importUnitResult;