From 7907a29cf8f2f8cf5a8a69d20c9153252bc7f383 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Tue, 3 Aug 2021 15:32:44 +0800 Subject: [PATCH] * finish task #40911. --- module/report/control.php | 2 +- module/report/css/annualdata.css | 2 +- module/report/js/annualdata.js | 26 +++++++++++++------------- module/report/lang/zh-cn.php | 4 ++-- module/report/model.php | 10 +++++----- 5 files changed, 22 insertions(+), 22 deletions(-) diff --git a/module/report/control.php b/module/report/control.php index daeca7d8cf..cdcfb3b4d8 100644 --- a/module/report/control.php +++ b/module/report/control.php @@ -353,7 +353,7 @@ class report extends control if(empty($dept) and empty($userID)) $data['statusStat'] = $this->report->getAllTimeStatusStat(); - $this->view->title = sprintf($this->lang->report->annualData->title, ($userID ? $users[$userID] : ($dept ? substr($depts[$dept], strrpos($depts[$dept], '/') + 1) : $depts[''])), $year); + $this->view->title = sprintf($this->lang->report->annualData->title, ($userID ? zget($users, $userID, '') : ($dept ? substr($depts[$dept], strrpos($depts[$dept], '/') + 1) : $depts[''])), $year); $this->view->data = $data; $this->view->year = $year; $this->view->users = $users; diff --git a/module/report/css/annualdata.css b/module/report/css/annualdata.css index 1cd848cfb4..2001f5f069 100644 --- a/module/report/css/annualdata.css +++ b/module/report/css/annualdata.css @@ -68,7 +68,7 @@ section.active {border: 1px solid rgb(0, 166, 255);} #executionData table tr>th, #productData table tr>th {color: #fff !important;} #executionData .c-story, #executionData .c-task, #executionData .c-bug {text-align: center; width: 105px;} #productData {margin-left: 20px;} -#productData .c-plan, #productData .c-requirement, #productData .c-story, #productData .c-finished {text-align: center; width: 105px;} +#productData .c-plan, #productData .c-requirement, #productData .c-story, #productData .c-closed {text-align: center; width: 105px;} #productData .c-story {width: 115px;} #productData .c-requirement {width: 140px;} .table-hover>tbody>tr:hover>td {background-color: #888 !important;} diff --git a/module/report/js/annualdata.js b/module/report/js/annualdata.js index a5c6d47674..67fa201cc7 100644 --- a/module/report/js/annualdata.js +++ b/module/report/js/annualdata.js @@ -1,10 +1,10 @@ /** * Draw status pie chart. - * - * @param string $id - * @param string $title - * @param array $data - * @param function $callback + * + * @param string $id + * @param string $title + * @param array $data + * @param function $callback * @access public * @return object */ @@ -66,18 +66,18 @@ function drawStatusPieChart(id, title, data, callback) } chart.setOption(option); if(typeof(callback) == 'function') chart.on('finished', callback); - + return chart; } /** * Draw months bar chart. - * - * @param string $id - * @param string $title - * @param array $legends - * @param array $xAxis - * @param array $data + * + * @param string $id + * @param string $title + * @param array $legends + * @param array $xAxis + * @param array $data * @access public * @return object */ @@ -141,7 +141,7 @@ function drawMonthsBarChart(id, title, legends, xAxis, data) series: data } chart.setOption(option); - + return chart; } diff --git a/module/report/lang/zh-cn.php b/module/report/lang/zh-cn.php index 8ae2b06d61..56d4bcf32d 100644 --- a/module/report/lang/zh-cn.php +++ b/module/report/lang/zh-cn.php @@ -164,8 +164,8 @@ if(!empty($config->URAndSR)) { $lang->report->annualData->productFields['requirement'] = "创建{$lang->URCommon}数"; } -$lang->report->annualData->productFields['story'] = "创建{$lang->SRCommon}数"; -$lang->report->annualData->productFields['finished'] = "完成需求数"; +$lang->report->annualData->productFields['story'] = "创建{$lang->SRCommon}数"; +$lang->report->annualData->productFields['closed'] = "关闭需求数"; $lang->report->annualData->objectTypeList['product'] = $lang->productCommon; $lang->report->annualData->objectTypeList['story'] = "需求"; diff --git a/module/report/model.php b/module/report/model.php index 7f8d4294d5..05520623d3 100644 --- a/module/report/model.php +++ b/module/report/model.php @@ -642,7 +642,7 @@ class reportModel extends model } /** - * Get count of created story,plan and finished story by accounts every product in this year. + * Get count of created story,plan and closed story by accounts every product in this year. * * @param array $accounts * @param int $year @@ -709,7 +709,7 @@ class reportModel extends model ->groupBy('product') ->fetchAll('product'); - $closedStoryStats = $this->dao->select("product,sum(if((status = 'closed'), 1, 0)) as finished")->from(TABLE_STORY) + $closedStoryStats = $this->dao->select("product,sum(if((status = 'closed'), 1, 0)) as closed")->from(TABLE_STORY) ->where('product')->in(array_keys($products)) ->andWhere('deleted')->eq(0) ->andWhere('LEFT(closedDate, 4)')->eq($year) @@ -717,13 +717,13 @@ class reportModel extends model ->groupBy('product') ->fetchAll('product'); - /* Merge created plan, created story and finished story in every product. */ + /* Merge created plan, created story and closed story in every product. */ foreach($products as $productID => $product) { $product->plan = 0; $product->requirement = 0; $product->story = 0; - $product->finished = 0; + $product->closed = 0; $plans = zget($planGroups, $productID, array()); if($plans) $product->plan = count($plans); @@ -736,7 +736,7 @@ class reportModel extends model } $closedStoryStat = zget($closedStoryStats, $productID, ''); - if($closedStoryStat) $product->finished = $closedStoryStat->finished; + if($closedStoryStat) $product->closed = $closedStoryStat->closed; } return $products;