diff --git a/module/bug/control.php b/module/bug/control.php index 334405b8c3..d28b6fc25f 100755 --- a/module/bug/control.php +++ b/module/bug/control.php @@ -982,8 +982,15 @@ class bug extends control $executionID = $bug->execution; $projectID = $bug->project; $currentModuleID = $bug->module; + $product = $this->loadModel('product')->getByID($productID); $this->bug->checkBugExecutionPriv($bug); + if(!isset($this->products[$bug->product])) + { + $this->products[$bug->product] = $product->name; + $this->view->products = $this->products; + } + /* Set the menu. */ if($this->app->tab == 'project') $this->loadModel('project')->setMenu($bug->project); if($this->app->tab == 'execution') $this->loadModel('execution')->setMenu($bug->execution); @@ -1010,7 +1017,7 @@ class bug extends control { $products = array(); $productList = $this->config->CRProduct ? $this->product->getOrderedProducts('all', 40, $bug->project) : $this->product->getOrderedProducts('normal', 40, $bug->project); - foreach($productList as $product) $products[$product->id] = $product->name; + foreach($productList as $productInfo) $products[$productInfo->id] = $productInfo->name; $this->view->products = $products; } @@ -1020,7 +1027,6 @@ class bug extends control $this->view->position[] = $this->lang->bug->edit; /* Assign. */ - $product = $this->loadModel('product')->getByID($productID); $allBuilds = $this->loadModel('build')->getBuildPairs($productID, 'all', 'noempty'); if($executionID) { @@ -1064,6 +1070,11 @@ class bug extends control $branchOption[$branchInfo->id] = $branchInfo->name; $branchTagOption[$branchInfo->id] = $branchInfo->name . ($branchInfo->status == 'closed' ? ' (' . $this->lang->branch->statusList['closed'] . ')' : ''); } + if(!isset($branchTagOption[$bug->branch])) + { + $bugBranch = $this->branch->getById($bug->branch, $bug->product, ''); + $branchTagOption[$bug->branch] = $bug->branch == BRANCH_MAIN ? $bugBranch : ($bugBranch->name . ($bugBranch->status == 'closed' ? ' (' . $this->lang->branch->statusList['closed'] . ')' : '')); + } $moduleOptionMenu = $this->tree->getOptionMenu($productID, $viewType = 'bug', $startModuleID = 0, $bug->branch); if(!isset($moduleOptionMenu[$bug->module])) $moduleOptionMenu += $this->tree->getModulesName($bug->module); diff --git a/module/bug/js/common.js b/module/bug/js/common.js index 3f4f5c7282..16da26ea54 100644 --- a/module/bug/js/common.js +++ b/module/bug/js/common.js @@ -629,7 +629,8 @@ function loadProductBranches(productID, param) $('#branch').next('.picker').remove(); var branchStatus = page == 'create' ? 'active' : 'all'; - var param = "productID=" + productID + "&oldBranch=0¶m=" + branchStatus; + var oldBranch = page == 'edit' ? bugBranch : 0; + var param = "productID=" + productID + "&oldBranch=" + oldBranch + "¶m=" + branchStatus; if(typeof(tab) != 'undefined' && (tab == 'execution' || tab == 'project')) param += "&projectID=" + objectID; $.get(createLink('branch', 'ajaxGetBranches', param), function(data) { diff --git a/module/bug/view/edit.html.php b/module/bug/view/edit.html.php index 3981eb1f15..8716ea05fa 100644 --- a/module/bug/view/edit.html.php +++ b/module/bug/view/edit.html.php @@ -27,6 +27,7 @@ js::set('oldResolvedBuild' , $bug->resolvedBuild); js::set('systemMode' , $config->systemMode); js::set('confirmUnlinkBuild' , sprintf($lang->bug->confirmUnlinkBuild, zget($resolvedBuilds, $bug->resolvedBuild))); js::set('tab' , $this->app->tab); +js::set('bugBranch' , $bug->branch); if($this->app->tab == 'execution') js::set('objectID', $bug->execution); if($this->app->tab == 'project') js::set('objectID', $bug->project); ?>