From a6e12e72efec6b8f406851f795a0c5ca7f10e4b6 Mon Sep 17 00:00:00 2001 From: liugang Date: Tue, 19 Sep 2023 13:18:19 +0800 Subject: [PATCH] * testtask: adjust code order. --- module/testtask/control.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/module/testtask/control.php b/module/testtask/control.php index 5b94ba58e4..22e1e40baf 100644 --- a/module/testtask/control.php +++ b/module/testtask/control.php @@ -390,6 +390,12 @@ class testtask extends control $testtask = $this->testtask->getByID($taskID); if(!$testtask) return $this->send(array('result' => 'fail', 'load' => array('alert' => $this->lang->testtask->checkLinked, 'locate' => array('back' => true)))); + /* 检查是否有权限访问测试单所属产品。*/ + /* Check if user have permission to access the product to which the testtask belongs. */ + $productID = $this->loadModel('product')->checkAccess($testtask->product, $this->products); + + $this->testtaskZen->setMenu($productID, $testtask->branch, $testtask->project, $testtask->execution); + /* 预处理部分变量供后面使用。*/ /* Prepare variables. */ $browseType = strtolower($browseType); @@ -406,17 +412,11 @@ class testtask extends control if($this->cookie->preTaskID != $taskID) helper::setcookie('taskCaseModule', 0, 0); if($browseType == 'bymodule') helper::setcookie('taskCaseModule', $param, 0); - /* 检查是否有权限访问测试单所属产品。*/ - /* Check if user have permission to access the product to which the testtask belongs. */ - $productID = $this->loadModel('product')->checkAccess($testtask->product, $this->products); - /* 如果测试单所属产品在产品键值对中不存在,将其加入。*/ /* Prepare the product key-value pairs. */ $product = $this->loadModel('product')->getByID($productID); if(!isset($this->products[$productID])) $this->products[$productID] = $product->name; - $this->testtaskZen->setMenu($productID, $testtask->branch, $testtask->project, $testtask->execution); - /* 预处理部分变量供查询使用。*/ /* Prepare variables for query. */ $this->app->loadClass('pager', $static = true);