diff --git a/module/product/model.php b/module/product/model.php index 40000db08e..d8059a291b 100644 --- a/module/product/model.php +++ b/module/product/model.php @@ -530,22 +530,26 @@ class productModel extends model $output .= ''; $output .= ""; - $notNormalProduct = (isset($currentProduct->type) and $currentProduct->type != 'normal'); - $isTrackMethod = ($currentModule == 'story' and $currentMethod == 'track'); - $isTreeBrowseMethod = ($currentModule == 'tree' and $currentMethod == 'browse'); - $isTesttaskCreateMethod = ($currentModule == 'testtask' and $currentMethod == 'create'); - $isTesttaskEditMethod = ($currentModule == 'testtask' and $currentMethod == 'edit'); - $isShowBranchMethod = (strpos($this->config->product->showBranchMethod, $currentMethod) !== false and $currentModule == 'product') || $isTrackMethod || $isTreeBrowseMethod; - if($notNormalProduct and strpos(',testsuite,testreport,', ',' . $currentModule . ',') === false and (($this->app->tab == 'qa' and !$isTesttaskCreateMethod and !$isTesttaskEditMethod) or $isShowBranchMethod)) + $notNormalProduct = (isset($currentProduct->type) and $currentProduct->type != 'normal'); + if($notNormalProduct) { - $this->lang->product->branch = sprintf($this->lang->product->branch, $this->lang->product->branchName[$currentProduct->type]); - $branches = $this->loadModel('branch')->getPairs($productID, 'all'); - $branchName = isset($branches[$branch]) ? $branches[$branch] : $branches[0]; - $dropMenuLink = helper::createLink('branch', 'ajaxGetDropMenu', "objectID=$productID&branch=$branch&module=$currentModule&method=$currentMethod&extra=$extra"); + $isShowBranch = false; + if($currentModule == 'story' and $currentMethod == 'track') $isShowBranch = true; + if($currentModule == 'tree' and $currentMethod == 'browse') $isShowBranch = true; + if($currentModule == 'product' and strpos($this->config->product->showBranchMethod, $currentMethod) !== false) $isShowBranch = true; + if($this->app->tab == 'qa' and strpos(',testsuite,testreport,testtask,', ",$currentModule,") === false) $isShowBranch = true; + if($this->app->tab == 'qa' and $currentModule == 'testtask' and strpos(',create,edit,', ",$currentMethod,") === false) $isShowBranch = true; + if($isShowBranch) + { + $this->lang->product->branch = sprintf($this->lang->product->branch, $this->lang->product->branchName[$currentProduct->type]); + $branches = $this->loadModel('branch')->getPairs($productID, 'all'); + $branchName = isset($branches[$branch]) ? $branches[$branch] : $branches[0]; + $dropMenuLink = helper::createLink('branch', 'ajaxGetDropMenu', "objectID=$productID&branch=$branch&module=$currentModule&method=$currentMethod&extra=$extra"); - $output .= "
"; + $output .= "
"; + } } return $output;