From 0eda0edd50ff12d6fd7d4d0435c2e90f943cb741 Mon Sep 17 00:00:00 2001 From: holan20180123 <56391770@qq.com> Date: Wed, 24 Mar 2021 16:12:48 +0800 Subject: [PATCH] * Adjust session. --- module/product/control.php | 33 +++++++++++++++++---------------- module/product/model.php | 1 - module/productplan/control.php | 10 +++++----- module/program/control.php | 4 ++-- module/project/control.php | 27 ++++++++++++++------------- 5 files changed, 38 insertions(+), 37 deletions(-) diff --git a/module/product/control.php b/module/product/control.php index f4ac5ef0f0..a5b85ba588 100644 --- a/module/product/control.php +++ b/module/product/control.php @@ -448,7 +448,7 @@ class product extends control $param = $programID ? "programID=$programID" : "product=$productID"; $locate = $this->createLink($moduleName, $methodName, $param); - if(!$programID) $this->session->set('productList', $this->createLink('product', 'browse', $param)); + if(!$programID) $this->session->set('productList', $this->createLink('product', 'browse', $param), 'product'); $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $locate)); } @@ -677,8 +677,8 @@ class product extends control $this->lang->product->switcherMenu = $this->product->getSwitcher($productID, '', $branch); $this->product->setMenu($productID, $branch); - $this->session->set('releaseList', $this->app->getURI(true)); - $this->session->set('productPlanList', $this->app->getURI(true)); + $this->session->set('releaseList', $this->app->getURI(true), 'product'); + $this->session->set('productPlanList', $this->app->getURI(true), 'product'); $product = $this->dao->findById($productID)->from(TABLE_PRODUCT)->fetch(); if(empty($product)) $this->locate($this->createLink('product', 'showErrorNone', 'fromModule=product')); @@ -709,16 +709,17 @@ class product extends control { /* Save session. */ $uri = $this->app->getURI(true); - $this->session->set('productList', $uri); - $this->session->set('productPlanList', $uri); - $this->session->set('releaseList', $uri); - $this->session->set('storyList', $uri); - $this->session->set('projectList', $uri); - $this->session->set('taskList', $uri); - $this->session->set('buildList', $uri); - $this->session->set('bugList', $uri); - $this->session->set('caseList', $uri); - $this->session->set('testtaskList', $uri); + $this->session->set('productList', $uri, 'product'); + $this->session->set('productPlanList', $uri, 'product'); + $this->session->set('releaseList', $uri, 'product'); + $this->session->set('storyList', $uri, 'product'); + $this->session->set('projectList', $uri, 'project'); + $this->session->set('executionList', $uri, 'execution'); + $this->session->set('taskList', $uri, 'execution'); + $this->session->set('buildList', $uri, 'execution'); + $this->session->set('bugList', $uri, 'qa'); + $this->session->set('caseList', $uri, 'qa'); + $this->session->set('testtaskList', $uri, 'qa'); $this->product->setMenu($productID); @@ -1019,7 +1020,7 @@ class product extends control { /* Load module and set session. */ $this->loadModel('program'); - $this->session->set('productList', $this->app->getURI(true)); + $this->session->set('productList', $this->app->getURI(true), 'product'); /* Process product structure. */ $productStructure = array(); @@ -1193,7 +1194,7 @@ class product extends control public function build($productID = 0, $branch = 0) { $this->app->loadLang('build'); - $this->session->set('productList', $this->app->getURI(true)); + $this->session->set('productList', $this->app->getURI(true), 'product'); /* Get all product list. Locate to the create product page if there is no product. */ $this->products = $this->product->getPairs('', $this->session->project); @@ -1205,7 +1206,7 @@ class product extends control $this->product->setMenu($productID, $branch); /* Set menu.*/ - $this->session->set('buildList', $this->app->getURI(true)); + $this->session->set('buildList', $this->app->getURI(true), 'execution'); $this->view->title = $product->name . $this->lang->colon . $this->lang->product->build; $this->view->position[] = $this->lang->product->build; diff --git a/module/product/model.php b/module/product/model.php index 682db54b6a..c5be2b6ca6 100644 --- a/module/product/model.php +++ b/module/product/model.php @@ -421,7 +421,6 @@ class productModel extends model { $currentModule = $this->app->moduleName; $currentMethod = $this->app->methodName; - $this->session->set('moreProductLink', $this->app->getURI(true)); /* init currentModule and currentMethod for report and story. */ if($currentModule == 'story') diff --git a/module/productplan/control.php b/module/productplan/control.php index f148bc55f9..f76efeb375 100644 --- a/module/productplan/control.php +++ b/module/productplan/control.php @@ -214,7 +214,7 @@ class productplan extends control /* Append id for secend sort. */ $sort = $this->loadModel('common')->appendOrder($orderBy); - $this->session->set('productPlanList', $this->app->getURI(true)); + $this->session->set('productPlanList', $this->app->getURI(true), 'product'); $this->commonAction($productID, $branch); $products = $this->product->getPairs(); $this->view->title = $products[$productID] . $this->lang->colon . $this->lang->productplan->browse; @@ -249,8 +249,8 @@ class productplan extends control $plan = $this->productplan->getByID($planID, true); if(!$plan) die(js::error($this->lang->notFound) . js::locate('back')); - $this->session->set('storyList', $this->app->getURI(true) . '&type=' . 'story'); - $this->session->set('bugList', $this->app->getURI(true) . '&type=' . 'bug'); + $this->session->set('storyList', $this->app->getURI(true) . '&type=' . 'story', 'product'); + $this->session->set('bugList', $this->app->getURI(true) . '&type=' . 'bug', 'qa'); /* Determines whether an object is editable. */ $canBeChanged = common::canBeChanged('plan', $plan); @@ -359,7 +359,7 @@ class productplan extends control die(js::locate(inlink('view', "planID=$planID&type=story&orderBy=$orderBy"), 'parent')); } - $this->session->set('storyList', inlink('view', "planID=$planID&type=story&orderBy=$orderBy&link=true¶m=" . helper::safe64Encode("&browseType=$browseType&queryID=$param"))); + $this->session->set('storyList', inlink('view', "planID=$planID&type=story&orderBy=$orderBy&link=true¶m=" . helper::safe64Encode("&browseType=$browseType&queryID=$param")), 'product'); $this->loadModel('story'); $this->loadModel('tree'); @@ -498,7 +498,7 @@ class productplan extends control /* Load module and set session. */ $this->loadModel('bug'); - $this->session->set('bugList', inlink('view', "planID=$planID&type=bug&orderBy=$orderBy&link=true¶m=" . helper::safe64Encode("&browseType=$browseType&queryID=$param"))); + $this->session->set('bugList', inlink('view', "planID=$planID&type=bug&orderBy=$orderBy&link=true¶m=" . helper::safe64Encode("&browseType=$browseType&queryID=$param")), 'qa'); /* Init vars. */ $projects = $this->app->user->view->projects . ',0'; diff --git a/module/program/control.php b/module/program/control.php index 4a85657c52..712d2bce21 100644 --- a/module/program/control.php +++ b/module/program/control.php @@ -392,8 +392,8 @@ class program extends control $this->program->setMenu($programID); - $this->app->session->set('programProject', $this->app->getURI(true)); - $this->app->session->set('projectList', $this->app->getURI(true)); + $this->app->session->set('programProject', $this->app->getURI(true), 'program'); + $this->app->session->set('projectList', $this->app->getURI(true), 'project'); $this->loadModel('datatable'); diff --git a/module/project/control.php b/module/project/control.php index be1404a6ca..7d63670d45 100644 --- a/module/project/control.php +++ b/module/project/control.php @@ -277,7 +277,7 @@ class project extends control if($model == 'waterfall') { $productID = $this->loadModel('product')->getProductIDByProject($projectID, true); - $this->session->set('projectPlanList', $this->createLink('projectplan', 'browse', "projectID=$projectID&productID=$productID&type=lists", '', '', $projectID)); + $this->session->set('projectPlanList', $this->createLink('projectplan', 'browse', "projectID=$projectID&productID=$productID&type=lists", '', '', $projectID), 'project'); $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $this->createLink('projectplan', 'create', "projectID=$projectID", '', '', $projectID))); } @@ -490,7 +490,7 @@ class project extends control $this->project->setMenu($projectID); - $this->app->session->set('projectList', $this->app->getURI(true)); + $this->app->session->set('projectList', $this->app->getURI(true), 'project'); $products = $this->loadModel('product')->getProducts($projectID); $linkedBranches = array(); @@ -591,16 +591,17 @@ class project extends control /* Save session. */ $uri = $this->app->getURI(true); - $this->session->set('productList', $uri); - $this->session->set('productPlanList', $uri); - $this->session->set('releaseList', $uri); - $this->session->set('storyList', $uri); - $this->session->set('executionList', $uri); - $this->session->set('taskList', $uri); - $this->session->set('buildList', $uri); - $this->session->set('bugList', $uri); - $this->session->set('caseList', $uri); - $this->session->set('testtaskList', $uri); + $this->session->set('productList', $uri, 'product'); + $this->session->set('productPlanList', $uri, 'product'); + $this->session->set('releaseList', $uri, 'product'); + $this->session->set('storyList', $uri, 'product'); + $this->session->set('projectList', $uri, 'project'); + $this->session->set('executionList', $uri, 'execution'); + $this->session->set('taskList', $uri, 'execution'); + $this->session->set('buildList', $uri, 'execution'); + $this->session->set('bugList', $uri, 'qa'); + $this->session->set('caseList', $uri, 'qa'); + $this->session->set('testtaskList', $uri, 'qa'); /* Append id for secend sort. */ $orderBy = $direction == 'next' ? 'date_desc' : 'date_asc'; @@ -826,7 +827,7 @@ class project extends control $project = $this->project->getByID($projectID); $this->project->setMenu($projectID); - $this->session->set('buildList', $this->app->getURI(true)); + $this->session->set('buildList', $this->app->getURI(true), 'execution'); /* Get products' list. */ $products = $this->project->getProducts($projectID, false);