From 6abb1f2aae6ebd05ee68aafae436d480c3f7d0d0 Mon Sep 17 00:00:00 2001 From: holan20180123 <56391770@qq.com> Date: Tue, 25 Aug 2020 09:37:08 +0800 Subject: [PATCH] * Add block for program statistic. --- module/block/control.php | 14 ++- .../block/view/printassigntomeblock.html.php | 14 ++- .../block/view/programstatisticblock.html.php | 73 +++++++++++++ module/group/lang/resource.php | 2 + module/program/lang/en.php | 102 +++++++++++------- module/program/lang/zh-cn.php | 9 ++ 6 files changed, 168 insertions(+), 46 deletions(-) diff --git a/module/block/control.php b/module/block/control.php index 9bfa0ef78d..52e3e9581e 100644 --- a/module/block/control.php +++ b/module/block/control.php @@ -1377,13 +1377,14 @@ class block extends control */ public function printAssignToMeBlock($longBlock = true) { - if(common::hasPriv('todo', 'view')) $hasViewPriv['todo'] = true; - if(common::hasPriv('task', 'view')) $hasViewPriv['task'] = true; - if(common::hasPriv('bug', 'view')) $hasViewPriv['bug'] = true; - if(common::hasPriv('risk', 'view')) $hasViewPriv['risk'] = true; + if(common::hasPriv('todo', 'view')) $hasViewPriv['todo'] = true; + if(common::hasPriv('task', 'view')) $hasViewPriv['task'] = true; + if(common::hasPriv('bug', 'view')) $hasViewPriv['bug'] = true; + if(common::hasPriv('risk', 'view')) $hasViewPriv['risk'] = true; $params = $this->get->param; $params = json_decode(base64_decode($params)); + $count = array(); if(isset($hasViewPriv['todo'])) { @@ -1407,6 +1408,7 @@ class block extends control $todo->begin = date::formatTime($todo->begin); $todo->end = date::formatTime($todo->end); } + $count['todo'] = count($todos); $this->view->todos = $todos; } if(isset($hasViewPriv['task'])) @@ -1420,6 +1422,7 @@ class block extends control if(isset($params->taskNum)) $stmt->limit($params->taskNum); $tasks = $stmt->fetchAll(); + $count['task'] = count($tasks); $this->view->tasks = $tasks; } if(isset($hasViewPriv['bug'])) @@ -1433,6 +1436,7 @@ class block extends control if(isset($params->bugNum)) $stmt->limit($params->bugNum); $bugs = $stmt->fetchAll(); + $count['bug'] = count($bugs); $this->view->bugs = $bugs; } if(isset($hasViewPriv['risk'])) @@ -1446,11 +1450,13 @@ class block extends control if(isset($params->riskNum)) $stmt->limit($params->riskNum); $risks = $stmt->fetchAll(); + $count['risk'] = count($risks); $this->view->risks = $risks; } $this->view->selfCall = $this->selfCall; $this->view->hasViewPriv = $hasViewPriv; + $this->view->count = $count; $this->view->longBlock = $longBlock; $this->display(); } diff --git a/module/block/view/printassigntomeblock.html.php b/module/block/view/printassigntomeblock.html.php index 379fa30f61..9085b18ead 100644 --- a/module/block/view/printassigntomeblock.html.php +++ b/module/block/view/printassigntomeblock.html.php @@ -16,7 +16,12 @@ $bool):?> global->flow != 'full' && $config->global->flow != 'onlyTask' && $type == 'task') continue;?> global->flow != 'full' && $config->global->flow != 'onlyTest' && $type == 'bug') continue;?> - >block->availableBlocks->$type;?> + > + + block->availableBlocks->$type;?> + '> + +
@@ -36,3 +41,10 @@ #assigntomeBlock > .nav {position: absolute; top: -41px; left: 120px;} #assigntomeBlock .block-todoes .todoes-form{top: -50px;} + diff --git a/module/block/view/programstatisticblock.html.php b/module/block/view/programstatisticblock.html.php index 00d3380f4b..d6a321b4e9 100644 --- a/module/block/view/programstatisticblock.html.php +++ b/module/block/view/programstatisticblock.html.php @@ -62,6 +62,14 @@ html[lang="en"] .product-info .type-info {color: #A6AAB8; text-align: center; po .status-count{margin:auto} .status-count tr:first-child td:last-child{color:#000;font-weight:bold} + +.block-statistic .progress-group{margin-top: 20px; height: 65px;} +.block-statistic .weekly-title{font-weight: bold; font-size:14px; color: #3C4253;} +.block-statistic .weekly-small{font-size:12px; color: #838A9D;} +.block-statistic .weekly-progress {font-weight: bold; font-size:24px;} +.block-statistic .weekly-name{font-size:14px; color: #838A9D;} +.block-statistic .weekly-value{font-size:18px; color: #3C4253;} +.block-statistic .col-6 .stage{margin-left: 10px}