From 447ea11570817ae58428ccc0496f7836df15f603 Mon Sep 17 00:00:00 2001 From: holan20180123 <56391770@qq.com> Date: Wed, 24 Mar 2021 14:37:36 +0800 Subject: [PATCH] * Adjust session. --- module/release/control.php | 10 ++++----- module/repo/control.php | 4 ++-- module/repo/model.php | 4 ++-- module/search/control.php | 38 +++++++++++++++++------------------ module/story/control.php | 11 +++++----- module/testcase/control.php | 4 ++-- module/testreport/control.php | 4 ++-- module/testsuite/control.php | 6 +++--- module/testtask/control.php | 8 ++++---- module/todo/control.php | 8 ++++++-- 10 files changed, 50 insertions(+), 47 deletions(-) diff --git a/module/release/control.php b/module/release/control.php index 4e23cf9da1..e467e81236 100644 --- a/module/release/control.php +++ b/module/release/control.php @@ -43,7 +43,7 @@ class release extends control public function browse($productID, $branch = 0, $type = 'all') { $this->commonAction($productID, $branch); - $this->session->set('releaseList', $this->app->getURI(true)); + $this->session->set('releaseList', $this->app->getURI(true), 'product'); $this->view->title = $this->view->product->name . $this->lang->colon . $this->lang->release->browse; $this->view->position[] = $this->lang->release->browse; @@ -149,8 +149,8 @@ class release extends control $release = $this->release->getByID((int)$releaseID, true); if(!$release) die(js::error($this->lang->notFound) . js::locate('back')); - if($type == 'story') $this->session->set('storyList', $this->app->getURI(true)); - if($type == 'bug' or $type == 'leftBug') $this->session->set('bugList', $this->app->getURI(true)); + if($type == 'story') $this->session->set('storyList', $this->app->getURI(true), 'product'); + if($type == 'bug' or $type == 'leftBug') $this->session->set('bugList', $this->app->getURI(true), 'qa'); $this->loadModel('story'); $this->loadModel('bug'); @@ -380,7 +380,7 @@ class release extends control $this->release->linkStory($releaseID); die(js::locate(inlink('view', "releaseID=$releaseID&type=story"), 'parent')); } - $this->session->set('storyList', inlink('view', "releaseID=$releaseID&type=story&link=true¶m=" . helper::safe64Encode("&browseType=$browseType&queryID=$param"))); + $this->session->set('storyList', inlink('view', "releaseID=$releaseID&type=story&link=true¶m=" . helper::safe64Encode("&browseType=$browseType&queryID=$param")), 'product'); $release = $this->release->getById($releaseID); $build = $this->loadModel('build')->getByID($release->build); @@ -500,7 +500,7 @@ class release extends control die(js::locate(inlink('view', "releaseID=$releaseID&type=$type"), 'parent')); } - $this->session->set('bugList', inlink('view', "releaseID=$releaseID&type=$type&link=true¶m=" . helper::safe64Encode("&browseType=$browseType&queryID=$param"))); + $this->session->set('bugList', inlink('view', "releaseID=$releaseID&type=$type&link=true¶m=" . helper::safe64Encode("&browseType=$browseType&queryID=$param")), 'qa'); /* Set menu. */ $release = $this->release->getByID($releaseID); $build = $this->loadModel('build')->getByID($release->build); diff --git a/module/repo/control.php b/module/repo/control.php index aae41380ec..85d0845cf5 100644 --- a/module/repo/control.php +++ b/module/repo/control.php @@ -95,7 +95,7 @@ class repo extends control $this->view->orderBy = $orderBy; $this->view->objectID = $objectID; $this->view->pager = $pager; - $this->view->repoList = empty($repoList) ? $repoList: $repoList[$pageID - 1];; + $this->view->repoList = empty($repoList) ? $repoList: $repoList[$pageID - 1];; $this->view->products = $this->loadModel('product')->getPairs(); $this->display(); @@ -501,7 +501,7 @@ class repo extends control $repo = $this->repo->getRepoByID($repoID); /* Save session. */ - $this->session->set('revisionList', $this->app->getURI(true)); + $this->session->set('revisionList', $this->app->getURI(true), 'repo'); $this->commonAction($repoID); $this->scm->setEngine($repo); diff --git a/module/repo/model.php b/module/repo/model.php index ed9f5202e8..2aca0edf58 100644 --- a/module/repo/model.php +++ b/module/repo/model.php @@ -872,8 +872,8 @@ class repoModel extends model if($type == 'list') unset($_SESSION['repoView']); if($withOtherModule) { - $this->session->set('bugList', $uri); - $this->session->set('taskList', $uri); + $this->session->set('bugList', $uri, 'qa'); + $this->session->set('taskList', $uri, 'execution'); } session_write_close(); } diff --git a/module/search/control.php b/module/search/control.php index 240c033992..ab2fb8ed64 100644 --- a/module/search/control.php +++ b/module/search/control.php @@ -197,25 +197,25 @@ class search extends control $uri = inlink('index', "recTotal=$pager->recTotal&pageID=$pager->pageID"); $uri .= strpos($uri, '?') === false ? '?' : '&'; $uri .= 'words=' . $words; - $this->session->set('bugList', $uri); - $this->session->set('buildList', $uri); - $this->session->set('caseList', $uri); - $this->session->set('docList', $uri); - $this->session->set('productList', $uri); - $this->session->set('productPlanList', $uri); - $this->session->set('programList', $uri); - $this->session->set('projectList', $uri); - $this->session->set('executionList', $uri); - $this->session->set('releaseList', $uri); - $this->session->set('storyList', $uri); - $this->session->set('taskList', $uri); - $this->session->set('testtaskList', $uri); - $this->session->set('todoList', $uri); - $this->session->set('effortList', $uri); - $this->session->set('reportList', $uri); - $this->session->set('testsuiteList', $uri); - $this->session->set('issueList', $uri); - $this->session->set('riskList', $uri); + $this->session->set('bugList', $uri, 'qa'); + $this->session->set('buildList', $uri, 'execution'); + $this->session->set('caseList', $uri, 'qa'); + $this->session->set('docList', $uri, 'doc'); + $this->session->set('productList', $uri, 'product'); + $this->session->set('productPlanList', $uri, 'product'); + $this->session->set('programList', $uri, 'program'); + $this->session->set('projectList', $uri, 'project'); + $this->session->set('executionList', $uri, 'execution'); + $this->session->set('releaseList', $uri, 'product'); + $this->session->set('storyList', $uri, 'product'); + $this->session->set('taskList', $uri, 'execution'); + $this->session->set('testtaskList', $uri, 'qa'); + $this->session->set('todoList', $uri, 'my'); + $this->session->set('effortList', $uri, 'my'); + $this->session->set('reportList', $uri, 'qa'); + $this->session->set('testsuiteList', $uri, 'qa'); + $this->session->set('issueList', $uri, 'project'); + $this->session->set('riskList', $uri, 'project'); $this->session->set('searchIngWord', $words); $this->session->set('searchIngType', $type); diff --git a/module/story/control.php b/module/story/control.php index 95ac801a0d..940d3a1546 100644 --- a/module/story/control.php +++ b/module/story/control.php @@ -1373,12 +1373,11 @@ class story extends control } /* Save session. */ - $this->session->set('storyList', $this->app->getURI(true)); - $this->session->set('designList', $this->app->getURI(true)); - $this->session->set('bugList', $this->app->getURI(true)); - $this->session->set('caseList', $this->app->getURI(true)); - $this->session->set('bugList', $this->app->getURI(true)); - $this->session->set('revisionList', $this->app->getURI(true)); + $this->session->set('storyList', $this->app->getURI(true), 'product'); + $this->session->set('designList', $this->app->getURI(true), 'project'); + $this->session->set('bugList', $this->app->getURI(true), 'qa'); + $this->session->set('caseList', $this->app->getURI(true), 'qa'); + $this->session->set('revisionList', $this->app->getURI(true), 'repo'); /* Load pager and get tracks. */ $this->app->loadClass('pager', $static = true); diff --git a/module/testcase/control.php b/module/testcase/control.php index 3c3f60f5bb..f93b165452 100644 --- a/module/testcase/control.php +++ b/module/testcase/control.php @@ -98,7 +98,7 @@ class testcase extends control /* Set menu, save session. */ if($this->app->openApp == 'project') $this->products = array('0' => $this->lang->product->all) + $this->products; $this->app->openApp == 'project' ? $this->loadModel('project')->setMenu($projectID) : $this->testcase->setMenu($this->products, $productID, $branch, $moduleID, $suiteID, $orderBy); - $this->session->set('caseList', $this->app->getURI(true)); + $this->session->set('caseList', $this->app->getURI(true), 'qa'); $this->session->set('productID', $productID); $this->session->set('moduleID', $moduleID); $this->session->set('browseType', $browseType); @@ -191,7 +191,7 @@ class testcase extends control $this->app->loadLang('testtask'); $this->app->openApp == 'project' ? $this->loadModel('project')->setMenu($this->session->project) : $this->testcase->setMenu($this->products, $productID, $branch); - $this->session->set('caseList', $this->app->getURI(true)); + $this->session->set('caseList', $this->app->getURI(true), 'qa'); $cases = $this->testcase->getModuleCases($productID, $branch, 0, $groupBy); $this->loadModel('common')->saveQueryCondition($this->dao->get(), 'testcase', false); diff --git a/module/testreport/control.php b/module/testreport/control.php index d15c75a19c..35d1d82a5e 100644 --- a/module/testreport/control.php +++ b/module/testreport/control.php @@ -43,8 +43,8 @@ class testreport extends control $this->app->loadConfig('qa'); foreach($this->config->qa->menuList as $module) $this->lang->navGroup->$module = 'qa'; } - else - { + else + { $this->lang->testreport->menu = $this->lang->projectQa->menu; $this->lang->testreport->subMenu = $this->lang->projectQa->subMenu; } diff --git a/module/testsuite/control.php b/module/testsuite/control.php index dac547edc1..1c9f9d6c2d 100644 --- a/module/testsuite/control.php +++ b/module/testsuite/control.php @@ -60,7 +60,7 @@ class testsuite extends control public function browse($productID = 0, $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1) { /* Save session. */ - $this->session->set('testsuiteList', $this->app->getURI(true)); + $this->session->set('testsuiteList', $this->app->getURI(true), 'qa'); /* Set menu. */ $this->view->products = $this->products = $this->loadModel('product')->getPairs(); @@ -169,7 +169,7 @@ class testsuite extends control $this->loadModel('qa')->setMenu($this->products, $productID); /* Save session. */ - $this->session->set('caseList', $this->app->getURI(true)); + $this->session->set('caseList', $this->app->getURI(true), 'qa'); /* Append id for secend sort. */ $sort = $this->loadModel('common')->appendOrder($orderBy); @@ -303,7 +303,7 @@ class testsuite extends control public function linkCase($suiteID, $param = 0, $recTotal = 0, $recPerPage = 20, $pageID = 1) { /* Save session. */ - $this->session->set('caseList', $this->app->getURI(true)); + $this->session->set('caseList', $this->app->getURI(true), 'qa'); if(!empty($_POST)) { diff --git a/module/testtask/control.php b/module/testtask/control.php index b7d1f0550f..a8b24c30cb 100644 --- a/module/testtask/control.php +++ b/module/testtask/control.php @@ -134,7 +134,7 @@ class testtask extends control public function browseUnits($productID = 0, $browseType = 'newest', $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1) { /* Save session. */ - $this->session->set('testtaskList', $this->app->getURI(true)); + $this->session->set('testtaskList', $this->app->getURI(true), 'qa'); $this->session->set('buildList', $this->app->getURI(true), 'execution'); $this->loadModel('testcase'); $this->app->loadLang('tree'); @@ -388,7 +388,7 @@ class testtask extends control $this->loadModel('execution'); /* Save the session. */ - $this->session->set('caseList', $this->app->getURI(true)); + $this->session->set('caseList', $this->app->getURI(true), 'qa'); /* Load pager. */ $this->app->loadClass('pager', $static = true); @@ -547,7 +547,7 @@ class testtask extends control $this->loadModel('testcase'); $this->app->loadLang('execution'); $this->app->loadLang('task'); - $this->session->set('caseList', $this->app->getURI(true)); + $this->session->set('caseList', $this->app->getURI(true), 'qa'); /* Get task and product info, set menu. */ $groupBy = empty($groupBy) ? 'story' : $groupBy; @@ -882,7 +882,7 @@ class testtask extends control } /* Save session. */ - $this->session->set('caseList', $this->app->getURI(true)); + $this->session->set('caseList', $this->app->getURI(true), 'qa'); /* Get task and product id. */ $task = $this->testtask->getById($taskID); diff --git a/module/todo/control.php b/module/todo/control.php index 49a7e7c4be..0dcb14ed90 100644 --- a/module/todo/control.php +++ b/module/todo/control.php @@ -372,8 +372,12 @@ class todo extends control if(!$todo) die(js::error($this->lang->notFound) . js::locate('back')); /* Save the session. */ - $this->session->set('taskList', $this->app->getURI(true)); - $this->session->set('bugList', $this->app->getURI(true)); + $uri = $this->app->getURI(true); + $this->session->set('todoList', $uri, 'my'); + $this->session->set('bugList', $uri, 'qa'); + $this->session->set('taskList', $uri, 'execution'); + $this->session->set('storyList', $uri, 'product'); + $this->session->set('testtaskList', $uri, 'qa'); /* Fix bug #936. */ if($this->app->user->account != $todo->account and !common::hasPriv('company', 'index'))