+ add the feature of report of bug.

This commit is contained in:
wangchunsheng
2010-03-09 09:34:55 +00:00
parent 9e713a5bd4
commit 1811187425
10 changed files with 394 additions and 26 deletions
+37
View File
@@ -112,6 +112,11 @@ class bug extends control
$bugs = $this->dao->select('*')->from(TABLE_BUG)->where($bugQuery)->orderBy($orderBy)->page($pager)->fetchAll();
}
/* 处理查询语句,获取条件部分,并记录session。*/
$sql = explode('WHERE', $this->dao->get());
$sql = explode('ORDER', $sql[1]);
$this->session->set('bugReportCondition', $sql[0]);
$users = $this->user->getPairs('noletter');
$header['title'] = $this->products[$productID] . $this->lang->colon . $this->lang->bug->common;
@@ -134,6 +139,38 @@ class bug extends control
$this->display();
}
/* 统计报表。*/
public function report($productID, $browseType, $moduleID)
{
$this->loadModel('report');
$this->view->charts = array();
$this->view->rendJS = '';
if(!empty($_POST))
{
foreach($this->post->charts as $chart)
{
$chartFunc = 'getDataOf' . $chart;
$chartData = $this->bug->$chartFunc();
$chartOption = $this->lang->bug->report->$chart;
$this->bug->mergeChartOption($chart);
$chartXML = $this->report->createSingleXML($chartData, $chartOption->graph);
$this->view->charts[$chart] = $this->report->createJSChart($chartOption->swf, $chartXML, $chartOption->width, $chartOption->height);
$this->view->datas[$chart] = $this->report->computePercent($chartData);
}
$this->view->rendJS = $this->report->rendJsCharts(count($this->view->charts));
}
$this->bug->setMenu($this->products, $productID);
$this->view->header->title = $this->products[$productID] . $this->lang->colon . $this->lang->bug->common;
$this->view->productID = $productID;
$this->view->browseType = $browseType;
$this->view->moduleID = $moduleID;
$this->view->checkedCharts = $this->post->charts ? join(',', $this->post->charts) : '';
$this->display();
}
/* 创建Bug。extras是其他的参数,key和value之间使用=连接,多个键值对之间使用,隔开。*/
public function create($productID, $extras = '')
{