diff --git a/module/testreport/control.php b/module/testreport/control.php
index f42f97fc9a..a374571706 100644
--- a/module/testreport/control.php
+++ b/module/testreport/control.php
@@ -158,6 +158,8 @@ class testreport extends control
$tasks = array($task->id => $task);
$owner = $task->owner;
+ $this->setChartDatas($objectID);
+
$this->view->title = $task->name . $this->lang->testreport->create;
$this->view->position[] = html::a(inlink('browse', "objectID=$productID&objectType=product&extra={$task->id}"), $task->name);
$this->view->position[] = $this->lang->testreport->create;
@@ -306,6 +308,8 @@ class testreport extends control
$bugs = $this->testreport->getBugs4Test($builds, $report->product, $report->begin, $report->end);
}
$tasks = array($task->id => $task);
+
+ $this->setChartDatas($report->objectID);
}
else
{
@@ -390,6 +394,8 @@ class testreport extends control
$cases = $this->testreport->getTaskCases($tasks, $report->cases);
$bugInfo = $this->testreport->getBugInfo($tasks, $report->product, $report->begin, $report->end, $builds);
+ if($report->objectType == 'testtask') $this->setChartDatas($report->objectID);
+
$this->view->title = $report->title;
$this->view->browseLink = $browseLink;
$this->view->position[] = $report->title;
@@ -461,4 +467,29 @@ class testreport extends control
return $projectID;
}
}
+
+ /**
+ * Set chart datas of cases.
+ *
+ * @param int $taskID
+ * @access public
+ * @return void
+ */
+ public function setChartDatas($taskID)
+ {
+ $this->loadModel('report');
+ $task = $this->loadModel('testtask')->getById($taskID);
+ foreach($this->lang->testtask->report->charts as $chart => $title)
+ {
+ if(strpos($chart, 'testTask') === false) continue;
+
+ $chartFunc = 'getDataOf' . $chart;
+ $chartData = $this->testtask->$chartFunc($taskID);
+ $chartOption = $this->testtask->mergeChartOption($chart);
+ if(!empty($chartType)) $chartOption->type = $chartType;
+
+ $this->view->charts[$chart] = $chartOption;
+ $this->view->datas[$chart] = $this->report->computePercent($chartData);
+ }
+ }
}
diff --git a/module/testreport/lang/zh-cn.php b/module/testreport/lang/zh-cn.php
index 7894d57ac9..55b334c8c7 100644
--- a/module/testreport/lang/zh-cn.php
+++ b/module/testreport/lang/zh-cn.php
@@ -24,7 +24,7 @@ $lang->testreport->bugs = '测试的Bug';
$lang->testreport->builds = '版本信息';
$lang->testreport->goal = '项目目标';
$lang->testreport->cases = '用例';
-$lang->testreport->bugInfo = '缺陷分布';
+$lang->testreport->bugInfo = 'Bug分布';
$lang->testreport->report = '总结';
$lang->testreport->legacyBugs = '遗留的Bug';
$lang->testreport->createdDate = '创建时间';
diff --git a/module/testreport/lang/zh-tw.php b/module/testreport/lang/zh-tw.php
index c0355c0dc1..82ce33904f 100644
--- a/module/testreport/lang/zh-tw.php
+++ b/module/testreport/lang/zh-tw.php
@@ -24,7 +24,7 @@ $lang->testreport->bugs = '測試的Bug';
$lang->testreport->builds = '版本信息';
$lang->testreport->goal = '項目目標';
$lang->testreport->cases = '用例';
-$lang->testreport->bugInfo = '缺陷分佈';
+$lang->testreport->bugInfo = 'Bug分佈';
$lang->testreport->report = '總結';
$lang->testreport->legacyBugs = '遺留的Bug';
$lang->testreport->createdDate = '創建時間';
diff --git a/module/testreport/view/blockbugreport.html.php b/module/testreport/view/blockbugreport.html.php
index c5acb1ac11..232a061728 100644
--- a/module/testreport/view/blockbugreport.html.php
+++ b/module/testreport/view/blockbugreport.html.php
@@ -1,4 +1,50 @@