From 631a62e2dd627dd3a07bdd5c7b1f1ec9247ccb34 Mon Sep 17 00:00:00 2001 From: songchenxuan Date: Wed, 1 Dec 2021 13:16:42 +0800 Subject: [PATCH] * 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');