* Finish Bug #30687

This commit is contained in:
lanzongjun
2022-12-08 14:32:27 +08:00
parent 0f4ef051bf
commit e6989dc17c
2 changed files with 8 additions and 4 deletions
+5 -1
View File
@@ -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;
+3 -3
View File
@@ -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())