*Finish task #46100.

This commit is contained in:
songchenxuan
2021-12-22 08:50:10 +08:00
parent 434e7fb369
commit 35a4af824f
2 changed files with 14 additions and 10 deletions
+10 -6
View File
@@ -669,15 +669,18 @@ class story extends control
if($this->app->tab == 'project' or $this->app->tab == 'execution')
{
$objectID = $this->app->tab == 'project' ? $this->session->project : $this->session->execution;
$productBranches = $product->type != 'normal' ? $this->loadModel('execution')->getBranchByProduct($story->product, $objectID, 'all') : array();
$branches = isset($productBranches[$story->product]) ? array(BRANCH_MAIN => $this->lang->branch->main) + $productBranches[$story->product] : array();
$products = $this->product->getProductPairsByProject($objectID);
$this->view->objectID = $objectID;
}
else
/* Display status of branch. */
$branches = $this->loadModel('branch')->getList($product->id, isset($objectID) ? $objectID : 0, 'all');
$branchOption = array();
$branchTagOption = array();
foreach($branches as $branchInfo)
{
$branches = $product->type != 'normal' ? $this->loadModel('branch')->getPairs($product->id) : array();
$branchOption[$branchInfo->id] = $branchInfo->name;
$branchTagOption[$branchInfo->id] = $branchInfo->name . ($branchInfo->status == 'closed' ? ' (' . $this->lang->branch->statusList['closed'] . ')' : '');
}
/* Get product reviewers. */
@@ -694,7 +697,8 @@ class story extends control
$this->view->product = $product;
$this->view->plans = $this->loadModel('productplan')->getPairsForStory($story->product, $story->branch, 'skipParent');
$this->view->products = $products;
$this->view->branches = $branches;
$this->view->branchOption = $branchOption;
$this->view->branchTagOption = $branchTagOption;
$this->view->reviewers = implode(',', $reviewerList);
$this->view->reviewedReviewer = $reviewedReviewer;
$this->view->productReviewers = $this->user->getPairs('noclosed|nodeleted', $reviewerList, 0, $productReviewers);
+4 -4
View File
@@ -83,7 +83,7 @@
<div class='input-group'>
<?php echo html::select('product', $products, $story->product, "onchange='loadProduct(this.value);' class='form-control chosen control-product'");?>
<span class='input-group-addon fix-border fix-padding'></span>
<?php if($product->type != 'normal') echo html::select('branch', $branches, $story->branch, "onchange='loadBranch();' class='form-control chosen control-branch'");?>
<?php if($product->type != 'normal') echo html::select('branch', $branchTagOption, $story->branch, "onchange='loadBranch();' class='form-control chosen control-branch'");?>
</div>
</td>
</tr>
@@ -91,7 +91,7 @@
<tr>
<th class='thWidth'><?php echo $lang->product->branch = sprintf($lang->product->branch, $lang->product->branchName['branch']);?></th>
<td>
<div class='input-group'><?php if($product->type != 'normal') echo html::select('branch', $branches, $story->branch, "onchange='loadBranch();' class='form-control chosen control-branch'");?></div>
<div class='input-group'><?php if($product->type != 'normal') echo html::select('branch', $branchTagOption, $story->branch, "onchange='loadBranch();' class='form-control chosen control-branch'");?></div>
</td>
</tr>
<?php endif;?>
@@ -157,11 +157,11 @@
<th><?php echo $lang->story->stage;?></th>
<td>
<?php
if($story->stages and $branches)
if($story->stages and $branchTagOption)
{
foreach($story->stages as $branch => $stage)
{
if(isset($branches[$branch])) echo '<p>' . $branches[$branch] . html::select("stages[$branch]", $lang->story->stageList, $stage, "class='form-control chosen'") . '</p>';
if(isset($branchTagOption[$branch])) echo '<p>' . $branchTagOption[$branch] . html::select("stages[$branch]", $lang->story->stageList, $stage, "class='form-control chosen'") . '</p>';
}
}
else