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;?> -