* Modify the code.

This commit is contained in:
tianshujie
2021-11-19 11:27:36 +08:00
parent 3045b1a234
commit 53a34f1546
3 changed files with 10 additions and 7 deletions
+5
View File
@@ -977,6 +977,11 @@ class testcase extends control
break;
}
}
if($this->app->tab == 'project') $productBranches = $this->loadModel('execution')->getBranchByProduct(array_keys($products), $this->session->project);
$this->view->products = $products;
$this->view->productBranches = isset($productBranches) ? $productBranches : $this->loadModel('branch')->getByProducts(array_keys($products), 'ignoreNormal');
}
// if(!$this->testcase->forceNotReview()) unset($this->lang->testcase->statusList['wait']); /* Bug#1343 */
+4 -6
View File
@@ -65,20 +65,18 @@
</tr>
</thead>
<tbody>
<?php $this->loadModel('branch');?>
<?php $this->loadModel('execution');?>
<?php foreach($caseIDList as $caseID):?>
<?php
if(!isset($cases[$caseID])) continue;
$caseBranch = isset($cases[$caseID]->branch) ? $cases[$caseID]->branch : 0;
if((!$productID and !$cases[$caseID]->lib) or $app->tab != 'qa')
{
$product = $this->product->getByID($cases[$caseID]->product);
$branches = array('' => '');
$caseProductID = $cases[$caseID]->product;
$product = $products[$caseProductID];
$branches = array('' => '');
if($product->type != 'normal')
{
if($this->app->tab == 'project') $productBranches = $this->execution->getBranchByProduct($product->id, $this->session->project);
$branches = isset($productBranches[$product->id]) ? $productBranches[$product->id] : $this->branch->getPairs($product->id);
$branches = isset($productBranches[$product->id]) ? $productBranches[$product->id] : array();
foreach($branches as $branchID => $branchName) $branches[$branchID] = '/' . $product->name . '/' . $branchName;
}
+1 -1
View File
@@ -172,7 +172,7 @@
<td>
<div class='input-group'>
<?php echo html::select('product', $products, $productID, "onchange='loadAll(this.value)' class='form-control chosen'");?>
<?php if(isset($product->type) and $product->type != 'normal') echo html::select('branch', $branches, $case->branch, "onchange='loadBranch();' class='form-control' style='width:65px'");?>
<?php if(isset($product->type) and $product->type != 'normal') echo html::select('branch', $branches, $case->branch, "onchange='loadBranch();' class='form-control'");?>
</div>
</td>
</tr>