* Fix bug #16429.
This commit is contained in:
+27
-1
@@ -1013,12 +1013,38 @@ class bug extends control
|
||||
$plans = $this->loadModel('productplan')->getPairs($productID, $branch);
|
||||
$plans = array('' => '', 'ditto' => $this->lang->bug->ditto) + $plans;
|
||||
|
||||
/* Set branches and modules. */
|
||||
$branches = array();
|
||||
$modules = array();
|
||||
if($product->type != 'normal')
|
||||
{
|
||||
$branches = $this->loadModel('branch')->getPairs($productID);
|
||||
if($branch === 'all')
|
||||
{
|
||||
$modules[0] = $this->tree->getOptionMenu($productID, 'bug', 0, 0);
|
||||
foreach($branches as $branchID => $branchName)
|
||||
{
|
||||
$modules[$branchID] = $this->tree->getOptionMenu($productID, 'bug', 0, $branchID);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$modules[$branch] = $this->tree->getOptionMenu($productID, 'bug', 0, $branch);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$modules[0] = $this->tree->getOptionMenu($productID, 'bug', 0, 0);
|
||||
}
|
||||
|
||||
/* Set product menu. */
|
||||
$this->qa->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;
|
||||
$this->view->branches = $product->type == 'normal' ? array() : array('' => '', 'ditto' => $this->lang->bug->ditto) + $this->loadModel('branch')->getPairs($product->id);
|
||||
$this->view->branches = $branches;
|
||||
$this->view->modules = $modules;
|
||||
}
|
||||
/* The bugs of my. */
|
||||
else
|
||||
|
||||
@@ -6,53 +6,6 @@ $(function()
|
||||
if($titleCol.width() < 150) $titleCol.width(150);
|
||||
})
|
||||
|
||||
/**
|
||||
* Set branch related.
|
||||
*
|
||||
* @param int $branchID
|
||||
* @param int $productID
|
||||
* @param int $num
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function setBranchRelated(branchID, productID, num)
|
||||
{
|
||||
moduleLink = createLink('tree', 'ajaxGetModules', 'productID=' + productID + '&viewType=bug&branch=' + branchID + '&num=' + num);
|
||||
$.get(moduleLink, function(modules)
|
||||
{
|
||||
if(!modules) modules = '<select id="modules' + num + '" name="modules[' + num + ']" class="form-control"></select>';
|
||||
$('#modules' + num).replaceWith(modules);
|
||||
$("#modules" + num + "_chosen").remove();
|
||||
$("#modules" + num).next('.picker').remove();
|
||||
$("#modules" + num).chosen();
|
||||
});
|
||||
|
||||
executionLink = createLink('product', 'ajaxGetExecutions', 'productID=' + productID + '&projectID=0&branch=' + branchID + '&num=' + num);
|
||||
$.get(executionLink, function(executions)
|
||||
{
|
||||
if(!executions) executions = '<select id="executions' + num + '" name="executions[' + num + ']" class="form-control"></select>';
|
||||
$('#executions' + num).replaceWith(executions);
|
||||
$("#executions" + num + "_chosen").remove();
|
||||
$("#executions" + num).next('.picker').remove();
|
||||
$("#executions" + num).chosen();
|
||||
});
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set opened builds.
|
||||
*
|
||||
|
||||
@@ -612,3 +612,52 @@ function notice()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set branch related.
|
||||
*
|
||||
* @param int $branchID
|
||||
* @param int $productID
|
||||
* @param int $num
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function setBranchRelated(branchID, productID, num)
|
||||
{
|
||||
moduleLink = createLink('tree', 'ajaxGetModules', 'productID=' + productID + '&viewType=bug&branch=' + branchID + '&num=' + num);
|
||||
$.get(moduleLink, function(modules)
|
||||
{
|
||||
if(!modules) modules = '<select id="modules' + num + '" name="modules[' + num + ']" class="form-control"></select>';
|
||||
$('#modules' + num).replaceWith(modules);
|
||||
$("#modules" + num + "_chosen").remove();
|
||||
$("#modules" + num).next('.picker').remove();
|
||||
$("#modules" + num).chosen();
|
||||
});
|
||||
|
||||
executionLink = createLink('product', 'ajaxGetExecutions', 'productID=' + productID + '&projectID=0&branch=' + branchID + '&num=' + num);
|
||||
$.get(executionLink, function(executions)
|
||||
{
|
||||
if(!executions) executions = '<select id="executions' + num + '" name="executions[' + num + ']" class="form-control"></select>';
|
||||
$('#executions' + num).replaceWith(executions);
|
||||
$("#executions" + num + "_chosen").remove();
|
||||
$("#executions" + num).next('.picker').remove();
|
||||
$("#executions" + num).chosen();
|
||||
});
|
||||
|
||||
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. */
|
||||
if(config.currentMethod == 'batchCreate')
|
||||
{
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -742,6 +742,7 @@ class bugModel extends model
|
||||
$bug->title = $data->titles[$bugID];
|
||||
$bug->plan = empty($data->plans[$bugID]) ? 0 : $data->plans[$bugID];
|
||||
$bug->branch = empty($data->branches[$bugID]) ? 0 : $data->branches[$bugID];
|
||||
$bug->module = $data->modules[$bugID];
|
||||
$bug->assignedTo = $data->assignedTos[$bugID];
|
||||
$bug->deadline = $data->deadlines[$bugID];
|
||||
$bug->resolvedBy = $data->resolvedBys[$bugID];
|
||||
|
||||
@@ -51,10 +51,11 @@
|
||||
<th class='c-type<?php echo zget($visibleFields, 'type', ' hidden') . zget($requiredFields, 'type', '', ' required');?>'><?php echo $lang->bug->type;?></th>
|
||||
<th class='c-severity<?php echo zget($visibleFields, 'severity', ' hidden') . zget($requiredFields, 'severity', '', ' required');?>'><?php echo $lang->bug->severity;?></th>
|
||||
<th class='c-pri<?php echo zget($visibleFields, 'pri', ' hidden') . zget($requiredFields, 'pri', '', ' required');?>'><?php echo $lang->bug->pri;?></th>
|
||||
<th class="required <?php if(count($visibleFields) >= 10) echo ' c-title';?>"><?php echo $lang->bug->title;?></th>
|
||||
<th class="required <?php if(count($visibleFields) >= 9) echo ' c-title';?>"><?php echo $lang->bug->title;?></th>
|
||||
<?php if($branchProduct):?>
|
||||
<th class='c-branch<?php echo zget($visibleFields, 'branch', ' hidden')?>'><?php echo $lang->bug->branch;?></th>
|
||||
<th class='c-branch'><?php echo $lang->bug->branch;?></th>
|
||||
<?php endif;?>
|
||||
<th class='c-module<?php echo zget($requiredFields, 'module', '', ' required');?>'> <?php echo $lang->bug->module;?></th>
|
||||
<th class='c-plan<?php echo zget($visibleFields, 'productplan', ' hidden') . zget($requiredFields, 'productplan', '', ' required');?>'><?php echo $lang->bug->productplan;?></th>
|
||||
<th class='c-assigned<?php echo zget($visibleFields, 'assignedTo', ' hidden') . zget($requiredFields, 'assignedTo', '', ' required');?>'><?php echo $lang->bug->assignedTo;?></th>
|
||||
<th class='c-date<?php echo zget($visibleFields, 'deadline', ' hidden') . zget($requiredFields, 'deadline', '', ' required');?>'><?php echo $lang->bug->deadline;?></th>
|
||||
@@ -78,14 +79,14 @@
|
||||
{
|
||||
$product = $this->product->getByID($bug->product);
|
||||
|
||||
$plans = $this->loadModel('productplan')->getPairs($bug->product, $branch);
|
||||
$plans = array('' => '', 'ditto' => $this->lang->bug->ditto) + $plans;
|
||||
$bugBranch = isset($bug->branch) ? $bug->branch : 0;
|
||||
$plans = $this->loadModel('productplan')->getPairs($bug->product, $branch);
|
||||
|
||||
$branches = $product->type == 'normal' ? array('' => '') : $this->loadModel('branch')->getPairs($product->id);
|
||||
if($product->type != 'normal')
|
||||
{
|
||||
foreach($branches as $branchID => $branchName) $branches[$branchID] = '/' . $product->name . '/' . $branchName;
|
||||
$branches = array('ditto' => $this->lang->story->ditto) + $branches;
|
||||
$modules[$bugBranch] = $this->tree->getOptionMenu($bug->product, $viewType = 'case', 0, $bugBranch);
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -109,12 +110,13 @@
|
||||
<div>
|
||||
</td>
|
||||
<?php if($branchProduct):?>
|
||||
<td class='<?php echo zget($visibleFields, 'branch', ' hidden')?>' style='overflow:visible'>
|
||||
<td style='overflow:visible'>
|
||||
<?php $branchProductID = $productID ? $productID : $product->id;?>
|
||||
<?php $disabled = (isset($product) and $product->type == 'normal') ? "disabled='disabled'" : '';?>
|
||||
<?php echo html::select("branches[$bugID]", $branches, $bug->branch, "class='form-control chosen' $disabled");?>
|
||||
<?php echo html::select("branches[$bugID]", $branches, $bug->branch, "class='form-control chosen' $disabled onchange='setBranchRelated(this.value, $bug->product, $bug->id)'");?>
|
||||
</td>
|
||||
<?php endif;?>
|
||||
<td><?php echo html::select("modules[$bugID]", $modules[$bug->branch], $bug->module, "class='form-control chosen'");?></td>
|
||||
<td class='<?php echo zget($visibleFields, 'productplan', ' hidden')?>' style='overflow:visible'><?php echo html::select("plans[$bugID]", $plans, $bug->plan, "class='form-control chosen'");?></td>
|
||||
<td class='<?php echo zget($visibleFields, 'assignedTo', ' hidden')?>' style='overflow:visible'><?php echo html::select("assignedTos[$bugID]", $users, $bug->assignedTo, "class='form-control chosen'");?></td>
|
||||
<td class='<?php echo zget($visibleFields, 'deadline', ' hidden')?>' style='overflow:visible'><?php echo html::input("deadlines[$bugID]", $bug->deadline, "class='form-control form-date'");?></td>
|
||||
|
||||
Reference in New Issue
Block a user