From 207c5c7117a625abf9c36911d943c9216a634486 Mon Sep 17 00:00:00 2001 From: liuhong Date: Thu, 8 Dec 2022 14:40:21 +0000 Subject: [PATCH] * Adjust code task #78665. --- module/build/control.php | 6 +++--- module/build/lang/de.php | 3 +-- module/build/lang/en.php | 3 +-- module/build/lang/fr.php | 3 +-- module/build/lang/zh-cn.php | 3 +-- module/build/lang/zh-tw.php | 1 + module/tree/model.php | 2 +- 7 files changed, 9 insertions(+), 12 deletions(-) diff --git a/module/build/control.php b/module/build/control.php index 2074573901..f13ca09759 100644 --- a/module/build/control.php +++ b/module/build/control.php @@ -643,7 +643,7 @@ class build extends control else { $branchPairs = $this->loadModel('branch')->getPairs($build->product, 'noempty'); - $branchAll = $build->productType == 'branch' ? $this->lang->build->allBranch : $this->lang->build->allPlatform; + $branchAll = sprintf($this->lang->build->branchAll, $this->lang->product->branchName[$product->type]); $branches = array('' => $branchAll) + array(BRANCH_MAIN => $this->lang->branch->main); if($build->branch) { @@ -707,7 +707,7 @@ class build extends control * AJAX: Get unlinkBranch story and bug. * * @param int $buildID - * @param int $branch + * @param int $newBranch * @access public * @return void */ @@ -876,7 +876,7 @@ class build extends control else { $branchList = $this->loadModel('branch')->getPairs($build->product, '', $build->execution); - $branchAll = $build->productType == 'branch' ? $this->lang->build->allBranch : $this->lang->build->allPlatform; + $branchAll = sprintf($this->lang->build->branchAll, $this->lang->product->branchName[$product->type]); $branches = array('' => $branchAll, BRANCH_MAIN => $this->lang->branch->main); if(strpos($build->branch, ',') !== false) $buildBranch = explode(',', $build->branch); foreach($buildBranch as $buildKey) $branches += array($buildKey => zget($branchList, $buildKey)); diff --git a/module/build/lang/de.php b/module/build/lang/de.php index f6276463c8..7063290779 100644 --- a/module/build/lang/de.php +++ b/module/build/lang/de.php @@ -30,8 +30,7 @@ $lang->build->basicInfo = 'Basis Info'; $lang->build->id = 'ID'; $lang->build->product = $lang->productCommon; $lang->build->project = 'Project'; -$lang->build->allBranch = 'All associated branches'; -$lang->build->allPlatform = 'All associated platforms'; +$lang->build->branchAll = 'All associated %s'; $lang->build->branch = 'Platform/Branch'; $lang->build->branchName = '%s'; $lang->build->execution = $lang->executionCommon; diff --git a/module/build/lang/en.php b/module/build/lang/en.php index 58689e8035..472e7c1b07 100644 --- a/module/build/lang/en.php +++ b/module/build/lang/en.php @@ -31,8 +31,7 @@ $lang->build->id = 'ID'; $lang->build->product = $lang->productCommon; $lang->build->project = 'Project'; $lang->build->branch = 'Platform/Branch'; -$lang->build->allBranch = 'All associated branches'; -$lang->build->allPlatform = 'All associated platforms'; +$lang->build->branchAll = 'All associated %s'; $lang->build->branchName = '%s'; $lang->build->execution = $lang->executionCommon; $lang->build->integrated = 'Integrated'; diff --git a/module/build/lang/fr.php b/module/build/lang/fr.php index 70540626c1..65d85299bb 100644 --- a/module/build/lang/fr.php +++ b/module/build/lang/fr.php @@ -31,8 +31,7 @@ $lang->build->id = 'ID'; $lang->build->product = $lang->productCommon; $lang->build->project = 'Project'; $lang->build->branch = 'Plateforme/Branche'; -$lang->build->allBranch = 'All associated branches'; -$lang->build->allPlatform = 'All associated platforms'; +$lang->build->branchAll = 'All associated %s'; $lang->build->branchName = '%s'; $lang->build->execution = $lang->executionCommon; $lang->build->integrated = 'Integrated'; diff --git a/module/build/lang/zh-cn.php b/module/build/lang/zh-cn.php index 4e5c514d58..e0db140e9b 100644 --- a/module/build/lang/zh-cn.php +++ b/module/build/lang/zh-cn.php @@ -31,8 +31,7 @@ $lang->build->id = 'ID'; $lang->build->product = '所属' . $lang->productCommon; $lang->build->project = '所属项目'; $lang->build->branch = '平台/分支'; -$lang->build->allBranch = '所有关联分支'; -$lang->build->allPlatform = '所有关联平台'; +$lang->build->branchAll = '所有关联%s'; $lang->build->branchName = '所属%s'; $lang->build->execution = '所属' . $lang->executionCommon; $lang->build->integrated = '集成版本'; diff --git a/module/build/lang/zh-tw.php b/module/build/lang/zh-tw.php index 55b8b0934e..89d85f8281 100644 --- a/module/build/lang/zh-tw.php +++ b/module/build/lang/zh-tw.php @@ -31,6 +31,7 @@ $lang->build->id = 'ID'; $lang->build->product = $lang->productCommon; $lang->build->project = '所屬項目'; $lang->build->branch = '平台/分支'; +$lang->build->branchAll = '所有關聯%s'; $lang->build->branchName = '所屬%s'; $lang->build->execution = '所屬' . $lang->executionCommon; $lang->build->name = '名稱編號'; diff --git a/module/tree/model.php b/module/tree/model.php index fb828a6b4e..63b9cc85e2 100644 --- a/module/tree/model.php +++ b/module/tree/model.php @@ -155,7 +155,7 @@ class treeModel extends model if($type == 'line') $rootID = 0; - $branches = array(); + $branches = array($branch => ''); if($branch != 'all' and strpos('story|bug|case', $type) !== false) { $product = $this->loadModel('product')->getById($rootID);