diff --git a/module/build/lang/de.php b/module/build/lang/de.php index 58e816e8fe..04a6ea1e97 100644 --- a/module/build/lang/de.php +++ b/module/build/lang/de.php @@ -60,6 +60,7 @@ $lang->build->notice->changeProduct = "The {$lang->SRCommon}, bug, or the vers $lang->build->notice->changeExecution = "The version of the submitted test order cannot be modified {$lang->executionCommon}"; $lang->build->notice->changeBuilds = "The version of the submitted test order cannot be modified builds"; $lang->build->notice->autoRelation = "The completed requirements, resolved bugs, and generated bugs under the relevant version will be automatically associated with the project version"; +$lang->build->notice->createTest = "The execution of this version has been deleted, and the test cannot be submitted"; $lang->build->finishStories = " %s {$lang->SRCommon} sind abgeschlossen."; $lang->build->resolvedBugs = ' %s Bugs sind gelöst.'; diff --git a/module/build/lang/en.php b/module/build/lang/en.php index 1de167d912..4042bdbc9c 100644 --- a/module/build/lang/en.php +++ b/module/build/lang/en.php @@ -60,6 +60,7 @@ $lang->build->notice->changeProduct = "The {$lang->SRCommon}, bug, or the vers $lang->build->notice->changeExecution = "The version of the submitted test order cannot be modified {$lang->executionCommon}"; $lang->build->notice->changeBuilds = "The version of the submitted test order cannot be modified builds"; $lang->build->notice->autoRelation = "The completed requirements, resolved bugs, and generated bugs under the relevant version will be automatically associated with the project version"; +$lang->build->notice->createTest = "The execution of this version has been deleted, and the test cannot be submitted"; $lang->build->finishStories = " Finished {$lang->SRCommon} %s"; $lang->build->resolvedBugs = ' Resolved Bug %s'; diff --git a/module/build/lang/fr.php b/module/build/lang/fr.php index 68b572a9fe..9feb78c0f3 100644 --- a/module/build/lang/fr.php +++ b/module/build/lang/fr.php @@ -60,6 +60,7 @@ $lang->build->notice->changeProduct = "The {$lang->SRCommon}, bug, or the vers $lang->build->notice->changeExecution = "The version of the submitted test order cannot be modified {$lang->executionCommon}"; $lang->build->notice->changeBuilds = "The version of the submitted test order cannot be modified builds"; $lang->build->notice->autoRelation = "The completed requirements, resolved bugs, and generated bugs under the relevant version will be automatically associated with the project version"; +$lang->build->notice->createTest = "The execution of this version has been deleted, and the test cannot be submitted"; $lang->build->finishStories = " {$lang->SRCommon} Terminées %s"; $lang->build->resolvedBugs = ' Bugs Résolus %s'; diff --git a/module/build/lang/vi.php b/module/build/lang/vi.php index aaf8d2800b..0c493659f2 100644 --- a/module/build/lang/vi.php +++ b/module/build/lang/vi.php @@ -54,6 +54,7 @@ $lang->build->notice->changeProduct = "The {$lang->SRCommon}, bug, or the vers $lang->build->notice->changeExecution = "The version of the submitted test order cannot be modified {$lang->executionCommon}"; $lang->build->notice->changeBuilds = "The version of the submitted test order cannot be modified builds"; $lang->build->notice->autoRelation = "The completed requirements, resolved bugs, and generated bugs under the relevant version will be automatically associated with the project version"; +$lang->build->notice->createTest = "The execution of this version has been deleted, and the test cannot be submitted"; $lang->build->finishStories = " {$lang->SRCommon} đã kết thúc %s"; $lang->build->resolvedBugs = ' Bug đã giải quyết %s'; diff --git a/module/build/lang/zh-cn.php b/module/build/lang/zh-cn.php index a503ab297f..ad3930e02b 100644 --- a/module/build/lang/zh-cn.php +++ b/module/build/lang/zh-cn.php @@ -60,6 +60,8 @@ $lang->build->notice->changeProduct = "已经关联{$lang->SRCommon}、Bug或 $lang->build->notice->changeExecution = "提交测试单的版本,不能修改其所属{$lang->executionCommon}"; $lang->build->notice->changeBuilds = "提交测试单的版本,不能修改关联版本"; $lang->build->notice->autoRelation = "相关版本下完成的需求、解决的Bug、产生的Bug将会自动关联到项目版本中"; +$lang->build->notice->createTest = "该版本所属执行已删除,不能提交测试"; + $lang->build->finishStories = " 本次共完成 %s 个{$lang->SRCommon}"; $lang->build->resolvedBugs = ' 本次共解决 %s 个Bug'; diff --git a/module/build/model.php b/module/build/model.php index 2d9f389e7f..c1ce58ecf0 100644 --- a/module/build/model.php +++ b/module/build/model.php @@ -259,7 +259,7 @@ class buildModel extends model } $branchs = strpos($params, 'separate') === false ? "0,$branch" : $branch; - $allBuilds = $this->dao->select('t1.id, t1.name, t1.date, t1.deleted, t2.status as objectStatus, t3.id as releaseID, t3.status as releaseStatus, t4.name as branchName, t5.type as productType')->from(TABLE_BUILD)->alias('t1') + $allBuilds = $this->dao->select('t1.id, t1.name, t1.execution, t1.date, t1.deleted, t2.status as objectStatus, t3.id as releaseID, t3.status as releaseStatus, t4.name as branchName, t5.type as productType')->from(TABLE_BUILD)->alias('t1') ->beginIF($objectType === 'execution')->leftJoin(TABLE_EXECUTION)->alias('t2')->on('t1.execution = t2.id')->fi() ->beginIF($objectType === 'project')->leftJoin(TABLE_PROJECT)->alias('t2')->on('t1.project = t2.id')->fi() ->leftJoin(TABLE_RELEASE)->alias('t3')->on("FIND_IN_SET(t1.id,t3.build)") @@ -275,6 +275,8 @@ class buildModel extends model ->beginIF($branch !== 'all')->andWhere('t1.branch')->in("$branchs")->fi() ->orderBy('t1.date desc, t1.id desc')->fetchAll('id'); + $executions = $this->dao->select('id, deleted')->from(TABLE_EXECUTION)->where('type')->eq('sprint')->andWhere('deleted')->eq('1')->fetchPairs(); + /* Set builds and filter done executions and terminate releases. */ $builds = array(); $buildIdList = array(); @@ -283,6 +285,7 @@ class buildModel extends model { if(empty($build->releaseID) and (strpos($params, 'nodone') !== false) and ($build->objectStatus === 'done')) continue; if((strpos($params, 'noterminate') !== false) and ($build->releaseStatus === 'terminate')) continue; + if((strpos($params, 'withexecution') !== false) and $build->execution and !empty($executions[$build->execution])) continue; if($build->deleted == 1) $build->name .= ' (' . $this->lang->build->deleted . ')'; $branchName = $build->branchName ? $build->branchName : $this->lang->branch->main; @@ -685,7 +688,14 @@ class buildModel extends model if(common::hasPriv($module, 'linkstory') and common::canBeChanged('build', $build)) $menu .= $this->buildMenu($module, 'view', "{$params}&type=story&link=true", $build, $type, 'link', '', '', '', "data-app={$tab}", $this->lang->build->linkStory); - $menu .= $this->buildMenu('testtask', 'create', "product=$build->product&execution={$executionID}&build=$build->id&projectID=$build->project", $build, $type, 'bullhorn', '', '', '', $testtaskApp); + if($execution and $execution->deleted === '1') + { + if(common::hasPriv('testtask', 'create')) $menu .= html::a(helper::createLink('testtask', 'create', "product=$build->product&execution={$executionID}&build=$build->id&projectID=$build->project"), "", '', "class='btn' title='{$this->lang->build->notice->createTest}' disabled"); + } + else + { + $menu .= $this->buildMenu('testtask', 'create', "product=$build->product&execution={$executionID}&build=$build->id&projectID=$build->project", $build, $type, 'bullhorn', '', '', '', $testtaskApp); + } if($tab == 'execution' and !empty($execution->type) and $execution->type != 'kanban') $menu .= $this->buildMenu('execution', 'bug', "execution={$extraParams['executionID']}&productID={$extraParams['productID']}&branchID=all&orderBy=status&build=$build->id", $build, $type, '', '', '', '', $this->lang->execution->viewBug); if($tab == 'project' or empty($execution->type) or $execution->type == 'kanban') $menu .= $this->buildMenu($module, 'view', "{$params}&type=generatedBug", $build, $type, 'bug', '', '', '', "data-app='$tab'", $this->lang->project->bug); diff --git a/module/testtask/control.php b/module/testtask/control.php index 85298a54ed..587200d33d 100644 --- a/module/testtask/control.php +++ b/module/testtask/control.php @@ -250,7 +250,7 @@ class testtask extends control /* Create testtask from testtask of test.*/ $productID = $productID ? $productID : key($this->products); $executions = empty($productID) ? array() : $this->loadModel('product')->getExecutionPairsByProduct($productID, '', 'id_desc', $projectID, 'stagefilter'); - $builds = empty($productID) ? array() : $this->loadModel('build')->getBuildPairs($productID, 'all', 'notrunk'); + $builds = empty($productID) ? array() : $this->loadModel('build')->getBuildPairs($productID, 'all', 'notrunk,withexecution', $projectID, 'project'); $execution = $this->loadModel('execution')->getByID($executionID); if(!empty($execution) and $execution->type == 'kanban') $this->lang->testtask->execution = str_replace($this->lang->execution->common, $this->lang->kanban->common, $this->lang->testtask->execution); @@ -816,13 +816,18 @@ class testtask extends control $executions[$executionID] = $project->name . "({$this->lang->project->disableExecution})"; } } + $builds = $this->loadModel('build')->getBuildPairs($productID, 'all', 'noempty,notrunk,withexecution', $executionID, 'execution'); + } + else + { + $builds = $this->loadModel('build')->getBuildPairs($productID, 'all', 'noempty,notrunk,withexecution', $task->project, 'project'); } $this->view->title = $this->products[$productID] . $this->lang->colon . $this->lang->testtask->edit; $this->view->task = $task; $this->view->project = $this->project->getByID($projectID); $this->view->executions = $executions; - $this->view->builds = empty($productID) ? array() : $this->loadModel('build')->getBuildPairs($productID, 'all', 'noempty,notrunk', $executionID, 'execution'); + $this->view->builds = empty($productID) ? array() : $builds; $this->view->testreports = $this->loadModel('testreport')->getPairs($task->product, $task->testreport); $this->view->users = $this->loadModel('user')->getPairs('nodeleted|noclosed', $task->owner); $this->view->contactLists = $this->user->getContactLists($this->app->user->account, 'withnote'); @@ -1501,6 +1506,7 @@ class testtask extends control $this->view->builds = $builds; $this->view->users = $this->loadModel('user')->getPairs('noletter|nodeleted|noclosed'); $this->view->productID = $productID; + $this->view->projectID = $projectID; $this->display(); } diff --git a/module/testtask/js/common.js b/module/testtask/js/common.js index 26df905e98..9f090c7157 100644 --- a/module/testtask/js/common.js +++ b/module/testtask/js/common.js @@ -100,10 +100,9 @@ function loadExecutionBuilds(executionID, selected) if(!selectedBuild) selectedBuild = 0; var link = createLink('build', 'ajaxGetExecutionBuilds', 'executionID=' + executionID + '&productID=' + $('#product').val() + '&varName=testTaskBuild&build=' + selectedBuild); - if(executionID == 0) link = createLink('build', 'ajaxGetProductBuilds', 'productID=' + $('#product').val() + '&varName=resolvedBuild&build=' + selectedBuild); + if(executionID == 0) link = createLink('build', 'ajaxGetProjectBuilds', 'projectID=' + projectID + '&productID=' + $('#product').val() + '&varName=build&build=' + selectedBuild + '&branch=&index=&needCreate=&type=noempty,notrunk,withexecution'); $('#buildBox').load(link, function() { - $('#resolvedBuild').attr('id', 'build').attr('name', 'build').find('option[value=trunk]').remove(); if(selected) $('#build').val(selected); $('#build').chosen(); }); diff --git a/module/testtask/js/create.js b/module/testtask/js/create.js index 97acffeb71..ed479be08c 100755 --- a/module/testtask/js/create.js +++ b/module/testtask/js/create.js @@ -8,7 +8,7 @@ function loadProductRelated() { loadExecutions($('#product').val()); loadTestReports($('#product').val()); - loadExecutionRelated($('#execution').val()) + loadExecutionBuilds($('#execution').val()) } /** diff --git a/module/testtask/view/edit.html.php b/module/testtask/view/edit.html.php index 59fd40faab..20101655c8 100644 --- a/module/testtask/view/edit.html.php +++ b/module/testtask/view/edit.html.php @@ -13,6 +13,7 @@ +project);?>