From e6989dc17c360902f06433729829f2849f1cff31 Mon Sep 17 00:00:00 2001 From: lanzongjun Date: Thu, 8 Dec 2022 14:32:27 +0800 Subject: [PATCH] * Finish Bug #30687 --- module/build/control.php | 6 +++++- module/tree/model.php | 6 +++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/module/build/control.php b/module/build/control.php index 021f442967..d0ad05431f 100644 --- a/module/build/control.php +++ b/module/build/control.php @@ -640,7 +640,11 @@ class build extends control { $branchPairs = $this->loadModel('branch')->getPairs($build->product, 'noempty'); $branches = array('' => '') + array(BRANCH_MAIN => $this->lang->branch->main); - if($build->branch) $branches += array($build->branch => $branchPairs[$build->branch]); + + if($build->branch) + { + foreach(explode(',', $build->branch) as $branchID) $branches += array($branchID => $branchPairs[$branchID]); + } $this->config->product->search['fields']['branch'] = sprintf($this->lang->product->branch, $this->lang->product->branchName[$product->type]); $this->config->product->search['params']['branch']['values'] = $branches; diff --git a/module/tree/model.php b/module/tree/model.php index c84f818e66..7c94195bd2 100644 --- a/module/tree/model.php +++ b/module/tree/model.php @@ -155,14 +155,14 @@ class treeModel extends model if($type == 'line') $rootID = 0; - $branches = array($branch => ''); + $branches = array(); if($branch != 'all' and strpos('story|bug|case', $type) !== false) { $product = $this->loadModel('product')->getById($rootID); if($product and $product->type != 'normal') { $branchPairs = $this->loadModel('branch')->getPairs($rootID, 'all'); - $branches = array($branch => $branchPairs[$branch]); + foreach(explode(',', $branch) as $branchID) $branches += array($branchID => $branchPairs[$branchID]); } elseif($product and $product->type == 'normal') { @@ -175,7 +175,7 @@ class treeModel extends model $treeMenu = array(); foreach($branches as $branchID => $branch) - { + { $stmt = $this->dbh->query($this->buildMenuQuery($rootID, $type, $startModule, $branchID, $param)); $modules = array(); while($module = $stmt->fetch())