diff --git a/module/bug/control.php b/module/bug/control.php index 9327e37eeb..e2f3da10b7 100644 --- a/module/bug/control.php +++ b/module/bug/control.php @@ -111,7 +111,7 @@ class bug extends control $browseType = strtolower($browseType); /* Set productID, moduleID, queryID and branch. */ - $branch = ($this->cookie->preBranch and $branch === '') ? $this->cookie->preBranch : $branch; + $branch = ($this->cookie->preBranch !== '' and $branch === '') ? $this->cookie->preBranch : $branch; setcookie('preProductID', $productID, $this->config->cookieLife, $this->config->webRoot, '', $this->config->cookieSecure, true); setcookie('preBranch', $branch, $this->config->cookieLife, $this->config->webRoot, '', $this->config->cookieSecure, true); @@ -125,7 +125,7 @@ class bug extends control setcookie('bugModule', (int)$param, 0, $this->config->webRoot, '', $this->config->cookieSecure, false); $_COOKIE['bugBranch'] = 0; setcookie('bugBranch', 0, 0, $this->config->webRoot, '', $this->config->cookieSecure, false); - if($browseType == '') setcookie('treeBranch', (int)$branch, 0, $this->config->webRoot, '', $this->config->cookieSecure, false); + if($browseType == '') setcookie('treeBranch', $branch, 0, $this->config->webRoot, '', $this->config->cookieSecure, false); } if($browseType == 'bybranch') setcookie('bugBranch', $branch, 0, $this->config->webRoot, '', $this->config->cookieSecure, false); if($browseType != 'bymodule' and $browseType != 'bybranch') $this->session->set('bugBrowseType', $browseType); @@ -142,6 +142,10 @@ class bug extends control setcookie('treeBranch', $branch, 0, $this->config->webRoot, '', $this->config->cookieSecure, false); $browseType = 'unclosed'; } + else + { + $branch = $this->cookie->treeBranch; + } if($this->projectID and !$productID) { @@ -149,7 +153,7 @@ class bug extends control } else { - $moduleTree = $this->tree->getTreeMenu($productID, 'bug', 0, array('treeModel', 'createBugLink'), '', $browseType == '' ? $branch : $this->cookie->treeBranch); + $moduleTree = $this->tree->getTreeMenu($productID, 'bug', 0, array('treeModel', 'createBugLink'), '', $branch); } if(($browseType != 'bymodule' && $browseType != 'bybranch')) $this->session->set('bugBrowseType', $browseType); diff --git a/module/product/control.php b/module/product/control.php index 9d409d26cd..1e53c206c3 100644 --- a/module/product/control.php +++ b/module/product/control.php @@ -81,7 +81,7 @@ class product extends control $this->app->loadLang('execution'); $this->app->loadLang('project'); - $branch = ($this->cookie->preBranch and $branch === '') ? $this->cookie->preBranch : $branch; + $branch = ($this->cookie->preBranch !== '' and $branch === '') ? $this->cookie->preBranch : $branch; setcookie('preBranch', $branch, $this->config->cookieLife, $this->config->webRoot, '', $this->config->cookieSecure, true); $this->product->setMenu($productID, $branch); @@ -126,7 +126,7 @@ class product extends control public function browse($productID = 0, $branch = '', $browseType = '', $param = 0, $storyType = 'story', $orderBy = '', $recTotal = 0, $recPerPage = 20, $pageID = 1, $projectID = 0) { $productID = $this->app->tab != 'project' ? $this->product->saveState($productID, $this->products) : $productID; - $branch = ($this->cookie->preBranch and $branch === '') ? $this->cookie->preBranch : $branch; + $branch = ($this->cookie->preBranch !== '' and $branch === '') ? $this->cookie->preBranch : $branch; /* Set menu. */ if($this->app->tab == 'product') @@ -764,7 +764,7 @@ class product extends control */ public function roadmap($productID, $branch = '') { - $branch = ($this->cookie->preBranch and $branch === '') ? $this->cookie->preBranch : $branch; + $branch = ($this->cookie->preBranch !== '' and $branch === '') ? $this->cookie->preBranch : $branch; setcookie('preBranch', $branch, $this->config->cookieLife, $this->config->webRoot, '', $this->config->cookieSecure, true); $this->lang->product->switcherMenu = $this->product->getSwitcher($productID, '', $branch); diff --git a/module/qa/model.php b/module/qa/model.php index a9c8623eb2..fa41835710 100644 --- a/module/qa/model.php +++ b/module/qa/model.php @@ -29,7 +29,7 @@ class qaModel extends model die(js::error($this->lang->product->accessDenied) . js::locate('back')); } - $branch = ($this->cookie->preBranch and $branch === '') ? $this->cookie->preBranch : $branch; + $branch = ($this->cookie->preBranch !== '' and $branch === '') ? $this->cookie->preBranch : $branch; setcookie('preBranch', $branch, $this->config->cookieLife, $this->config->webRoot, '', $this->config->cookieSecure, true); if(!in_array($this->app->rawModule, $this->config->qa->noDropMenuModule)) $this->lang->switcherMenu = $this->loadModel('product')->getSwitcher($productID, $extra, $branch); diff --git a/module/story/control.php b/module/story/control.php index c147e2cebd..009787c23f 100644 --- a/module/story/control.php +++ b/module/story/control.php @@ -1540,7 +1540,7 @@ class story extends control */ public function track($productID, $branch = '', $projectID = 0, $recTotal = 0, $recPerPage = 20, $pageID = 1) { - $branch = ($this->cookie->preBranch and $branch === '') ? $this->cookie->preBranch : $branch; + $branch = ($this->cookie->preBranch !== '' and $branch === '') ? $this->cookie->preBranch : $branch; setcookie('preBranch', $branch, $this->config->cookieLife, $this->config->webRoot, '', $this->config->cookieSecure, true); /* Set menu. The projectstory module does not execute. */ diff --git a/module/testcase/control.php b/module/testcase/control.php index f6ae8c9689..0af4d8a525 100644 --- a/module/testcase/control.php +++ b/module/testcase/control.php @@ -105,7 +105,7 @@ class testcase extends control /* Set browseType, productID, moduleID and queryID. */ $productID = $this->app->tab != 'project' ? $this->product->saveState($productID, $this->products) : $productID; - $branch = ($this->cookie->preBranch and $branch === '') ? $this->cookie->preBranch : $branch; + $branch = ($this->cookie->preBranch !== '' and $branch === '') ? $this->cookie->preBranch : $branch; setcookie('preProductID', $productID, $this->config->cookieLife, $this->config->webRoot, '', $this->config->cookieSecure, true); setcookie('preBranch', $branch, $this->config->cookieLife, $this->config->webRoot, '', $this->config->cookieSecure, true); @@ -227,7 +227,7 @@ class testcase extends control { $groupBy = empty($groupBy) ? 'story' : $groupBy; $productID = $this->product->saveState($productID, $this->products); - if($branch === '') $branch = (int)$this->cookie->preBranch; + if($branch === '') $branch = $this->cookie->preBranch; $this->app->loadLang('testtask'); @@ -352,7 +352,7 @@ class testcase extends control /* Set productID and branch. */ $productID = $this->product->saveState($productID, $this->products); - if($branch === '') $branch = (int)$this->cookie->preBranch; + if($branch === '') $branch = $this->cookie->preBranch; /* Set menu. */ if($this->app->tab == 'project') @@ -510,7 +510,7 @@ class testcase extends control /* Set productID and currentModuleID. */ $productID = $this->product->saveState($productID, $this->products); - if($branch === '') $branch = (int)$this->cookie->preBranch; + if($branch === '') $branch = $this->cookie->preBranch; if($storyID and empty($moduleID)) { $story = $this->loadModel('story')->getByID($storyID); diff --git a/module/testtask/control.php b/module/testtask/control.php index f4fe17d8fb..78f410e170 100644 --- a/module/testtask/control.php +++ b/module/testtask/control.php @@ -109,7 +109,7 @@ class testtask extends control /* Set menu. */ $productID = $this->product->saveState($productID, $this->products); - $branch = ($this->cookie->preBranch and $branch === '') ? $this->cookie->preBranch : $branch; + $branch = ($this->cookie->preBranch !== '' and $branch === '') ? $this->cookie->preBranch : $branch; $this->loadModel('qa')->setMenu($this->products, $productID, $branch, $type); /* Load pager. */