From ea086296b0cec9083dc11a565c247b314ecaa9cc Mon Sep 17 00:00:00 2001 From: leiyong <1549684884@qq.com> Date: Mon, 22 Mar 2021 23:53:00 +0800 Subject: [PATCH] * Adjsut QA menu. --- module/bug/control.php | 4 +- module/caselib/control.php | 3 +- module/caselib/view/view.html.php | 2 +- module/common/lang/menu.php | 14 ++--- module/product/control.php | 6 +- module/product/model.php | 2 +- module/story/control.php | 21 +++---- module/story/view/change.html.php | 2 +- module/story/view/close.html.php | 2 +- module/story/view/edit.html.php | 2 +- module/story/view/zerocase.html.php | 10 ++-- module/testcase/control.php | 2 - module/testcase/view/browse.html.php | 2 +- module/testreport/control.php | 2 +- module/testsuite/control.php | 51 +++++++--------- module/testtask/control.php | 6 +- module/testtask/view/browse.html.php | 2 +- .../testtask/view/importunitresult.html.php | 6 ++ module/tree/control.php | 58 +++---------------- 19 files changed, 77 insertions(+), 120 deletions(-) diff --git a/module/bug/control.php b/module/bug/control.php index 1eb6faac46..721969b22d 100644 --- a/module/bug/control.php +++ b/module/bug/control.php @@ -124,8 +124,8 @@ class bug extends control $moduleID = ($browseType == 'bymodule') ? (int)$param : (($browseType == 'bysearch' or $browseType == 'bybranch') ? 0 : ($this->cookie->bugModule ? $this->cookie->bugModule : 0)); $queryID = ($browseType == 'bysearch') ? (int)$param : 0; - /* Set menu and save session. */ - $this->session->set('bugList', $this->app->getURI(true)); + /* Set session. */ + $this->session->set('bugList', $this->app->getURI(true), 'qa'); /* Set moduleTree. */ if($browseType == '') diff --git a/module/caselib/control.php b/module/caselib/control.php index a9f43d5ad3..fa8af8e01e 100644 --- a/module/caselib/control.php +++ b/module/caselib/control.php @@ -195,7 +195,8 @@ class caselib extends control if(empty($libraries)) $this->locate(inlink('create')); /* Save session. */ - $this->session->set('caseList', $this->app->getURI(true)); + $this->session->set('caseList', $this->app->getURI(true), 'qa'); + $this->session->set('caselibList', $this->app->getURI(true), 'qa'); /* Set menu. */ $libID = $this->caselib->saveLibState($libID, $libraries); diff --git a/module/caselib/view/view.html.php b/module/caselib/view/view.html.php index a2f5669ebc..1d3b1dc160 100644 --- a/module/caselib/view/view.html.php +++ b/module/caselib/view/view.html.php @@ -13,7 +13,7 @@ + diff --git a/module/tree/control.php b/module/tree/control.php index 8892b6a224..9548ef4d41 100644 --- a/module/tree/control.php +++ b/module/tree/control.php @@ -95,23 +95,9 @@ class tree extends control } elseif($viewType == 'bug') { - $this->lang->navGroup->tree = 'qa'; - $productPairs = array(); - if($from == 'project') - { - $this->lang->navGroup->tree = 'project'; - $productPairs = $this->product->getProductPairsByProject($this->session->project); - } - elseif($from == 'qa') - { - $this->app->loadConfig('qa'); - foreach($this->config->qa->menuList as $module) $this->lang->navGroup->$module = 'qa'; - $productPairs = $this->product->getPairs(); - } - - $this->loadModel('bug')->setMenu($productPairs, $rootID); - $this->lang->tree->menu = $this->lang->bug->menu; - $this->lang->tree->menuOrder = $this->lang->bug->menuOrder; + $this->app->loadConfig('qa'); + foreach($this->config->qa->menuList as $module) $this->lang->navGroup->$module = 'qa'; + $this->app->rawModule = 'bug'; $title = $this->lang->tree->manageBug; $position[] = html::a($this->createLink('bug', 'browse', "product=$rootID"), $product->name); @@ -130,25 +116,9 @@ class tree extends control } elseif($viewType == 'case') { - $this->lang->navGroup->tree = 'qa'; - - $productPairs = array(); - if($from == 'project') - { - $this->lang->navGroup->tree = 'project'; - $productPairs = $this->product->getProductPairsByProject($this->session->project); - } - elseif($from == 'qa') - { - $this->lang->navGroup->tree = 'qa'; - $this->app->loadConfig('qa'); - foreach($this->config->qa->menuList as $module) $this->lang->navGroup->$module = 'qa'; - $productPairs = $this->product->getPairs(); - } - - $this->loadModel('testcase')->setMenu($productPairs, $rootID); - $this->lang->tree->menu = $this->lang->testcase->menu; - $this->lang->tree->menuOrder = $this->lang->testcase->menuOrder; + $this->app->loadConfig('qa'); + foreach($this->config->qa->menuList as $module) $this->lang->navGroup->$module = 'qa'; + $this->app->rawModule = 'testcase'; $title = $this->lang->tree->manageCase; $position[] = html::a($this->createLink('testcase', 'browse', "product=$rootID"), $product->name); @@ -156,21 +126,11 @@ class tree extends control } elseif($viewType == 'caselib') { - $this->lang->navGroup->tree = 'qa'; - if($from == 'project') - { - $this->lang->navGroup->tree = 'project'; - } - elseif($from == 'qa') - { - $this->lang->navGroup->tree = 'qa'; - $this->app->loadConfig('qa'); - foreach($this->config->qa->menuList as $module) $this->lang->navGroup->$module = 'qa'; - } + $this->app->loadConfig('qa'); + foreach($this->config->qa->menuList as $module) $this->lang->navGroup->$module = 'qa'; $this->caselib->setLibMenu($this->caselib->getLibraries(), $rootID); - $this->lang->tree->menu = $this->lang->caselib->menu; - $this->lang->tree->menuOrder = $this->lang->caselib->menuOrder; + $this->app->rawModule = 'caselib'; $title = $this->lang->tree->manageCaseLib; $position[] = html::a($this->createLink('caselib', 'browse', "libID=$rootID"), $lib->name);