diff --git a/module/bug/control.php b/module/bug/control.php index 4e65a59019..f4c367d23d 100644 --- a/module/bug/control.php +++ b/module/bug/control.php @@ -101,15 +101,13 @@ class bug extends control { $this->loadModel('datatable'); - $products = $this->loadModel('product')->getPairs('noclosed'); - $productID = $this->product->saveState($productID, $products); - $this->qa->setMenu($products, $productID, $branch); + $productID = $this->product->saveState($productID, $this->products); + $this->qa->setMenu($this->products, $productID, $branch); /* Set browse type. */ $browseType = strtolower($browseType); /* Set productID, moduleID, queryID and branch. */ - if(!$this->projectID) $productID = $this->product->saveState($productID, $this->products); $branch = ($branch == '') ? (int)$this->cookie->preBranch : (int)$branch; setcookie('preProductID', $productID, $this->config->cookieLife, $this->config->webRoot, '', $this->config->cookieSecure, true); setcookie('preBranch', (int)$branch, $this->config->cookieLife, $this->config->webRoot, '', $this->config->cookieSecure, true); diff --git a/module/testcase/control.php b/module/testcase/control.php index 96f74d4eab..10e8a01c99 100644 --- a/module/testcase/control.php +++ b/module/testcase/control.php @@ -42,25 +42,29 @@ class testcase extends control $this->loadModel('qa'); /* Get product data. */ + $products = array(); $objectID = 0; - if($this->app->openApp == 'project') + $openApp = ($this->app->openApp == 'project' or $this->app->openApp == 'execution') ? $this->app->openApp : 'qa'; + if(!isonlybody()) { - $objectID = $this->session->project; - $products = $this->loadModel('project')->getProducts($objectID, false); - } - elseif($this->app->openApp == 'execution') - { - $objectID = $this->session->execution; - $products = $this->loadModel('execution')->getProducts($objectID, false); - } - else - { - $products = $this->product->getPairs(); - } + if($this->app->openApp == 'project') + { + $objectID = $this->session->project; + $products = $this->loadModel('project')->getProducts($objectID, false); + } + elseif($this->app->openApp == 'execution') + { + $objectID = $this->session->execution; + $products = $this->loadModel('execution')->getProducts($objectID, false); + } + else + { + $products = $this->product->getPairs(); + } + if(empty($products) and !helper::isAjaxRequest()) die($this->locate($this->createLink('product', 'showErrorNone', "moduleName=$openApp&activeMenu=testcase&objectID=$objectID"))); + } $this->view->products = $this->products = $products; - $openApp = ($this->app->openApp == 'project' or $this->app->openApp == 'execution') ? $this->app->openApp : 'qa'; - if(empty($this->products) and !helper::isAjaxRequest()) die($this->locate($this->createLink('product', 'showErrorNone', "moduleName=$openApp&activeMenu=testcase&objectID=$objectID"))); } /** diff --git a/module/testreport/control.php b/module/testreport/control.php index 8fec7d5276..c34d56064d 100644 --- a/module/testreport/control.php +++ b/module/testreport/control.php @@ -45,25 +45,29 @@ class testreport extends control $this->app->loadLang('report'); /* Get product data. */ + $products = array(); $objectID = 0; - if($this->app->openApp == 'project') + $openApp = ($this->app->openApp == 'project' or $this->app->openApp == 'execution') ? $this->app->openApp : 'qa'; + if(!isonlybody()) { - $objectID = $this->session->project; - $products = $this->loadModel('project')->getProducts($objectID, false); - } - elseif($this->app->openApp == 'execution') - { - $objectID = $this->session->execution; - $products = $this->loadModel('execution')->getProducts($objectID, false); - } - else - { - $products = $this->product->getPairs(); - } + if($this->app->openApp == 'project') + { + $objectID = $this->session->project; + $products = $this->loadModel('project')->getProducts($objectID, false); + } + elseif($this->app->openApp == 'execution') + { + $objectID = $this->session->execution; + $products = $this->loadModel('execution')->getProducts($objectID, false); + } + else + { + $products = $this->product->getPairs(); + } + if(empty($products) and !helper::isAjaxRequest()) die($this->locate($this->createLink('product', 'showErrorNone', "moduleName=$openApp&activeMenu=testreport&objectID=$objectID"))); + } $this->view->products = $this->products = $products; - $openApp = ($this->app->openApp == 'project' or $this->app->openApp == 'execution') ? $this->app->openApp : 'qa'; - if(empty($this->products) and !helper::isAjaxRequest()) die($this->locate($this->createLink('product', 'showErrorNone', "moduleName=$openApp&activeMenu=testreport&objectID=$objectID"))); } /** diff --git a/module/testtask/control.php b/module/testtask/control.php index f6ad9b4583..dadfd0d636 100644 --- a/module/testtask/control.php +++ b/module/testtask/control.php @@ -40,25 +40,29 @@ class testtask extends control $this->loadModel('product'); /* Get product data. */ + $products = array(); $objectID = 0; - if($this->app->openApp == 'project') + $openApp = ($this->app->openApp == 'project' or $this->app->openApp == 'execution') ? $this->app->openApp : 'qa'; + if(!isonlybody()) { - $objectID = $this->session->project; - $products = $this->loadModel('project')->getProducts($objectID, false); - } - elseif($this->app->openApp == 'execution') - { - $objectID = $this->session->execution; - $products = $this->loadModel('execution')->getProducts($objectID, false); - } - else - { - $products = $this->product->getPairs(); - } + if($this->app->openApp == 'project') + { + $objectID = $this->session->project; + $products = $this->loadModel('project')->getProducts($objectID, false); + } + elseif($this->app->openApp == 'execution') + { + $objectID = $this->session->execution; + $products = $this->loadModel('execution')->getProducts($objectID, false); + } + else + { + $products = $this->product->getPairs(); + } + if(empty($products) and !helper::isAjaxRequest()) die($this->locate($this->createLink('product', 'showErrorNone', "moduleName=$openApp&activeMenu=testtask&objectID=$objectID"))); + } $this->view->products = $this->products = $products; - $openApp = ($this->app->openApp == 'project' or $this->app->openApp == 'execution') ? $this->app->openApp : 'qa'; - if(empty($this->products) and !helper::isAjaxRequest()) die($this->locate($this->createLink('product', 'showErrorNone', "moduleName=$openApp&activeMenu=testtask&objectID=$objectID"))); } /**