From d5665b54f7f651fcaec6eb41c5815eb5ef5d993a Mon Sep 17 00:00:00 2001 From: tianshujie98 Date: Fri, 19 Mar 2021 14:51:01 +0800 Subject: [PATCH] * Reduction. --- module/execution/model.php | 8 ++++---- module/product/model.php | 8 ++++---- module/project/model.php | 8 ++++---- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/module/execution/model.php b/module/execution/model.php index 2bce8e7325..d9d36ac94c 100644 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -275,23 +275,23 @@ class executionModel extends model /* When the cookie and session do not exist, get it from the database. */ if(empty($executionID) and isset($this->config->execution->lastExecution) and isset($executions[$this->config->execution->lastExecution])) { - $this->session->set('execution', $this->config->execution->lastExecution, $this->app->openApp); + $this->session->set('execution', $this->config->execution->lastExecution); $this->setProjectSession($this->session->execution); return $this->session->execution; } - if($executionID > 0) $this->session->set('execution', (int)$executionID, $this->app->openApp); + if($executionID > 0) $this->session->set('execution', (int)$executionID); if($executionID == 0 and $this->cookie->lastExecution) { /* Execution link is execution-task. */ $executionID = (int)$this->cookie->lastExecution; $executionID = in_array($executionID, array_keys($executions)) ? $executionID : key($executions); - $this->session->set('execution', $executionID, $this->app->openApp); + $this->session->set('execution', $executionID); } if($executionID == 0 and $this->session->execution == '') $this->session->set('execution', key($executions)); if(!isset($executions[$this->session->execution])) { - $this->session->set('execution', key($executions), $this->app->openApp); + $this->session->set('execution', key($executions)); if($executionID && strpos(",{$this->app->user->view->sprints},", ",{$this->session->execution},") === false) $this->accessDenied(); } diff --git a/module/product/model.php b/module/product/model.php index 6dc234b88f..0e8be554c1 100644 --- a/module/product/model.php +++ b/module/product/model.php @@ -167,12 +167,12 @@ class productModel extends model */ public function saveState($productID, $products) { - if($productID > 0) $this->session->set('product', (int)$productID, $this->app->openApp); - if($productID == 0 and $this->cookie->lastProduct) $this->session->set('product', (int)$this->cookie->lastProduct, $this->app->openApp); - if($productID == 0 and $this->session->product == '') $this->session->set('product', key($products), $this->app->openApp); + if($productID > 0) $this->session->set('product', (int)$productID); + if($productID == 0 and $this->cookie->lastProduct) $this->session->set('product', (int)$this->cookie->lastProduct); + if($productID == 0 and $this->session->product == '') $this->session->set('product', key($products)); if(!isset($products[$this->session->product])) { - $this->session->set('product', key($products), $this->app->openApp); + $this->session->set('product', key($products)); if($productID && strpos(",{$this->app->user->view->products},", ",{$this->session->product},") === false) $this->accessDenied(); } if($this->cookie->preProductID != $productID) diff --git a/module/project/model.php b/module/project/model.php index 27b29fbaca..eb4d4c5a34 100644 --- a/module/project/model.php +++ b/module/project/model.php @@ -115,12 +115,12 @@ class projectModel extends model */ public function saveState($projectID = 0, $projects = array()) { - if($projectID > 0) $this->session->set('PRJ', (int)$projectID, $this->app->openApp); - if($projectID == 0 and $this->cookie->lastProject) $this->session->set('PRJ', (int)$this->cookie->lastProject, $this->app->openApp); - if($projectID == 0 and $this->session->PRJ == '') $this->session->set('PRJ', key($projects), $this->app->openApp); + if($projectID > 0) $this->session->set('PRJ', (int)$projectID); + if($projectID == 0 and $this->cookie->lastProject) $this->session->set('PRJ', (int)$this->cookie->lastProject); + if($projectID == 0 and $this->session->PRJ == '') $this->session->set('PRJ', key($projects)); if(!isset($projects[$this->session->PRJ])) { - $this->session->set('PRJ', key($projects), $this->app->openApp); + $this->session->set('PRJ', key($projects)); if($projectID && strpos(",{$this->app->user->view->projects},", ",{$this->session->PRJ},") === false) $this->accessDenied(); }