* finish task #2531.

This commit is contained in:
chenfeiCF
2016-04-08 00:00:24 +08:00
parent 10d9fe4982
commit 4ae9e43e41
24 changed files with 333 additions and 94 deletions
+19 -7
View File
@@ -621,14 +621,26 @@ class bug extends control
$this->app->session->set('showSuhosinInfo', $showSuhosinInfo);
if($showSuhosinInfo) $this->view->suhosinInfo = $this->lang->suhosinInfo;
/* Set ditto option for users and type, severity, pri, resolution list. */
$users = $this->user->getPairs('nodeleted,devfirst');
$users['ditto'] = $this->lang->bug->ditto;
$this->lang->bug->typeList ['ditto'] = $this->lang->bug->ditto;
$this->lang->bug->priList ['ditto'] = $this->lang->bug->ditto;
$this->lang->bug->resolutionList['ditto'] = $this->lang->bug->ditto;
$this->lang->bug->severityList ['ditto'] = $this->lang->bug->ditto;
/* Assign. */
$this->view->position[] = $this->lang->bug->common;
$this->view->position[] = $this->lang->bug->batchEdit;
$this->view->bugIDList = $bugIDList;
$this->view->productID = $productID;
$this->view->bugs = $bugs;
$this->view->branch = $branch;
$this->view->users = $this->user->getPairs('nodeleted,devfirst');
$this->view->position[] = $this->lang->bug->common;
$this->view->position[] = $this->lang->bug->batchEdit;
$this->view->bugIDList = $bugIDList;
$this->view->productID = $productID;
$this->view->typeList = $this->lang->bug->typeList;
$this->view->priList = (array)$this->lang->bug->priList;
$this->view->resolutionList = $this->lang->bug->resolutionList;
$this->view->severityList = (array)$this->lang->bug->severityList;
$this->view->bugs = $bugs;
$this->view->branch = $branch;
$this->view->users = $users;
$this->display();
}
+47
View File
@@ -16,3 +16,50 @@ function setDuplicate(resolution, bugID)
$('#duplicateBugBox' + bugID).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");
}
})
+3 -4
View File
@@ -39,7 +39,6 @@
* Remove designchange, newfeature, trackings from the typeList, because should be tracked in story or task.
* These thress types if upgrade from bugfree2.x.
*/
$typeList = $lang->bug->typeList;
if($bugs[$bugID]->type != 'designchange') unset($typeList['designchange']);
if($bugs[$bugID]->type != 'newfeature') unset($typeList['newfeature']);
if($bugs[$bugID]->type != 'trackthings') unset($typeList['trackthings']);
@@ -47,8 +46,8 @@
<tr class='text-center'>
<td><?php echo $bugID . html::hidden("bugIDList[$bugID]", $bugID);?></td>
<td><?php echo html::select("types[$bugID]", $typeList, $bugs[$bugID]->type, 'class=form-control');?></td>
<td><?php echo html::select("severities[$bugID]", (array)$lang->bug->severityList, $bugs[$bugID]->severity, 'class=form-control');?></td>
<td><?php echo html::select("pris[$bugID]", (array)$lang->bug->priList, $bugs[$bugID]->pri, 'class=form-control');?></td>
<td><?php echo html::select("severities[$bugID]", $severityList, $bugs[$bugID]->severity, 'class=form-control');?></td>
<td><?php echo html::select("pris[$bugID]", $priList, $bugs[$bugID]->pri, 'class=form-control');?></td>
<td title='<?php echo $bugs[$bugID]->title?>'> <?php echo html::input("titles[$bugID]", $bugs[$bugID]->title, 'class=form-control');?></td>
<td class='text-left' style='overflow:visible'><?php echo html::select("assignedTos[$bugID]", $users, $bugs[$bugID]->assignedTo, "class='form-control chosen'");?></td>
<td><?php echo html::select("statuses[$bugID]", (array)$lang->bug->statusList, $bugs[$bugID]->status, 'class=form-control');?></td>
@@ -57,7 +56,7 @@
<table class='w-p100'>
<tr>
<td class='pd-0'>
<?php echo html::select("resolutions[$bugID]", $this->lang->bug->resolutionList, $bugs[$bugID]->resolution, "class=form-control onchange=setDuplicate(this.value,$bugID)");?>
<?php echo html::select("resolutions[$bugID]", $resolutionList, $bugs[$bugID]->resolution, "class=form-control onchange=setDuplicate(this.value,$bugID)");?>
</td>
<td class='pd-0 w-p50' id='<?php echo 'duplicateBugBox' . $bugID;?>' <?php if($bugs[$bugID]->resolution != 'duplicate') echo "style='display:none'";?>>
<?php echo html::input("duplicateBugs[$bugID]", '', "class=form-control placeholder='{$lang->bug->duplicateBug}'");?>
+32 -20
View File
@@ -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();
+4 -4
View File
@@ -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);
}
+47
View File
@@ -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");
}
})
+2 -1
View File
@@ -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';
+2 -1
View File
@@ -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] = '使用';
+3 -3
View File
@@ -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;
+6 -6
View File
@@ -42,9 +42,9 @@
<?php $i = 0; ?>
<?php if(!empty($titles)):?>
<?php foreach($titles as $storyTitle => $fileName):?>
<?php $moduleID = $i == 0 ? $moduleID : 'same';?>
<?php $planID = $i == 0 ? '' : 'same';?>
<?php $pri = $i == 0 ? '' : 'same';?>
<?php $moduleID = $i == 0 ? $moduleID : 'ditto';?>
<?php $planID = $i == 0 ? '' : 'ditto';?>
<?php $pri = $i == 0 ? '' : 'ditto';?>
<tr class='text-center'>
<td><?php echo $i+1;?></td>
<td class='text-left' style='overflow:visible'><?php echo html::select("module[$i]", $moduleOptionMenu, $moduleID, "class='form-control chosen'");?></td>
@@ -66,9 +66,9 @@
<?php endif;?>
<?php $nextStart = $i;?>
<?php for($i = $nextStart; $i < $config->story->batchCreate; $i++):?>
<?php $moduleID = $i - $nextStart == 0 ? $moduleID : 'same';?>
<?php $planID = $i - $nextStart == 0 ? '' : 'same';?>
<?php $pri = $i - $nextStart == 0 ? '' : 'same';?>
<?php $moduleID = $i - $nextStart == 0 ? $moduleID : 'ditto';?>
<?php $planID = $i - $nextStart == 0 ? '' : 'ditto';?>
<?php $pri = $i - $nextStart == 0 ? '' : 'ditto';?>
<tr class='text-center'>
<td><?php echo $i+1;?></td>
<td class='text-left' style='overflow:visible'><?php echo html::select("module[$i]", $moduleOptionMenu, $moduleID, "class='form-control chosen'");?></td>
+21 -8
View File
@@ -11,6 +11,7 @@
*/
?>
<?php include '../../common/view/header.html.php';?>
<?php js::set('dittoNotice', $this->lang->story->dittoNotice);?>
<div id='titlebar'>
<div class='heading'>
<span class='prefix'><?php echo html::icon($lang->icons['story']);?></span>
@@ -38,20 +39,32 @@
</tr>
</thead>
<?php foreach($storyIDList as $storyID):?>
<?php
if(!$productID)
{
$product = $this->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;
}
?>
<tr class='text-center'>
<td><?php echo $storyID . html::hidden("storyIDList[$storyID]", $storyID);?></td>
<td class='text-left' style='overflow:visible'> <?php echo html::select("modules[$storyID]", $moduleOptionMenus[$stories[$storyID]->product], $stories[$storyID]->module, "class='form-control chosen'");?></td>
<td class='text-left' style='overflow:visible'> <?php echo html::select("plans[$storyID]", $productPlans[$stories[$storyID]->product], $stories[$storyID]->plan, "class='form-control chosen'");?></td>
<td class='text-left' style='overflow:visible'> <?php echo html::select("modules[$storyID]", $modules, $stories[$storyID]->module, "class='form-control chosen'");?></td>
<td class='text-left' style='overflow:visible'> <?php echo html::select("plans[$storyID]", $productPlans, $stories[$storyID]->plan, "class='form-control chosen'");?></td>
<td title='<?php echo $stories[$storyID]->title?>'><?php echo html::input("titles[$storyID]", $stories[$storyID]->title, 'class=form-control'); ?></td>
<td><?php echo html::input("estimates[$storyID]", $stories[$storyID]->estimate, "class='form-control' autocomplete='off'"); ?></td>
<td><?php echo html::select("pris[$storyID]", (array)$lang->story->priList, $stories[$storyID]->pri, 'class=form-control');?></td>
<td><?php echo html::select("sources[$storyID]", $lang->story->sourceList, $stories[$storyID]->source, 'class=form-control');?></td>
<td><?php echo html::select("pris[$storyID]", $priList, $stories[$storyID]->pri, 'class=form-control');?></td>
<td><?php echo html::select("sources[$storyID]", $sourceList, $stories[$storyID]->source, 'class=form-control');?></td>
<td class='story-<?php echo $stories[$storyID]->status;?>'><?php echo $lang->story->statusList[$stories[$storyID]->status];?></td>
<?php if($stories[$storyID]->status != 'draft'):?>
<td><?php echo html::select("stages[$storyID]", $lang->story->stageList, $stories[$storyID]->stage, 'class=form-control');?></td>
<td><?php echo html::select("stages[$storyID]", $stageList, $stories[$storyID]->stage, 'class=form-control');?></td>
<?php else:?>
<td><?php echo html::select("stages[$storyID]", $lang->story->stageList, $stories[$storyID]->stage, 'class="form-control" disabled="disabled"');?></td>
<td><?php echo html::select("stages[$storyID]", $stageList, $stories[$storyID]->stage, 'class="form-control" disabled="disabled"');?></td>
<?php endif;?>
<?php if($stories[$storyID]->status == 'closed'):?>
@@ -65,7 +78,7 @@
<table class='w-p100'>
<tr>
<td class='pd-0'>
<?php echo html::select("closedReasons[$storyID]", $lang->story->reasonList, $stories[$storyID]->closedReason, "class=form-control onchange=setDuplicateAndChild(this.value,$storyID) style='min-width: 70px'");?>
<?php echo html::select("closedReasons[$storyID]", $reasonList, $stories[$storyID]->closedReason, "class=form-control onchange=setDuplicateAndChild(this.value,$storyID) style='min-width: 70px'");?>
</td>
<td class='pd-0' id='<?php echo 'duplicateStoryBox' . $storyID;?>' <?php if($stories[$storyID]->closedReason != 'duplicate') echo "style='display:none'";?>>
<?php echo html::input("duplicateStoryIDList[$storyID]", '', "class=form-control placeholder='{$lang->idAB}'");?>
@@ -77,7 +90,7 @@
</table>
</td>
<?php else:?>
<td><?php echo html::select("closedReasons[$storyID]", $lang->story->reasonList, $stories[$storyID]->closedReason, 'class="form-control" disabled="disabled"');?></td>
<td><?php echo html::select("closedReasons[$storyID]", $reasonList, $stories[$storyID]->closedReason, 'class="form-control" disabled="disabled"');?></td>
<?php endif;?>
</tr>
<?php endforeach;?>
+12 -10
View File
@@ -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 : '';
+11 -1
View File
@@ -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);
}
+1 -1
View File
@@ -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[''] = '';
+1 -1
View File
@@ -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[''] = '';
+6 -4
View File
@@ -11,7 +11,7 @@
*/
?>
<?php include '../../common/view/header.html.php';?>
<?php js::set('editNotice', $this->lang->task->editNotice);?>
<?php js::set('dittoNotice', $this->lang->task->dittoNotice);?>
<div id='titlebar'>
<div class='heading'>
<span class='prefix'><?php echo html::icon($lang->icons['task']);?></span>
@@ -42,11 +42,13 @@
<?php
if(!isset($project))
{
$modules = $this->tree->getOptionMenu($tasks[$taskID]->project, $viewType = 'task');
$prjInfo = $this->project->getById($tasks[$taskID]->project);
$modules = $this->tree->getOptionMenu($tasks[$taskID]->project, $viewType = 'task');
foreach($modules as $moduleID => $moduleName) $modules[$moduleID] = '/' . $prjInfo->name. $moduleName;
$modules = array(0 => '/', 'ditto' => $this->lang->task->ditto) + $modules;
$members = array('' => '', 'ditto' => $this->lang->task->ditto) + $this->project->getTeamMemberPairs($tasks[$taskID]->project, 'nodeleted');
$modules['ditto'] = $this->lang->task->ditto;
$members = $this->project->getTeamMemberPairs($tasks[$taskID]->project, 'nodeleted');
$members['ditto'] = $this->lang->task->ditto;
}
?>
<tr class='text-center'>
+14 -4
View File
@@ -554,11 +554,16 @@ class testcase extends control
/* The cases of a product. */
if($productID)
{
$this->testcase->setMenu($this->products, $productID, $branch);
$product = $this->product->getByID($productID);
$this->view->moduleOptionMenu = $this->tree->getOptionMenu($productID, $viewType = 'case', $startModuleID = 0, $branch);
$this->view->position[] = html::a($this->createLink('testcase', 'browse', "productID=$productID"), $this->products[$productID]);
$this->view->title = $product->name . $this->lang->colon . $this->lang->testcase->batchEdit;
$this->testcase->setMenu($this->products, $productID, $branch);
/* Set modules. */
$modules = $this->tree->getOptionMenu($productID, $viewType = 'case', $startModuleID = 0, $branch);
$modules['ditto'] = $this->lang->testcase->ditto;
$this->view->modules = $modules;
$this->view->position[] = html::a($this->createLink('testcase', 'browse', "productID=$productID"), $this->products[$productID]);
$this->view->title = $product->name . $this->lang->colon . $this->lang->testcase->batchEdit;
}
/* The cases of my. */
else
@@ -577,11 +582,16 @@ class testcase extends control
$this->app->session->set('showSuhosinInfo', $showSuhosinInfo);
if($showSuhosinInfo) $this->view->suhosinInfo = $this->lang->suhosinInfo;
/* Set pri and type list. */
$this->lang->testcase->priList['ditto'] = $this->lang->testcase->ditto;
$this->lang->testcase->typeList['ditto'] = $this->lang->testcase->ditto;
/* Assign. */
$this->view->position[] = $this->lang->testcase->common;
$this->view->position[] = $this->lang->testcase->batchEdit;
$this->view->caseIDList = $caseIDList;
$this->view->productID = $productID;
$this->view->priList = (array)$this->lang->testcase->priList;
$this->view->typeList = $this->lang->testcase->typeList;
$this->view->cases = $cases;
$this->display();
+6 -6
View File
@@ -8,11 +8,11 @@ $(document).ready(function()
{
index = id.substring(5);
module = $('#module' + index).val();
if(module == 'same')
if(module == 'ditto')
{
for(var i = index - 1; i >=0; i--)
{
if($('#module' + i).val() != 'same')
if($('#module' + i).val() != 'ditto')
{
module = $('#module' + i).val();
break;
@@ -22,7 +22,7 @@ $(document).ready(function()
link = createLink('story', 'ajaxGetProductStories', 'productID=' + productID + '&branch=' + branch + '&moduleID=' + module + '&storyID='+ $(select).val() + '&onlyOption=true&status=noclosed');
$('#story' + index).load(link, function(){$(this).trigger("chosen:updated");});
}
if($(select).val() == 'same')
if($(select).val() == 'ditto')
{
var index = $(select).closest('td').index();
var row = $(select).closest('tr').index();
@@ -31,7 +31,7 @@ $(document).ready(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");
@@ -40,7 +40,7 @@ $(document).ready(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();
@@ -49,7 +49,7 @@ $(document).ready(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);
}
+72
View File
@@ -1,4 +1,76 @@
$(function()
{
$(".chosen").chosen(defaultChosenOptions);
/* Remove ditto option of select in first row. */
$firstTr = $('.table-form').find('tbody tr:first');
$firstTr.find('td select').each(function()
{
$(this).find("option[value='ditto']").remove();
$(this).trigger("chosen:updated");
});
})
/**
* Set duplicate field.
*
* @param string $resolution
* @param int $storyID
* @access public
* @return void
*/
function setDuplicateAndChild(resolution, storyID)
{
if(resolution == 'duplicate')
{
$('#childStoryBox' + storyID).hide();
$('#duplicateStoryBox' + storyID).show();
}
else if(resolution == 'subdivided')
{
$('#duplicateStoryBox' + storyID).hide();
$('#childStoryBox' + storyID).show();
}
else
{
$('#duplicateStoryBox' + storyID).hide();
$('#childStoryBox' + storyID).hide();
}
}
$(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");
}
})
+2 -1
View File
@@ -97,7 +97,8 @@ $lang->testcase->legendComment = 'Comment';
$lang->testcase->confirmDelete = 'Are you sure to delete this case?';
$lang->testcase->confirmBatchDelete = 'Are you sure to batch delete there cases?';
$lang->testcase->same = 'Ditto';
$lang->testcase->ditto = 'Ditto';
$lang->testcase->dittoNotice = 'Current case and case above it do not belong to same product!';
$lang->testcase->priList[3] = 3;
$lang->testcase->priList[1] = 1;
+2 -1
View File
@@ -97,7 +97,8 @@ $lang->testcase->legendComment = '备注';
$lang->testcase->confirmDelete = '您确认要删除该测试用例吗?';
$lang->testcase->confirmBatchDelete = '您确认要批量删除这些测试用例吗?';
$lang->testcase->same = '同上';
$lang->testcase->ditto = '同上';
$lang->testcase->dittoNotice = '该用例与上一用例不属于同一产品!';
$lang->testcase->priList[3] = 3;
$lang->testcase->priList[1] = 1;
+3 -3
View File
@@ -105,9 +105,9 @@ class testcaseModel extends model
$type = '';
for($i = 0; $i < $batchNum; $i++)
{
$module = $cases->module[$i] == 'same' ? $module : $cases->module[$i];
$story = $cases->story[$i] == 'same' ? $story : $cases->story[$i];
$type = $cases->type[$i] == 'same' ? $type : $cases->type[$i];
$module = $cases->module[$i] == 'ditto' ? $module : $cases->module[$i];
$story = $cases->story[$i] == 'ditto' ? $story : $cases->story[$i];
$type = $cases->type[$i] == 'ditto' ? $type : $cases->type[$i];
$cases->module[$i] = (int)$module;
$cases->story[$i] = (int)$story;
$cases->type[$i] = $type;
+4 -4
View File
@@ -43,13 +43,13 @@
<?php
unset($lang->testcase->typeList['']);
$moduleOptionMenu['same'] = $lang->testcase->same;
$moduleOptionMenu['ditto'] = $lang->testcase->ditto;
?>
<?php for($i = 0; $i < $config->testcase->batchCreate; $i++):?>
<?php
if($i != 0) $currentModuleID = 'same';
if($i != 0) $lang->testcase->typeList['same'] = $lang->testcase->same;
$type = $i == 0 ? 'feature' : 'same';
if($i != 0) $currentModuleID = 'ditto';
if($i != 0) $lang->testcase->typeList['ditto'] = $lang->testcase->ditto;
$type = $i == 0 ? 'feature' : 'ditto';
$pri = 3;
?>
<tr class='text-center'>
+13 -4
View File
@@ -11,6 +11,7 @@
*/
?>
<?php include '../../common/view/header.html.php';?>
<?php js::set('dittoNotice', $this->lang->testcase->dittoNotice);?>
<div id='titlebar'>
<div class='heading'>
<span class='prefix'><?php echo html::icon($lang->icons['testcase']);?></span>
@@ -32,14 +33,22 @@
</thead>
<?php foreach($caseIDList as $caseID):?>
<?php if(!$productID) $moduleOptionMenu = $this->tree->getOptionMenu($cases[$caseID]->product, $viewType = 'case', $startModuleID = 0); ?>
<?php
if(!$productID)
{
$product = $this->product->getByID($cases[$caseID]->product);
$modules = $this->tree->getOptionMenu($cases[$caseID]->product, $viewType = 'case', $startModuleID = 0);
foreach($modules as $moduleID => $moduleName) $modules[$moduleID] = '/' . $product->name . $moduleName;
$modules['ditto'] = $this->lang->testcase->ditto;
}
?>
<tr class='text-center'>
<td><?php echo $caseID . html::hidden("caseIDList[$caseID]", $caseID);?></td>
<td><?php echo html::select("pris[$caseID]", $lang->testcase->priList, $cases[$caseID]->pri, 'class=form-control');?></td>
<td><?php echo html::select("pris[$caseID]", $priList, $cases[$caseID]->pri, 'class=form-control');?></td>
<td><?php echo html::select("statuses[$caseID]", (array)$lang->testcase->statusList, $cases[$caseID]->status, 'class=form-control');?></td>
<td class='text-left' style='overflow:visible'> <?php echo html::select("modules[$caseID]", $moduleOptionMenu, $cases[$caseID]->module, "class='form-control chosen'");?></td>
<td class='text-left' style='overflow:visible'> <?php echo html::select("modules[$caseID]", $modules, $cases[$caseID]->module, "class='form-control chosen'");?></td>
<td title='<?php echo $cases[$caseID]->title?>'><?php echo html::input("titles[$caseID]", $cases[$caseID]->title, 'class=form-control'); echo "<span class='star'>*</span>";?></td>
<td><?php echo html::select("types[$caseID]", $lang->testcase->typeList, $cases[$caseID]->type, 'class=form-control');?></td>
<td><?php echo html::select("types[$caseID]", $typeList, $cases[$caseID]->type, 'class=form-control');?></td>
<td class='text-left' style='overflow:visible'> <?php echo html::select("stages[$caseID][]", $lang->testcase->stageList, $cases[$caseID]->stage, "class='form-control chosen' multiple data-placeholder='{$lang->testcase->stage}'");?></td>
</tr>
<?php endforeach;?>