From 41ffd2d5f7aee398c7ccfd1bdbdf3eb866cad7c3 Mon Sep 17 00:00:00 2001 From: fujia Date: Fri, 12 Nov 2010 06:03:44 +0000 Subject: [PATCH] + complete task #325:add bugsPerAssignedTo to bug report. --- module/bug/lang/en.php | 2 ++ module/bug/lang/zh-cn.php | 2 ++ module/bug/model.php | 16 ++++++++++++++-- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/module/bug/lang/en.php b/module/bug/lang/en.php index 14434a9d7b..1bacb11239 100644 --- a/module/bug/lang/en.php +++ b/module/bug/lang/en.php @@ -225,6 +225,7 @@ $lang->bug->report->charts['bugsPerSeverity'] = 'Severity'; $lang->bug->report->charts['bugsPerResolution'] = 'Resolution'; $lang->bug->report->charts['bugsPerStatus'] = 'Status'; $lang->bug->report->charts['bugsPerType'] = 'Type'; +$lang->bug->report->charts['bugsPerAssignedTo'] = 'AssignedTo'; //$lang->bug->report->charts['bugLiveDays'] = 'Bug处理时间统计'; //$lang->bug->report->charts['bugHistories'] = 'Bug处理步骤统计'; @@ -267,6 +268,7 @@ $lang->bug->report->bugsPerSeverity->graph->xAxisName = 'Severity'; $lang->bug->report->bugsPerResolution->graph->xAxisName = 'Resolution'; $lang->bug->report->bugsPerStatus->graph->xAxisName = 'Status'; $lang->bug->report->bugsPerType->graph->xAxisName = 'Type'; +$lang->bug->report->bugsPerAssignedTo->graph->xAxisName = 'AssignedTo'; $lang->bug->report->bugLiveDays->graph->xAxisName = 'Live days'; $lang->bug->report->bugHistories->graph->xAxisName = 'Histories'; diff --git a/module/bug/lang/zh-cn.php b/module/bug/lang/zh-cn.php index ad40088106..5a7c8c01df 100644 --- a/module/bug/lang/zh-cn.php +++ b/module/bug/lang/zh-cn.php @@ -225,6 +225,7 @@ $lang->bug->report->charts['bugsPerSeverity'] = 'Bug严重程度统计'; $lang->bug->report->charts['bugsPerResolution'] = 'Bug解决方案统计'; $lang->bug->report->charts['bugsPerStatus'] = 'Bug状态统计'; $lang->bug->report->charts['bugsPerType'] = 'Bug类型统计'; +$lang->bug->report->charts['bugsPerAssignedTo'] = '指派给统计'; //$lang->bug->report->charts['bugLiveDays'] = 'Bug处理时间统计'; //$lang->bug->report->charts['bugHistories'] = 'Bug处理步骤统计'; @@ -267,6 +268,7 @@ $lang->bug->report->bugsPerSeverity->graph->xAxisName = '严重程度'; $lang->bug->report->bugsPerResolution->graph->xAxisName = '解决方案'; $lang->bug->report->bugsPerStatus->graph->xAxisName = '状态'; $lang->bug->report->bugsPerType->graph->xAxisName = '类型'; +$lang->bug->report->bugsPerAssignedTo->graph->xAxisName = '指派给'; $lang->bug->report->bugLiveDays->graph->xAxisName = '处理时间'; $lang->bug->report->bugHistories->graph->xAxisName = '处理步骤'; diff --git a/module/bug/model.php b/module/bug/model.php index 58286ef6fb..db26526473 100644 --- a/module/bug/model.php +++ b/module/bug/model.php @@ -409,8 +409,20 @@ class bugModel extends model foreach($datas as $type => $data) if(isset($this->lang->bug->typeList[$type])) $data->name = $this->lang->bug->typeList[$type]; return $datas; } - - + + /* 按assignedTo统计。*/ + public function getDataOfBugsPerAssignedTo() + { + $datas = $this->dao->select('assignedTo AS name, COUNT(*) AS value') + ->from(TABLE_BUG)->where($this->session->bugReportCondition) + ->groupBy('name') + ->orderBy('value DESC')->fetchAll('name'); + if(!$datas) return array(); + if(!isset($this->users)) $this->users = $this->loadModel('user')->getPairs('noletter'); + foreach($datas as $account => $data) if(isset($this->users[$account])) $data->name = $this->users[$account]; + return $datas; + } + /* 合并公共的chart设置和当前chart的设置。*/ public function mergeChartOption($chartType) {