diff --git a/module/file/control.php b/module/file/control.php index 4878d0d050..716985be6f 100644 --- a/module/file/control.php +++ b/module/file/control.php @@ -20,7 +20,7 @@ class file extends control * @return void */ public function buildForm($fileCount = 2, $percent = 0.9) - { + { if(!file_exists($this->file->savePath)) { printf($this->lang->file->errorNotExists, $this->file->savePath); diff --git a/module/project/control.php b/module/project/control.php index 2150dccf23..10cfa2b25f 100644 --- a/module/project/control.php +++ b/module/project/control.php @@ -107,8 +107,8 @@ class project extends control /* Set browseType, productID, moduleID and queryID. */ $browseType = strtolower($status); $queryID = ($browseType == 'bysearch') ? (int)$param : 0; - $project = $this->commonAction($projectID); - $projectID = $project->id; + $project = $this->commonAction($projectID); + $projectID = $project->id; /* Save to session. */ $uri = $this->app->getURI(true); @@ -151,7 +151,15 @@ class project extends control } $taskQuery = str_replace("`project` = 'all'", '1', $this->session->taskQuery); // Search all project. $tasks = $this->project->getSearchTasks($projectID, $taskQuery, $pager, $orderBy); - } + } + + if($browseType != 'needconfirm') + { + $sql = explode('WHERE', $this->dao->get()); + $sql = explode('ORDER', $sql[1]); + $this->session->set('taskReportCondition', $sql[0]); + } + /* Build the search form. */ $this->config->project->search['actionURL'] = $this->createLink('project', 'task', "projectID=$projectID&status=bySearch¶m=myQueryID"); $this->config->project->search['queryID'] = $queryID; diff --git a/module/task/control.php b/module/task/control.php index 7e5f0b503f..a5ef470631 100644 --- a/module/task/control.php +++ b/module/task/control.php @@ -521,6 +521,7 @@ class task extends control $this->view->projectID = $projectID; $this->view->browseType = $browseType; $this->view->checkedCharts = $this->post->charts ? join(',', $this->post->charts) : ''; + $this->display(); } } diff --git a/module/task/model.php b/module/task/model.php index eddb530b76..9331f757f2 100644 --- a/module/task/model.php +++ b/module/task/model.php @@ -541,11 +541,20 @@ class taskModel extends model public function getDataOftasksPerProject() { - + $datas = $this->dao->select('project as name, count(project) as value')->from(TABLE_TASK)->alias('t1')->where($this->session->taskReportCondition)->orderBy('value DESC')->fetchAll('name'); + if(!$datas) return array(); + $projects = $this->loadModel('project')->getPairs(); + foreach($datas as $projectID => $data) $data->name = isset($projects[$projectID]) ? $projects[$projectID] : $this->lang->report->undefined; + return $datas; } + public function getDataOftasksPerAssignedTo() { - + $datas = $this->dao->select('assignedTo as name, count(assignedTo) as value')->from(TABLE_TASK)->alias('t1')->where($this->session->taskReportCondition)->orderBy('value DESC')->fetchAll('name'); + if(!$datas) return array(); + $projects = $this->loadModel('project')->getPairs(); + foreach($datas as $projectID => $data) $data->name = isset($projects[$projectID]) ? $projects[$projectID] : $this->lang->report->undefined; + return $datas; } public function getDataOftasksPerType() {