From 9a5c00cf7231e70054b459c2e97be47443d9491d Mon Sep 17 00:00:00 2001 From: wangyidong Date: Mon, 12 Sep 2016 14:14:59 +0800 Subject: [PATCH] * fix bug #908. --- module/task/control.php | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/module/task/control.php b/module/task/control.php index 64eb1c5159..8b2b33a885 100644 --- a/module/task/control.php +++ b/module/task/control.php @@ -1151,9 +1151,18 @@ class task extends control } /* Get tasks. */ - $tasks = $this->dao->select('*')->from(TABLE_TASK)->alias('t1')->where($this->session->taskQueryCondition) - ->beginIF($this->post->exportType == 'selected')->andWhere('t1.id')->in($this->cookie->checkedItem)->fi() - ->orderBy($orderBy)->fetchAll('id'); + $tasks = array(); + if($this->session->taskOnlyCondition) + { + $tasks = $this->dao->select('*')->from(TABLE_TASK)->alias('t1')->where($this->session->taskQueryCondition) + ->beginIF($this->post->exportType == 'selected')->andWhere('t1.id')->in($this->cookie->checkedItem)->fi() + ->orderBy($orderBy)->fetchAll('id'); + } + else + { + $stmt = $this->dbh->query($this->session->taskQueryCondition . ($this->post->exportType == 'selected' ? " AND t1.id IN({$this->cookie->checkedItem})" : '') . " ORDER BY " . strtr($orderBy, '_', ' ')); + while($row = $stmt->fetch()) $tasks[$row->id] = $row; + } /* Get users and projects. */ $users = $this->loadModel('user')->getPairs('noletter');