Merge branch 'zentaopms_266_bug#30429' into 'master'

* Fix bug #30429.

See merge request easycorp/zentaopms!6436
This commit is contained in:
王怡栋
2022-12-01 07:58:03 +00:00
5 changed files with 19 additions and 15 deletions
-1
View File
@@ -63,7 +63,6 @@ $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';
$lang->build->createdBugs = ' 本次共产生 %s 个Bug';
+8 -10
View File
@@ -275,7 +275,7 @@ 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();
$deletedExecutions = $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();
@@ -285,7 +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((strpos($params, 'withexecution') !== false) and $build->execution and isset($executions[$build->execution])) continue;
if($build->deleted == 1) $build->name .= ' (' . $this->lang->build->deleted . ')';
$branchName = $build->branchName ? $build->branchName : $this->lang->branch->main;
@@ -657,6 +657,8 @@ class buildModel extends model
{
$action = strtolower($action);
if($module == 'testtask' and $action == 'create') return !$object->executionDeleted;
return true;
}
@@ -685,18 +687,14 @@ class buildModel extends model
{
$executionID = $tab == 'execution' ? $extraParams['executionID'] : $build->execution;
$execution = $this->loadModel('execution')->getByID($executionID);
$build->executionDeleted = $execution ? $execution->deleted : 0;
$testtaskApp = (!empty($execution->type) and $execution->type == 'kanban') ? 'data-app="qa"' : "data-app='{$tab}'";
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);
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"), "<i class='icon-testtask-create icon-bullhorn'></i>", '', "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);
}
$title = ($execution and $execution->deleted === '1') ? $this->lang->build->notice->createTest : '';
$menu .= $this->buildMenu('testtask', 'create', "product=$build->product&execution={$executionID}&build=$build->id&projectID=$build->project", $build, $type, 'bullhorn', '', '', '', $testtaskApp, $title);
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);
+1
View File
@@ -1462,6 +1462,7 @@ class project extends control
{
foreach($builds as $build)
{
$build->builds = $this->build->getByList($build->builds);
/* If product is normal, unset branch name. */
if(isset($productList[$build->product]) and $productList[$build->product]->type == 'normal')
{
+10 -3
View File
@@ -85,9 +85,16 @@
<td class="c-name text-left" title='<?php echo $build->executionName;?>'><?php echo $build->executionName;?></td>
<?php else:?>
<td class="c-name text-left">
<?php foreach(explode(',', $build->builds) as $childBuild):?>
<?php $buildName = zget($buildPairs, $childBuild);?>
<span title="<?php echo $buildName;?>"><?php echo $buildName;?></span></br>
<?php $childExecutions = array();?>
<?php foreach($build->builds as $childBuild):?>
<?php $childExecutions[$childBuild->execution] = $childBuild->execution;?>
<?php endforeach;?>
<?php foreach($childExecutions as $execution):?>
<?php $executionName = zget($allExecutions, $execution, '');?>
<?php if($executionName):?>
<span title="<?php echo $executionName;?>"><?php echo $executionName;?></span></br>
<?php endif;?>
<?php endforeach;?>
</td>
<?php endif;?>
-1
View File
@@ -90,7 +90,6 @@ function loadExecutionRelated(executionID)
* Load execution builds.
*
* @param int $executionID
* @param int $selected
* @access public
* @return void
*/