|
- lang->bug->resolutionList, $bugs[$bugID]->resolution, "class=form-control onchange=setDuplicate(this.value,$bugID)");?>
+ resolution, "class=form-control onchange=setDuplicate(this.value,$bugID)");?>
|
' resolution != 'duplicate') echo "style='display:none'";?>>
bug->duplicateBug}'");?>
diff --git a/module/story/control.php b/module/story/control.php
index 71e6581a9f..9f4c6e912f 100644
--- a/module/story/control.php
+++ b/module/story/control.php
@@ -242,11 +242,11 @@ class story extends control
$this->view->titles = $titles;
}
- $moduleOptionMenu['same'] = $this->lang->story->same;
- $plans = $this->loadModel('productplan')->getPairs($productID, 'unexpired');
- $plans['same'] = $this->lang->story->same;
- $priList = (array)$this->lang->story->priList;
- $priList['same'] = $this->lang->story->same;
+ $moduleOptionMenu['ditto'] = $this->lang->story->ditto;
+ $plans = $this->loadModel('productplan')->getPairs($productID, $branch, 'unexpired');
+ $plans['ditto'] = $this->lang->story->ditto;
+ $priList = (array)$this->lang->story->priList;
+ $priList['ditto'] = $this->lang->story->ditto;
$this->view->title = $product->name . $this->lang->colon . $this->lang->story->batchCreate;
$this->view->productName = $product->name;
@@ -348,6 +348,9 @@ class story extends control
*/
public function batchEdit($productID = 0, $projectID = 0, $branch = 0)
{
+ /* Load model. */
+ $this->loadModel('productplan');
+
if($this->post->titles)
{
$allChanges = $this->story->batchUpdate();
@@ -364,7 +367,6 @@ class story extends control
}
}
die(js::locate($this->session->storyList, 'parent'));
-
}
$storyIDList = $this->post->storyIDList ? $this->post->storyIDList : die(js::locate($this->session->storyList, 'parent'));
@@ -377,8 +379,17 @@ class story extends control
{
$this->product->setMenu($this->product->getPairs('nodeleted'), $productID, $branch);
$product = $this->product->getByID($productID);
- $this->view->position[] = html::a($this->createLink('product', 'browse', "product=$product->id&branch=$branch"), $product->name);
- $this->view->title = $product->name . $this->lang->colon . $this->lang->story->batchEdit;
+
+ /* Set modules and productPlans. */
+ $modules = $this->tree->getOptionMenu($productID, $viewType = 'story', 0, $branch);
+ $modules['ditto'] = $this->lang->story->ditto;
+ $productPlans = $this->productplan->getPairs($productID, $branch);
+ $productPlans['ditto'] = $this->lang->story->ditto;
+
+ $this->view->modules = $modules;
+ $this->view->productPlans = $productPlans;
+ $this->view->position[] = html::a($this->createLink('product', 'browse', "product=$product->id&branch=$branch"), $product->name);
+ $this->view->title = $product->name . $this->lang->colon . $this->lang->story->batchEdit;
}
/* The stories of a project. */
@@ -403,15 +414,13 @@ class story extends control
$this->view->title = $this->lang->story->batchEdit;
}
- /* Get the module and productplan of edited stories. */
- $moduleOptionMenus = array();
- $productPlans = array();
- $this->loadModel('productplan');
- foreach($stories as $story)
- {
- $moduleOptionMenus[$story->product] = $this->tree->getOptionMenu($story->product, $viewType = 'story', 0, $branch);
- $productPlans[$story->product] = $this->productplan->getPairs($story->product, $branch);
- }
+ /* Set ditto option for users and pri, source, stage list. */
+ $users = $this->loadModel('user')->getPairs('nodeleted');
+ $users['ditto'] = $this->lang->story->ditto;
+ $this->lang->story->priList['ditto'] = $this->lang->story->ditto;
+ $this->lang->story->sourceList['ditto'] = $this->lang->story->ditto;
+ $this->lang->story->stageList['ditto'] = $this->lang->story->ditto;
+ $this->lang->story->reasonList['ditto'] = $this->lang->story->ditto;
/* Judge whether the editedStories is too large and set session. */
$showSuhosinInfo = false;
@@ -421,11 +430,14 @@ class story extends control
$this->view->position[] = $this->lang->story->common;
$this->view->position[] = $this->lang->story->batchEdit;
- $this->view->users = $this->loadModel('user')->getPairs('nodeleted');
- $this->view->moduleOptionMenus = $moduleOptionMenus;
- $this->view->productPlans = $productPlans;
+ $this->view->users = $users;
+ $this->view->priList = (array)$this->lang->story->priList;
+ $this->view->sourceList = $this->lang->story->sourceList;
+ $this->view->reasonList = $this->lang->story->reasonList;
+ $this->view->stageList = $this->lang->story->stageList;
$this->view->productID = $productID;
$this->view->storyIDList = $storyIDList;
+ $this->view->branch = $branch;
$this->view->stories = $stories;
$this->view->productName = isset($product) ? $product->name : '';
$this->display();
diff --git a/module/story/js/batchcreate.js b/module/story/js/batchcreate.js
index ed0b319f4d..73d3b44a68 100644
--- a/module/story/js/batchcreate.js
+++ b/module/story/js/batchcreate.js
@@ -1,7 +1,7 @@
$(document).on('click', '.chosen-with-drop', function()
{
var select = $(this).prev('select');
- if($(select).val() == 'same')
+ if($(select).val() == 'ditto')
{
var index = $(select).closest('td').index();
var row = $(select).closest('tr').index();
@@ -10,7 +10,7 @@ $(document).on('click', '.chosen-with-drop', function()
for(i = row - 1; i >= 0; i--)
{
value = $(table).find('tr').eq(i).find('td').eq(index).find('select').val();
- if(value != 'same') break;
+ if(value != 'ditto') break;
}
$(select).val(value);
$(select).trigger("chosen:updated");
@@ -18,7 +18,7 @@ $(document).on('click', '.chosen-with-drop', function()
});
$(document).on('mousedown', 'select', function()
{
- if($(this).val() == 'same')
+ if($(this).val() == 'ditto')
{
var index = $(this).closest('td').index();
var row = $(this).closest('tr').index();
@@ -27,7 +27,7 @@ $(document).on('mousedown', 'select', function()
for(i = row - 1; i >= 0; i--)
{
value = $(table).find('tr').eq(i).find('td').eq(index).find('select').val();
- if(value != 'same') break;
+ if(value != 'ditto') break;
}
$(this).val(value);
}
diff --git a/module/story/js/batchedit.js b/module/story/js/batchedit.js
index 45150d3088..f0b5b2c9f2 100644
--- a/module/story/js/batchedit.js
+++ b/module/story/js/batchedit.js
@@ -24,3 +24,50 @@ function setDuplicateAndChild(resolution, storyID)
$('#childStoryBox' + storyID).hide();
}
}
+
+$(function()
+{
+ $firstTr = $('.table-form').find('tbody tr:first');
+ $firstTr.find('td select').each(function()
+ {
+ $(this).find("option[value='ditto']").remove();
+ $(this).trigger("chosen:updated");
+ });
+})
+
+$(document).on('click', '.chosen-with-drop', function()
+{
+ var $select = $(this).prev('select');
+ oldValue = $select.val();
+})
+
+$(document).on('change', 'select', function()
+{
+ if($(this).val() == 'ditto')
+ {
+ var index = $(this).closest('td').index();
+ var row = $(this).closest('tr').index();
+ var table = $(this).closest('tr').parent();
+
+ var value = '';
+ for(i = row - 1; i >= 0; i--)
+ {
+ value = $(table).find('tr').eq(i).find('td').eq(index).find('select').val();
+ if(value != 'ditto') break;
+ }
+
+ var valueStr = ',' + $(this).find('option').map(function(){return $(this).val();}).get().join(',') + ',';
+ if(valueStr.indexOf(',' + value + ',') != -1)
+ {
+ $(this).val(value);
+ }
+ else
+ {
+ alert(dittoNotice);
+ $(this).val(oldValue);
+ }
+
+ $(this).trigger("chosen:updated");
+ $(this).trigger("change");
+ }
+})
diff --git a/module/story/lang/en.php b/module/story/lang/en.php
index 7f0d94a9e4..6df6c30851 100644
--- a/module/story/lang/en.php
+++ b/module/story/lang/en.php
@@ -76,7 +76,8 @@ $lang->story->preVersion = 'Pre version';
$lang->story->keywords = 'Keyword';
$lang->story->newStory = 'Continue to add story.';
-$lang->story->same = 'Ditto';
+$lang->story->ditto = 'Ditto';
+$lang->story->dittoNotice = 'Current story and story above it do not belong to same product!';
$lang->story->useList[0] = 'No use';
$lang->story->useList[1] = 'Use';
diff --git a/module/story/lang/zh-cn.php b/module/story/lang/zh-cn.php
index 999b9c4dfa..daffe2611b 100644
--- a/module/story/lang/zh-cn.php
+++ b/module/story/lang/zh-cn.php
@@ -76,7 +76,8 @@ $lang->story->preVersion = '之前版本';
$lang->story->keywords = '关键词';
$lang->story->newStory = '继续添加需求';
-$lang->story->same = '同上';
+$lang->story->ditto = '同上';
+$lang->story->dittoNotice = '该需求与上一需求不属于同一产品!';
$lang->story->useList[0] = '不使用';
$lang->story->useList[1] = '使用';
diff --git a/module/story/model.php b/module/story/model.php
index 401cb86b3a..437effe48c 100644
--- a/module/story/model.php
+++ b/module/story/model.php
@@ -249,9 +249,9 @@ class storyModel extends model
$pri = 0;
for($i = 0; $i < $batchNum; $i++)
{
- $module = $stories->module[$i] == 'same' ? $module : $stories->module[$i];
- $plan = $stories->plan[$i] == 'same' ? $plan : $stories->plan[$i];
- $pri = $stories->pri[$i] == 'same' ? $pri : $stories->pri[$i];
+ $module = $stories->module[$i] == 'ditto' ? $module : $stories->module[$i];
+ $plan = $stories->plan[$i] == 'ditto' ? $plan : $stories->plan[$i];
+ $pri = $stories->pri[$i] == 'ditto' ? $pri : $stories->pri[$i];
$stories->module[$i] = (int)$module;
$stories->plan[$i] = (int)$plan;
$stories->pri[$i] = (int)$pri;
diff --git a/module/story/view/batchcreate.html.php b/module/story/view/batchcreate.html.php
index 1f38bb12b4..cd05025702 100644
--- a/module/story/view/batchcreate.html.php
+++ b/module/story/view/batchcreate.html.php
@@ -42,9 +42,9 @@
$fileName):?>
-
-
-
+
+
+
|
|
|
diff --git a/module/story/view/batchedit.html.php b/module/story/view/batchedit.html.php
index 83b7b01b09..4ec244e3a0 100644
--- a/module/story/view/batchedit.html.php
+++ b/module/story/view/batchedit.html.php
@@ -11,6 +11,7 @@
*/
?>
+lang->story->dittoNotice);?>
icons['story']);?>
@@ -38,20 +39,32 @@
+ product->getByID($stories[$storyID]->product);
+ $modules = $this->tree->getOptionMenu($stories[$storyID]->product, $viewType = 'story', 0, $branch);
+ foreach($modules as $moduleID => $moduleName) $modules[$moduleID] = '/' . $product->name . $moduleName;
+ $modules['ditto'] = $this->lang->story->ditto;
+
+ $productPlans = $this->productplan->getPairs($stories[$storyID]->product, $branch);
+ $productPlans['ditto'] = $this->lang->story->ditto;
+ }
+ ?>
|
- product], $stories[$storyID]->module, "class='form-control chosen'");?> |
- product], $stories[$storyID]->plan, "class='form-control chosen'");?> |
+ module, "class='form-control chosen'");?> |
+ plan, "class='form-control chosen'");?> |
title, 'class=form-control'); ?> |
estimate, "class='form-control' autocomplete='off'"); ?> |
- story->priList, $stories[$storyID]->pri, 'class=form-control');?> |
- story->sourceList, $stories[$storyID]->source, 'class=form-control');?> |
+ pri, 'class=form-control');?> |
+ source, 'class=form-control');?> |
story->statusList[$stories[$storyID]->status];?> |
status != 'draft'):?>
- story->stageList, $stories[$storyID]->stage, 'class=form-control');?> |
+ stage, 'class=form-control');?> |
- story->stageList, $stories[$storyID]->stage, 'class="form-control" disabled="disabled"');?> |
+ stage, 'class="form-control" disabled="disabled"');?> |
status == 'closed'):?>
@@ -65,7 +78,7 @@
|
- story->reasonList, $stories[$storyID]->closedReason, "class=form-control onchange=setDuplicateAndChild(this.value,$storyID) style='min-width: 70px'");?>
+ closedReason, "class=form-control onchange=setDuplicateAndChild(this.value,$storyID) style='min-width: 70px'");?>
|
' closedReason != 'duplicate') echo "style='display:none'";?>>
idAB}'");?>
@@ -77,7 +90,7 @@
|
- story->reasonList, $stories[$storyID]->closedReason, 'class="form-control" disabled="disabled"');?> |
+ closedReason, 'class="form-control" disabled="disabled"');?> |
diff --git a/module/task/control.php b/module/task/control.php
index b23704b9e1..0c2cb7a804 100644
--- a/module/task/control.php
+++ b/module/task/control.php
@@ -338,9 +338,11 @@ class task extends control
$this->project->setMenu($this->project->getPairs(), $project->id);
/* Set modules and members. */
- $modules = array(0 => '/', 'ditto' => $this->lang->task->ditto) + $this->tree->getTaskOptionMenu($projectID);
- $members = $this->project->getTeamMemberPairs($projectID, 'nodeleted') + array('closed' => 'Closed');
- $members = array('' => '', 'ditto' => $this->lang->task->ditto) + $members;
+ $modules = $this->tree->getTaskOptionMenu($projectID);
+ $modules['ditto'] = $this->lang->task->ditto;
+ $members = $this->project->getTeamMemberPairs($projectID, 'nodeleted');
+ $members['closed'] = 'Closed';
+ $members['ditto'] = $this->lang->task->ditto;
$this->view->title = $project->name . $this->lang->colon . $this->lang->task->batchEdit;
$this->view->position[] = html::a($this->createLink('project', 'browse', "project=$project->id"), $project->name);
@@ -369,18 +371,18 @@ class task extends control
$this->app->session->set('showSuhosinInfo', $showSuhosinInfo);
if($showSuhosinInfo) $this->view->suhosinInfo = $this->lang->suhosinInfo;
- /* Set pri, status and type list. */
- $priList = array(0 => '', 'ditto' => $this->lang->task->ditto) + (array)$this->lang->task->priList;
- $statusList = array('' => '', 'ditto' => $this->lang->task->ditto) + $this->lang->task->statusList;
- $typeList = array('' => '', 'ditto' => $this->lang->task->ditto) + $this->lang->task->typeList;
+ /* Set ditto option for pri, status and type list. */
+ $this->lang->task->priList['ditto'] = $this->lang->task->ditto;
+ $this->lang->task->statusList['ditto'] = $this->lang->task->ditto;
+ $this->lang->task->typeList['ditto'] = $this->lang->task->ditto;
/* Assign. */
$this->view->position[] = $this->lang->task->common;
$this->view->position[] = $this->lang->task->batchEdit;
$this->view->projectID = $projectID;
- $this->view->priList = $priList;
- $this->view->statusList = $statusList;
- $this->view->typeList = $typeList;
+ $this->view->priList = (array)$this->lang->task->priList;
+ $this->view->statusList = $this->lang->task->statusList;
+ $this->view->typeList = $this->lang->task->typeList;
$this->view->taskIDList = $taskIDList;
$this->view->tasks = $tasks;
$this->view->projectName = isset($project) ? $project->name : '';
diff --git a/module/task/js/batchedit.js b/module/task/js/batchedit.js
index 1aa60962f3..f647b28e71 100644
--- a/module/task/js/batchedit.js
+++ b/module/task/js/batchedit.js
@@ -1,3 +1,13 @@
+$(function()
+{
+ $firstTr = $('.table-form').find('tbody tr:first');
+ $firstTr.find('td select').each(function()
+ {
+ $(this).find("option[value='ditto']").remove();
+ $(this).trigger("chosen:updated");
+ });
+})
+
$(document).on('click', '.chosen-with-drop', function()
{
var $select = $(this).prev('select');
@@ -26,7 +36,7 @@ $(document).on('change', 'select', function()
}
else
{
- alert(editNotice);
+ alert(dittoNotice);
$(this).val(oldValue);
}
diff --git a/module/task/lang/en.php b/module/task/lang/en.php
index d2a998da0f..479c6eb424 100644
--- a/module/task/lang/en.php
+++ b/module/task/lang/en.php
@@ -31,7 +31,6 @@ $lang->task->export = "Export data";
$lang->task->reportChart = "Report chart";
$lang->task->fromBug = 'From Bug';
$lang->task->confirmStoryChange = "Confirm story change";
-$lang->task->editNotice = "Current task and task above it do not belong to same project!";
$lang->task->common = 'Task';
$lang->task->id = 'ID';
@@ -88,6 +87,7 @@ $lang->task->editEstimate = 'Edit Hour';
$lang->task->deleteEstimate = 'Delete Hour';
$lang->task->ditto = 'Ditto';
+$lang->task->dittoNotice = "Current task and task above it do not belong to same project!";
$lang->task->selectAllUser = 'All';
$lang->task->statusList[''] = '';
diff --git a/module/task/lang/zh-cn.php b/module/task/lang/zh-cn.php
index 8265cedca9..2531e988f4 100644
--- a/module/task/lang/zh-cn.php
+++ b/module/task/lang/zh-cn.php
@@ -31,7 +31,6 @@ $lang->task->export = "导出数据";
$lang->task->reportChart = "报表统计";
$lang->task->fromBug = '来源Bug';
$lang->task->confirmStoryChange = "确认需求变动";
-$lang->task->editNotice = "该任务与上一任务不属于同一项目!";
$lang->task->common = '任务';
$lang->task->id = '编号';
@@ -88,6 +87,7 @@ $lang->task->editEstimate = '编辑工时';
$lang->task->deleteEstimate = '删除工时';
$lang->task->ditto = '同上';
+$lang->task->dittoNotice = "该任务与上一任务不属于同一项目!";
$lang->task->selectAllUser = '全部';
$lang->task->statusList[''] = '';
diff --git a/module/task/view/batchedit.html.php b/module/task/view/batchedit.html.php
index 312725fc10..17f2a08ed6 100755
--- a/module/task/view/batchedit.html.php
+++ b/module/task/view/batchedit.html.php
@@ -11,7 +11,7 @@
*/
?>
-lang->task->editNotice);?>
+lang->task->dittoNotice);?>