From 864d6b7001b50952ba4e0ec28d3046b18d74e148 Mon Sep 17 00:00:00 2001 From: leiyong <1549684884@qq.com> Date: Tue, 29 Dec 2020 09:00:50 +0800 Subject: [PATCH] * Adjust code. --- module/bug/model.php | 1 - module/issue/control.php | 2 +- module/project/control.php | 4 ---- module/project/model.php | 8 +++++++- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/module/bug/model.php b/module/bug/model.php index 1c04b2e271..3f96733af9 100644 --- a/module/bug/model.php +++ b/module/bug/model.php @@ -1414,7 +1414,6 @@ class bugModel extends model ->leftJoin(TABLE_PRODUCT)->alias('t2') ->on('t1.product=t2.id') ->where('t1.assignedTo')->eq($account) - ->beginIF(!$this->app->user->admin)->andWhere('t1.project')->in('0,' . $this->app->user->view->projects)->fi() ->beginIF(!empty($skipProductIDList))->andWhere('t1.product')->notin($skipProductIDList)->fi() ->beginIF(!empty($skipProjectIDList))->andWhere('t1.project')->notin($skipProjectIDList)->fi() ->andWhere('t1.deleted')->eq(0) diff --git a/module/issue/control.php b/module/issue/control.php index 1bbd04bf50..4e90ec7ece 100644 --- a/module/issue/control.php +++ b/module/issue/control.php @@ -363,7 +363,7 @@ class issue extends control { $this->loadModel('task'); $this->loadModel('tree'); - $this->loadModel('project')->getLimitedExecution(); + $this->loadModel('project'); $projects = $this->project->getExecutionsByProject($this->session->PRJ, 'all', 0, true); $projectID = $this->session->project; diff --git a/module/project/control.php b/module/project/control.php index 6fe7c1157c..401460338f 100644 --- a/module/project/control.php +++ b/module/project/control.php @@ -117,8 +117,6 @@ class project extends control if(common::hasPriv('project', 'create')) $this->lang->TRActions = html::a($this->createLink('project', 'create', ''), " " . $this->lang->project->create, '', "class='btn btn-primary'"); - $this->project->getLimitedExecution(); - /* Set browse type. */ $browseType = strtolower($status); @@ -645,8 +643,6 @@ class project extends control $this->loadModel('user'); $this->app->loadLang('testcase'); - $this->project->getLimitedExecution(); - $type = strtolower($type); setcookie('storyPreProjectID', $projectID, $this->config->cookieLife, $this->config->webRoot, '', false, true); if($this->cookie->storyPreProjectID != $projectID) diff --git a/module/project/model.php b/module/project/model.php index 860c1aa1a4..e2f38add5f 100644 --- a/module/project/model.php +++ b/module/project/model.php @@ -1375,7 +1375,13 @@ class projectModel extends model if($this->app->user->admin) return true; /* Get all teams of all executions and group by executions, save it as static. */ - $executions = $this->dao->select('root, limited')->from(TABLE_TEAM)->where('type')->eq('project')->andWhere('account')->eq($this->app->user->account)->andWhere('limited')->eq('yes')->orderBy('root asc')->fetchPairs('root', 'root'); + $executions = $this->dao->select('root, limited')->from(TABLE_TEAM) + ->where('type')->in('sprint,stage') + ->andWhere('account')->eq($this->app->user->account) + ->andWhere('limited')->eq('yes') + ->orderBy('root asc') + ->fetchPairs('root', 'root'); + $_SESSION['limitedProjects'] = join(',', $executions); }