From 985007b1cebe8405b57704d91c85aba817905ffc Mon Sep 17 00:00:00 2001 From: tianshujie Date: Tue, 15 Mar 2022 14:52:07 +0800 Subject: [PATCH 1/3] * Fix bug #19321. --- module/bug/control.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/module/bug/control.php b/module/bug/control.php index 6245d24d50..e4986b8b0d 100644 --- a/module/bug/control.php +++ b/module/bug/control.php @@ -554,9 +554,6 @@ class bug extends control if($user) $productMembers[$assignedTo] = $user->realname; } - $moduleOptionMenu = $this->tree->getOptionMenu($productID, $viewType = 'bug', $startModuleID = 0, ($branch === 'all' or !isset($branches[$branch])) ? 0 : $branch); - if(empty($moduleOptionMenu)) return print(js::locate(helper::createLink('tree', 'browse', "productID=$productID&view=story"))); - /* Get products and projects. */ $products = $this->config->CRProduct ? $this->products : $this->product->getPairs('noclosed', 0, 'program_asc'); $projects = array(0 => ''); @@ -589,6 +586,11 @@ class bug extends control $projects += $this->product->getProjectPairsByProduct($productID, $branch); } + if(!empty($products) and !isset($products[$productID])) $productID = key($products); + $moduleOptionMenu = $this->tree->getOptionMenu($productID, $viewType = 'bug', $startModuleID = 0, ($branch === 'all' or !isset($branches[$branch])) ? 0 : $branch); + if(empty($moduleOptionMenu)) return print(js::locate(helper::createLink('tree', 'browse', "productID=$productID&view=story"))); + + /* Get block id of assinge to me. */ $blockID = 0; if(isonlybody()) From 63f53d23d6d2146317327348444adeb3cadcbbae Mon Sep 17 00:00:00 2001 From: tianshujie Date: Tue, 15 Mar 2022 17:04:56 +0800 Subject: [PATCH 2/3] * Fix bug #19321. --- module/execution/js/kanban.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/execution/js/kanban.js b/module/execution/js/kanban.js index 40a802e27e..eabb87a16d 100644 --- a/module/execution/js/kanban.js +++ b/module/execution/js/kanban.js @@ -280,7 +280,7 @@ function createColumnCreateMenu(options) } else if(col.type == 'unconfirmed') { - if(priv.canCreateBug) items.push({label: bugLang.create, url: $.createLink('bug', 'create', 'productID=0&moduleID=0&extra=regionID=' + regionID + ',laneID=' + laneID + ',columnID=' + col.id + ',executionID=' + executionID, '', true), className: 'iframe', attrs: {'data-toggle': 'modal', 'data-width': '80%'}}); + if(priv.canCreateBug) items.push({label: bugLang.create, url: $.createLink('bug', 'create', 'productID=' + productID + '&moduleID=0&extra=regionID=' + regionID + ',laneID=' + laneID + ',columnID=' + col.id + ',executionID=' + executionID, '', true), className: 'iframe', attrs: {'data-toggle': 'modal', 'data-width': '80%'}}); if(priv.canBatchCreateBug) { if(productNum > 1) items.push({label: bugLang.batchCreate, url: '#batchCreateBug', 'attrs' : {'data-toggle': 'modal'}}); From a9fe233f4d37485597d2a7998e61dc70ea70fed2 Mon Sep 17 00:00:00 2001 From: tianshujie Date: Tue, 15 Mar 2022 17:05:45 +0800 Subject: [PATCH 3/3] * Fix bug #19321. --- module/bug/control.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/module/bug/control.php b/module/bug/control.php index e4986b8b0d..6245d24d50 100644 --- a/module/bug/control.php +++ b/module/bug/control.php @@ -554,6 +554,9 @@ class bug extends control if($user) $productMembers[$assignedTo] = $user->realname; } + $moduleOptionMenu = $this->tree->getOptionMenu($productID, $viewType = 'bug', $startModuleID = 0, ($branch === 'all' or !isset($branches[$branch])) ? 0 : $branch); + if(empty($moduleOptionMenu)) return print(js::locate(helper::createLink('tree', 'browse', "productID=$productID&view=story"))); + /* Get products and projects. */ $products = $this->config->CRProduct ? $this->products : $this->product->getPairs('noclosed', 0, 'program_asc'); $projects = array(0 => ''); @@ -586,11 +589,6 @@ class bug extends control $projects += $this->product->getProjectPairsByProduct($productID, $branch); } - if(!empty($products) and !isset($products[$productID])) $productID = key($products); - $moduleOptionMenu = $this->tree->getOptionMenu($productID, $viewType = 'bug', $startModuleID = 0, ($branch === 'all' or !isset($branches[$branch])) ? 0 : $branch); - if(empty($moduleOptionMenu)) return print(js::locate(helper::createLink('tree', 'browse', "productID=$productID&view=story"))); - - /* Get block id of assinge to me. */ $blockID = 0; if(isonlybody())