From 64bb6eb19fd1821da043ebf09812c75fc687fee8 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Thu, 22 Sep 2022 09:42:01 +0800 Subject: [PATCH] * adjust for no sprint menu. --- module/execution/control.php | 2 +- module/execution/model.php | 1 + module/project/model.php | 10 ++++++++-- module/story/control.php | 2 +- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/module/execution/control.php b/module/execution/control.php index e85dde39db..dc21336b3a 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -139,7 +139,7 @@ class execution extends control $recentExecutions = array_unique($recentExecutions); $recentExecutions = array_slice($recentExecutions, 0, 5); $recentExecutions = join(',', $recentExecutions); - if(empty($this->config->projectMode)) + if($this->session->noSprint) { if(!isset($this->config->execution->recentExecutions) or $this->config->execution->recentExecutions != $recentExecutions) $this->setting->updateItem($this->app->user->account . 'common.execution.recentExecutions', $recentExecutions); if(!isset($this->config->execution->lastExecution) or $this->config->execution->lastExecution != $executionID) $this->setting->updateItem($this->app->user->account . 'common.execution.lastExecution', $executionID); diff --git a/module/execution/model.php b/module/execution/model.php index 72981cc7c1..bedea3965e 100644 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -1269,6 +1269,7 @@ class executionModel extends model $executions = $this->dao->select('*, IF(INSTR("done,closed", status) < 2, 0, 1) AS isDone, INSTR("doing,wait,suspended,closed", status) AS sortStatus')->from(TABLE_EXECUTION) ->where('deleted')->eq(0) ->andWhere('vision')->eq($this->config->vision) + ->beginIF($this->session->noSprint and $this->app->tab == 'execution')->andWhere('noSprint')->eq('0')->fi() ->beginIF($type == 'all')->andWhere('type')->in('stage,sprint,kanban')->fi() ->beginIF($projectID)->andWhere('project')->eq($projectID)->fi() ->beginIF($type != 'all')->andWhere('type')->eq($type)->fi() diff --git a/module/project/model.php b/module/project/model.php index 5b311e0680..e908efa6f0 100644 --- a/module/project/model.php +++ b/module/project/model.php @@ -2491,10 +2491,14 @@ class projectModel extends model $moduleName = $this->app->rawModule; $methodName = $this->app->rawMethod; + $this->session->set('noSprint', false); + $navGroup = zget($this->lang->navGroup, $moduleName); $this->config->resetNavGroup['execution'] = 'execution'; + $this->config->resetNavGroup['task'] = zget($this->lang->navGroup, 'task'); + $this->config->resetNavGroup['story'] = zget($this->lang->navGroup, 'story'); $this->config->resetNavGroup[$moduleName] = $navGroup; - $this->session->set('noSprint', false, 'project'); + $project = $this->dao->select('*')->from(TABLE_PROJECT)->where('id')->eq($objectID)->andWhere('noSprint')->eq('1')->fetch(); if(empty($project)) return; @@ -2519,7 +2523,7 @@ class projectModel extends model if(empty($projectID) or empty($executionID)) return; $this->session->set('project', $projectID, 'project'); - $this->session->set('noSprint', true, 'project'); + $this->session->set('noSprint', true); $this->app->tab = 'project'; $_COOKIE['tab'] = 'project'; @@ -2555,6 +2559,8 @@ class projectModel extends model } $this->config->resetNavGroup['execution'] = 'project'; + $this->config->resetNavGroup['task'] = 'project'; + $this->config->resetNavGroup['story'] = 'project'; $this->config->resetNavGroup[$moduleName] = 'project'; /* If objectID is set, cannot use homeMenu. */ diff --git a/module/story/control.php b/module/story/control.php index 1edb12e9ec..f18c2df0cd 100644 --- a/module/story/control.php +++ b/module/story/control.php @@ -64,7 +64,7 @@ class story extends control { $this->product->setMenu($productID); } - else if($this->app->tab == 'project') + elseif($this->app->tab == 'project') { $objects = $this->project->getPairsByProgram();