+ add funtion of task report

This commit is contained in:
wenjie@cnezsoft.com
2011-04-16 08:13:39 +00:00
parent a49e3510c8
commit 74a8292f49
4 changed files with 24 additions and 6 deletions
+1 -1
View File
@@ -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);
+11 -3
View File
@@ -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&param=myQueryID");
$this->config->project->search['queryID'] = $queryID;
+1
View File
@@ -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();
}
}
+11 -2
View File
@@ -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()
{