From 0f9ee29fec40c22b643152d189d104223c5ccdb8 Mon Sep 17 00:00:00 2001 From: liuhong Date: Fri, 30 Sep 2022 07:20:17 +0000 Subject: [PATCH] *Fix bug #28214. --- module/execution/config.php | 8 ++++++++ module/execution/lang/de.php | 1 + module/execution/lang/en.php | 1 + module/execution/lang/fr.php | 1 + module/execution/lang/vi.php | 1 + module/execution/lang/zh-cn.php | 1 + module/execution/lang/zh-tw.php | 1 + module/execution/model.php | 19 +++++++++++++++++++ 8 files changed, 33 insertions(+) diff --git a/module/execution/config.php b/module/execution/config.php index e3faacb40e..c32e04c599 100644 --- a/module/execution/config.php +++ b/module/execution/config.php @@ -135,6 +135,7 @@ $config->execution->all->search['fields']['realEnd'] = $lang->execution-> $config->execution->all->search['fields']['closedBy'] = $lang->execution->closedBy; $config->execution->all->search['fields']['lastEditedDate'] = $lang->execution->lastEditedDate; $config->execution->all->search['fields']['closedDate'] = $lang->execution->closedDate; +$config->execution->all->search['fields']['teamCount'] = $lang->execution->teamCount; $config->execution->all->search['params']['name'] = array('operator' => 'include', 'control' => 'input', 'values' => ''); $config->execution->all->search['params']['id'] = array('operator' => '=', 'control' => 'input', 'values' => ''); @@ -150,6 +151,7 @@ $config->execution->all->search['params']['realEnd'] = array('operator' = $config->execution->all->search['params']['closedBy'] = array('operator' => '=', 'control' => 'select', 'values' => 'users'); $config->execution->all->search['params']['lastEditedDate'] = array('operator' => '=', 'control' => 'input', 'values' => '', 'class' => 'date'); $config->execution->all->search['params']['closedDate'] = array('operator' => '=', 'control' => 'input', 'values' => '', 'class' => 'date'); +$config->execution->all->search['params']['teamCount'] = array('operator' => '=', 'control' => 'input', 'values' => ''); $config->printKanban = new stdClass(); $config->printKanban->col['story'] = 1; @@ -255,6 +257,12 @@ $config->execution->datatable->fieldList['realEnd']['width'] = '90'; $config->execution->datatable->fieldList['realEnd']['required'] = 'no'; $config->execution->datatable->fieldList['realEnd']['sort'] = 'no'; +$config->execution->datatable->fieldList['teamCount']['title'] = 'teamCount'; +$config->execution->datatable->fieldList['teamCount']['fixed'] = 'no'; +$config->execution->datatable->fieldList['teamCount']['width'] = '80'; +$config->execution->datatable->fieldList['teamCount']['required'] = 'no'; +$config->execution->datatable->fieldList['teamCount']['sort'] = 'no'; + $config->execution->datatable->fieldList['estimate']['title'] = 'estimate'; $config->execution->datatable->fieldList['estimate']['fixed'] = 'no'; $config->execution->datatable->fieldList['estimate']['width'] = '70'; diff --git a/module/execution/lang/de.php b/module/execution/lang/de.php index 9c88536042..de9321ad5f 100644 --- a/module/execution/lang/de.php +++ b/module/execution/lang/de.php @@ -54,6 +54,7 @@ $lang->execution->end = 'Ende'; $lang->execution->dateRange = 'Dauer'; $lang->execution->realBeganAB = 'Actual Begin'; $lang->execution->realEndAB = 'Actual End'; +$lang->execution->teamCount = 'Anzahl der Personen'; $lang->execution->realBegan = 'Tatsächlicher Start'; $lang->execution->realEnd = 'Tatsächliches Ende'; $lang->execution->to = 'An'; diff --git a/module/execution/lang/en.php b/module/execution/lang/en.php index e5cfcf3eeb..b85b3635f2 100644 --- a/module/execution/lang/en.php +++ b/module/execution/lang/en.php @@ -54,6 +54,7 @@ $lang->execution->end = 'Planned End'; $lang->execution->dateRange = 'Plan Duration'; $lang->execution->realBeganAB = 'Actual Begin'; $lang->execution->realEndAB = 'Actual End'; +$lang->execution->teamCount = 'number of people'; $lang->execution->realBegan = 'Actual Begin'; $lang->execution->realEnd = 'Actual End'; $lang->execution->to = 'To'; diff --git a/module/execution/lang/fr.php b/module/execution/lang/fr.php index 6764593377..30283cd12a 100644 --- a/module/execution/lang/fr.php +++ b/module/execution/lang/fr.php @@ -54,6 +54,7 @@ $lang->execution->end = 'Fin'; $lang->execution->dateRange = 'Durée'; $lang->execution->realBeganAB = 'Actual Begin'; $lang->execution->realEndAB = 'Actual End'; +$lang->execution->teamCount = 'nombre de personnes'; $lang->execution->realBegan = 'Début effectif'; $lang->execution->realEnd = 'Clôture effective'; $lang->execution->to = 'à'; diff --git a/module/execution/lang/vi.php b/module/execution/lang/vi.php index 5031004d73..e13b1a4eca 100644 --- a/module/execution/lang/vi.php +++ b/module/execution/lang/vi.php @@ -54,6 +54,7 @@ $lang->execution->RD = 'Quản lý phát hành'; $lang->execution->release = 'Phát hành'; $lang->execution->acl = 'Quyền truy cập'; $lang->execution->teamname = 'Tên đội nhóm'; +$lang->execution->teamCount = 'số người'; $lang->execution->order = "Đánh giá {$lang->executionCommon}"; $lang->execution->orderAB = "Đánh giá"; $lang->execution->products = "Liên kết {$lang->productCommon}"; diff --git a/module/execution/lang/zh-cn.php b/module/execution/lang/zh-cn.php index 5d3bd56de2..479d165527 100644 --- a/module/execution/lang/zh-cn.php +++ b/module/execution/lang/zh-cn.php @@ -54,6 +54,7 @@ $lang->execution->end = '计划完成'; $lang->execution->dateRange = '计划起止日期'; $lang->execution->realBeganAB = '实际开始'; $lang->execution->realEndAB = '实际完成'; +$lang->execution->teamCount = '人数'; $lang->execution->realBegan = '实际开始日期'; $lang->execution->realEnd = '实际完成日期'; $lang->execution->to = '至'; diff --git a/module/execution/lang/zh-tw.php b/module/execution/lang/zh-tw.php index 1c06be7dd3..2eb28b233b 100644 --- a/module/execution/lang/zh-tw.php +++ b/module/execution/lang/zh-tw.php @@ -54,6 +54,7 @@ $lang->execution->execPM = "{$lang->execution->common}負責人"; $lang->execution->QD = '測試負責人'; $lang->execution->RD = '發佈負責人'; $lang->execution->release = '發佈'; +$lang->execution->teamCount = '人數'; $lang->execution->acl = '訪問控制'; $lang->execution->teamname = '團隊名稱'; $lang->execution->updateOrder = '排序'; diff --git a/module/execution/model.php b/module/execution/model.php index c8eb61f0ed..f98a19d950 100644 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -1531,6 +1531,15 @@ class executionModel extends model $hours = $this->loadModel('project')->computerProgress($executions); $burns = $this->getBurnData($executions); + /* Get the number of execution teams. */ + $teams = $this->dao->select('t1.root,count(t1.id) as teams')->from(TABLE_TEAM)->alias('t1') + ->leftJoin(TABLE_USER)->alias('t2')->on('t1.account=t2.account') + ->where('t1.root')->in(array_keys($executions)) + ->andWhere('t1.type')->ne('project') + ->andWhere('t2.deleted')->eq(0) + ->groupBy('t1.root') + ->fetchAll('root'); + if($withTasks) $executionTasks = $this->getTaskGroupByExecution(array_keys($executions)); /* Process executions. */ @@ -1557,6 +1566,7 @@ class executionModel extends model /* Process the hours. */ $execution->hours = isset($hours[$execution->id]) ? $hours[$execution->id] : (object)$emptyHour; + $execution->teamCount = isset($teams[$execution->id]) ? $teams[$execution->id]->teams : 0; if(isset($executionTasks) and isset($executionTasks[$execution->id])) { @@ -4841,6 +4851,12 @@ class executionModel extends model if(!empty($execution->children)) $class .= ' has-child'; } + if($id == 'teamCount') + { + $title = " title='{$execution->teamCount}'"; + $class .= ' text-right'; + } + if($id == 'project') $title = " title='{$execution->projectName}'"; if($id == 'code') $title = " title='{$execution->code}'"; @@ -4909,6 +4925,9 @@ class executionModel extends model case 'begin': echo helper::isZeroDate($execution->begin) ? '' : $execution->begin; break; + case 'teamCount': + echo $execution->teamCount; + break; case 'end': echo helper::isZeroDate($execution->end) ? '' : $execution->end; break;