* Refactor testcaseModel::setMenu.
This commit is contained in:
@@ -137,7 +137,7 @@ class testcase extends control
|
||||
/* 设置菜单。 */
|
||||
/* Set menu. */
|
||||
if($this->app->tab == 'project') $this->loadModel('project')->setMenu((int)$this->session->project);
|
||||
if($this->app->tab == 'qa') $this->testcase->setMenu($this->products, $productID, $branch);
|
||||
if($this->app->tab == 'qa') $this->testcase->setMenu($productID, $branch);
|
||||
|
||||
/* 展示变量. */
|
||||
/* Show the variables. */
|
||||
@@ -322,7 +322,7 @@ class testcase extends control
|
||||
|
||||
/* 设置菜单。 */
|
||||
/* Set menu. */
|
||||
$this->app->tab == 'project' ? $this->loadModel('project')->setMenu($this->session->project) : $this->testcase->setMenu($this->products, $productID, $branch);
|
||||
$this->app->tab == 'project' ? $this->loadModel('project')->setMenu($this->session->project) : $this->testcase->setMenu($productID, $branch);
|
||||
|
||||
/* 指派产品、分支、需求、自定义字段等变量. */
|
||||
/* Assign the variables about product, branches, story and custom fields. */
|
||||
@@ -741,7 +741,7 @@ class testcase extends control
|
||||
|
||||
/* 设置导航。*/
|
||||
/* Set menu. */
|
||||
$this->testcase->setMenu($this->products, $case->product, $case->branch);
|
||||
$this->testcase->setMenu($case->product, $case->branch);
|
||||
|
||||
/* 构建搜索表单。*/
|
||||
/* Build the search form. */
|
||||
@@ -1139,7 +1139,7 @@ class testcase extends control
|
||||
|
||||
/* 设置菜单。 */
|
||||
/* Set menu. */
|
||||
$this->app->tab == 'project' ? $this->loadModel('project')->setMenu($this->session->project) : $this->testcase->setMenu($this->products, $productID, $branch);
|
||||
$this->app->tab == 'project' ? $this->loadModel('project')->setMenu($this->session->project) : $this->testcase->setMenu($productID, $branch);
|
||||
|
||||
$browseType = strtolower($browseType);
|
||||
|
||||
@@ -1191,7 +1191,7 @@ class testcase extends control
|
||||
return $this->testcaseZen->responseAfterShowImport($productID, $branch, $maxImport, $tmpFile);
|
||||
}
|
||||
|
||||
$this->app->tab == 'project' ? $this->loadModel('project')->setMenu($this->session->project) : $this->testcase->setMenu($this->products, $productID, $branch);
|
||||
$this->app->tab == 'project' ? $this->loadModel('project')->setMenu($this->session->project) : $this->testcase->setMenu($productID, $branch);
|
||||
|
||||
/* Get imported data. */
|
||||
if(!empty($maxImport) && file_exists($tmpFile))
|
||||
@@ -1755,7 +1755,7 @@ class testcase extends control
|
||||
|
||||
/* Set menu. */
|
||||
if($this->app->tab == 'project') $this->loadModel('project')->setMenu(null);
|
||||
if($this->app->tab == 'qa') $this->testcase->setMenu($this->products, $productID, $branch);
|
||||
if($this->app->tab == 'qa') $this->testcase->setMenu($productID, $branch);
|
||||
|
||||
$product = $this->product->getByID($productID);
|
||||
$branches = (isset($product->type) && $product->type != 'normal') ? $this->loadModel('branch')->getPairs($productID, 'active') : array();
|
||||
|
||||
@@ -15,18 +15,15 @@ declare(strict_types=1);
|
||||
class testcaseModel extends model
|
||||
{
|
||||
/**
|
||||
* 设置菜单。
|
||||
* Set menu.
|
||||
*
|
||||
* @param array $products
|
||||
* @param int $productID
|
||||
* @param int $branch
|
||||
* @param int $moduleID
|
||||
* @param int $suiteID
|
||||
* @param string $orderBy
|
||||
* @param int $productID
|
||||
* @param int|string $branch
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function setMenu($products, $productID, $branch = 0, $moduleID = 0, $suiteID = 0, $orderBy = 'id_desc')
|
||||
public function setMenu(int $productID, int|string $branch = 0): void
|
||||
{
|
||||
$this->loadModel('qa')->setMenu($productID, $branch);
|
||||
}
|
||||
|
||||
@@ -111,7 +111,7 @@ class testcaseZen extends testcase
|
||||
{
|
||||
if($this->app->tab == 'project') $this->loadModel('project')->setMenu($projectID);
|
||||
if($this->app->tab == 'execution') $this->loadModel('execution')->setMenu($executionID);
|
||||
if($this->app->tab == 'qa') $this->testcase->setMenu($this->products, $productID, $branch);
|
||||
if($this->app->tab == 'qa') $this->testcase->setMenu($productID, $branch);
|
||||
|
||||
$this->view->projectID = $projectID;
|
||||
$this->view->executionID = $executionID;
|
||||
@@ -767,7 +767,7 @@ class testcaseZen extends testcase
|
||||
$this->view->executionID = $executionID;
|
||||
}
|
||||
|
||||
if($this->app->tab == 'qa') $this->testcase->setMenu($this->products, $case->product, $case->branch);
|
||||
if($this->app->tab == 'qa') $this->testcase->setMenu($case->product, $case->branch);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user