From 8559d77319079859dacd4cd1fc2e6247070bf30d Mon Sep 17 00:00:00 2001 From: wangyuting <851424971@qq.com> Date: Thu, 10 Nov 2022 08:09:17 +0000 Subject: [PATCH] * Optimize code. --- module/build/control.php | 7 +++++-- module/build/js/edit.js | 1 - module/build/lang/de.php | 1 + module/build/lang/en.php | 1 + module/build/lang/fr.php | 1 + module/build/lang/vi.php | 1 + module/build/lang/zh-cn.php | 1 + module/build/view/edit.html.php | 5 +++-- 8 files changed, 13 insertions(+), 5 deletions(-) diff --git a/module/build/control.php b/module/build/control.php index 0055b61203..dfad9d95c4 100644 --- a/module/build/control.php +++ b/module/build/control.php @@ -162,15 +162,17 @@ class build extends control if($this->app->tab == 'project') $this->loadModel('project')->setMenu($build->project); if($this->app->tab == 'execution') $this->execution->setMenu($build->execution); + $builds = array(); if($build->execution) { $productGroups = $this->product->getProducts($build->execution); - $branches = $this->loadModel('branch')->getList($build->product, $build->execution, 'all'); + $branches = $this->loadModel('branch')->getList($build->product, $build->execution, 'all'); } else { $productGroups = $this->product->getProducts($build->project); - $branches = $this->loadModel('branch')->getList($build->product, $build->project, 'all'); + $branches = $this->loadModel('branch')->getList($build->product, $build->project, 'all'); + $builds = $this->build->getBuildPairs($build->product, $build->branch, 'noempty,notrunk,separate,noproject'); } $executions = $this->product->getExecutionPairsByProduct($build->product, $build->branch, 'id_desc', $this->session->project, 'stagefilter'); @@ -207,6 +209,7 @@ class build extends control $this->view->products = $products; $this->view->users = $this->loadModel('user')->getPairs('noletter', $build->builder); $this->view->build = $build; + $this->view->builds = $builds; $this->view->testtaskID = $this->dao->select('id')->from(TABLE_TESTTASK)->where('build')->eq($build->id)->andWhere('deleted')->eq(0)->fetch('id'); $this->display(); } diff --git a/module/build/js/edit.js b/module/build/js/edit.js index db4faeb57d..00d4624411 100644 --- a/module/build/js/edit.js +++ b/module/build/js/edit.js @@ -18,7 +18,6 @@ $().ready(function() }); } }); - if(!executionID) $('#product').change(); }); function loadExecutions(oldExecutionID) diff --git a/module/build/lang/de.php b/module/build/lang/de.php index d714465ad7..92cb1f847c 100644 --- a/module/build/lang/de.php +++ b/module/build/lang/de.php @@ -55,6 +55,7 @@ $lang->build->emptyExecution = $lang->executionCommon . 'should be not empty.'; $lang->build->notice = new stdclass(); $lang->build->notice->changeProduct = "The {$lang->SRCommon}, bug, or the version of the submitted test order has been linked, and its {$lang->productCommon} cannot be modified"; $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->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 73ec7a1d33..c82634972b 100644 --- a/module/build/lang/en.php +++ b/module/build/lang/en.php @@ -55,6 +55,7 @@ $lang->build->emptyExecution = $lang->executionCommon . 'should be not empty.'; $lang->build->notice = new stdclass(); $lang->build->notice->changeProduct = "The {$lang->SRCommon}, bug, or the version of the submitted test order has been linked, and its {$lang->productCommon} cannot be modified"; $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->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 48326670ad..82e060e09b 100644 --- a/module/build/lang/fr.php +++ b/module/build/lang/fr.php @@ -55,6 +55,7 @@ $lang->build->emptyExecution = $lang->executionCommon . 'should be not empty.'; $lang->build->notice = new stdclass(); $lang->build->notice->changeProduct = "The {$lang->SRCommon}, bug, or the version of the submitted test order has been linked, and its {$lang->productCommon} cannot be modified"; $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->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 e0080ba5da..3342240d41 100644 --- a/module/build/lang/vi.php +++ b/module/build/lang/vi.php @@ -51,6 +51,7 @@ $lang->build->noBuild = 'Không có bản dựng nào'; $lang->build->notice = new stdclass(); $lang->build->notice->changeProduct = "The {$lang->SRCommon}, bug, or the version of the submitted test order has been linked, and its {$lang->productCommon} cannot be modified"; $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->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 c45863af1a..af15c07dae 100644 --- a/module/build/lang/zh-cn.php +++ b/module/build/lang/zh-cn.php @@ -55,6 +55,7 @@ $lang->build->emptyExecution = $lang->executionCommon . '不能为空。'; $lang->build->notice = new stdclass(); $lang->build->notice->changeProduct = "已经关联{$lang->SRCommon}、Bug或提交测试单的版本,不能修改其所属{$lang->productCommon}"; $lang->build->notice->changeExecution = "提交测试单的版本,不能修改其所属{$lang->executionCommon}"; +$lang->build->notice->changeBuilds = "提交测试单的版本,不能修改关联版本"; $lang->build->finishStories = " 本次共完成 %s 个{$lang->SRCommon}"; $lang->build->resolvedBugs = ' 本次共解决 %s 个Bug'; diff --git a/module/build/view/edit.html.php b/module/build/view/edit.html.php index efa48215c0..90a95c2b75 100644 --- a/module/build/view/edit.html.php +++ b/module/build/view/edit.html.php @@ -42,13 +42,14 @@