diff --git a/module/testcase/control.php b/module/testcase/control.php index 647fb1dcce..5eb51673a9 100644 --- a/module/testcase/control.php +++ b/module/testcase/control.php @@ -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 */ diff --git a/module/testcase/view/batchedit.html.php b/module/testcase/view/batchedit.html.php index 7377e5c5e8..df5fb6538d 100644 --- a/module/testcase/view/batchedit.html.php +++ b/module/testcase/view/batchedit.html.php @@ -65,20 +65,18 @@ - loadModel('branch');?> - loadModel('execution');?> 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; } diff --git a/module/testcase/view/edit.html.php b/module/testcase/view/edit.html.php index 72d273f5ec..85d6a14665 100644 --- a/module/testcase/view/edit.html.php +++ b/module/testcase/view/edit.html.php @@ -172,7 +172,7 @@
- type) and $product->type != 'normal') echo html::select('branch', $branches, $case->branch, "onchange='loadBranch();' class='form-control' style='width:65px'");?> + type) and $product->type != 'normal') echo html::select('branch', $branches, $case->branch, "onchange='loadBranch();' class='form-control'");?>