* Adjust session.

This commit is contained in:
holan20180123
2021-03-24 16:12:48 +08:00
parent 0afdfe0b60
commit 0eda0edd50
5 changed files with 38 additions and 37 deletions
+17 -16
View File
@@ -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;
-1
View File
@@ -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')
+5 -5
View File
@@ -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&param=" . helper::safe64Encode("&browseType=$browseType&queryID=$param")));
$this->session->set('storyList', inlink('view', "planID=$planID&type=story&orderBy=$orderBy&link=true&param=" . 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&param=" . helper::safe64Encode("&browseType=$browseType&queryID=$param")));
$this->session->set('bugList', inlink('view', "planID=$planID&type=bug&orderBy=$orderBy&link=true&param=" . helper::safe64Encode("&browseType=$browseType&queryID=$param")), 'qa');
/* Init vars. */
$projects = $this->app->user->view->projects . ',0';
+2 -2
View File
@@ -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');
+14 -13
View File
@@ -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);