diff --git a/module/build/control.php b/module/build/control.php index 4dd0b32a2f..4433ef29cf 100644 --- a/module/build/control.php +++ b/module/build/control.php @@ -169,29 +169,23 @@ class build extends control $productGroups[$build->product] = $product; } - $branchGroups = $this->loadModel('project')->getBranchesByProject($build->execution); - $branchPairs = $this->loadModel('branch')->getPairs($build->product); - $products = array(); - $branches = array(); - - /* Set branches and products. */ - if($productGroups[$build->product]->type != 'normal' and isset($branchGroups[$build->product])) + /* Display status of branch. */ + $branches = $this->loadModel('branch')->getList($build->product, $build->execution, 'all'); + $branchTagOption = array(); + foreach($branches as $branchInfo) { - foreach($branchGroups[$build->product] as $branchID => $branch) - { - $branches[$branchID] = $branchPairs[$branchID]; - } + $branchTagOption[$branchInfo->id] = $branchInfo->name . ($branchInfo->status == 'closed' ? ' (' . $this->lang->branch->statusList['closed'] . ')' : ''); } foreach($productGroups as $product) $products[$product->id] = $product->name; - $this->view->title = $execution->name . $this->lang->colon . $this->lang->build->edit; - $this->view->position[] = html::a($this->createLink('execution', 'task', "executionID=$build->execution"), $execution->name); - $this->view->position[] = $this->lang->build->edit; - $this->view->product = isset($productGroups[$build->product]) ? $productGroups[$build->product] : ''; - $this->view->branches = $branches; - $this->view->executions = $executions; - $this->view->orderBy = $orderBy; + $this->view->title = $execution->name . $this->lang->colon . $this->lang->build->edit; + $this->view->position[] = html::a($this->createLink('execution', 'task', "executionID=$build->execution"), $execution->name); + $this->view->position[] = $this->lang->build->edit; + $this->view->product = isset($productGroups[$build->product]) ? $productGroups[$build->product] : ''; + $this->view->branchTagOption = $branchTagOption; + $this->view->executions = $executions; + $this->view->orderBy = $orderBy; $this->view->productGroups = $productGroups; $this->view->products = $products; diff --git a/module/build/view/edit.html.php b/module/build/view/edit.html.php index 1426cbe396..7745491568 100644 --- a/module/build/view/edit.html.php +++ b/module/build/view/edit.html.php @@ -35,7 +35,7 @@ productType != 'normal') { - echo "" . html::select('branch', $branches, $build->branch, "class='form-control chosen' $disabled"); + echo "" . html::select('branch', $branchTagOption, $build->branch, "class='form-control chosen' $disabled"); } ?> diff --git a/module/productplan/view/view.html.php b/module/productplan/view/view.html.php index 142eaa38fc..295a0f78e3 100644 --- a/module/productplan/view/view.html.php +++ b/module/productplan/view/view.html.php @@ -27,7 +27,7 @@