diff --git a/module/execution/control.php b/module/execution/control.php index 472864abcb..65674748d6 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -862,7 +862,7 @@ class execution extends control $productPairs = array('0' => $this->lang->product->all); foreach($products as $product) $productPairs[$product->id] = $product->name; - $this->lang->modulePageNav = $this->product->select($productPairs, $productID, 'execution', 'bug', '', $branchID); + $this->lang->modulePageNav = $this->product->select($productPairs, $productID, 'execution', 'bug', '', $branchID, 0, '', false); /* Header and position. */ $title = $execution->name . $this->lang->colon . $this->lang->execution->bug; diff --git a/module/product/model.php b/module/product/model.php index 4dc7eee09c..b2e42a7856 100644 --- a/module/product/model.php +++ b/module/product/model.php @@ -67,11 +67,12 @@ class productModel extends model * @param int $branch * @param int $module * @param string $moduleType + * @param bool $withBranch true|false * * @access public * @return string */ - public function select($products, $productID, $currentModule, $currentMethod, $extra = '', $branch = 0, $module = 0, $moduleType = '') + public function select($products, $productID, $currentModule, $currentMethod, $extra = '', $branch = 0, $module = 0, $moduleType = '', $withBranch = true) { $isBrowseBug = (strpos(',project,execution,', ",{$this->app->openApp},") !== false and strpos(',bug,testcase,testtask,', ",{$this->app->rawMethod},") !== false and isset($products[0])) ? true : false; @@ -106,8 +107,8 @@ class productModel extends model $output .= ""; if($isMobile) $output = "{$currentProduct->name}
"; - if($currentProduct->type == 'normal') unset($this->lang->product->menu->settings['subMenu']->branch); - if($currentProduct->type != 'normal' && $currentModule != 'programplan') + if($currentProduct->type == 'normal' || !$withBranch) unset($this->lang->product->menu->settings['subMenu']->branch); + if($currentProduct->type != 'normal' && $currentModule != 'programplan' && $withBranch) { $this->lang->product->branch = $this->lang->product->branchName[$currentProduct->type]; $this->lang->product->menu->settings['subMenu']->branch = str_replace('@branch@', $this->lang->product->branch, $this->lang->product->menu->settings['subMenu']->branch); diff --git a/module/project/control.php b/module/project/control.php index 331e45fd6c..37aa2cd229 100644 --- a/module/project/control.php +++ b/module/project/control.php @@ -723,7 +723,7 @@ class project extends control $productPairs = array('0' => $this->lang->product->all); foreach($products as $product) $productPairs[$product->id] = $product->name; - $this->lang->modulePageNav = $this->product->select($productPairs, $productID, 'project', 'bug', '', $branchID); + $this->lang->modulePageNav = $this->product->select($productPairs, $productID, 'project', 'bug', '', $branchID, 0, '', false); /* Header and position. */ $title = $project->name . $this->lang->colon . $this->lang->bug->common; @@ -786,7 +786,7 @@ class project extends control { $this->loadModel('product'); $products = array('0' => $this->lang->product->all) + $this->project->getProducts($projectID, false); - $this->lang->modulePageNav = $this->product->select($products, $productID, 'project', 'testcase', '', $branch); + $this->lang->modulePageNav = $this->product->select($products, $productID, 'project', 'testcase', '', $branch, 0, '', false); echo $this->fetch('testcase', 'browse', "productID=$productID&branch=$branch&browseType=$browseType¶m=$param&orderBy=$orderBy&recTotal=$orderBy&recPerPage=$recPerPage&pageID=$pageID&projectID=$projectID"); }