* testtask: adjust code order.
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user