From 05dca799a078c382e68bd1086a0f941f683acaa7 Mon Sep 17 00:00:00 2001 From: holan20180123 <56391770@qq.com> Date: Wed, 2 Dec 2020 17:04:20 +0800 Subject: [PATCH] * Fix bug 3718. --- module/project/model.php | 5 +++-- module/todo/control.php | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/module/project/model.php b/module/project/model.php index 1a789467dd..f7c4c8d808 100644 --- a/module/project/model.php +++ b/module/project/model.php @@ -834,7 +834,7 @@ class projectModel extends model * Get execution pairs. * * @param int $projectID - * @param string $type all|sprint|stage|kanban + * @param string $type all|execution|sprint|stage|kanban * @param string $mode all|noclosed or empty * @access public * @return array @@ -850,7 +850,8 @@ class projectModel extends model $executions = $this->dao->select('*, IF(INSTR(" done,closed", status) < 2, 0, 1) AS isDone')->from(TABLE_EXECUTION) ->where('deleted')->eq(0) ->beginIF($projectID)->andWhere('project')->eq($projectID)->fi() - ->beginIF($type != 'all')->andWhere('type')->eq($type)->fi() + ->beginIF(!$projectID and $type == 'execution')->andWhere('project')->gt(0)->fi() + ->beginIF($type != 'all' and $type != 'execution')->andWhere('type')->eq($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) diff --git a/module/todo/control.php b/module/todo/control.php index b90ba280cf..0a64937f18 100644 --- a/module/todo/control.php +++ b/module/todo/control.php @@ -376,8 +376,8 @@ class todo extends control $this->view->users = $this->user->getPairs('noletter'); $this->view->actions = $this->loadModel('action')->getList('todo', $todoID); $this->view->from = $from; - $this->view->projects = $this->loadModel('project')->getExecutionPairs($this->session->PRJ); - $this->view->products = $this->loadModel('product')->getPairs('', $this->session->PRJ); + $this->view->projects = $this->loadModel('project')->getExecutionPairs(0, 'execution'); + $this->view->products = $this->loadModel('product')->getPairs(); $this->display(); }