diff --git a/module/release/model.php b/module/release/model.php index 4c456018b8..db98fadded 100644 --- a/module/release/model.php +++ b/module/release/model.php @@ -111,13 +111,13 @@ class releaseModel extends model { $productID = (int)$productID; $branch = (int)$branch; - $buildID = 0; + $buildID = strpos($this->config->release->create->requiredFields, 'build') === false ? 0 : ''; /* Check date must be not more than today. */ if($this->post->date > date('Y-m-d')) return dao::$errors[] = $this->lang->release->errorDate; /* Auto create build when release is not link build. */ - if($this->post->build == false && $this->post->name) + if($this->post->build == false and $this->post->name and strpos($this->config->release->create->requiredFields, 'build') === false) { $build = $this->dao->select('*')->from(TABLE_BUILD) ->where('deleted')->eq('0') @@ -161,7 +161,7 @@ class releaseModel extends model ->stripTags($this->config->release->editor->create['id'], $this->config->allowedTags) ->remove('allchecker,files,labels,uid') ->get(); - + $release = $this->loadModel('file')->processImgURL($release, $this->config->release->editor->create['id'], $this->post->uid); $this->dao->insert(TABLE_RELEASE)->data($release) ->autoCheck() diff --git a/module/task/model.php b/module/task/model.php index d5f4b7988d..34e1b10230 100644 --- a/module/task/model.php +++ b/module/task/model.php @@ -2492,6 +2492,7 @@ class taskModel extends model { $tasks = $this->dao->select('id,deadline')->from(TABLE_TASK)->alias('t1') ->where($this->reportCondition()) + ->orderBy('deadline asc') ->fetchAll('id'); if(!$tasks) return array(); @@ -2663,7 +2664,7 @@ class taskModel extends model if(!isset($fields[$task->$field])) $fields[$task->$field] = 0; $fields[$task->$field] ++; } - asort($fields); + if($field != 'date' and $field != 'deadline') asort($fields); foreach($fields as $field => $count) { $data = new stdclass();