From 9979876a0d26c8984fe86e87b95058dad0c6c77c Mon Sep 17 00:00:00 2001 From: mayue Date: Wed, 17 Nov 2021 16:54:16 +0800 Subject: [PATCH] * Fix bug #16257. --- module/execution/control.php | 6 +++--- module/project/model.php | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/module/execution/control.php b/module/execution/control.php index 6981d3f0de..1146acd555 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -1382,7 +1382,7 @@ class execution extends control $this->view->code = $code; $this->view->team = $team; $this->view->teams = array(0 => '') + $this->execution->getTeamPairsByProject((int)$projectID); - $this->view->allProjects = array(0 => '') + $this->project->getPairsByModel(); + $this->view->allProjects = array(0 => '') + $this->project->getPairsByModel($model = 'all', $programID = 0, $param = 'noclosed'); $this->view->executionID = $executionID; $this->view->productID = $productID; $this->view->projectID = $projectID; @@ -1538,7 +1538,7 @@ class execution extends control $this->view->qdUsers = $qdUsers; $this->view->rdUsers = $rdUsers; $this->view->users = $this->user->getPairs('nodeleted|noclosed'); - $this->view->allProjects = $this->project->getPairsByModel(); + $this->view->allProjects = $this->project->getPairsByModel($model = 'all', $programID = 0, $param = 'noclosed'); $this->view->groups = $this->loadModel('group')->getPairs(); $this->view->allProducts = $allProducts; $this->view->linkedProducts = $linkedProducts; @@ -1619,7 +1619,7 @@ class execution extends control $this->view->position[] = $this->lang->execution->batchEdit; $this->view->executionIDList = $executionIDList; $this->view->executions = $executions; - $this->view->allProjects = $this->project->getPairsByModel(); + $this->view->allProjects = $this->project->getPairsByModel($model = 'all', $programID = 0, $param = 'noclosed'); $this->view->pmUsers = $pmUsers; $this->view->poUsers = $poUsers; $this->view->qdUsers = $qdUsers; diff --git a/module/project/model.php b/module/project/model.php index b667be0876..1725ab1d59 100644 --- a/module/project/model.php +++ b/module/project/model.php @@ -647,7 +647,7 @@ class projectModel extends model * @access public * @return array */ - public function getPairsByModel($model = 'all', $programID = 0) + public function getPairsByModel($model = 'all', $programID = 0, $param = '') { if(defined('TUTORIAL')) return $this->loadModel('tutorial')->getProjectPairs(); @@ -655,6 +655,7 @@ class projectModel extends model ->where('type')->eq('project') ->beginIF($programID)->andWhere('parent')->eq($programID)->fi() ->beginIF($model != 'all')->andWhere('model')->eq($model)->fi() + ->beginIF(strpos($param, 'noclosed') !== false)->andWhere('status')->ne('closed')->fi() ->andWhere('deleted')->eq('0') ->beginIF(!$this->app->user->admin)->andWhere('id')->in($this->app->user->view->projects)->fi() ->orderBy('id_desc')