This commit is contained in:
王怡栋
2022-11-25 08:34:59 +08:00
parent 38e665a485
commit 994015ade9
2 changed files with 12 additions and 3 deletions
+10 -2
View File
@@ -23,7 +23,15 @@ function loadProductExecutions(productID, projectID)
$('#executionBox').load(link, function()
{
$(this).find('select').chosen();
$select = $(this).find('select');
$tr = $(this).closest('tr');
$tr.removeClass('hidden');
if($select.data('multiple') == 0)
{
$tr.addClass('hidden');
$select.find('option:last').prop('selected', true);
}
$select.chosen();
});
}
@@ -37,7 +45,7 @@ $('#toTaskButton').on('click', function()
{
$('#cancelButton').click();
link = createLink('task', 'create', 'executionID=' + executionID + '&storyID=0&moduleID=0&taskID=0&todoID=0&extra=projectID=' + projectID + '&bugID=' + bugID);
window.parent.$.apps.open(link, 'execution');
window.parent.$.apps.open(link, $('#execution').data('multiple') == 0 ? 'project' : 'execution');
}
else if(projectID == 0)
{
+2 -1
View File
@@ -963,13 +963,14 @@ class product extends control
$mode .= ($from == 'bugToTask' or empty($this->config->CRExecution)) ? 'noclosed' : '';
$mode .= !$projectID ? ',multiple' : '';
$project = $this->loadModel('project')->getById($projectID);
$executions = $from == 'showImport' ? $this->product->getAllExecutionPairsByProduct($productID, $branch, $projectID) : $this->product->getExecutionPairsByProduct($productID, $branch, 'id_desc', $projectID, $mode);
if($this->app->getViewType() == 'json') return print(json_encode($executions));
if($number === '')
{
$event = $from == 'bugToTask' ? '' : " onchange='loadExecutionRelated(this.value)'";
return print(html::select('execution', array('' => '') + $executions, $executionID, "class='form-control' $event"));
return print(html::select('execution', array('' => '') + $executions, $executionID, "class='form-control' data-multiple={$project->multiple} $event"));
}
else
{