Merge branch 'zentaopms_266_task_#77616' into 'master'

* Fix bug for task #77615,#77616.

See merge request easycorp/zentaopms!6444
This commit is contained in:
王怡栋
2022-12-01 08:39:27 +00:00
8 changed files with 60 additions and 36 deletions
+19 -9
View File
@@ -854,7 +854,6 @@ class bug extends control
$this->view->productID = $productID;
$this->view->stories = $stories;
$this->view->builds = $builds;
$this->view->releasedBuilds = $this->loadModel('release')->getReleasedBuilds($productID, $branch);
$this->view->users = $this->user->getPairs('devfirst|noclosed');
$this->view->projects = array('' => '') + $this->product->getProjectPairsByProduct($productID, $branch ? "0,$branch" : 0, 'id_desc', $projectID);
$this->view->projectID = $projectID;
@@ -1166,7 +1165,6 @@ class bug extends control
if($product->shadow) $this->view->project = $this->loadModel('project')->getByShadowProduct($bug->product);
$this->view->bug = $bug;
$this->view->productID = $productID;
$this->view->product = $product;
$this->view->execution = $execution;
$this->view->productBugs = $productBugs;
@@ -1187,7 +1185,6 @@ class bug extends control
$this->view->cases = array('' => '') + $cases;
$this->view->openedBuilds = $openedBuilds;
$this->view->resolvedBuilds = array('' => '') + $openedBuilds + $oldResolvedBuild;
$this->view->releasedBuilds = $this->loadModel('release')->getReleasedBuilds($productID, $branch);
$this->view->actions = $this->action->getList('bug', $bugID);
$this->display();
@@ -1839,7 +1836,6 @@ class bug extends control
$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->releasedBuilds = $this->loadModel('release')->getReleasedBuilds($productID, $branch);
$this->view->actions = $this->action->getList('bug', $bugID);
$this->view->execution = isset($execution) ? $execution : '';
$this->display();
@@ -1936,11 +1932,10 @@ class bug extends control
$this->view->position[] = html::a($this->createLink('bug', 'browse', "productID=$productID"), $this->products[$productID]);
$this->view->position[] = $this->lang->bug->activate;
$this->view->bug = $bug;
$this->view->users = $this->user->getPairs('noclosed', $bug->resolvedBy);
$this->view->builds = $this->loadModel('build')->getBuildPairs($productID, $bug->branch, 'noempty,noreleased', 0, 'execution', $bug->openedBuild);
$this->view->actions = $this->action->getList('bug', $bugID);
$this->view->releasedBuilds = $this->loadModel('release')->getReleasedBuilds($productID);
$this->view->bug = $bug;
$this->view->users = $this->user->getPairs('noclosed', $bug->resolvedBy);
$this->view->builds = $this->loadModel('build')->getBuildPairs($productID, $bug->branch, 'noempty,noreleased', 0, 'execution', $bug->openedBuild);
$this->view->actions = $this->action->getList('bug', $bugID);
$this->display();
}
@@ -2506,4 +2501,19 @@ class bug extends control
if($project->model == 'kanban') return print($this->lang->bug->kanban);
return print($this->lang->bug->execution);
}
/**
* Ajax get released builds.
*
* @param int $productID
* @param int|string $branch
* @access public
* @return string
*/
public function ajaxGetReleasedBuilds($productID, $branch = 'all')
{
$releasedBuilds = $this->loadModel('release')->getReleasedBuilds($productID, $branch);
return print(helper::jsonEncode($releasedBuilds));
}
}
+1 -3
View File
@@ -20,8 +20,6 @@ $(function()
$('#dropMenu').css('z-index', 9999);
})
$('[name^=openedBuilds]').picker({optionRender: markReleasedBuilds, dropWidth: 'auto'});
/**
* Set opened builds.
*
@@ -46,7 +44,7 @@ function setOpenedBuilds(link, index)
$('#buildBox' + index + ' select').addClass('select-1');
$('#buildBox' + index + ' select').attr('name','openedBuilds[' + index + '][]');
$('#buildBox' + index + ' select').attr('id','openedBuilds' + index);
$('#buildBox' + index + ' select').picker({optionRender: markReleasedBuilds});
$('#buildBox' + index + ' select').picker({optionRender: markReleasedBuilds, dropWidth: 'auto'});
index++;
if($('#executions' + index).val() != 'ditto') break;
+33 -16
View File
@@ -19,7 +19,13 @@ $(function()
}
});
$('#openedBuild, #resolvedBuild').picker({optionRender: markReleasedBuilds});
if($('#openedBuild').length || $('#resolvedBuild').length || $('[name^=openedBuilds]').length)
{
$.get(createLink('bug', 'ajaxGetReleasedBuilds', 'productID=' + productID), function(data){releasedBuilds = data;}, 'json');
$('#openedBuild, #resolvedBuild, [name^=openedBuilds]').picker({optionRender: markReleasedBuilds, dropWidth: 'auto'});
}
function markReleasedBuilds($option)
{
@@ -193,6 +199,8 @@ function loadAllExecutionBuilds(executionID, productID, buildBox)
{
branch = $('#branch').val();
if(typeof(branch) == 'undefined') branch = 0;
$.get(createLink('bug', 'ajaxGetReleasedBuilds', 'productID=' + productID), function(data){releasedBuilds = data;}, 'json');
if(page == 'create')
{
oldOpenedBuild = $('#openedBuild').val() ? $('#openedBuild').val() : 0;
@@ -204,7 +212,7 @@ function loadAllExecutionBuilds(executionID, productID, buildBox)
$('#pickerDropMenu-pk_openedBuild').remove();
$('#openedBuild').next('.picker').remove();
notice();
$("#openedBuild").picker({optionRender: markReleasedBuilds});
$("#openedBuild").picker({optionRender: markReleasedBuilds, dropWidth: 'auto'});
})
}
if(page == 'edit')
@@ -212,12 +220,12 @@ function loadAllExecutionBuilds(executionID, productID, buildBox)
if(buildBox == 'openedBuildBox')
{
link = createLink('build', 'ajaxGetExecutionBuilds', 'executionID=' + executionID + '&productID=' + productID + '&varName=openedBuild&build=' + oldOpenedBuild + '&branch=' + branch + '&index=0&needCreate=true&type=all');
$('#openedBuildBox').load(link, function(){$(this).find('select').picker({optionRender: markReleasedBuilds})});
$('#openedBuildBox').load(link, function(){$(this).find('select').picker({optionRender: markReleasedBuilds, dropWidth: 'auto'})});
}
if(buildBox == 'resolvedBuildBox')
{
link = createLink('build', 'ajaxGetProductBuilds', 'productID=' + productID + '&varName=resolvedBuild&build=' + oldResolvedBuild + '&branch=' + branch + '&index=0&type=all');
$('#resolvedBuildBox').load(link, function(){$(this).find('select').picker({optionRender: markReleasedBuilds})});
$('#resolvedBuildBox').load(link, function(){$(this).find('select').picker({optionRender: markReleasedBuilds, dropWidth: 'auto'})});
}
}
}
@@ -234,6 +242,9 @@ function loadAllProductBuilds(productID, buildBox)
{
branch = $('#branch').val();
if(typeof(branch) == 'undefined') branch = 0;
$.get(createLink('bug', 'ajaxGetReleasedBuilds', 'productID=' + productID), function(data){releasedBuilds = data;}, 'json');
if(page == 'create')
{
link = createLink('build', 'ajaxGetProductBuilds', 'productID=' + productID + '&varName=openedBuild&build=' + oldOpenedBuild + '&branch=' + branch + '&index=0&type=all');
@@ -244,7 +255,7 @@ function loadAllProductBuilds(productID, buildBox)
$('#pickerDropMenu-pk_openedBuild').remove();
$('#openedBuild').next('.picker').remove();
notice();
$("#openedBuild").picker({optionRender: markReleasedBuilds});
$("#openedBuild").picker({optionRender: markReleasedBuilds, dropWidth: 'auto'});
})
}
if(page == 'edit')
@@ -252,12 +263,12 @@ function loadAllProductBuilds(productID, buildBox)
if(buildBox == 'openedBuildBox')
{
link = createLink('build', 'ajaxGetProductBuilds', 'productID=' + productID + '&varName=openedBuild&build=' + oldOpenedBuild + '&branch=' + branch + '&index=0&type=all');
$('#openedBuildBox').load(link, function(){$(this).find('select').picker({optionRender: markReleasedBuilds})});
$('#openedBuildBox').load(link, function(){$(this).find('select').picker({optionRender: markReleasedBuilds, dropWidth: 'auto'})});
}
if(buildBox == 'resolvedBuildBox')
{
link = createLink('build', 'ajaxGetProductBuilds', 'productID=' + productID + '&varName=resolvedBuild&build=' + oldResolvedBuild + '&branch=' + branch + '&index=0&type=all');
$('#resolvedBuildBox').load(link, function(){$(this).find('select').picker({optionRender: markReleasedBuilds})});
$('#resolvedBuildBox').load(link, function(){$(this).find('select').picker({optionRender: markReleasedBuilds, dropWidth: 'auto'})});
}
}
}
@@ -452,6 +463,8 @@ function loadProductBuilds(productID)
if(typeof(oldOpenedBuild) == 'undefined') oldOpenedBuild = 0;
link = createLink('build', 'ajaxGetProductBuilds', 'productID=' + productID + '&varName=openedBuild&build=' + oldOpenedBuild + '&branch=' + branch);
$.get(createLink('bug', 'ajaxGetReleasedBuilds', 'productID=' + productID), function(data){releasedBuilds = data;}, 'json');
if(page == 'create')
{
$.get(link, function(data)
@@ -461,14 +474,14 @@ function loadProductBuilds(productID)
$('#pickerDropMenu-pk_openedBuild').remove();
$('#openedBuild').next('.picker').remove();
notice();
$("#openedBuild").picker({optionRender: markReleasedBuilds});
$("#openedBuild").picker({optionRender: markReleasedBuilds, dropWidth: 'auto'});
})
}
else
{
$('#openedBuildBox').load(link, function(){$(this).find('select').picker({optionRender: markReleasedBuilds})});
$('#openedBuildBox').load(link, function(){$(this).find('select').picker({optionRender: markReleasedBuilds, dropWidth: 'auto'})});
link = createLink('build', 'ajaxGetProductBuilds', 'productID=' + productID + '&varName=resolvedBuild&build=' + oldResolvedBuild + '&branch=' + branch);
$('#resolvedBuildBox').load(link, function(){$(this).find('select').picker({optionRender: markReleasedBuilds})});
$('#resolvedBuildBox').load(link, function(){$(this).find('select').picker({optionRender: markReleasedBuilds, dropWidth: 'auto'})});
}
}
@@ -606,6 +619,8 @@ function loadProjectBuilds(projectID)
var productID = $('#product').val();
var oldOpenedBuild = $('#openedBuild').val() ? $('#openedBuild').val() : 0;
$.get(createLink('bug', 'ajaxGetReleasedBuilds', 'productID=' + productID), function(data){releasedBuilds = data;}, 'json');
if(page == 'create')
{
var link = createLink('build', 'ajaxGetProjectBuilds', 'projectID=' + projectID + '&productID=' + productID + '&varName=openedBuild&build=&branch=' + branch);
@@ -617,17 +632,17 @@ function loadProjectBuilds(projectID)
$('#pickerDropMenu-pk_openedBuild').remove();
$('#openedBuild').next('.picker').remove();
notice();
$("#openedBuild").picker({optionRender: markReleasedBuilds});
$("#openedBuild").picker({optionRender: markReleasedBuilds, dropWidth: 'auto'});
})
}
else
{
var link = createLink('build', 'ajaxGetProjectBuilds', 'projectID=' + projectID + '&productID=' + productID + '&varName=openedBuild&build=' + oldOpenedBuild + '&branch=' + branch);
$('#openedBuildBox').load(link, function(){$(this).find('select').val(oldOpenedBuild).picker({optionRender: markReleasedBuilds})});
$('#openedBuildBox').load(link, function(){$(this).find('select').val(oldOpenedBuild).picker({optionRender: markReleasedBuilds, dropWidth: 'auto'})});
var oldResolvedBuild = $('#resolvedBuild').val() ? $('#resolvedBuild').val() : 0;
var link = createLink('build', 'ajaxGetProductBuilds', 'productID=' + productID + '&varName=resolvedBuild&build=' + oldResolvedBuild + '&branch=' + branch);
$('#resolvedBuildBox').load(link, function(){$(this).find('select').val(oldResolvedBuild).picker({optionRender: markReleasedBuilds})});
$('#resolvedBuildBox').load(link, function(){$(this).find('select').val(oldResolvedBuild).picker({optionRender: markReleasedBuilds, dropWidth: 'auto'})});
}
}
@@ -649,6 +664,8 @@ function loadExecutionBuilds(executionID, num)
if(typeof(branch) == 'undefined') var branch = 0;
if(typeof(productID) == 'undefined') var productID = 0;
$.get(createLink('bug', 'ajaxGetReleasedBuilds', 'productID=' + productID), function(data){releasedBuilds = data;}, 'json');
if(page == 'create')
{
link = createLink('build', 'ajaxGetExecutionBuilds', 'executionID=' + executionID + '&productID=' + productID + '&varName=openedBuild&build=' + oldOpenedBuild + "&branch=" + branch + "&index=0&needCreate=true");
@@ -660,17 +677,17 @@ function loadExecutionBuilds(executionID, num)
$('#pickerDropMenu-pk_openedBuild').remove();
$('#openedBuild').next('.picker').remove();
notice();
$("#openedBuild").picker({optionRender: markReleasedBuilds});
$("#openedBuild").picker({optionRender: markReleasedBuilds, dropWidth: 'auto'});
})
}
else
{
link = createLink('build', 'ajaxGetExecutionBuilds', 'executionID=' + executionID + '&productID=' + productID + '&varName=openedBuild&build=' + oldOpenedBuild + '&branch=' + branch + '&index=0&needCreate=false&type=normal&number=' + num);
$('#openedBuildBox' + num).load(link, function(){$(this).find('select').val(oldOpenedBuild).picker({optionRender: markReleaseBuilds})});
$('#openedBuildBox' + num).load(link, function(){$(this).find('select').val(oldOpenedBuild).picker({optionRender: markReleaseBuilds, dropWidth: 'auto'})});
oldResolvedBuild = $('#resolvedBuild').val() ? $('#resolvedBuild').val() : 0;
link = createLink('build', 'ajaxGetProductBuilds', 'productID=' + productID + '&varName=resolvedBuild&build=' + oldResolvedBuild + '&branch=' + branch);
$('#resolvedBuildBox').load(link, function(){$(this).find('select').val(oldResolvedBuild).picker({optionRender: markReleasedBuilds})});
$('#resolvedBuildBox').load(link, function(){$(this).find('select').val(oldResolvedBuild).picker({optionRender: markReleasedBuilds, dropWidth: 'auto'})});
}
}
+1 -1
View File
@@ -57,7 +57,7 @@
</div>
</div>
<?php
js::set('releasedBuilds', $releasedBuilds);
js::set('productID', $bug->product);
js::set('releasedBuild', $lang->build->releasedBuild);
?>
<?php include '../../common/view/footer.html.php';?>
+1 -1
View File
@@ -13,7 +13,7 @@
<?php
include '../../common/view/header.html.php';
js::set('requiredFields', $config->bug->create->requiredFields);
js::set('releasedBuilds', $releasedBuilds);
js::set('productID', $productID);
js::set('releasedBuild', $lang->build->releasedBuild);
?>
<?php
+1 -1
View File
@@ -30,7 +30,7 @@ js::set('tab', $this->app->tab);
js::set('requiredFields', $config->bug->create->requiredFields);
js::set('showFields', $showFields);
js::set('projectExecutionPairs', $projectExecutionPairs);
js::set('releasedBuilds', $releasedBuilds);
js::set('productID', $productID);
js::set('releasedBuild', $lang->build->releasedBuild);
if($this->app->tab == 'execution') js::set('objectID', zget($execution, 'id', ''));
if($this->app->tab == 'project') js::set('objectID', $projectID);
+4 -4
View File
@@ -30,7 +30,7 @@ js::set('bugID' , $bug->id);
js::set('bugBranch' , $bug->branch);
js::set('isClosedBug' , $bug->status == 'closed');
js::set('projectExecutionPairs' , $projectExecutionPairs);
js::set('releasedBuilds' , $releasedBuilds);
js::set('productID' , $product->id);
js::set('releasedBuild' , $lang->build->releasedBuild);
if($this->app->tab == 'execution') js::set('objectID', $bug->execution);
if($this->app->tab == 'project') js::set('objectID', $bug->project);
@@ -102,7 +102,7 @@ if($this->app->tab == 'project') js::set('objectID', $bug->project);
<th class='w-80px'><?php echo $lang->bug->product;?></th>
<td>
<div class='input-group'>
<?php echo html::select('product', $products, $productID, "onchange='loadAll(this.value)' class='form-control chosen'");?>
<?php echo html::select('product', $products, $product->id, "onchange='loadAll(this.value)' class='form-control chosen'");?>
<?php if($product->type != 'normal') echo html::select('branch', $branchTagOption, $bug->branch, "onchange='loadBranch();' class='form-control'");?>
</div>
</td>
@@ -116,9 +116,9 @@ if($this->app->tab == 'project') js::set('objectID', $bug->project);
if(count($moduleOptionMenu) == 1)
{
echo "<span class='input-group-addon'>";
echo html::a($this->createLink('tree', 'browse', "rootID=$productID&view=bug&currentModuleID=0&branch=$bug->branch", '', true), $lang->tree->manage, '', "class='text-primary' data-toggle='modal' data-type='iframe' data-width='95%'");
echo html::a($this->createLink('tree', 'browse', "rootID={$product->id}&view=bug&currentModuleID=0&branch=$bug->branch", '', true), $lang->tree->manage, '', "class='text-primary' data-toggle='modal' data-type='iframe' data-width='95%'");
echo '&nbsp; ';
echo html::a("javascript:void(0)", $lang->refreshIcon, '', "class='refresh' title='$lang->refresh' onclick='loadProductModules($productID)'");
echo html::a("javascript:void(0)", $lang->refreshIcon, '', "class='refresh' title='$lang->refresh' onclick='loadProductModules($product->id)'");
echo '</span>';
}
?>
-1
View File
@@ -16,7 +16,6 @@
<?php
js::set('page', 'resolve');
js::set('productID', $bug->product);
js::set('releasedBuilds', $releasedBuilds);
js::set('releasedBuild', $lang->build->releasedBuild);
?>
<div id='mainContent' class='main-content'>