diff --git a/module/bug/control.php b/module/bug/control.php index 027ae7c08f..66e2107a8d 100644 --- a/module/bug/control.php +++ b/module/bug/control.php @@ -114,6 +114,9 @@ class bug extends control $moduleTree = $this->tree->getTreeMenu($productID, $viewType = 'bug', $startModuleID = 0, array('treeModel', 'createBugLink'), '', (int)$this->cookie->treeBranch); } + if(($browseType != 'bymodule' && $browseType != 'bybranch')) $this->session->set('bugBrowseType', $browseType); + if(($browseType == 'bymodule' || $browseType == 'bybranch') and $this->session->bugBrowseType == 'bysearch') $this->session->set('bugBrowseType', 'unclosed'); + /* Process the order by field. */ if(!$orderBy) $orderBy = $this->cookie->qaBugOrder ? $this->cookie->qaBugOrder : 'id_desc'; setcookie('qaBugOrder', $orderBy, 0, $this->config->webRoot, '', false, true); diff --git a/module/bug/view/browse.html.php b/module/bug/view/browse.html.php index 014ee3e016..7697d91a08 100644 --- a/module/bug/view/browse.html.php +++ b/module/bug/view/browse.html.php @@ -48,12 +48,10 @@ $currentBrowseType = isset($lang->bug->mySelects[$browseType]) && in_array($brow foreach($menus as $menuItem) { if(isset($menuItem->hidden)) continue; - $menuBrowseType = strpos($menuItem->name, 'QUERY') === 0 ? 'bySearch' : $menuItem->name; $label = "{$menuItem->text}"; - if($this->session->bugBrowseType != 'bysearch' && ($browseType == 'bymodule' or $browseType == 'bybranch')) $browseType = $this->session->bugBrowseType; - $label .= $menuBrowseType == $browseType ? " {$pager->recTotal}" : ''; - $active = $menuBrowseType == $browseType ? 'btn-active-text' : ''; + $label .= $menuBrowseType == $this->session->bugBrowseType ? " {$pager->recTotal}" : ''; + $active = $menuBrowseType == $this->session->bugBrowseType ? 'btn-active-text' : ''; if($menuItem->name == 'my') { diff --git a/module/product/control.php b/module/product/control.php index 171e438725..4dfe862056 100644 --- a/module/product/control.php +++ b/module/product/control.php @@ -133,7 +133,6 @@ class product extends control if($browseType == '') setcookie('treeBranch', (int)$branch, 0, $this->config->webRoot, '', false, false); } if($browseType == 'bybranch') setcookie('storyBranch', (int)$branch, 0, $this->config->webRoot, '', false, false); - if($browseType != 'bymodule' and $browseType != 'bybranch') $this->session->set('storyBrowseType', $browseType); $moduleID = ($browseType == 'bymodule') ? (int)$param : (($browseType == 'bysearch' or $browseType == 'bybranch') ? 0 : ($this->cookie->storyModule ? $this->cookie->storyModule : 0)); $queryID = ($browseType == 'bysearch') ? (int)$param : 0; @@ -154,6 +153,9 @@ class product extends control $moduleTree = $this->tree->getTreeMenu($productID, $viewType = 'story', $startModuleID = 0, array('treeModel', $createModuleLink), '', (int)$this->cookie->treeBranch); } + if($browseType != 'bymodule' and $browseType != 'bybranch') $this->session->set('storyBrowseType', $browseType); + if(($browseType == 'bymodule' or $browseType == 'bybranch') and $this->session->storyBrowseType == 'bysearch') $this->session->set('storyBrowseType', 'unclosed'); + /* Process the order by field. */ if(!$orderBy) $orderBy = $this->cookie->productStoryOrder ? $this->cookie->productStoryOrder : 'id_desc'; setcookie('productStoryOrder', $orderBy, 0, $this->config->webRoot, '', false, true); diff --git a/module/product/model.php b/module/product/model.php index 86c235e4d7..8f6dc83503 100644 --- a/module/product/model.php +++ b/module/product/model.php @@ -561,6 +561,7 @@ class productModel extends model /* Set modules and browse type. */ $modules = $moduleID ? $this->loadModel('tree')->getAllChildID($moduleID) : '0'; + $browseType = $browseType == 'bybranch' ? 'bymodule' : $browseType; $browseType = ($browseType == 'bymodule' and $this->session->storyBrowseType and $this->session->storyBrowseType != 'bysearch') ? $this->session->storyBrowseType : $browseType; diff --git a/module/product/view/browse.html.php b/module/product/view/browse.html.php index 67a31a1c2f..ab806ef73a 100644 --- a/module/product/view/browse.html.php +++ b/module/product/view/browse.html.php @@ -39,7 +39,6 @@ js::set('foldAll', $lang->project->treeLevel['root']);
session->storyBrowseType == 'bysearch') $this->session->set('storyBrowseType', 'allstory'); foreach(customModel::getFeatureMenu($this->moduleName, $this->methodName) as $menuItem) { if(isset($menuItem->hidden)) continue; diff --git a/module/project/control.php b/module/project/control.php index cf9626bf9d..6631a89c6e 100644 --- a/module/project/control.php +++ b/module/project/control.php @@ -149,6 +149,8 @@ class project extends control $this->session->set('taskBrowseType', $browseType); } + if($browseType == 'bymodule' and $this->session->taskBrowseType == 'bysearch') $this->session->set('taskBrowseType', 'unclosed'); + /* Set queryID, moduleID and productID. */ $queryID = ($browseType == 'bysearch') ? (int)$param : 0; $moduleID = ($browseType == 'bymodule') ? (int)$param : (($browseType == 'bysearch' or $browseType == 'byproduct') ? 0 : $this->cookie->moduleBrowseParam); diff --git a/module/project/view/task.html.php b/module/project/view/task.html.php index ef85df8506..8965770cd3 100644 --- a/module/project/view/task.html.php +++ b/module/project/view/task.html.php @@ -69,8 +69,8 @@ js::set('foldAll', $lang->project->treeLevel['root']); elseif($menuType != 'status' and $menuType != 'QUERY') { $label = "{$menuItem->text}"; - $label .= $menuType == $browseType ? " {$pager->recTotal}" : ''; - $active = $menuType == $browseType ? 'btn-active-text' : ''; + $label .= $menuType == $this->session->taskBrowseType ? " {$pager->recTotal}" : ''; + $active = $menuType == $this->session->taskBrowseType ? 'btn-active-text' : ''; $title = $menuType == 'needconfirm' ? "title='{$lang->task->storyChange}'" : ''; echo html::a(inlink('task', "project=$projectID&type=$menuType"), $label, '', "id='{$menuType}' class='btn btn-link $active' $title"); }