From cb006257958873bf63824adccd171a5728ff2c90 Mon Sep 17 00:00:00 2001 From: songchenxuan Date: Wed, 1 Dec 2021 08:45:25 +0800 Subject: [PATCH 1/4] * Finish task #45040. --- module/build/lang/en.php | 1 + module/build/lang/zh-cn.php | 1 + module/execution/control.php | 13 +++++++++++++ module/project/control.php | 12 ++++++++++++ 4 files changed, 27 insertions(+) diff --git a/module/build/lang/en.php b/module/build/lang/en.php index 20a3d4b1bd..70ccd580f8 100644 --- a/module/build/lang/en.php +++ b/module/build/lang/en.php @@ -31,6 +31,7 @@ $lang->build->id = 'ID'; $lang->build->product = $lang->productCommon; $lang->build->project = 'Project'; $lang->build->branch = 'Platform/Branch'; +$lang->build->branchName = '%s'; $lang->build->execution = $lang->executionCommon; $lang->build->name = 'Name'; $lang->build->date = 'Date'; diff --git a/module/build/lang/zh-cn.php b/module/build/lang/zh-cn.php index 2470d7e637..34647aec6d 100644 --- a/module/build/lang/zh-cn.php +++ b/module/build/lang/zh-cn.php @@ -31,6 +31,7 @@ $lang->build->id = 'ID'; $lang->build->product = $lang->productCommon; $lang->build->project = '所属项目'; $lang->build->branch = '平台/分支'; +$lang->build->branchName = '所属%s'; $lang->build->execution = '所属' . $lang->executionCommon; $lang->build->name = '名称编号'; $lang->build->date = '打包日期'; diff --git a/module/execution/control.php b/module/execution/control.php index f88607269c..1cb40627ce 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -1007,6 +1007,19 @@ class execution extends control $type = strtolower($type); $queryID = ($type == 'bysearch') ? (int)$param : 0; $actionURL = $this->createLink('execution', 'build', "executionID=$executionID&type=bysearch&queryID=myQueryID"); + + if($param) + { + $product = $this->loadModel('product')->getById($param); + if($product and $product->type != 'normal') + { + $this->loadModel('build'); + $this->loadModel('branch'); + $branches = array(BRANCH_MAIN => $this->lang->branch->main) + $this->branch->getPairs($product->id, '', $executionID); + $this->config->build->search['fields']['branch'] = sprintf($this->lang->build->branchName, $this->lang->product->branchName[$product->type]); + $this->config->build->search['params']['branch'] = array('operator' => '=', 'control' => 'select', 'values' => $branches); + } + } $this->project->buildProjectBuildSearchForm($products, $queryID, $actionURL, 'execution'); /* Get builds. */ diff --git a/module/project/control.php b/module/project/control.php index 84bacab478..8a2d20652b 100644 --- a/module/project/control.php +++ b/module/project/control.php @@ -1073,6 +1073,18 @@ class project extends control $this->config->build->search['fields']['execution'] = $this->project->lang->executionCommon; $this->config->build->search['params']['execution'] = array('operator' => '=', 'control' => 'select', 'values' => array('' => '') + $executions); + if($param) + { + $product = $this->loadModel('product')->getById($param); + if($product and $product->type != 'normal') + { + $this->loadModel('build'); + $this->loadModel('branch'); + $branches = array(BRANCH_MAIN => $this->lang->branch->main) + $this->branch->getPairs($product->id, '', $projectID); + $this->config->build->search['fields']['branch'] = sprintf($this->lang->build->branchName, $this->lang->product->branchName[$product->type]); + $this->config->build->search['params']['branch'] = array('operator' => '=', 'control' => 'select', 'values' => $branches); + } + } $this->project->buildProjectBuildSearchForm($products, $queryID, $actionURL, 'project'); if($type == 'bysearch') From 73726f8a6743acc32b396561a95e8273cb3f66c9 Mon Sep 17 00:00:00 2001 From: songchenxuan Date: Wed, 1 Dec 2021 09:12:33 +0800 Subject: [PATCH 2/4] * Finish task #45040. --- module/execution/control.php | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/module/execution/control.php b/module/execution/control.php index 1cb40627ce..2ce309c3e4 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -1008,17 +1008,14 @@ class execution extends control $queryID = ($type == 'bysearch') ? (int)$param : 0; $actionURL = $this->createLink('execution', 'build', "executionID=$executionID&type=bysearch&queryID=myQueryID"); - if($param) + $product = $param ? $this->loadModel('product')->getById($param) : ''; + if($product and $product->type != 'normal') { - $product = $this->loadModel('product')->getById($param); - if($product and $product->type != 'normal') - { - $this->loadModel('build'); - $this->loadModel('branch'); - $branches = array(BRANCH_MAIN => $this->lang->branch->main) + $this->branch->getPairs($product->id, '', $executionID); - $this->config->build->search['fields']['branch'] = sprintf($this->lang->build->branchName, $this->lang->product->branchName[$product->type]); - $this->config->build->search['params']['branch'] = array('operator' => '=', 'control' => 'select', 'values' => $branches); - } + $this->loadModel('build'); + $this->loadModel('branch'); + $branches = array(BRANCH_MAIN => $this->lang->branch->main) + $this->branch->getPairs($product->id, '', $executionID); + $this->config->build->search['fields']['branch'] = sprintf($this->lang->build->branchName, $this->lang->product->branchName[$product->type]); + $this->config->build->search['params']['branch'] = array('operator' => '=', 'control' => 'select', 'values' => $branches); } $this->project->buildProjectBuildSearchForm($products, $queryID, $actionURL, 'execution'); From 85cf0ab20c4fc5385287344d019c493f24b5990a Mon Sep 17 00:00:00 2001 From: songchenxuan Date: Wed, 1 Dec 2021 11:15:19 +0800 Subject: [PATCH 3/4] * Finish task #45040. --- module/execution/control.php | 2 +- module/project/control.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/module/execution/control.php b/module/execution/control.php index 2ce309c3e4..bf5a2e5019 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -1013,7 +1013,7 @@ class execution extends control { $this->loadModel('build'); $this->loadModel('branch'); - $branches = array(BRANCH_MAIN => $this->lang->branch->main) + $this->branch->getPairs($product->id, '', $executionID); + $branches = array(BRANCH_MAIN => $this->lang->branch->main) + $this->branch->getPairs($product->id, '', $executionID); $this->config->build->search['fields']['branch'] = sprintf($this->lang->build->branchName, $this->lang->product->branchName[$product->type]); $this->config->build->search['params']['branch'] = array('operator' => '=', 'control' => 'select', 'values' => $branches); } diff --git a/module/project/control.php b/module/project/control.php index 8a2d20652b..44423756b0 100644 --- a/module/project/control.php +++ b/module/project/control.php @@ -1080,7 +1080,7 @@ class project extends control { $this->loadModel('build'); $this->loadModel('branch'); - $branches = array(BRANCH_MAIN => $this->lang->branch->main) + $this->branch->getPairs($product->id, '', $projectID); + $branches = array(BRANCH_MAIN => $this->lang->branch->main) + $this->branch->getPairs($product->id, '', $projectID); $this->config->build->search['fields']['branch'] = sprintf($this->lang->build->branchName, $this->lang->product->branchName[$product->type]); $this->config->build->search['params']['branch'] = array('operator' => '=', 'control' => 'select', 'values' => $branches); } From 631a62e2dd627dd3a07bdd5c7b1f1ec9247ccb34 Mon Sep 17 00:00:00 2001 From: songchenxuan Date: Wed, 1 Dec 2021 13:16:42 +0800 Subject: [PATCH 4/4] * Finish task #45040. --- module/project/control.php | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/module/project/control.php b/module/project/control.php index 44423756b0..33727faf1f 100644 --- a/module/project/control.php +++ b/module/project/control.php @@ -1073,17 +1073,14 @@ class project extends control $this->config->build->search['fields']['execution'] = $this->project->lang->executionCommon; $this->config->build->search['params']['execution'] = array('operator' => '=', 'control' => 'select', 'values' => array('' => '') + $executions); - if($param) + $product = $param ? $this->loadModel('product')->getById($param) : ''; + if($product and $product->type != 'normal') { - $product = $this->loadModel('product')->getById($param); - if($product and $product->type != 'normal') - { - $this->loadModel('build'); - $this->loadModel('branch'); - $branches = array(BRANCH_MAIN => $this->lang->branch->main) + $this->branch->getPairs($product->id, '', $projectID); - $this->config->build->search['fields']['branch'] = sprintf($this->lang->build->branchName, $this->lang->product->branchName[$product->type]); - $this->config->build->search['params']['branch'] = array('operator' => '=', 'control' => 'select', 'values' => $branches); - } + $this->loadModel('build'); + $this->loadModel('branch'); + $branches = array(BRANCH_MAIN => $this->lang->branch->main) + $this->branch->getPairs($product->id, '', $projectID); + $this->config->build->search['fields']['branch'] = sprintf($this->lang->build->branchName, $this->lang->product->branchName[$product->type]); + $this->config->build->search['params']['branch'] = array('operator' => '=', 'control' => 'select', 'values' => $branches); } $this->project->buildProjectBuildSearchForm($products, $queryID, $actionURL, 'project');