* fix error if bugs do not belong to same product when batch edit bugs.
This commit is contained in:
@@ -602,10 +602,15 @@ class bug extends control
|
||||
{
|
||||
$product = $this->product->getByID($productID);
|
||||
|
||||
/* Set plans. */
|
||||
$plans = $this->loadModel('productplan')->getPairs($productID, $branch);
|
||||
$plans['ditto'] = $this->lang->bug->ditto;
|
||||
|
||||
/* Set product menu. */
|
||||
$this->bug->setMenu($this->products, $productID, $branch);
|
||||
$this->view->title = $product->name . $this->lang->colon . "BUG" . $this->lang->bug->batchEdit;
|
||||
$this->view->position[] = html::a($this->createLink('bug', 'browse', "productID=$productID&branch=$branch"), $this->products[$productID]);
|
||||
$this->view->plans = $plans;
|
||||
}
|
||||
/* The bugs of my. */
|
||||
else
|
||||
@@ -631,11 +636,11 @@ class bug extends control
|
||||
$this->view->customFields = $customFields;
|
||||
$this->view->showFields = $this->config->bug->custom->batchedit;
|
||||
|
||||
/* Set ditto option for users and type, severity, pri, resolution list. */
|
||||
/* Set users. */
|
||||
$users = $this->user->getPairs('nodeleted,devfirst');
|
||||
$users['ditto'] = $this->lang->bug->ditto;
|
||||
$plans = $this->loadModel('productplan')->getPairs($productID, $branch);
|
||||
$plans['ditto'] = $this->lang->bug->ditto;
|
||||
|
||||
/* Set ditto option for users and type, severity, pri, resolution list. */
|
||||
$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;
|
||||
@@ -656,7 +661,6 @@ class bug extends control
|
||||
$this->view->bugs = $bugs;
|
||||
$this->view->branch = $branch;
|
||||
$this->view->users = $users;
|
||||
$this->view->plans = $plans;
|
||||
|
||||
$this->display();
|
||||
}
|
||||
|
||||
@@ -27,6 +27,8 @@ $(function()
|
||||
});
|
||||
})
|
||||
|
||||
$(document).on('click', '.chosen-with-drop', function(){oldValue = $(this).prev('select').val();})
|
||||
|
||||
$(document).on('change', 'select', function()
|
||||
{
|
||||
if($(this).val() == 'ditto')
|
||||
@@ -49,7 +51,26 @@ $(document).on('change', 'select', function()
|
||||
if(value != 'ditto') break;
|
||||
}
|
||||
|
||||
$(this).val(value);
|
||||
isPlans = $(this).attr('name').indexOf('plans') != -1;
|
||||
|
||||
if(isPlans)
|
||||
{
|
||||
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);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$(this).val(value);
|
||||
}
|
||||
|
||||
$(this).trigger("chosen:updated");
|
||||
$(this).trigger("change");
|
||||
}
|
||||
|
||||
@@ -107,7 +107,9 @@ $lang->bug->allBugs = 'Allbug';
|
||||
$lang->bug->byQuery = 'Search';
|
||||
$lang->bug->needConfirm = 'StoryChanged';
|
||||
$lang->bug->allProduct = "All {$lang->productCommon}s";
|
||||
$lang->bug->ditto = 'Ditto';
|
||||
|
||||
$lang->bug->ditto = 'Ditto';
|
||||
$lang->bug->dittoNotice = 'Current bug and bug above it do not belong to same product!';
|
||||
|
||||
/* Labels. */
|
||||
$lang->bug->lblAssignedTo = 'Assigned to';
|
||||
|
||||
@@ -107,7 +107,9 @@ $lang->bug->allBugs = '所有';
|
||||
$lang->bug->byQuery = '搜索';
|
||||
$lang->bug->needConfirm = '需求变动';
|
||||
$lang->bug->allProduct = '所有' . $lang->productCommon;
|
||||
$lang->bug->ditto = '同上';
|
||||
|
||||
$lang->bug->ditto = '同上';
|
||||
$lang->bug->dittoNotice = '该bug与上一bug不属于同一产品!';
|
||||
|
||||
/* 页面标签。*/
|
||||
$lang->bug->lblAssignedTo = '当前指派';
|
||||
|
||||
@@ -543,7 +543,7 @@ class bugModel extends model
|
||||
$bug->pri = $data->pris[$bugID];
|
||||
$bug->status = $data->statuses[$bugID];
|
||||
$bug->title = $data->titles[$bugID];
|
||||
$bug->plan = $data->plan[$bugID];
|
||||
$bug->plan = empty($data->plans[$bugID]) ? 0 : $data->plans[$bugID];
|
||||
$bug->assignedTo = $data->assignedTos[$bugID];
|
||||
$bug->resolvedBy = $data->resolvedBys[$bugID];
|
||||
$bug->keywords = $data->keywords[$bugID];
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
*/
|
||||
?>
|
||||
<?php include '../../common/view/header.html.php';?>
|
||||
<?php js::set('dittoNotice', $this->lang->bug->dittoNotice);?>
|
||||
<div id='titlebar'>
|
||||
<div class='heading'>
|
||||
<span class='prefix'><?php echo html::icon($lang->icons['bug']);?></span>
|
||||
@@ -40,16 +41,21 @@ $columns = count($hasFields) + 2;
|
||||
<th class='w-150px<?php echo zget($hasFields, 'productplan', ' hidden')?>'><?php echo $lang->bug->productplan;?></th>
|
||||
<th class='w-150px<?php echo zget($hasFields, 'assignedTo', ' hidden')?>'><?php echo $lang->bug->assignedTo;?></th>
|
||||
<th class='w-90px<?php echo zget($hasFields, 'status', ' hidden')?>'><?php echo $lang->bug->status;?></th>
|
||||
<th class='w-150px<?php echo zget($hasFields, 'resolvedBy', ' hidden')?>'><?php echo $lang->bug->resolvedByAB;?></th>
|
||||
<th class='w-180px<?php echo zget($hasFields, 'resolution', ' hidden')?>'><?php echo $lang->bug->resolutionAB;?></th>
|
||||
<th class='w-100px<?php echo zget($hasFields, 'os', ' hidden')?>'><?php echo $lang->bug->os;?></th>
|
||||
<th class='w-100px<?php echo zget($hasFields, 'browser', ' hidden')?>'><?php echo $lang->bug->browser;?></th>
|
||||
<th class='w-100px<?php echo zget($hasFields, 'keywords', ' hidden')?>'><?php echo $lang->bug->keywords;?></th>
|
||||
<th class='w-150px<?php echo zget($hasFields, 'resolvedBy', ' hidden')?>'><?php echo $lang->bug->resolvedByAB;?></th>
|
||||
<th class='w-180px<?php echo zget($hasFields, 'resolution', ' hidden')?>'><?php echo $lang->bug->resolutionAB;?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach($bugIDList as $bugID):?>
|
||||
<?php
|
||||
if(!$productID)
|
||||
{
|
||||
$plans = $this->loadModel('productplan')->getPairs($bugs[$bugID]->product, $branch);
|
||||
$plans['ditto'] = $this->lang->story->ditto;
|
||||
}
|
||||
/**
|
||||
* Remove designchange, newfeature, trackings from the typeList, because should be tracked in story or task.
|
||||
* These thress types if upgrade from bugfree2.x.
|
||||
@@ -67,6 +73,9 @@ $columns = count($hasFields) + 2;
|
||||
<td class='text-left<?php echo zget($hasFields, 'productplan', ' hidden')?>' style='overflow:visible'><?php echo html::select("plans[$bugID]", $plans, $bugs[$bugID]->plan, "class='form-control chosen'");?></td>
|
||||
<td class='text-left<?php echo zget($hasFields, 'assignedTo', ' hidden')?>' style='overflow:visible'><?php echo html::select("assignedTos[$bugID]", $users, $bugs[$bugID]->assignedTo, "class='form-control chosen'");?></td>
|
||||
<td <?php echo zget($hasFields, 'status', "class='hidden'")?>><?php echo html::select("statuses[$bugID]", $lang->bug->statusList, $bugs[$bugID]->status, 'class=form-control');?></td>
|
||||
<td <?php echo zget($hasFields, 'os', "class='hidden'")?>><?php echo html::select("os[$bugID]", $lang->bug->osList, $bugs[$bugID]->os, 'class=form-control');?></td>
|
||||
<td <?php echo zget($hasFields, 'browser', "class='hidden'")?>><?php echo html::select("browsers[$bugID]", $lang->bug->browserList, $bugs[$bugID]->browser, 'class=form-control');?></td>
|
||||
<td <?php echo zget($hasFields, 'keywords', "class='hidden'")?>><?php echo html::input("keywords[$bugID]", $bugs[$bugID]->keywords, 'class=form-control');?></td>
|
||||
<td class='text-left<?php echo zget($hasFields, 'resolvedBy', ' hidden')?>' style='overflow:visible'><?php echo html::select("resolvedBys[$bugID]", $users, $bugs[$bugID]->resolvedBy, "class='form-control chosen'");?></td>
|
||||
<td <?php echo zget($hasFields, 'resolution', "class='hidden'")?>>
|
||||
<table class='w-p100'>
|
||||
@@ -80,9 +89,6 @@ $columns = count($hasFields) + 2;
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<td <?php echo zget($hasFields, 'os', "class='hidden'")?>><?php echo html::select("os[$bugID]", $lang->bug->osList, $bugs[$bugID]->os, 'class=form-control');?></td>
|
||||
<td <?php echo zget($hasFields, 'browser', "class='hidden'")?>><?php echo html::select("browsers[$bugID]", $lang->bug->browserList, $bugs[$bugID]->browser, 'class=form-control');?></td>
|
||||
<td <?php echo zget($hasFields, 'keywords', "class='hidden'")?>><?php echo html::input("keywords[$bugID]", $bugs[$bugID]->keywords, 'class=form-control');?></td>
|
||||
</tr>
|
||||
<?php endforeach;?>
|
||||
<?php if(isset($suhosinInfo)):?>
|
||||
|
||||
Reference in New Issue
Block a user