From a08eff199f2eb8211f43563d8b2d880d2213c176 Mon Sep 17 00:00:00 2001 From: liuhong Date: Thu, 15 Dec 2022 08:12:15 +0000 Subject: [PATCH 1/2] * Fix bug #30907. --- module/build/control.php | 32 ++++++++++++++++++-------------- module/build/lang/de.php | 1 + module/build/lang/en.php | 1 + module/build/lang/fr.php | 1 + module/build/lang/zh-cn.php | 1 + module/build/view/edit.html.php | 2 +- module/build/view/view.html.php | 2 +- 7 files changed, 24 insertions(+), 16 deletions(-) diff --git a/module/build/control.php b/module/build/control.php index 8dc4494c0e..9c5d4dd7b2 100644 --- a/module/build/control.php +++ b/module/build/control.php @@ -183,7 +183,8 @@ class build extends control $builds = $this->build->getBuildPairs($build->product, 'all', 'noempty,notrunk,singled,separate', $build->project, 'project', $build->builds, false); } - $executions = $this->product->getExecutionPairsByProduct($build->product, $build->branch, 'id_desc', $this->session->project, 'stagefilter'); + $executions = $this->product->getExecutionPairsByProduct($build->product, $build->branch, 'id_desc', $this->session->project, 'stagefilter'); + $executionType = $build->execution ? $this->execution->getByID($build->execution) : ''; if($build->execution and !isset($executions[$build->execution])) $executions[$build->execution] = $this->loadModel('execution')->getById($build->execution)->name; /* Get stories and bugs. */ @@ -218,6 +219,7 @@ class build extends control $this->view->orderBy = $orderBy; $this->view->oldBranch = $oldBranch; $this->view->executions = $executions; + $this->view->executionType = (!empty($executionType) and $executionType->type == 'stage') ? 1 : 0; $this->view->productGroups = $productGroups; $this->view->products = $products; $this->view->users = $this->loadModel('user')->getPairs('noletter', $build->builder); @@ -303,6 +305,7 @@ class build extends control } $executions = $this->loadModel('execution')->getPairs($this->session->project, 'all', 'empty'); + $executionType = $build->execution ? $this->execution->getByID($build->execution) : ''; $this->commonActions($build->project); @@ -329,19 +332,20 @@ class build extends control /* Assign. */ $this->view->canBeChanged = common::canBeChanged('build', $build); // Determines whether an object is editable. $this->view->users = $this->loadModel('user')->getPairs('noletter'); - $this->view->build = $build; - $this->view->buildPairs = $this->build->getBuildPairs(0, 'all', 'noempty,notrunk', $objectID, $objectType); - $this->view->builds = $this->build->getByList(array_keys($this->view->buildPairs)); - $this->view->executions = $executions; - $this->view->actions = $this->loadModel('action')->getList('build', $buildID); - $this->view->link = $link; - $this->view->param = $param; - $this->view->orderBy = $orderBy; - $this->view->bugs = $bugs; - $this->view->type = $type; - $this->view->bugPager = $bugPager; - $this->view->branchName = empty($branchName) ? $this->lang->branch->main : $branchName; - $this->view->childBuilds = empty($build->builds) ? array() : $this->dao->select('id,name,bugs,stories')->from(TABLE_BUILD)->where('id')->in($build->builds)->fetchAll(); + $this->view->build = $build; + $this->view->buildPairs = $this->build->getBuildPairs(0, 'all', 'noempty,notrunk', $objectID, $objectType); + $this->view->builds = $this->build->getByList(array_keys($this->view->buildPairs)); + $this->view->executions = $executions; + $this->view->actions = $this->loadModel('action')->getList('build', $buildID); + $this->view->link = $link; + $this->view->param = $param; + $this->view->orderBy = $orderBy; + $this->view->bugs = $bugs; + $this->view->type = $type; + $this->view->bugPager = $bugPager; + $this->view->branchName = empty($branchName) ? $this->lang->branch->main : $branchName; + $this->view->childBuilds = empty($build->builds) ? array() : $this->dao->select('id,name,bugs,stories')->from(TABLE_BUILD)->where('id')->in($build->builds)->fetchAll(); + $this->view->executionType = (!empty($executionType) and $executionType->type == 'stage') ? 1 : 0; if($this->app->getViewType() == 'json') { diff --git a/module/build/lang/de.php b/module/build/lang/de.php index 658b48f285..17b15639f3 100644 --- a/module/build/lang/de.php +++ b/module/build/lang/de.php @@ -34,6 +34,7 @@ $lang->build->branch = 'Platform/Branch'; $lang->build->branchAll = 'All associated %s'; $lang->build->branchName = '%s'; $lang->build->execution = $lang->executionCommon; +$lang->build->executionAB = 'execution'; $lang->build->integrated = 'Integrated'; $lang->build->singled = 'Singled'; $lang->build->builds = 'Included Builds'; diff --git a/module/build/lang/en.php b/module/build/lang/en.php index c877b2bf25..f97e216c23 100644 --- a/module/build/lang/en.php +++ b/module/build/lang/en.php @@ -34,6 +34,7 @@ $lang->build->branch = 'Platform/Branch'; $lang->build->branchAll = 'All associated %s'; $lang->build->branchName = '%s'; $lang->build->execution = $lang->executionCommon; +$lang->build->executionAB = 'execution'; $lang->build->integrated = 'Integrated'; $lang->build->singled = 'Singled'; $lang->build->builds = 'Included Builds'; diff --git a/module/build/lang/fr.php b/module/build/lang/fr.php index 33f4168700..3fc321540b 100644 --- a/module/build/lang/fr.php +++ b/module/build/lang/fr.php @@ -34,6 +34,7 @@ $lang->build->branch = 'Plateforme/Branche'; $lang->build->branchAll = 'All associated %s'; $lang->build->branchName = '%s'; $lang->build->execution = $lang->executionCommon; +$lang->build->executionAB = 'execution'; $lang->build->integrated = 'Integrated'; $lang->build->singled = 'Singled'; $lang->build->builds = 'Included Builds'; diff --git a/module/build/lang/zh-cn.php b/module/build/lang/zh-cn.php index a8c80bbd5b..4ef08ed9c5 100644 --- a/module/build/lang/zh-cn.php +++ b/module/build/lang/zh-cn.php @@ -34,6 +34,7 @@ $lang->build->branch = '平台/分支'; $lang->build->branchAll = '所有关联%s'; $lang->build->branchName = '所属%s'; $lang->build->execution = '所属' . $lang->executionCommon; +$lang->build->executionAB = '所属执行'; $lang->build->integrated = '集成版本'; $lang->build->singled = '单一版本'; $lang->build->builds = '包含版本'; diff --git a/module/build/view/edit.html.php b/module/build/view/edit.html.php index fdaa8edaa1..59945e5179 100644 --- a/module/build/view/edit.html.php +++ b/module/build/view/edit.html.php @@ -64,7 +64,7 @@ - build->execution;?> + build->executionAB : $lang->build->execution;?> execution, "class='form-control chosen' required $disabled");?> build->notice->changeExecution;?> diff --git a/module/build/view/view.html.php b/module/build/view/view.html.php index 47cb7cf6ce..ef74659025 100644 --- a/module/build/view/view.html.php +++ b/module/build/view/view.html.php @@ -384,7 +384,7 @@ tbody tr td:first-child input {display: none;} execution):?> - build->project : $lang->build->execution;?> + build->project :($executionType ? $lang->build->executionAB : $lang->build->execution);?> execution);?> From cc631b6e4f71ff8c30d09a57c38fa0b6a4c1e7d2 Mon Sep 17 00:00:00 2001 From: liuhong Date: Thu, 15 Dec 2022 08:15:03 +0000 Subject: [PATCH 2/2] * Adjust code #30907. --- module/build/control.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/build/control.php b/module/build/control.php index 9c5d4dd7b2..8e7e735d29 100644 --- a/module/build/control.php +++ b/module/build/control.php @@ -304,7 +304,7 @@ class build extends control $objectID = $build->execution; } - $executions = $this->loadModel('execution')->getPairs($this->session->project, 'all', 'empty'); + $executions = $this->loadModel('execution')->getPairs($this->session->project, 'all', 'empty'); $executionType = $build->execution ? $this->execution->getByID($build->execution) : ''; $this->commonActions($build->project);