diff --git a/module/bug/control.php b/module/bug/control.php
index 7c12932430..f5da31c669 100755
--- a/module/bug/control.php
+++ b/module/bug/control.php
@@ -1243,8 +1243,12 @@ class bug extends control
$branchProduct = $product->type == 'normal' ? false : true;
/* Set plans. */
- $plans = $this->loadModel('productplan')->getPairs($productID, $branch, '', true);
- $plans = array('' => '', 'ditto' => $this->lang->bug->ditto) + $plans;
+ foreach($bugs as $bug)
+ {
+ $plans = $this->loadModel('productplan')->getPairs($productID, $bug->branch, '', true);
+ $plans = array('' => '', 'ditto' => $this->lang->bug->ditto) + $plans;
+ $bug->plans = $plans;
+ }
/* Set branches and modules. */
$branches = 0;
diff --git a/module/bug/js/common.js b/module/bug/js/common.js
index a5832ffbb7..4df2463255 100644
--- a/module/bug/js/common.js
+++ b/module/bug/js/common.js
@@ -885,6 +885,14 @@ function setBranchRelated(branchID, productID, num)
$('#plans' + num).parent('td').load(planLink, function()
{
$('#plans' + num).chosen();
+ if(planID == 1)
+ {
+ $(this).find('option').each(function()
+ {
+ if($(this).val() == 'ditto') $(this).remove();
+ });
+ $('#plans' + num).chosen().trigger('chosen:updated');
+ }
});
}
}
diff --git a/module/bug/view/batchedit.html.php b/module/bug/view/batchedit.html.php
index 89d343479d..54b6a5a704 100644
--- a/module/bug/view/batchedit.html.php
+++ b/module/bug/view/batchedit.html.php
@@ -103,7 +103,7 @@
product][$bug->branch]) ? $modules[$bug->product][$bug->branch] : array(0 => '/'), $bug->module, "class='form-control picker-select' data-drop-width='auto'");?> |
- ' style='overflow:visible'>plan, "class='form-control picker-select' data-drop-width='auto'");?> |
+ ' style='overflow:visible'>plans, $bug->plan, "class='form-control picker-select' data-drop-width='auto'");?> |
tab == 'project' or $app->tab == 'execution')
diff --git a/module/productplan/model.php b/module/productplan/model.php
index 1f05807b2d..e00c1a59b3 100644
--- a/module/productplan/model.php
+++ b/module/productplan/model.php
@@ -247,7 +247,7 @@ class productplanModel extends model
->leftJoin(TABLE_PRODUCT)->alias('t3')->on('t3.id=t1.product')
->where('t1.product')->in($product)
->andWhere('t1.deleted')->eq(0)
- ->beginIF($branch !== '')->andWhere('t1.branch')->in($branch)->fi()
+ ->beginIF($branch !== '' and $branch != 'all')->andWhere('t1.branch')->in("0,$branch")->fi()
->beginIF(strpos($param, 'unexpired') !== false)->andWhere('t1.end')->ge($date)->fi()
->beginIF(strpos($param, 'noclosed') !== false)->andWhere('t1.status')->ne('closed')->fi()
->orderBy('t1.begin desc')
@@ -255,6 +255,7 @@ class productplanModel extends model
$plans = $this->reorder4Children($plans);
$planPairs = array();
+ $this->app->loadLang('bug');
$this->app->loadLang('branch');
foreach($plans as $plan)
{
@@ -263,8 +264,14 @@ class productplanModel extends model
$planPairs[$plan->id] = $plan->title . " [{$plan->begin} ~ {$plan->end}]";
if($plan->begin == $this->config->productplan->future and $plan->end == $this->config->productplan->future) $planPairs[$plan->id] = $plan->title . ' ' . $this->lang->productplan->future;
if($plan->productType != 'normal') $planPairs[$plan->id] = ($plan->branchName ? $plan->branchName : $this->lang->branch->main) . ' / ' . $planPairs[$plan->id];
+ if(empty($plan->branchName))
+ {
+ $mainplan = $planPairs[$plan->id];
+ unset($planPairs[$plan->id]);
+ }
}
- return array('' => '') + $planPairs;
+ array_splice($planPairs, 0, 0, $mainplan);
+ return array('' => '', 'ditto' => $this->lang->bug->ditto) + $planPairs;
}
/**