* Resolve feedback #2000.

This commit is contained in:
liuyongkai
2023-01-16 09:23:33 +00:00
parent 32a24ad561
commit 99ab60df05
3 changed files with 32 additions and 7 deletions
+18 -6
View File
@@ -1822,11 +1822,6 @@ class bug extends control
if(!isset($users[$assignedTo])) $assignedTo = $this->bug->getModuleOwner($bug->module, $productID);
unset($this->lang->bug->resolutionList['tostory']);
$product = $this->loadModel('product')->getById($productID);
$branch = $product->type == 'branch' ? ($bug->branch > 0 ? $bug->branch . ',0' : '0') : '';
$productBugs = $this->bug->getProductBugPairs($productID, $branch);
unset($productBugs[$bugID]);
$this->bug->checkBugExecutionPriv($bug);
$this->qa->setMenu($this->products, $productID, $bug->branch);
@@ -1834,7 +1829,6 @@ class bug extends control
$this->view->bug = $bug;
$this->view->users = $users;
$this->view->assignedTo = $assignedTo;
$this->view->productBugs = $productBugs;
$this->view->executions = $this->loadModel('product')->getExecutionPairsByProduct($productID, $bug->branch ? "0,{$bug->branch}" : 0, 'id_desc', $projectID, 'stagefilter');
$this->view->builds = $this->loadModel('build')->getBuildPairs($productID, $bug->branch, 'withbranch,noreleased');
$this->view->actions = $this->action->getList('bug', $bugID);
@@ -2476,6 +2470,24 @@ class bug extends control
return print(html::select('assignedTo', $productMembers, $selectedUser, 'class="form-control"'));
}
/**
* Ajax get product bugs.
*
* @param int $productID
* @param int $bugID
* @access public
* @return string
*/
public function ajaxGetProductBugs($productID, $bugID)
{
$product = $this->loadModel('product')->getById($productID);
$branch = $product->type == 'branch' ? ($bug->branch > 0 ? $bug->branch . ',0' : '0') : '';
$productBugs = $this->bug->getProductBugPairs($productID, $branch);
unset($productBugs[$bugID]);
return print(html::select('duplicateBug', $productBugs, '', "class='form-control' placeholder='{$this->lang->bug->duplicateTip}'"));
}
/**
* Ajax get project team members.
*
+12
View File
@@ -2,6 +2,18 @@ function setDuplicate(resolution)
{
if(resolution == 'duplicate')
{
$.ajaxSettings.async = false;
$.get(createLink('bug', 'ajaxGetProductBugs', 'projectID=' + productID + '&bugID=' + bugID),function(data)
{
$('#duplicateBug').replaceWith(data);
$('#pk_duplicateBug-search').parent().parent().remove();
$('#duplicateBug').picker(
{
disableEmptySearch : true,
dropWidth : 'auto'
});
});
$.ajaxSettings.async = true;
$('#duplicateBugBox').show();
}
else
+2 -1
View File
@@ -16,6 +16,7 @@
<?php
js::set('page', 'resolve');
js::set('productID', $bug->product);
js::set('bugID', $bug->id);
js::set('released', $lang->build->released);
?>
<div id='mainContent' class='main-content'>
@@ -39,7 +40,7 @@ js::set('released', $lang->build->released);
</tr>
<tr id='duplicateBugBox' class='hide'>
<th><?php echo $lang->bug->duplicateBug;?></th>
<td class='required'><?php echo html::select('duplicateBug', $productBugs, '', "class='form-control' placeholder='{$lang->bug->duplicateTip}'");?></td>
<td class='required'><?php echo html::select('duplicateBug', '', '', "class='form-control' placeholder='{$lang->bug->duplicateTip}'");?></td>
</tr>
<tr>
<th><?php echo $lang->bug->resolvedBuild;?></th>