-
-
-
-
-
-
-
- | issue->id;?> |
- id;?> |
-
-
- | issue->type;?> |
- issue->typeList, $issue->type);?> |
-
-
-
- | issue->severity;?> |
- severity;?> |
-
-
- | issue->pri;?> |
- pri;?> |
-
-
- | issue->resolvedDate;?> |
- resolvedDate;?> |
-
-
- | issue->owner;?> |
- owner);?> |
-
-
- | issue->assignedTo;?> |
- assignedTo);?> |
-
-
- | issue->createdBy;?> |
- createdBy);?> |
-
-
- | issue->createdDate;?> |
- createdDate;?> |
-
-
- | issue->editedBy;?> |
- editedBy);?> |
-
-
- | issue->editedDate;?> |
- editedDate;?> |
-
-
- | issue->assignedBy;?> |
- assignedBy);?> |
-
-
- | issue->assignedDate;?> |
- assignedDate;?> |
-
-
- | issue->closedDate;?> |
- closedDate;?> |
-
-
- | issue->activateBy;?> |
- activateBy);?> |
-
-
- | issue->activateDate;?> |
- activateDate;?> |
-
-
- | issue->closeBy;?> |
- closeBy);?> |
-
-
- | issue->status;?> |
- issue->statusList, $issue->status);?> |
-
-
-
-
-
+
+ issue->basicInfo;?>
+
+
+
+
+ | issue->id;?> |
+ id;?> |
+
+
+ | issue->type;?> |
+ issue->typeList, $issue->type);?> |
+
+
+ | issue->severity;?> |
+ severity;?> |
+
+
+ | issue->pri;?> |
+ pri;?> |
+
+
+ | issue->deadline;?> |
+ deadline;?> |
+
+
+ | issue->resolvedDate;?> |
+ resolvedDate;?> |
+
+
+ | issue->owner;?> |
+ owner);?> |
+
+
+ | issue->assignedTo;?> |
+ assignedTo);?> |
+
+
+ | issue->createdBy;?> |
+ createdBy);?> |
+
+
+ | issue->createdDate;?> |
+ createdDate;?> |
+
+
+ | issue->editedBy;?> |
+ editedBy);?> |
+
+
+ | issue->editedDate;?> |
+ editedDate;?> |
+
+
+ | issue->assignedBy;?> |
+ assignedBy);?> |
+
+
+ | issue->assignedDate;?> |
+ assignedDate;?> |
+
+
+ | issue->closedDate;?> |
+ closedDate;?> |
+
+
+ | issue->activateBy;?> |
+ activateBy);?> |
+
+
+ | issue->activateDate;?> |
+ activateDate;?> |
+
+
+ | issue->closeBy;?> |
+ closeBy);?> |
+
+
+ | issue->status;?> |
+ issue->statusList, $issue->status);?> |
+
+
+
From 848c7cf866689748297e0c1a2e792c3976e5e2b0 Mon Sep 17 00:00:00 2001
From: holan20180123 <56391770@qq.com>
Date: Fri, 21 Aug 2020 15:37:59 +0800
Subject: [PATCH 2/2] * Add recent program block.
---
module/block/control.php | 22 +++++-
module/block/css/dashboard.css | 21 ++++++
module/block/lang/de.php | 2 +
module/block/lang/en.php | 2 +
module/block/lang/fr.php | 2 +
module/block/lang/vi.php | 2 +
module/block/lang/zh-cn.php | 2 +
module/block/lang/zh-tw.php | 2 +
module/block/model.php | 75 +++++++++++++++++++
module/block/view/recentprogramblock.html.php | 58 ++++++++++++++
module/risk/lang/zh-cn.php | 2 +-
11 files changed, 188 insertions(+), 2 deletions(-)
diff --git a/module/block/control.php b/module/block/control.php
index adeb8f0fd8..46671f201e 100644
--- a/module/block/control.php
+++ b/module/block/control.php
@@ -1392,14 +1392,34 @@ class block extends control
$this->display();
}
+ /**
+ * Print contribute block.
+ *
+ * @access public
+ * @return void
+ */
public function printContributeBlock()
{
$this->view->data = $this->block->getContributeBlockData();
}
+ /**
+ * Print recent program block.
+ *
+ * @access public
+ * @return void
+ */
public function printRecentprogramBlock()
{
-
+ $programs = $this->block->getRecentProject();
+
+ $this->loadModel('project');
+ foreach($programs as $programID => $program)
+ {
+ $program->teamCount = count($this->project->getTeamMembers($program->id));
+ }
+
+ $this->view->programs = $programs;
}
public function printProgramteamBlock()
diff --git a/module/block/css/dashboard.css b/module/block/css/dashboard.css
index 6d6324f9c5..97ce2ac5d6 100644
--- a/module/block/css/dashboard.css
+++ b/module/block/css/dashboard.css
@@ -26,3 +26,24 @@ body {padding-bottom: 20px;}
#dashboard .block-sm .hide-in-sm {display: none;}
#dashboard .block-dynamic .panel-body{overflow-x:hidden;}
.modal-body{padding: 10px 20px 20px 20px;}
+
+#cards {margin: 0 10px;}
+#cards > .col {width: 33.33%;}
+#cards .panel {margin: 10px 0; border: 1px solid #DCDCDC; border-radius: 2px; box-shadow: none; height: 146px; cursor: pointer;}
+#cards .panel:hover {border-color: #006AF1; box-shadow: 0 0 10px 0 rgba(0,0,100,.25);}
+#cards .panel-heading {padding: 12px 24px 10px 16px;}
+#cards .panel-body {padding: 0 16px 16px;}
+#cards .panel-actions {padding: 7px 0;}
+#cards .panel-actions .dropdown-menu > li > a {padding-left: 5px; text-align: left;}
+#cards .panel-actions .dropdown-menu > li > a > i {opacity: .5; display: inline-block; margin-right: 4px; width: 18px; text-align: center;}
+#cards .panel-actions .dropdown-menu > li > a:hover > i {opacity: 1;}
+#cards .project-type-label {padding: 1px 2px;}
+#cards .project-name {font-size: 16px; font-weight: normal; display: inline-block; max-width: 80%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle;}
+#cards .project-infos {font-size: 12px;}
+#cards .project-infos > span {display: inline-block; line-height: 12px;}
+#cards .project-infos > span > .icon {font-size: 12px; display: inline-block; position: relative; top: -1px}
+#cards .project-infos > span + span {margin-left: 15px;}
+#cards .project-detail {position: absolute; bottom: 16px; left: 16px; right: 16px; font-size: 12px;}
+#cards .project-detail > p {margin-bottom: 8px;}
+#cards .project-detail .progress {height: 4px;}
+#cards .project-detail .progress-text-left .progress-text {width: 50px; left: -50px;}
diff --git a/module/block/lang/de.php b/module/block/lang/de.php
index d47e52bf16..c551adf31c 100644
--- a/module/block/lang/de.php
+++ b/module/block/lang/de.php
@@ -50,6 +50,8 @@ $lang->block->openedStories = 'The Number Of Stories Created';
$lang->block->resolvedTasks = 'The Number Of Tasks Resolved';
$lang->block->resolvedBugs = 'The Number Of Bugs Resolved';
$lang->block->openedTestcases = 'The Number Of Test Case Created';
+$lang->block->cmmi = 'CMMI 3';
+$lang->block->scrum = 'Scrum+';
$lang->block->params = new stdclass();
$lang->block->params->name = 'Name';
diff --git a/module/block/lang/en.php b/module/block/lang/en.php
index 6b5af66058..b5416da341 100644
--- a/module/block/lang/en.php
+++ b/module/block/lang/en.php
@@ -50,6 +50,8 @@ $lang->block->openedStories = 'The Number Of Stories Created';
$lang->block->resolvedTasks = 'The Number Of Tasks Resolved';
$lang->block->resolvedBugs = 'The Number Of Bugs Resolved';
$lang->block->openedTestcases = 'The Number Of Test Case Created';
+$lang->block->cmmi = 'CMMI 3';
+$lang->block->scrum = 'Scrum+';
$lang->block->params = new stdclass();
$lang->block->params->name = 'Name';
diff --git a/module/block/lang/fr.php b/module/block/lang/fr.php
index 6e528fcec0..a3ecc79af9 100644
--- a/module/block/lang/fr.php
+++ b/module/block/lang/fr.php
@@ -50,6 +50,8 @@ $lang->block->openedStories = 'The Number Of Stories Created';
$lang->block->resolvedTasks = 'The Number Of Tasks Resolved';
$lang->block->resolvedBugs = 'The Number Of Bugs Resolved';
$lang->block->openedTestcases = 'The Number Of Test Case Created';
+$lang->block->cmmi = 'CMMI 3';
+$lang->block->scrum = 'Scrum+';
$lang->block->params = new stdclass();
$lang->block->params->name = 'Nom';
diff --git a/module/block/lang/vi.php b/module/block/lang/vi.php
index 84f76232e4..bc392ee9fd 100644
--- a/module/block/lang/vi.php
+++ b/module/block/lang/vi.php
@@ -50,6 +50,8 @@ $lang->block->openedStories = 'The Number Of Stories Created';
$lang->block->resolvedTasks = 'The Number Of Tasks Resolved';
$lang->block->resolvedBugs = 'The Number Of Bugs Resolved';
$lang->block->openedTestcases = 'The Number Of Test Case Created';
+$lang->block->cmmi = 'CMMI 3';
+$lang->block->scrum = 'Scrum+';
$lang->block->params = new stdclass();
$lang->block->params->name = 'Tên';
diff --git a/module/block/lang/zh-cn.php b/module/block/lang/zh-cn.php
index 27fa1591f5..70af0bd912 100644
--- a/module/block/lang/zh-cn.php
+++ b/module/block/lang/zh-cn.php
@@ -50,6 +50,8 @@ $lang->block->openedStories = '创建的需求数';
$lang->block->resolvedTasks = '完成的任务数';
$lang->block->resolvedBugs = '解决Bug数';
$lang->block->openedTestcases = '创建用例数';
+$lang->block->cmmi = 'CMMI 3';
+$lang->block->scrum = 'Scrum+';
$lang->block->params = new stdclass();
$lang->block->params->name = '参数名称';
diff --git a/module/block/lang/zh-tw.php b/module/block/lang/zh-tw.php
index 7eb4b5e6d5..68d200e7c5 100644
--- a/module/block/lang/zh-tw.php
+++ b/module/block/lang/zh-tw.php
@@ -50,6 +50,8 @@ $lang->block->openedStories = '創建的需求數';
$lang->block->resolvedTasks = '完成的任務數';
$lang->block->resolvedBugs = '解決Bug數';
$lang->block->openedTestcases = '創建用例數';
+$lang->block->cmmi = 'CMMI 3';
+$lang->block->scrum = 'Scrum+';
$lang->block->params = new stdclass();
$lang->block->params->name = '參數名稱';
diff --git a/module/block/model.php b/module/block/model.php
index af8849250f..2b003ab6f4 100644
--- a/module/block/model.php
+++ b/module/block/model.php
@@ -623,6 +623,12 @@ class blockModel extends model
return $blockPairs;
}
+ /**
+ * Get contribute block data.
+ *
+ * @access public
+ * @return array
+ */
public function getContributeBlockData()
{
$data = array();
@@ -653,6 +659,75 @@ class blockModel extends model
return $data;
}
+ public function getRecentProject()
+ {
+ $projects = $this->loadModel('program')->getUserPrograms('all', 'id_desc', 3);
+ if(empty($projects)) return array();
+
+ $this->loadModel('project');
+ foreach($projects as $projectID => $project)
+ {
+ $project->teamCount = count($this->project->getTeamMembers($project->id));
+ }
+
+ $projectKeys = array_keys($projects);
+ $hours = array();
+ $emptyHour = array('totalEstimate' => 0, 'totalConsumed' => 0, 'totalLeft' => 0, 'progress' => 0);
+
+ /* Get all tasks and compute totalEstimate, totalConsumed, totalLeft, progress according to them. */
+ $tasks = $this->dao->select('id, project, estimate, consumed, `left`, status, closedReason')
+ ->from(TABLE_TASK)
+ ->where('project')->in($projectKeys)
+ ->andWhere('parent')->lt(1)
+ ->andWhere('deleted')->eq(0)
+ ->fetchGroup('project', 'id');
+
+ /* Compute totalEstimate, totalConsumed, totalLeft. */
+ foreach($tasks as $projectID => $projectTasks)
+ {
+ $hour = (object)$emptyHour;
+ foreach($projectTasks as $task)
+ {
+ if($task->status != 'cancel')
+ {
+ $hour->totalEstimate += $task->estimate;
+ $hour->totalConsumed += $task->consumed;
+ }
+ if($task->status != 'cancel' and $task->status != 'closed') $hour->totalLeft += $task->left;
+ }
+ $hours[$projectID] = $hour;
+ }
+
+ /* Compute totalReal and progress. */
+ foreach($hours as $hour)
+ {
+ $hour->totalEstimate = round($hour->totalEstimate, 1) ;
+ $hour->totalConsumed = round($hour->totalConsumed, 1);
+ $hour->totalLeft = round($hour->totalLeft, 1);
+ $hour->totalReal = $hour->totalConsumed + $hour->totalLeft;
+ $hour->progress = $hour->totalReal ? round($hour->totalConsumed / $hour->totalReal, 3) * 100 : 0;
+ }
+
+ /* Process projects. */
+ foreach($projects as $key => $project)
+ {
+ // Process the end time.
+ $project->end = date(DT_DATE1, strtotime($project->end));
+
+ /* Judge whether the project is delayed. */
+ if($project->status != 'done' and $project->status != 'closed' and $project->status != 'suspended')
+ {
+ $delay = helper::diffDate(helper::today(), $project->end);
+ if($delay > 0) $project->delay = $delay;
+ }
+
+ /* Process the hours. */
+ $project->hours = isset($hours[$project->id]) ? $hours[$project->id] : (object)$emptyHour;
+ }
+
+ return $projects;
+ }
+
/**
* Build number params.
*
diff --git a/module/block/view/recentprogramblock.html.php b/module/block/view/recentprogramblock.html.php
index e69de29bb2..b1110f8a46 100644
--- a/module/block/view/recentprogramblock.html.php
+++ b/module/block/view/recentprogramblock.html.php
@@ -0,0 +1,58 @@
+
+ $project):?>
+
+
+
+ template === 'cmmi'): ?>
+
block->cmmi; ?>
+
+
block->scrum; ?>
+
+
name;?>
+
+
+
+
+ program->membersUnit, $project->teamCount); ?>
+ program->hoursUnit, $project->hours->totalEstimate); ?>
+ budget . '' . zget($lang->program->unitList, $project->budgetUnit);?>
+
+ template === 'cmmi'): ?>
+
+
program->ongoingStage; ?>
+
project->statusList, $project->status);?>
+
+
+
+
program->lastIteration; ?>
+
+
name; ?>
+
+
+
+ hours->progress;?>%
+
+
+
+
+
+
+
+
+
+
+
diff --git a/module/risk/lang/zh-cn.php b/module/risk/lang/zh-cn.php
index 60a1814c91..bd87a83d7a 100644
--- a/module/risk/lang/zh-cn.php
+++ b/module/risk/lang/zh-cn.php
@@ -40,7 +40,7 @@ $lang->risk->cancelDate = '取消日期';
$lang->risk->cancelReason = '取消原因';
$lang->risk->resolvedBy = '解决者';
$lang->risk->closedDate = '关闭日期';
-$lang->risk->actualClosedDate = '关闭日期';
+$lang->risk->actualClosedDate = '实际关闭日期';
$lang->risk->resolution = '解决措施';
$lang->risk->hangupBy = '由谁挂起';
$lang->risk->hangupDate = '挂起日期';