*Finish task #46100.

This commit is contained in:
songchenxuan
2021-12-23 09:29:34 +08:00
parent 055df23f69
commit c0e1f91e9a
3 changed files with 14 additions and 20 deletions
+12 -18
View File
@@ -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;
+1 -1
View File
@@ -35,7 +35,7 @@
<?php
if($build->productType != 'normal')
{
echo "<span class='input-group-addon fix-padding fix-border'></span>" . html::select('branch', $branches, $build->branch, "class='form-control chosen' $disabled");
echo "<span class='input-group-addon fix-padding fix-border'></span>" . html::select('branch', $branchTagOption, $build->branch, "class='form-control chosen' $disabled");
}
?>
</div>
+1 -1
View File
@@ -27,7 +27,7 @@
<div class='page-title'>
<span class='label label-id'><?php echo $plan->id;?></span>
<span title='<?php echo $plan->title;?>' class='text'><?php echo $plan->title;?></span>
<?php if($product->type !== 'normal') echo "<span title='{$lang->product->branchName[$product->type]}' class='label label-branch label-badge'>" . $branches[$branch] . '</span>';?>
<?php if($product->type !== 'normal') echo "<span title='{$lang->product->branchName[$product->type]}' class='label label-branch label-badge'>" . $branchOption[$branch] . '</span>';?>
<span class='label label-info label-badge'>
<?php echo ($plan->begin == '2030-01-01' || $plan->end == '2030-01-01') ? $lang->productplan->future : $plan->begin . '~' . $plan->end;?>
</span>