From 4659feabc84ed6c3cb72e0fa1e089a25d5f05fc3 Mon Sep 17 00:00:00 2001 From: wangchunsheng Date: Tue, 28 Jun 2011 15:07:36 +0000 Subject: [PATCH] * move the project stats code to the model from index/control.php. --- module/project/model.php | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/module/project/model.php b/module/project/model.php index 661365d5c0..1bf720d597 100644 --- a/module/project/model.php +++ b/module/project/model.php @@ -240,6 +240,34 @@ class projectModel extends model ->fetchGroup('product'); } + /** + * Get project stats. + * + * @access public + * @return array + */ + public function getProjectStats() + { + $this->loadModel('report'); + + $this->lang->project->charts->burn->graph->caption = ''; + $this->lang->project->charts->burn->graph->xAxisName = ""; + $this->lang->project->charts->burn->graph->yAxisName = ""; + + $burns = array(); + $projects = $this->getList('doing', $this->config->index->projectCounts); + foreach($projects as $key => $project) + { + if($this->checkPriv($project)) + { + $dataXML = $this->report->createSingleXML($this->getBurnData($project->id), $this->lang->project->charts->burn->graph, $this->lang->report->singleColor); + $burns[$project->id] = $this->report->createJSChart('line', $dataXML, 'auto', 210); + } + } + + return array('projects' => $projects, 'burns' => $burns); + } + /** * Get project by id. *