From 7fa5a2dab0be287da4556dad0971e3a271ef5b6c Mon Sep 17 00:00:00 2001 From: Yagami <976204163@qq.com> Date: Thu, 18 Mar 2021 16:36:47 +0800 Subject: [PATCH] * Fix session app. --- framework/base/router.class.php | 10 ++++------ module/my/control.php | 3 +-- module/program/model.php | 3 ++- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/framework/base/router.class.php b/framework/base/router.class.php index b8281b8c0f..87ec537a7f 100644 --- a/framework/base/router.class.php +++ b/framework/base/router.class.php @@ -2492,7 +2492,7 @@ class super * @access public * @return void */ - public function set($key, $value) + public function set($key, $value, $openApp = '') { if($this->scope == 'post') { @@ -2512,9 +2512,8 @@ class super } elseif($this->scope == 'session') { - $openApp = $this->openApp; - empty($openApp) ? $_SESSION[$key] = $value : $_SESSION['app-' . $openApp][$key] = $value; - $_SESSION[$key] = $value; + $openApp = $openApp ? $openApp : $this->openApp; + $openApp ? $_SESSION["app-$openApp"][$key] = $value : $_SESSION[$key] = $value; } elseif($this->scope == 'env') { @@ -2562,9 +2561,8 @@ class super elseif($this->scope == 'session') { $openApp = $this->openApp; - if(!empty($openApp) and isset($_SESSION['app-' . $openApp][$key])) return $_SESSION['app-' . $openApp][$key]; + if($openApp and isset($_SESSION["app-$openApp"][$key])) return $_SESSION["app-$openApp"][$key]; if(isset($_SESSION[$key])) return $_SESSION[$key]; - return false; } elseif($this->scope == 'env') diff --git a/module/my/control.php b/module/my/control.php index f731e53bb5..82f811e1c7 100644 --- a/module/my/control.php +++ b/module/my/control.php @@ -273,8 +273,7 @@ class my extends control /* Save session. */ if($this->app->viewType != 'json') { - $this->session->set('taskList', $this->app->getURI(true)); - $this->session->set('storyList', $this->app->getURI(true)); + $this->session->set('taskList', $this->app->getURI(true), 'execution'); } /* Load pager. */ diff --git a/module/program/model.php b/module/program/model.php index 978f35996d..4f78281241 100644 --- a/module/program/model.php +++ b/module/program/model.php @@ -96,8 +96,9 @@ class programModel extends model ->where('type')->in('program,project') ->andWhere('deleted')->eq(0) ->beginIF(!$this->app->user->admin) - ->andWhere('id')->in($this->app->user->view->programs) + ->andWhere('(id')->in($this->app->user->view->programs) ->orWhere('id')->in($this->app->user->view->projects) + ->markRight(1) ->fi() ->beginIF($status != 'all')->andWhere('status')->eq($status)->fi() ->beginIF(!$this->cookie->showClosed)->andWhere('status')->ne('closed')->fi()