diff --git a/module/bug/model.php b/module/bug/model.php index 457e9ef61a..d92d3389c1 100644 --- a/module/bug/model.php +++ b/module/bug/model.php @@ -1031,6 +1031,7 @@ class bugModel extends model if(strpos($orderBy, 'pri_') !== false) $orderBy = str_replace('pri_', 'priOrder_', $orderBy); if(strpos($orderBy, 'severity_') !== false) $orderBy = str_replace('severity_', 'severityOrder_', $orderBy); + if(strpos($orderBy, 'status') !== false) $orderBy = str_replace('status', 'statusOrder', $orderBy); $type = strtolower($type); if($type == 'bysearch') @@ -1051,7 +1052,7 @@ class bugModel extends model $condition = "($condition)"; } - $bugs = $this->dao->select("t1.*, IF(t1.`pri` = 0, {$this->config->maxPriValue}, t1.`pri`) AS priOrder, IF(t1.`severity` = 0, {$this->config->maxPriValue}, t1.`severity`) AS severityOrder")->from(TABLE_BUG)->alias('t1') + $bugs = $this->dao->select("t1.*, IF(t1.`pri` = 0, {$this->config->maxPriValue}, t1.`pri`) AS priOrder, IF(t1.`severity` = 0, {$this->config->maxPriValue}, t1.`severity`) AS severityOrder, INSTR('active,resolved,closed,', t1.status) as statusOrder")->from(TABLE_BUG)->alias('t1') ->leftJoin(TABLE_MODULE)->alias('t2')->on('t1.module = t2.id') ->where('t1.deleted')->eq('0') ->beginIF(!empty($productID) && $branchID !== 'all')->andWhere('t1.branch')->eq($branchID)->fi() diff --git a/module/task/tao.php b/module/task/tao.php index d95daacdf7..e5d4e85960 100644 --- a/module/task/tao.php +++ b/module/task/tao.php @@ -511,7 +511,8 @@ class taskTao extends taskModel { if(is_string($type)) $type = strtolower($type); $orderBy = str_replace('pri_', 'priOrder_', $orderBy); - $fields = "DISTINCT t1.*, t2.id AS storyID, t2.title AS storyTitle, t2.product, t2.branch, t2.version AS latestStoryVersion, t2.status AS storyStatus, IF(t1.`pri` = 0, {$this->config->maxPriValue}, t1.`pri`) as priOrder"; + $orderBy = str_replace('status', 'statusOrder', $orderBy); + $fields = "DISTINCT t1.*, t2.id AS storyID, t2.title AS storyTitle, t2.product, t2.branch, t2.version AS latestStoryVersion, t2.status AS storyStatus, IF(t1.`pri` = 0, {$this->config->maxPriValue}, t1.`pri`) as priOrder, INSTR('wait,doing,done,pause,cancel,closed,', t1.status) as statusOrder"; ($this->config->edition == 'max' or $this->config->edition == 'ipd') && $fields .= ', t5.name as designName, t5.version as latestDesignVersion'; $actionIDList = array();