From c40360d5569dd1863e0593e58012b512f467d71c Mon Sep 17 00:00:00 2001 From: mayue Date: Thu, 25 Nov 2021 09:43:34 +0800 Subject: [PATCH 1/2] * Fix bug #16605. --- module/branch/control.php | 3 ++- module/execution/model.php | 4 ++-- module/product/model.php | 3 ++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/module/branch/control.php b/module/branch/control.php index a83e5d950b..5a34c60190 100644 --- a/module/branch/control.php +++ b/module/branch/control.php @@ -205,7 +205,8 @@ class branch extends control */ public function ajaxGetDropMenu($productID, $branch = 0, $module, $method, $extra = '') { - $branches = $this->branch->getPairs($productID, 'all'); + $products = $this->loadModel('execution')->getBranchByProduct($productID, $extra, 'all'); + $branches = $products[$productID]; $statusList = $this->dao->select('id,status')->from(TABLE_BRANCH)->where('product')->eq($productID)->fetchPairs(); $this->view->link = $this->loadModel('product')->getProductLink($module, $method, $extra, true); diff --git a/module/execution/model.php b/module/execution/model.php index cd4dbeb8ec..da70844127 100644 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -1638,9 +1638,9 @@ class executionModel extends model * @access public * @return array */ - public function getBranchByProduct($products, $projectID = 0) + public function getBranchByProduct($products, $projectID = 0, $status = 'noclosed') { - $branchGroups = $this->loadModel('branch')->getByProducts($products, 'noclosed'); + $branchGroups = $this->loadModel('branch')->getByProducts($products, $status); if($projectID) { diff --git a/module/product/model.php b/module/product/model.php index 5b4b11f951..d55822bde7 100644 --- a/module/product/model.php +++ b/module/product/model.php @@ -75,7 +75,8 @@ class productModel extends model */ public function select($products, $productID, $currentModule, $currentMethod, $extra = '', $branch = '', $module = 0, $moduleType = '', $withBranch = true) { - $isBrowseBug = (strpos(',project,execution,', ",{$this->app->tab},") !== false and strpos(',bug,testcase,testtask,ajaxselectstory,', ",{$this->app->rawMethod},") !== false and isset($products[0])) ? true : false; + $browseBugMethod = ',bug,testcase,testtask,ajaxselectstory,groupcase,zerocase,browseunits,'; + $isBrowseBug = (strpos(',project,execution,', ",{$this->app->tab},") !== false and strpos($browseBugMethod, ",{$this->app->rawMethod},") !== false and isset($products)) ? true : false; $this->app->loadLang('product'); if(!$isBrowseBug and !$productID) From c2c13a907945198e9a38d7680c77305c60796130 Mon Sep 17 00:00:00 2001 From: mayue Date: Thu, 25 Nov 2021 09:53:49 +0800 Subject: [PATCH 2/2] * Fix bug #16605. --- module/execution/model.php | 1 + 1 file changed, 1 insertion(+) diff --git a/module/execution/model.php b/module/execution/model.php index da70844127..34edb0bad6 100644 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -1635,6 +1635,7 @@ class executionModel extends model * * @param array $products * @param int $projectID + * @param string $status * @access public * @return array */