From df01cbe76a79ba203a577c31cba8f896459997ba Mon Sep 17 00:00:00 2001 From: qiyu-xie Date: Wed, 20 Jan 2021 09:26:07 +0800 Subject: [PATCH] * Finish task#8970. Change to use session to record URL. --- module/my/control.php | 1 + module/my/view/project.html.php | 4 ++-- module/personnel/control.php | 15 ++------------- module/personnel/view/addwhitelist.html.php | 2 +- module/personnel/view/whitelist.html.php | 5 ++--- module/program/control.php | 4 ++++ 6 files changed, 12 insertions(+), 19 deletions(-) diff --git a/module/my/control.php b/module/my/control.php index db1583b146..8e17a81ca5 100644 --- a/module/my/control.php +++ b/module/my/control.php @@ -468,6 +468,7 @@ class my extends control $this->app->session->set('programList', $this->app->getURI(true)); $this->app->session->set('PRJBrowse', $this->app->getURI(true)); + $this->app->session->set('whitelist', $this->app->getURI(true)); /* Set the pager. */ $this->app->loadClass('pager', $static = true); diff --git a/module/my/view/project.html.php b/module/my/view/project.html.php index 94e60918e0..d6c15cec4a 100644 --- a/module/my/view/project.html.php +++ b/module/my/view/project.html.php @@ -77,14 +77,14 @@ status != 'closed') common::printIcon('program', 'PRJActivate', "projectID=$project->id", $project, 'list', 'magic', '', 'iframe', true);?> - id&programID=$project->parent", $project, 'list', 'edit', '', '', false, "data-group='project'");?> + id&programID=$project->parent", $project, 'list', 'edit', '', '', false, "data-group='project'");?> id", $project, 'list', 'group', '', '', false, "data-group='project'");?> id", $project, 'list', 'lock', '', '', false, "data-group='project'");?>
diff --git a/module/personnel/control.php b/module/personnel/control.php index 83c9f05e2c..9bc52ccf58 100644 --- a/module/personnel/control.php +++ b/module/personnel/control.php @@ -114,11 +114,6 @@ class personnel extends control $this->app->loadClass('pager', true); $pager = pager::init($recTotal, $recPerPage, $pageID); - /* Set back link. */ - if($from == 'pgmbrowse') $goback = $this->createLink('program', 'PGMBrowse'); - if($from == 'pgmproject') $goback = $this->createLink('program', 'PGMProject', "programID=$programID"); - if($from == 'PRJ') $goback = $this->createLink('program', 'PRJBrowse'); - $this->view->title = $this->lang->personnel->whitelist; $this->view->position[] = $this->lang->personnel->whitelist; @@ -127,7 +122,6 @@ class personnel extends control $this->view->whitelist = $this->personnel->getWhitelist($objectID, $objectType, $orderBy, $pager); $this->view->depts = $this->loadModel('dept')->getOptionMenu(); $this->view->module = $module; - $this->view->goback = isset($goback) ? $goback : ''; $this->view->programID = $programID; $this->view->from = $from; @@ -156,13 +150,8 @@ class personnel extends control $this->personnel->addWhitelist($objectType, $objectID); if(dao::isError()) $this->send(array('result' => 'fail', 'message' => $this->getError())); - $locateLink = $this->createLink($module, 'whitelist', "objectID=$objectID"); - if($module == 'program') - { - $openModule = $from == 'PRJ' ? 'project' : 'program'; - $locateLink = $this->createLink('program', 'PRJWhitelist', "objectID=$objectID&programID=$programID&module=$module&from=$from") . "#open=$openModule"; - } - $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $locateLink)); + $openModule = $module == 'program' ? ($from == 'PRJ' || $from == 'my' ? '#open=project' : '#open=program') : ''; + $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $this->session->whitelistBrowse . $openModule)); } $this->loadModel('dept'); diff --git a/module/personnel/view/addwhitelist.html.php b/module/personnel/view/addwhitelist.html.php index 7cea5b0997..1b110d2de1 100644 --- a/module/personnel/view/addwhitelist.html.php +++ b/module/personnel/view/addwhitelist.html.php @@ -84,7 +84,7 @@ session->whitelistBrowse;?> - + goback, '', "class='btn btn-back btn-wide' $dataGroup");?> diff --git a/module/personnel/view/whitelist.html.php b/module/personnel/view/whitelist.html.php index 5431d5c401..88a1801d80 100644 --- a/module/personnel/view/whitelist.html.php +++ b/module/personnel/view/whitelist.html.php @@ -12,17 +12,16 @@ ?> diff --git a/module/program/control.php b/module/program/control.php index bb93d9c6b0..e3f40ce1bb 100644 --- a/module/program/control.php +++ b/module/program/control.php @@ -66,6 +66,7 @@ class program extends control if(common::hasPriv('program', 'pgmcreate')) $this->lang->pageActions = html::a($this->createLink('program', 'pgmcreate'), " " . $this->lang->program->PGMCreate, '', "class='btn btn-secondary'"); $this->app->session->set('programList', $this->app->getURI(true)); + $this->app->session->set('whitelist', $this->app->getURI(true)); $programType = $this->cookie->programType ? $this->cookie->programType : 'bylist'; @@ -417,6 +418,8 @@ class program extends control if(!$programID) $this->locate($this->createLink('program', 'PGMbrowse')); setCookie("lastPGM", $programID, $this->config->cookieLife, $this->config->webRoot, '', false, true); + $this->app->session->set('whitelist', $this->app->getURI(true)); + $this->lang->navGroup->program = 'program'; $this->lang->program->switcherMenu = $this->program->getPGMSwitcher($programID, true); $this->lang->program->mainMenuAction = $this->program->getPGMMainAction(); @@ -794,6 +797,7 @@ class program extends control { $this->lang->program->mainMenuAction = html::a('javascript:history.go(-1);', ' ' . $this->lang->goback, '', "class='btn btn-link'"); $this->app->session->set('PRJBrowse', $this->app->getURI(true)); + $this->app->session->set('whitelist', $this->app->getURI(true)); $this->loadModel('datatable'); /* Load pager and get tasks. */