From 9390e960ee6bced1098b6faabbdc621e906f3e8f Mon Sep 17 00:00:00 2001 From: wangyidong Date: Fri, 17 Jul 2015 13:24:48 +0800 Subject: [PATCH] * finish task #3344. --- db/update7.2.4.sql | 1 + db/zentao.sql | 22 +++++++++---------- module/common/lang/en.php | 2 +- module/common/lang/zh-cn.php | 2 +- module/group/lang/resource.php | 6 ++--- module/my/control.php | 2 +- module/project/control.php | 1 - module/report/control.php | 11 +++++----- module/report/css/common.css | 1 + module/report/js/productsummary.js | 10 +++++++++ module/report/lang/en.php | 4 ++-- module/report/lang/zh-cn.php | 8 +++++-- module/report/model.php | 14 ++++++++---- ...tinfo.html.php => productsummary.html.php} | 11 ++++++++++ module/upgrade/model.php | 3 +++ 15 files changed, 67 insertions(+), 31 deletions(-) create mode 100644 db/update7.2.4.sql create mode 100644 module/report/js/productsummary.js rename module/report/view/{productinfo.html.php => productsummary.html.php} (85%) diff --git a/db/update7.2.4.sql b/db/update7.2.4.sql new file mode 100644 index 0000000000..7f3e92c7e8 --- /dev/null +++ b/db/update7.2.4.sql @@ -0,0 +1 @@ +UPDATE `zt_grouppriv` SET `method`='productSummary' WHERE `method`='productInfo' AND `module`='report'; diff --git a/db/zentao.sql b/db/zentao.sql index a703e2e0b0..8ff8adb710 100644 --- a/db/zentao.sql +++ b/db/zentao.sql @@ -906,7 +906,7 @@ INSERT INTO `zt_grouppriv` (`group`, `module`, `method`) VALUES (1, 'report', 'bugAssign'), (1, 'report', 'bugSummary'), (1, 'report', 'index'), -(1, 'report', 'productInfo'), +(1, 'report', 'productSummary'), (1, 'report', 'projectDeviation'), (1, 'report', 'workload'), (1, 'search', 'buildForm'), @@ -1113,7 +1113,7 @@ INSERT INTO `zt_grouppriv` (`group`, `module`, `method`) VALUES (2, 'report', 'bugAssign'), (2, 'report', 'bugSummary'), (2, 'report', 'index'), -(2, 'report', 'productInfo'), +(2, 'report', 'productSummary'), (2, 'report', 'projectDeviation'), (2, 'report', 'workload'), (2, 'search', 'buildForm'), @@ -1271,7 +1271,7 @@ INSERT INTO `zt_grouppriv` (`group`, `module`, `method`) VALUES (3, 'report', 'bugAssign'), (3, 'report', 'bugSummary'), (3, 'report', 'index'), -(3, 'report', 'productInfo'), +(3, 'report', 'productSummary'), (3, 'report', 'projectDeviation'), (3, 'report', 'workload'), (3, 'search', 'buildForm'), @@ -1487,7 +1487,7 @@ INSERT INTO `zt_grouppriv` (`group`, `module`, `method`) VALUES (4, 'report', 'bugAssign'), (4, 'report', 'bugSummary'), (4, 'report', 'index'), -(4, 'report', 'productInfo'), +(4, 'report', 'productSummary'), (4, 'report', 'projectDeviation'), (4, 'report', 'workload'), (4, 'search', 'buildForm'), @@ -1711,7 +1711,7 @@ INSERT INTO `zt_grouppriv` (`group`, `module`, `method`) VALUES (5, 'report', 'bugAssign'), (5, 'report', 'bugSummary'), (5, 'report', 'index'), -(5, 'report', 'productInfo'), +(5, 'report', 'productSummary'), (5, 'report', 'projectDeviation'), (5, 'report', 'workload'), (5, 'search', 'buildForm'), @@ -1915,7 +1915,7 @@ INSERT INTO `zt_grouppriv` (`group`, `module`, `method`) VALUES (6, 'report', 'bugAssign'), (6, 'report', 'bugSummary'), (6, 'report', 'index'), -(6, 'report', 'productInfo'), +(6, 'report', 'productSummary'), (6, 'report', 'projectDeviation'), (6, 'report', 'workload'), (6, 'search', 'buildForm'), @@ -2120,7 +2120,7 @@ INSERT INTO `zt_grouppriv` (`group`, `module`, `method`) VALUES (7, 'report', 'bugAssign'), (7, 'report', 'bugSummary'), (7, 'report', 'index'), -(7, 'report', 'productInfo'), +(7, 'report', 'productSummary'), (7, 'report', 'projectDeviation'), (7, 'report', 'workload'), (7, 'search', 'buildForm'), @@ -2300,7 +2300,7 @@ INSERT INTO `zt_grouppriv` (`group`, `module`, `method`) VALUES (8, 'report', 'bugAssign'), (8, 'report', 'bugSummary'), (8, 'report', 'index'), -(8, 'report', 'productInfo'), +(8, 'report', 'productSummary'), (8, 'report', 'projectDeviation'), (8, 'report', 'workload'), (8, 'search', 'buildForm'), @@ -2486,7 +2486,7 @@ INSERT INTO `zt_grouppriv` (`group`, `module`, `method`) VALUES (9, 'report', 'bugAssign'), (9, 'report', 'bugSummary'), (9, 'report', 'index'), -(9, 'report', 'productInfo'), +(9, 'report', 'productSummary'), (9, 'report', 'projectDeviation'), (9, 'report', 'workload'), (9, 'search', 'buildForm'), @@ -2603,7 +2603,7 @@ INSERT INTO `zt_grouppriv` (`group`, `module`, `method`) VALUES (10, 'report', 'bugAssign'), (10, 'report', 'bugSummary'), (10, 'report', 'index'), -(10, 'report', 'productInfo'), +(10, 'report', 'productSummary'), (10, 'report', 'projectDeviation'), (10, 'report', 'workload'), (10, 'search', 'buildForm'), @@ -2682,7 +2682,7 @@ INSERT INTO `zt_grouppriv` (`group`, `module`, `method`) VALUES (11, 'report', 'bugAssign'), (11, 'report', 'bugSummary'), (11, 'report', 'index'), -(11, 'report', 'productInfo'), +(11, 'report', 'productSummary'), (11, 'report', 'projectDeviation'), (11, 'report', 'workload'), (11, 'search', 'buildForm'), diff --git a/module/common/lang/en.php b/module/common/lang/en.php index 6982ed9e71..3bd510bb0c 100644 --- a/module/common/lang/en.php +++ b/module/common/lang/en.php @@ -249,7 +249,7 @@ $lang->doc->menu->create = array('link' => ' report = new stdclass(); $lang->report->menu = new stdclass(); -$lang->report->menu->product = array('link' => "{$lang->productcommon}|report|productinfo"); +$lang->report->menu->product = array('link' => "{$lang->productcommon}|report|productSummary"); $lang->report->menu->prj = array('link' => "{$lang->projectcommon}|report|projectdeviation"); $lang->report->menu->test = array('link' => 'Test|report|bugsummary', 'alias' => 'bugassign'); $lang->report->menu->staff = array('link' => 'Company|report|workload'); diff --git a/module/common/lang/zh-cn.php b/module/common/lang/zh-cn.php index f041b337c0..88e77a7a6d 100644 --- a/module/common/lang/zh-cn.php +++ b/module/common/lang/zh-cn.php @@ -249,7 +249,7 @@ $lang->doc->menu->create = array('link' => ' 添 $lang->report = new stdclass(); $lang->report->menu = new stdclass(); -$lang->report->menu->product = array('link' => $lang->productcommon . '|report|productinfo'); +$lang->report->menu->product = array('link' => $lang->productcommon . '|report|productSummary'); $lang->report->menu->prj = array('link' => $lang->projectcommon . '|report|projectdeviation'); $lang->report->menu->test = array('link' => '测试|report|bugsummary', 'alias' => 'bugassign'); $lang->report->menu->staff = array('link' => '组织|report|workload'); diff --git a/module/group/lang/resource.php b/module/group/lang/resource.php index 68d499a48b..5a6af43fdc 100644 --- a/module/group/lang/resource.php +++ b/module/group/lang/resource.php @@ -690,14 +690,14 @@ $lang->tree->methodOrder[30] = 'delete'; $lang->resource->report = new stdclass(); $lang->resource->report->index = 'index'; $lang->resource->report->projectDeviation = 'projectDeviation'; -$lang->resource->report->productInfo = 'productInfo'; +$lang->resource->report->productSummary = 'productSummary'; $lang->resource->report->bugSummary = 'bugSummary'; $lang->resource->report->bugAssign = 'bugAssign'; $lang->resource->report->workload = 'workload'; $lang->report->methodOrder[0] = 'index'; $lang->report->methodOrder[5] = 'projectDeviation'; -$lang->report->methodOrder[10] = 'productInfo'; +$lang->report->methodOrder[10] = 'productSummary'; $lang->report->methodOrder[15] = 'bugSummary'; $lang->report->methodOrder[17] = 'bugSummary'; $lang->report->methodOrder[20] = 'workload'; @@ -949,7 +949,7 @@ $lang->changelog['3.2'][] = 'task-batchEdit'; $lang->changelog['3.2'][] = 'release-export'; $lang->changelog['3.2'][] = 'report-index'; $lang->changelog['3.2'][] = 'report-projectDeviation'; -$lang->changelog['3.2'][] = 'report-productInfo'; +$lang->changelog['3.2'][] = 'report-productSummary'; $lang->changelog['3.2'][] = 'report-bugSummary'; $lang->changelog['3.2'][] = 'report-workload'; $lang->changelog['3.2'][] = 'tree-fix'; diff --git a/module/my/control.php b/module/my/control.php index 126b5f8a6f..fe7bdfe747 100644 --- a/module/my/control.php +++ b/module/my/control.php @@ -411,7 +411,7 @@ class my extends control $this->view->title = $this->lang->my->common . $this->lang->colon . $this->lang->my->profile; $this->view->position[] = $this->lang->my->profile; - $this->view->user = $this->user->getById($this->app->user->id); + $this->view->user = $user; $this->view->groups = $this->loadModel('group')->getByAccount($this->app->user->account); $this->view->deptPath = $this->dept->getParents($user->dept); $this->display(); diff --git a/module/project/control.php b/module/project/control.php index 5a7fe9b0f4..deb3ec35bc 100644 --- a/module/project/control.php +++ b/module/project/control.php @@ -757,7 +757,6 @@ class project extends control $this->view->title = $title; $this->view->position = $position; $this->view->tabID = 'burn'; - $this->view->charts = $charts; $this->view->projectID = $projectID; $this->view->projectName = $project->name; $this->view->type = $type; diff --git a/module/report/control.php b/module/report/control.php index 89929f0c38..f95c6c57a3 100644 --- a/module/report/control.php +++ b/module/report/control.php @@ -19,7 +19,7 @@ class report extends control */ public function index() { - $this->locate(inlink('productinfo')); + $this->locate(inlink('productSummary')); } /** @@ -43,16 +43,17 @@ class report extends control * @access public * @return void */ - public function productInfo() + public function productSummary($conditions = '') { $this->app->loadLang('product'); $this->app->loadLang('productplan'); $this->app->loadLang('story'); - $this->view->title = $this->lang->report->productInfo; - $this->view->position[] = $this->lang->report->productInfo; - $this->view->products = $this->report->getProducts(); + $this->view->title = $this->lang->report->productSummary; + $this->view->position[] = $this->lang->report->productSummary; + $this->view->products = $this->report->getProducts($conditions); $this->view->users = $this->loadModel('user')->getPairs('noletter|noclosed'); $this->view->submenu = 'product'; + $this->view->conditions = $conditions; $this->display(); } diff --git a/module/report/css/common.css b/module/report/css/common.css index a5a8bff3ce..b92e8ce365 100644 --- a/module/report/css/common.css +++ b/module/report/css/common.css @@ -31,3 +31,4 @@ td .deviation{padding-left:20px; text-align:left;} .d20{color:#33A52E;} #titlebar {display: none} +#conditions{ padding: 10px; margin: 0 0 10px; border: 1px solid #ddd;} diff --git a/module/report/js/productsummary.js b/module/report/js/productsummary.js new file mode 100644 index 0000000000..26199a6d7f --- /dev/null +++ b/module/report/js/productsummary.js @@ -0,0 +1,10 @@ +$('#conditions input:checkbox').change(function() +{ + var conditions = ''; + $('#conditions input:checkbox').each(function(i) + { + if($(this).prop('checked')) conditions += $(this).val() + ','; + }) + conditions = conditions.substring(0, conditions.length - 1); + location.href = createLink('report', 'productSummary', 'conditions=' + conditions); +}) diff --git a/module/report/lang/en.php b/module/report/lang/en.php index a543929da8..92fab63e8b 100644 --- a/module/report/lang/en.php +++ b/module/report/lang/en.php @@ -34,13 +34,13 @@ $lang->report->colors[] = 'A186BE'; $lang->report->singleColor[] = 'F6BD0F'; $lang->report->projectDeviation = $lang->projectcommon . ' deviation'; -$lang->report->productInfo = $lang->productcommon . ' information'; +$lang->report->productSummary = $lang->productcommon . ' summary'; $lang->report->bugSummary = 'Bug summary'; $lang->report->bugAssign = 'Bug assign'; $lang->report->workload = 'Workload'; $lang->reportList->project->lists[10] = $lang->projectcommon . ' deviation|report|projectdeviation'; -$lang->reportList->product->lists[10] = $lang->productcommon . ' information|report|productinfo'; +$lang->reportList->product->lists[10] = $lang->productcommon . ' summary|report|productsummary'; $lang->reportList->test->lists[10] = 'Bug summary|report|bugsummary'; $lang->reportList->test->lists[13] = 'Bug assign|report|bugassign'; $lang->reportList->staff->lists[10] = 'Workload|report|workload'; diff --git a/module/report/lang/zh-cn.php b/module/report/lang/zh-cn.php index 7c0c324d37..e9b534cc33 100644 --- a/module/report/lang/zh-cn.php +++ b/module/report/lang/zh-cn.php @@ -34,13 +34,13 @@ $lang->report->colors[] = 'A186BE'; $lang->report->singleColor[] = 'F6BD0F'; $lang->report->projectDeviation = $lang->projectcommon . '偏差报表'; -$lang->report->productInfo = $lang->productcommon . '信息统计表'; +$lang->report->productSummary = $lang->productcommon . '汇总表'; $lang->report->bugSummary = 'Bug汇总表'; $lang->report->bugAssign = 'Bug指派表'; $lang->report->workload = '员工负载表'; $lang->reportList->project->lists[10] = $lang->projectcommon . '偏差报表|report|projectdeviation'; -$lang->reportList->product->lists[10] = $lang->productcommon . '信息统计表|report|productinfo'; +$lang->reportList->product->lists[10] = $lang->productcommon . '汇总表|report|productsummary'; $lang->reportList->test->lists[10] = 'Bug汇总表|report|bugsummary'; $lang->reportList->test->lists[13] = 'Bug指派表|report|bugassign'; $lang->reportList->staff->lists[10] = '员工负载表|report|workload'; @@ -72,6 +72,10 @@ $lang->report->validRate = "有效率"; $lang->report->validRateTips = "方案为已解决或延期/状态为已解决或已关闭"; $lang->report->unplanned = '未计划'; +$lang->report->conditions = '筛选条件:'; +$lang->report->closedProduct = '关闭' . $lang->productcommon; +$lang->report->overduePlan = '过期计划'; + /* daily reminder. */ $lang->report->idAB = 'ID'; $lang->report->bugTitle = 'Bug标题'; diff --git a/module/report/model.php b/module/report/model.php index 0cce18cd20..53eca109f1 100644 --- a/module/report/model.php +++ b/module/report/model.php @@ -153,11 +153,15 @@ class reportModel extends model * @access public * @return array */ - public function getProducts() + public function getProducts($conditions) { - $products = $this->dao->select('id, code, name, PO')->from(TABLE_PRODUCT)->where('deleted')->eq(0)->fetchAll('id'); - $plans = $this->dao->select('*')->from(TABLE_PRODUCTPLAN)->where('deleted')->eq(0)->andWhere('product')->in(array_keys($products))->fetchAll('id'); - if(!$plans) return array(); + $products = $this->dao->select('id, code, name, PO')->from(TABLE_PRODUCT) + ->where('deleted')->eq(0) + ->beginIF(strpos($conditions, 'closedProduct') === false)->andWhere('status')->ne('closed')->fi() + ->fetchAll('id'); + $plans = $this->dao->select('*')->from(TABLE_PRODUCTPLAN)->where('deleted')->eq(0)->andWhere('product')->in(array_keys($products)) + ->beginIF(strpos($conditions, 'overduePlan') === false)->andWhere('end')->gt(date('Y-m-d'))->fi() + ->fetchAll('id'); foreach($plans as $plan) $products[$plan->product]->plans[$plan->id] = $plan; $planStories = $this->dao->select('plan, id, status')->from(TABLE_STORY)->where('deleted')->eq(0)->andWhere('plan')->in(array_keys($plans))->fetchGroup('plan', 'id'); @@ -181,6 +185,8 @@ class reportModel extends model $products[$product]->plans[0]->status[$story->status] = isset($products[$product]->plans[0]->status[$story->status]) ? $products[$product]->plans[0]->status[$story->status] + 1 : 1; } } + + unset($products['']); return $products; } diff --git a/module/report/view/productinfo.html.php b/module/report/view/productsummary.html.php similarity index 85% rename from module/report/view/productinfo.html.php rename to module/report/view/productsummary.html.php index 389ecc2ec3..9b71e1849f 100644 --- a/module/report/view/productinfo.html.php +++ b/module/report/view/productsummary.html.php @@ -15,6 +15,17 @@
+
+ report->conditions?> + + +
diff --git a/module/upgrade/model.php b/module/upgrade/model.php index 85b3731eb5..eb5370b37f 100644 --- a/module/upgrade/model.php +++ b/module/upgrade/model.php @@ -121,6 +121,8 @@ class upgradeModel extends model $this->execSQL($this->getUpgradeFile('7.1')); $this->initOrder(); case '7_2': + case '7_2_4': + $this->execSQL($this->getUpgradeFile('7.2.4')); default: if(!$this->isError()) $this->setting->updateVersion($this->config->version); } @@ -189,6 +191,7 @@ class upgradeModel extends model case '7_0': $confirmContent .= file_get_contents($this->getUpgradeFile('7.0')); case '7_1': $confirmContent .= file_get_contents($this->getUpgradeFile('7.1')); case '7_2': + case '7_2_4': $confirmContent .= file_get_contents($this->getUpgradeFile('7.2.4')); } return str_replace('zt_', $this->config->db->prefix, $confirmContent); }