diff --git a/module/bug/css/create.css b/module/bug/css/create.css index 433e87435a..de274bd781 100644 --- a/module/bug/css/create.css +++ b/module/bug/css/create.css @@ -45,3 +45,4 @@ html[lang='en'] #deadlineTd .input-group-addon {padding: 5px 18px;} #osBox .required:after {right: 1px;} #osBox {width: 190px;} #projectBox .required:after {right: 1px;} +#branch_chosen {min-width: 90px;} diff --git a/module/bug/js/batchcreate.js b/module/bug/js/batchcreate.js index 41834f78d2..a7ae9e9e8a 100644 --- a/module/bug/js/batchcreate.js +++ b/module/bug/js/batchcreate.js @@ -39,6 +39,17 @@ function setBranchRelated(branchID, productID, num) buildLink = createLink('build', 'ajaxGetProductBuilds', 'productID=' + productID + "&varName=openedBuilds&build=&branch=" + branchID + "&index=" + num); + /* If the branch of the current row is inconsistent with the one below, clear the module and execution of the nex row. */ + var nextBranchID = $('#branch' + (num + 1)).val(); + if(nextBranchID != branchID) + { + $('#modules' + (num + 1)).find("option[value='ditto']").remove(); + $('#modules' + (num + 1)).trigger("chosen:updated"); + + $('#executions' + (num + 1)).find("option[value='ditto']").remove(); + $('#executions' + (num + 1)).trigger("chosen:updated"); + } + setOpenedBuilds(buildLink, num); } diff --git a/module/bug/view/edit.html.php b/module/bug/view/edit.html.php index 552d3e2002..ae065ded78 100644 --- a/module/bug/view/edit.html.php +++ b/module/bug/view/edit.html.php @@ -19,7 +19,7 @@ js::set('changeProductConfirmed' , false); js::set('changeExecutionConfirmed' , false); js::set('confirmChangeProduct' , $lang->bug->confirmChangeProduct); js::set('planID' , $bug->plan); -js::set('oldExecutionID' , $bug->execution); +js::set('oldProjectID' , $bug->project); js::set('oldStoryID' , $bug->story); js::set('oldTaskID' , $bug->task); js::set('oldOpenedBuild' , $bug->openedBuild); diff --git a/module/product/control.php b/module/product/control.php index f1628fdda8..38a40b0eeb 100644 --- a/module/product/control.php +++ b/module/product/control.php @@ -929,7 +929,7 @@ class product extends control public function ajaxGetProjects($productID, $branch = 0, $projectID = 0) { $projects = array('' => ''); - $projects += $this->product->getProjectPairsByProduct($productID, $branch ? "0,$branch" : $branch); + $projects += $this->product->getProjectPairsByProduct($productID, $branch); if($this->app->getViewType() == 'json') die(json_encode($projects)); die(html::select('project', $projects, $projectID, "class='form-control' onchange='loadProductExecutions({$productID}, this.value)'")); @@ -948,7 +948,7 @@ class product extends control */ public function ajaxGetExecutions($productID, $projectID = 0, $branch = 0, $number = '', $executionID = 0) { - $executions = $this->product->getExecutionPairsByProduct($productID, $branch ? "0,$branch" : $branch, 'id_desc', $projectID); + $executions = $this->product->getExecutionPairsByProduct($productID, $branch, 'id_desc', $projectID); if($this->app->getViewType() == 'json') die(json_encode($executions)); if($number === '') diff --git a/module/productplan/control.php b/module/productplan/control.php index 4b4f947742..b5f8500776 100644 --- a/module/productplan/control.php +++ b/module/productplan/control.php @@ -346,7 +346,7 @@ class productplan extends control } else { - $plans = $this->productplan->getPairs($productID, $branch, $expired); + $plans = $this->productplan->getPairs($productID, $branch); } $planName = $number === '' ? 'plan' : "plan[$number]"; diff --git a/module/story/js/batchcreate.js b/module/story/js/batchcreate.js index 412811809f..98da6e91d8 100644 --- a/module/story/js/batchcreate.js +++ b/module/story/js/batchcreate.js @@ -67,6 +67,17 @@ function setModuleAndPlan(branchID, productID, num) $("#plan" + num).next('.picker').remove(); $("#plan" + num).chosen(); }); + + /* If the branch of the current row is inconsistent with the one below, clear the module and plan of the nex row. */ + var nextBranchID = $('#branch' + (num + 1)).val(); + if(nextBranchID != branchID) + { + $('#module' + (num + 1)).find("option[value='ditto']").remove(); + $('#module' + (num + 1)).trigger("chosen:updated"); + + $('#plan' + (num + 1)).find("option[value='ditto']").remove(); + $('#plan' + (num + 1)).trigger("chosen:updated"); + } } /* Copy story title as story spec. */