* move the project stats code to the model from index/control.php.

This commit is contained in:
wangchunsheng
2011-06-28 15:07:36 +00:00
parent e601537e9b
commit 4659feabc8
+28
View File
@@ -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.
*