* code for browse filter.

This commit is contained in:
wangyidong
2016-04-22 14:19:37 +08:00
parent ed4ad97ac3
commit 2872ae3f8f
9 changed files with 81 additions and 33 deletions
+12 -6
View File
@@ -231,6 +231,18 @@ class testtask extends control
/* Set the browseType and moduleID. */
$browseType = strtolower($browseType);
/* Get task and product info, set menu. */
$task = $this->testtask->getById($taskID);
if(!$task) die(js::error($this->lang->notFound) . js::locate('back'));
$productID = $task->product;
$this->testtask->setMenu($this->products, $productID, $task->branch);
setcookie('preProductID', $productID, $this->config->cookieLife, $this->config->webRoot);
if($this->cookie->preProductID != $productID)
{
$_COOKIE['taskCaseModule'] = 0;
setcookie('taskCaseModule', 0, $this->config->cookieLife, $this->config->webRoot);
}
if($browseType == 'bymodule') setcookie('taskCaseModule', (int)$param, $this->config->cookieLife, $this->config->webRoot);
if($browseType != 'bymodule') $this->session->set('taskCaseBrowseType', $browseType);
@@ -240,12 +252,6 @@ class testtask extends control
/* Append id for secend sort. */
$sort = $this->loadModel('common')->appendOrder($orderBy, 't2.id');
/* Get task and product info, set menu. */
$task = $this->testtask->getById($taskID);
if(!$task) die(js::error($this->lang->notFound) . js::locate('back'));
$productID = $task->product;
$this->testtask->setMenu($this->products, $productID, $task->branch);
/* Get test cases. */
$this->view->runs = $this->testtask->getTaskCases($productID, $browseType, $queryID, $moduleID, $sort, $pager, $task);
$this->loadModel('common')->saveQueryCondition($this->dao->get(), 'testcase', false);