* Assign switcherObjectID, and all products are displayed only if multiple products exist.

This commit is contained in:
liumengyi
2023-12-23 10:50:38 +08:00
parent fc040326e5
commit 4899b3680a
2 changed files with 17 additions and 11 deletions
+6 -5
View File
@@ -609,11 +609,12 @@ class execution extends control
$this->executionZen->assignTestcaseVars($executionID, $productID, $branchID, $moduleID, $orderBy, $type, $pager);
$this->view->execution = $execution;
$this->view->productOption = $productOption;
$this->view->branchOption = $branchOption;
$this->view->switcherParams = "executionID={$executionID}&productID={$productID}&currentMethod=testcase";
$this->view->switcherText = isset($products[$productID]) ? $products[$productID]->name : $this->lang->product->all;
$this->view->execution = $execution;
$this->view->productOption = $productOption;
$this->view->branchOption = $branchOption;
$this->view->switcherParams = "executionID={$executionID}&productID={$productID}&currentMethod=testcase";
$this->view->switcherText = isset($products[$productID]) ? $products[$productID]->name : $this->lang->product->all;
$this->view->switcherObjectID = $productID;
$this->display();
}
+11 -6
View File
@@ -15,13 +15,18 @@ namespace zin;
* Define the grouped data list.
*/
$defaultItem = array();
$defaultItem['id'] = 0;
$defaultItem['text'] = $lang->product->all;
$defaultItem['active'] = $productID == 0;
$defaultItem['type'] = 'product';
$data = array('normal' => array(), 'closed' => array());
$data = array('normal' => array($defaultItem), 'closed' => array());
if(count($products) > 1)
{
$defaultItem = array();
$defaultItem['id'] = 0;
$defaultItem['text'] = $lang->product->all;
$defaultItem['active'] = $productID == 0;
$defaultItem['type'] = 'product';
$data['normal'][] = $defaultItem;
}
foreach($products as $product)
{