* Reduction.

This commit is contained in:
tianshujie98
2021-03-19 14:51:01 +08:00
parent 1e1493d710
commit d5665b54f7
3 changed files with 12 additions and 12 deletions
+4 -4
View File
@@ -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();
}
+4 -4
View File
@@ -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)
+4 -4
View File
@@ -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();
}