diff --git a/module/automation/control.php b/module/automation/control.php index ca8db55b49..eb2ab35f21 100644 --- a/module/automation/control.php +++ b/module/automation/control.php @@ -44,7 +44,7 @@ class automation extends control /* Set menu. */ $productID = $this->product->saveState($productID, $this->products); if(empty($branch)) $branch = (int)$this->cookie->preBranch; - $this->loadModel('qa')->setMenu($this->products, $productID, $branch); + $this->loadModel('qa')->setMenu($productID, $branch); $this->view->title = $this->lang->automation->common; $this->display(); diff --git a/module/bug/control.php b/module/bug/control.php index 54b7ea2e18..05dbe63cf2 100755 --- a/module/bug/control.php +++ b/module/bug/control.php @@ -110,7 +110,7 @@ class bug extends control /* 设置1.5级导航相关信息。*/ /* Set the 1.5 nav. */ - $this->qa->setMenu($this->products, $productID, $branch); + $this->qa->setMenu($productID, $branch); /* 设置排序字段。*/ /* Set the order field. */ @@ -317,7 +317,7 @@ class bug extends control return $this->send(array('result' => 'success', 'message' => $message, 'closeModal' => true, 'load' => true)); } - $this->qa->setMenu($this->products, $oldBug->product, $oldBug->branch); + $this->qa->setMenu($oldBug->product, $oldBug->branch); /* 获取指派给的用户列表。*/ /* Get users that can be assigned to. */ @@ -375,7 +375,7 @@ class bug extends control return $this->bugZen->responseAfterOperate($bugID, array(), '', zget($kanbanData, 'regionID', 0), $message); } - $this->qa->setMenu($this->products, $oldBug->product, $oldBug->branch); + $this->qa->setMenu($oldBug->product, $oldBug->branch); /* 展示相关变量。 */ /* Show the variables associated. */ @@ -443,7 +443,7 @@ class bug extends control /* 设置菜单。 */ /* Set menu. */ - $this->qa->setMenu($this->products, $oldBug->product, $oldBug->branch); + $this->qa->setMenu($oldBug->product, $oldBug->branch); /* 展示相关变量。 */ /* Show the variables associated. */ @@ -503,7 +503,7 @@ class bug extends control } $productID = $oldBug->product; - $this->qa->setMenu($this->products, $productID, $oldBug->branch); + $this->qa->setMenu($productID, $oldBug->branch); /* 展示相关变量。 */ /* Show the variables associated. */ @@ -674,7 +674,7 @@ class bug extends control $project = $this->loadModel('project')->getByShadowProduct($productID); if(!empty($project) && !$project->multiple) unset($this->lang->bug->report->charts['bugsPerExecution']); - $this->qa->setMenu($this->products, $productID, $branchID); + $this->qa->setMenu($productID, $branchID); $this->view->title = $this->products[$productID] . $this->lang->colon . $this->lang->bug->common . $this->lang->colon . $this->lang->bug->reportChart; $this->view->productID = $productID; @@ -709,7 +709,7 @@ class bug extends control /* Check privilege of bug 所属执行的权限。*/ $this->bugZen->checkBugExecutionPriv($bug); - $this->qa->setMenu($this->products, $bug->product, $bug->branch); + $this->qa->setMenu($bug->product, $bug->branch); $this->bugZen->buildSearchFormForLinkBugs($bug, $excludeBugs, $queryID); @@ -782,7 +782,7 @@ class bug extends control /* 设置当前分支,并且设置导航。*/ /* Get branch and set menu. */ if($branch === '') $branch = (int)$this->cookie->preBranch; - $this->qa->setMenu($this->products, $productID, $branch); + $this->qa->setMenu($productID, $branch); /* 展示批量创建bug的相关变量。*/ /* Show the variables associated with the batch creation bugs. */ @@ -1262,7 +1262,7 @@ class bug extends control } - $this->qa->setMenu($this->products, $productID, $branch); + $this->qa->setMenu($productID, $branch); /* 展示关联的变量。 */ /* Show the variables associated. */ diff --git a/module/bug/zen.php b/module/bug/zen.php index 9e42f6a56a..85c69bd745 100644 --- a/module/bug/zen.php +++ b/module/bug/zen.php @@ -830,7 +830,7 @@ class bugZen extends bug } else { - $this->qa->setMenu($this->products, $productID, $branch); + $this->qa->setMenu($productID, $branch); } $this->view->users = $this->user->getPairs('devfirst|noclosed|nodeleted'); @@ -851,7 +851,7 @@ class bugZen extends bug { if($this->app->tab == 'project') $this->project->setMenu($bug->project); if($this->app->tab == 'execution') $this->execution->setMenu($bug->execution); - if($this->app->tab == 'qa') $this->qa->setMenu($this->products, $bug->product, $bug->branch); + if($this->app->tab == 'qa') $this->qa->setMenu($bug->product, $bug->branch); if($this->app->tab == 'devops') { session_write_close(); @@ -876,7 +876,7 @@ class bugZen extends bug { if($this->app->tab == 'project') $this->loadModel('project')->setMenu($bug->project); if($this->app->tab == 'execution') $this->loadModel('execution')->setMenu($bug->execution); - if($this->app->tab == 'qa') $this->qa->setMenu($this->products, $bug->product, $bug->branch); + if($this->app->tab == 'qa') $this->qa->setMenu($bug->product, $bug->branch); if($this->app->tab == 'devops') { @@ -1538,7 +1538,7 @@ class bugZen extends bug if($productID) { - $this->qa->setMenu($this->products, $productID, $branch); + $this->qa->setMenu($productID, $branch); $productIdList = array($productID => $productID); } diff --git a/module/caselib/model.php b/module/caselib/model.php index 2bd7e3fb39..b27d3f21ee 100644 --- a/module/caselib/model.php +++ b/module/caselib/model.php @@ -25,8 +25,8 @@ class caselibModel extends model { /* Set case lib menu. */ $products = $this->loadModel('product')->getPairs(); - if(!empty($products) and $this->session->product) $this->loadModel('qa')->setMenu($products, $this->session->product); - if(empty($products)) $this->loadModel('qa')->setMenu(array(0 => ''), 0); + if(!empty($products) and $this->session->product) $this->loadModel('qa')->setMenu($this->session->product); + if(empty($products)) $this->loadModel('qa')->setMenu(); $this->lang->qa->menu->caselib['subModule'] .= ',testcase'; diff --git a/module/product/zen.php b/module/product/zen.php index 536573c67f..d2ea146b33 100644 --- a/module/product/zen.php +++ b/module/product/zen.php @@ -143,7 +143,7 @@ class productZen extends product */ private function setShowErrorNoneMenu4QA(string $activeMenu) { - $this->loadModel('qa')->setMenu(array(), 0); + $this->loadModel('qa')->setMenu(); $this->view->moduleName = 'qa'; $this->app->rawModule = $activeMenu; diff --git a/module/qa/control.php b/module/qa/control.php index 62c7389c8d..ade534881b 100644 --- a/module/qa/control.php +++ b/module/qa/control.php @@ -29,7 +29,7 @@ class qa extends control $productID = $this->product->saveState($productID, $products); $branch = (int)$this->cookie->preBranch; - $this->qa->setMenu($products, $productID, $branch); + $this->qa->setMenu($productID, $branch); $this->view->title = $this->lang->qa->index; $this->view->products = $products; diff --git a/module/qa/model.php b/module/qa/model.php index 39a03e9a86..5a5f519787 100644 --- a/module/qa/model.php +++ b/module/qa/model.php @@ -19,7 +19,7 @@ class qaModel extends model * @access public * @return void */ - public function setMenu(int $productID, int|string $branch = '') + public function setMenu(int $productID = 0, int|string $branch = '') { if(!$this->app->user->admin and strpos(",{$this->app->user->view->products},", ",$productID,") === false and $productID != 0 and !commonModel::isTutorialMode()) { diff --git a/module/story/control.php b/module/story/control.php index cd8cfeb725..7e7127db5f 100755 --- a/module/story/control.php +++ b/module/story/control.php @@ -225,8 +225,7 @@ class story extends control } elseif($this->app->tab == 'qa') { - $products = $this->product->getProductPairsByProject(0, 'noclosed'); - $this->loadModel('qa')->setMenu($products, $story->product); + $this->loadModel('qa')->setMenu($story->product); } else { diff --git a/module/story/zen.php b/module/story/zen.php index 2d59548354..48d294f8b8 100644 --- a/module/story/zen.php +++ b/module/story/zen.php @@ -158,7 +158,7 @@ class storyZen extends story if($this->app->tab == 'qa') { - $this->loadModel('qa')->setMenu('', $productID); + $this->loadModel('qa')->setMenu($productID); return; } diff --git a/module/testcase/control.php b/module/testcase/control.php index cf6e9439f5..e38a9d2c43 100644 --- a/module/testcase/control.php +++ b/module/testcase/control.php @@ -187,7 +187,7 @@ class testcase extends control $this->loadModel('qa'); $this->app->rawModule = 'testcase'; foreach($this->config->qa->menuList as $module) $this->lang->navGroup->$module = 'qa'; - $this->qa->setMenu($products, $productID, $branchID); + $this->qa->setMenu($productID, $branchID); } /* 设置 分页。*/ diff --git a/module/testcase/model.php b/module/testcase/model.php index ca7c83df82..0d755409a3 100644 --- a/module/testcase/model.php +++ b/module/testcase/model.php @@ -27,7 +27,7 @@ class testcaseModel extends model */ public function setMenu($products, $productID, $branch = 0, $moduleID = 0, $suiteID = 0, $orderBy = 'id_desc') { - $this->loadModel('qa')->setMenu($products, $productID, $branch, $moduleID, 'case'); + $this->loadModel('qa')->setMenu($productID, $branch); } /** diff --git a/module/testcase/zen.php b/module/testcase/zen.php index 1022fe4278..e5464fdbaf 100644 --- a/module/testcase/zen.php +++ b/module/testcase/zen.php @@ -92,7 +92,7 @@ class testcaseZen extends testcase } else { - $this->qa->setMenu($this->products, $productID, $branch, $browseType); + $this->qa->setMenu($productID, $branch); } } diff --git a/module/testreport/control.php b/module/testreport/control.php index acc1633be5..185ed86893 100644 --- a/module/testreport/control.php +++ b/module/testreport/control.php @@ -262,7 +262,7 @@ class testreport extends control if($this->app->tab == 'qa') { $productID = $this->product->saveState(key($productIdList), $this->products); - $this->loadModel('qa')->setMenu($this->products, $productID); + $this->loadModel('qa')->setMenu($productID); } elseif($this->app->tab == 'project') { @@ -602,7 +602,7 @@ class testreport extends control if($objectType == 'product') { $productID = $this->product->saveState($objectID, $this->products); - $this->loadModel('qa')->setMenu($this->products, $productID); + $this->loadModel('qa')->setMenu($productID); return $productID; } elseif($objectType == 'execution') diff --git a/module/testsuite/control.php b/module/testsuite/control.php index ca8b068a3a..dc619abc8a 100644 --- a/module/testsuite/control.php +++ b/module/testsuite/control.php @@ -77,7 +77,7 @@ class testsuite extends control /* 设置1.5级导航。 */ /* Set level 1.5 navigation */ $productID = $this->product->saveState($productID, $this->products); - $this->loadModel('qa')->setMenu($this->products, $productID); + $this->loadModel('qa')->setMenu($productID); /* 初始化分页。 */ /* Load pager. */ @@ -146,7 +146,7 @@ class testsuite extends control /* 设置1.5级导航。 */ /* Set level 1.5 navigation */ $productID = $this->product->saveState($productID, $this->products); - $this->loadModel('qa')->setMenu($this->products, $productID); + $this->loadModel('qa')->setMenu($productID); $this->view->title = $this->products[$productID] . $this->lang->colon . $this->lang->testsuite->create; $this->view->productID = $productID; @@ -174,7 +174,7 @@ class testsuite extends control /* 设置1.5级导航。 */ /* Set level 1.5 navigation */ $productID = $this->product->saveState($suite->product, $this->products); - $this->loadModel('qa')->setMenu($this->products, $productID); + $this->loadModel('qa')->setMenu($productID); /* 当前URI存入session。 */ /* Sava the uri of current page into session. */ @@ -241,7 +241,7 @@ class testsuite extends control /* 设置1.5级导航。 */ /* Set level 1.5 navigation */ $productID = $this->product->saveState($suite->product, $this->products); - $this->loadModel('qa')->setMenu($this->products, $productID); + $this->loadModel('qa')->setMenu($productID); $this->view->title = $this->products[$productID] . $this->lang->colon . $this->lang->testsuite->edit; $this->view->suite = $suite; @@ -302,7 +302,7 @@ class testsuite extends control /* 设置1.5级导航。 */ /* Set level 1.5 navigation */ $productID = $this->product->saveState($suite->product, $this->products); - $this->loadModel('qa')->setMenu($this->products, $productID); + $this->loadModel('qa')->setMenu($productID); /* 初始化分页。 */ /* Load pager. */ diff --git a/module/testtask/control.php b/module/testtask/control.php index 3a77c9309e..d08b3e978b 100644 --- a/module/testtask/control.php +++ b/module/testtask/control.php @@ -88,7 +88,7 @@ class testtask extends control $products = $this->testtaskZen->getProducts(); $productID = $this->loadModel('product')->saveState($productID, $products); $branch = ($this->cookie->preBranch !== '' and $branch === '') ? $this->cookie->preBranch : $branch; - $this->loadModel('qa')->setMenu($products, $productID, $branch, $type); + $this->loadModel('qa')->setMenu($productID, $branch); $this->session->set('branch', $branch, 'qa'); /* Load pager. */ @@ -179,7 +179,7 @@ class testtask extends control } else { - $this->loadModel('qa')->setMenu($products, $productID); + $this->loadModel('qa')->setMenu($productID); $this->app->rawModule = 'testcase'; } @@ -272,7 +272,7 @@ class testtask extends control $productID = $this->loadModel('product')->saveState($productID, $products); 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->loadModel('qa')->setMenu($products, $productID); + if($this->app->tab == 'qa') $this->loadModel('qa')->setMenu($productID); $this->view->title = $products[$productID] . $this->lang->colon . $this->lang->testtask->create; $this->view->product = $this->product->getByID($productID); @@ -324,7 +324,7 @@ class testtask extends control $this->loadModel('execution')->setMenu($testtask->execution); $this->lang->modulePageNav = $this->testtask->select($productID, $testtaskID, 'execution', $testtask->execution); } - if($this->app->tab == 'qa') $this->testtask->setMenu($products, $productID, $testtask->branch, $testtaskID); + if($this->app->tab == 'qa') $this->qa->setMenu($productID, $testtask->branch); $this->executeHooks($testtaskID); // 执行工作流配置的扩展动作。 @@ -362,7 +362,7 @@ class testtask extends control } else { - $this->loadModel('qa')->setMenu($products, $productID); + $this->loadModel('qa')->setMenu($productID); $this->app->rawModule = 'testcase'; } @@ -451,7 +451,7 @@ class testtask extends control } else { - $this->testtask->setMenu($products, $productID, $testtask->branch, $testtaskID); + $this->qa->setMenu($productID, $testtask->branch); } /* set cookie. */ @@ -580,7 +580,7 @@ class testtask extends control } else { - $this->testtask->setMenu($this->products, $productID, $branchID, $taskID); + $this->qa->setMenu($productID, $branchID); } unset($this->lang->testtask->report->charts['bugStageGroups']); unset($this->lang->testtask->report->charts['bugHandleGroups']); @@ -644,7 +644,7 @@ class testtask extends control } else { - $this->testtask->setMenu($this->products, $productID, $task->branch, $taskID); + $this->qa->setMenu($productID, $task->branch); } /* Determines whether an object is editable. */ @@ -774,7 +774,7 @@ class testtask extends control $productID = $this->product->saveState($testtask->product, $this->products); /* Set menu. */ - $this->loadModel('qa')->setMenu($this->products, $productID, $testtask->branch, $taskID); + $this->loadModel('qa')->setMenu($productID, $testtask->branch); $this->view->title = $testtask->name . $this->lang->colon . $this->lang->testtask->start; $this->view->actions = $this->loadModel('action')->getList('testtask', $taskID); @@ -810,7 +810,7 @@ class testtask extends control $productID = $this->product->saveState((int)$testtask->product, $this->products); /* Set menu. */ - $this->loadModel('qa')->setMenu($this->products, $productID, (string)$testtask->branch, $taskID); + $this->loadModel('qa')->setMenu($productID, $testtask->branch); $this->view->title = $testtask->name . $this->lang->colon . $this->lang->close; $this->view->actions = $this->loadModel('action')->getList('testtask', $taskID); @@ -847,7 +847,7 @@ class testtask extends control $productID = $this->product->saveState($testtask->product, $this->products); /* Set menu. */ - $this->loadModel('qa')->setMenu($this->products, $productID, $testtask->branch, $taskID); + $this->loadModel('qa')->setMenu($productID, $testtask->branch); $this->view->title = $testtask->name . $this->lang->colon . $this->lang->testtask->block; $this->view->actions = $this->loadModel('action')->getList('testtask', $taskID); @@ -883,7 +883,7 @@ class testtask extends control $productID = $this->product->saveState($testtask->product, $this->products); /* Set menu. */ - $this->loadModel('qa')->setMenu($this->products, $productID, $testtask->branch, $taskID); + $this->loadModel('qa')->setMenu($productID, $testtask->branch); $this->view->title = $testtask->name . $this->lang->colon . $this->lang->testtask->activate; $this->view->actions = $this->loadModel('action')->getList('testtask', $taskID); @@ -963,7 +963,7 @@ class testtask extends control } else { - $this->testtask->setMenu($this->products, $productID, $task->branch, $taskID); + $this->qa->setMenu($productID, $task->branch); } /* Load pager. */ @@ -1212,7 +1212,7 @@ class testtask extends control } else { - $this->loadModel('qa')->setMenu($this->products, $productID, $taskID); + $this->loadModel('qa')->setMenu($productID); } $cases = $this->dao->select('*')->from(TABLE_CASE)->where('id')->in($caseIdList)->fetchAll('id'); @@ -1383,7 +1383,7 @@ class testtask extends control } else { - $this->loadModel('qa')->setMenu($this->products, $productID); + $this->loadModel('qa')->setMenu($productID); $this->app->rawModule = 'testcase'; } diff --git a/module/tree/control.php b/module/tree/control.php index bf640cf507..5cf932e883 100644 --- a/module/tree/control.php +++ b/module/tree/control.php @@ -36,8 +36,7 @@ class tree extends control } elseif($this->app->tab == 'qa' and $viewType != 'caselib') { - $products = $this->product->getPairs('noclosed'); - $this->loadModel('qa')->setMenu($products, $rootID, $branch, $viewType); + $this->loadModel('qa')->setMenu($rootID, $branch); } elseif($this->app->tab == 'project' and strpos($viewType, 'doc') === false) {