From 52a40837df1279ddf3d4fe596a4c9da2aaa318bd Mon Sep 17 00:00:00 2001 From: tianshujie Date: Tue, 4 Apr 2023 10:33:46 +0800 Subject: [PATCH] * Fix bug #33617. --- module/api/control.php | 2 +- module/doc/control.php | 12 ++++++------ module/doc/model.php | 10 ++++++---- module/execution/model.php | 2 +- 4 files changed, 14 insertions(+), 12 deletions(-) diff --git a/module/api/control.php b/module/api/control.php index 7385d80a54..892b236a29 100755 --- a/module/api/control.php +++ b/module/api/control.php @@ -431,7 +431,7 @@ class api extends control $this->view->objectID = $objectID; $this->view->groups = $this->loadModel('group')->getPairs(); $this->view->users = $this->user->getPairs('nocode|noclosed'); - $this->view->projects = $this->loadModel('project')->getPairsByModel(); + $this->view->projects = $this->loadModel('project')->getPairsByModel('scrum,waterfall,agileplus,waterfallplus'); $this->view->products = $this->loadModel('product')->getPairs(); $this->display(); diff --git a/module/doc/control.php b/module/doc/control.php index f750ff202b..36d3026a6d 100755 --- a/module/doc/control.php +++ b/module/doc/control.php @@ -151,7 +151,7 @@ class doc extends control if($type == 'product') $objects = $this->product->getPairs(); if($type == 'project') { - $objects = $this->project->getPairsByProgram(); + $objects = $this->project->getPairsByProgram('', 'all', false, 'order_asc', 'kanban'); if($this->app->tab == 'doc') { $this->view->executionPairs = array(0 => '') + $this->execution->getPairs($objectID, 'all', 'multiple,leaf,noprefix'); @@ -391,13 +391,13 @@ class doc extends control $objects = array(); if($objectType == 'project') { - $objects = $this->loadModel('project')->getPairs(); - $this->view->executions = array(0 => '') + $this->loadModel('execution')->getPairs($objectID, 'all', 'multiple,leaf,noprefix'); + $objects = $this->project->getPairsByProgram('', 'all', false, 'order_asc', 'kanban'); + $this->view->executions = array(0 => '') + $this->loadModel('execution')->getPairs($objectID, 'sprint,stage', 'multiple,leaf,noprefix'); } elseif($objectType == 'execution') { $execution = $this->loadModel('execution')->getById($objectID); - $objects = $this->execution->getPairs($execution->project, 'all', "multiple,leaf,noprefix"); + $objects = $this->execution->getPairs($execution->project, 'sprint,stage', "multiple,leaf,noprefix"); } elseif($objectType == 'product') { @@ -552,7 +552,7 @@ class doc extends control $objects = array(); if($objectType == 'project') { - $objects = $this->loadModel('project')->getPairs(); + $objects = $this->project->getPairsByProgram('', 'all', false, 'order_asc', 'kanban'); } elseif($objectType == 'execution') { @@ -1494,7 +1494,7 @@ class doc extends control public function ajaxGetExecution($projectID) { $executions = $this->execution->getList($projectID); - $executionPairs = array(0 => '') + $this->execution->getPairs($projectID, 'all', 'multiple,leaf,noprefix'); + $executionPairs = array(0 => '') + $this->execution->getPairs($projectID, 'sprint,stage', 'multiple,leaf,noprefix'); $project = $this->project->getById($projectID); $disabled = $project->multiple ? '' : 'disabled'; diff --git a/module/doc/model.php b/module/doc/model.php index 1504433d4f..6948a52e0f 100644 --- a/module/doc/model.php +++ b/module/doc/model.php @@ -986,8 +986,8 @@ class docModel extends model $this->config->doc->search['module'] = 'contributeDoc'; $products = $this->product->getPairs(); - $this->config->doc->search['params']['project']['values'] = array('' => '') + $this->loadModel('project')->getPairsByProgram() + array('all' => $this->lang->doc->allProjects); - $this->config->doc->search['params']['execution']['values'] = array('' => '') + $this->loadModel('execution')->getPairs(0, 'all', 'multiple,leaf,noprefix') + array('all' => $this->lang->doc->allExecutions); + $this->config->doc->search['params']['project']['values'] = array('' => '') + $this->loadModel('project')->getPairsByProgram('', 'all', false, 'order_asc', 'kanban') + array('all' => $this->lang->doc->allProjects); + $this->config->doc->search['params']['execution']['values'] = array('' => '') + $this->loadModel('execution')->getPairs(0, 'sprint,stage', 'multiple,leaf,noprefix') + array('all' => $this->lang->doc->allExecutions); $this->config->doc->search['params']['lib']['values'] = array('' => '') + $this->loadModel('doc')->getLibs('all', 'withObject') + array('all' => $this->lang->doclib->all); $this->config->doc->search['params']['product']['values'] = array('' => '') + $products + array('all' => $this->lang->doc->allProduct); @@ -1008,7 +1008,7 @@ class docModel extends model if($type == 'project') { - $this->config->doc->search['params']['execution']['values'] = array('' => '') + $this->loadModel('execution')->getPairs($this->session->project, 'all', 'multiple,leaf,noprefix') + array('all' => $this->lang->doc->allExecutions); + $this->config->doc->search['params']['execution']['values'] = array('' => '') + $this->loadModel('execution')->getPairs($this->session->project, 'sprint,stage', 'multiple,leaf,noprefix') + array('all' => $this->lang->doc->allExecutions); } else { @@ -1024,7 +1024,7 @@ class docModel extends model else { $products = $this->product->getPairs('nocode', $this->session->project); - $this->config->doc->search['params']['execution']['values'] = array('' => '') + $this->loadModel('execution')->getPairs($this->session->project, 'all', 'multiple,leaf,noprefix') + array('all' => $this->lang->doc->allExecutions); + $this->config->doc->search['params']['execution']['values'] = array('' => '') + $this->loadModel('execution')->getPairs($this->session->project, 'sprint,stage', 'multiple,leaf,noprefix') + array('all' => $this->lang->doc->allExecutions); $this->config->doc->search['params']['lib']['values'] = array('' => '', $libID => ($libID ? $libs[$libID] : 0), 'all' => $this->lang->doclib->all); $this->config->doc->search['params']['product']['values'] = array('' => '') + $products + array('all' => $this->lang->doc->allProduct); } @@ -1587,6 +1587,7 @@ class docModel extends model ->leftjoin(TABLE_DOCLIB)->alias('t2')->on('t2.project=t1.id') ->where("CONCAT(',', t2.users, ',')")->like("%,{$this->app->user->account},%") ->andWhere('t1.vision')->eq($this->config->vision) + ->andWhere('t1.model')->ne('kanban') ->andWhere('t1.deleted')->eq(0) ->beginIF(!$this->app->user->admin)->andWhere('t1.id')->in($this->app->user->view->projects)->fi() ->fetchPairs(); @@ -1596,6 +1597,7 @@ class docModel extends model ->where('type')->eq('project') ->andWhere('vision')->eq($this->config->vision) ->andWhere('deleted')->eq(0) + ->andWhere('model')->ne('kanban') ->beginIF(!$this->app->user->admin)->andWhere('id')->in($this->app->user->view->projects)->fi() ->orderBy('order_asc') ->fetchAll('id'); diff --git a/module/execution/model.php b/module/execution/model.php index 57e01c6c50..a343b46f3f 100755 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -1638,7 +1638,7 @@ class executionModel extends model ->beginIF(strpos($mode, 'multiple') !== false)->andWhere('multiple')->eq('1')->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() + ->beginIF($type != 'all')->andWhere('type')->in($type)->fi() ->beginIF(strpos($mode, 'withdelete') === false)->andWhere('deleted')->eq(0)->fi() ->beginIF(!$this->app->user->admin and strpos($mode, 'all') === false)->andWhere('id')->in($this->app->user->view->sprints)->fi() ->orderBy($orderBy)