From 2ce5ef1d5b99208185eda2729cd05a6546303b2e Mon Sep 17 00:00:00 2001 From: Yagami <976204163@qq.com> Date: Mon, 18 Jan 2021 10:13:34 +0800 Subject: [PATCH] * Fix story hour detail. --- framework/router.class.php | 15 +++++++++++---- module/program/config.php | 4 ++-- module/program/model.php | 7 +++++-- module/story/model.php | 8 ++++++-- module/task/config.php | 2 +- module/task/model.php | 6 +++--- 6 files changed, 28 insertions(+), 14 deletions(-) diff --git a/framework/router.class.php b/framework/router.class.php index 45e8d26e75..676fb8a0ca 100755 --- a/framework/router.class.php +++ b/framework/router.class.php @@ -152,10 +152,12 @@ class router extends baseRouter */ public function setCommonLang() { - if(!defined('ITERATION_KEY')) define('ITERATION_KEY', 0); - if(!defined('SPRINT_KEY')) define('SPRINT_KEY', 1); - if(!defined('STAGE_KEY')) define('STAGE_KEY', 2); - if(!defined('PRODUCT_KEY')) define('PRODUCT_KEY', 0); + if(!defined('ITERATION_KEY')) define('ITERATION_KEY', 0); + if(!defined('SPRINT_KEY')) define('SPRINT_KEY', 1); + if(!defined('STAGE_KEY')) define('STAGE_KEY', 2); + if(!defined('PRODUCT_KEY')) define('PRODUCT_KEY', 0); + if(!defined('STORYPOINT_KEY')) define('STORYPOINT_KEY', 1); + if(!defined('FUNCTIONPOINT_KEY')) define('FUNCTIONPOINT_KEY', 2); global $lang, $app; $sprintConcept = $hourPoint = false; @@ -188,6 +190,11 @@ class router extends baseRouter if($setting->key == 'URSR') $URSR = $setting->value; } + /* Record hour unit. */ + $config->hourUnit = 'H'; + if($hourKey == STORYPOINT_KEY) $config->hourUnit = 'SP'; + if($hourKey == FUNCTIONPOINT_KEY) $config->hourUnit = 'FP'; + $model = new stdclass(); $model->model = 'scrum'; if($this->session->PRJ) $model = $this->dbh->query('SELECT model FROM' . TABLE_PROJECT . "WHERE id = {$this->session->PRJ}")->fetch(); diff --git a/module/program/config.php b/module/program/config.php index f870092a81..d19cbe3621 100644 --- a/module/program/config.php +++ b/module/program/config.php @@ -93,13 +93,13 @@ $config->program->datatable->fieldList['teamCount']['sort'] = 'no'; $config->program->datatable->fieldList['PRJEstimate']['title'] = 'PRJEstimate'; $config->program->datatable->fieldList['PRJEstimate']['fixed'] = 'no'; -$config->program->datatable->fieldList['PRJEstimate']['width'] = '50'; +$config->program->datatable->fieldList['PRJEstimate']['width'] = '70'; $config->program->datatable->fieldList['PRJEstimate']['required'] = 'no'; $config->program->datatable->fieldList['PRJEstimate']['sort'] = 'no'; $config->program->datatable->fieldList['PRJConsume']['title'] = 'PRJConsume'; $config->program->datatable->fieldList['PRJConsume']['fixed'] = 'no'; -$config->program->datatable->fieldList['PRJConsume']['width'] = '50'; +$config->program->datatable->fieldList['PRJConsume']['width'] = '70'; $config->program->datatable->fieldList['PRJConsume']['required'] = 'no'; $config->program->datatable->fieldList['PRJConsume']['sort'] = 'no'; diff --git a/module/program/model.php b/module/program/model.php index 6bd4441406..aebdd879d6 100644 --- a/module/program/model.php +++ b/module/program/model.php @@ -1665,6 +1665,9 @@ class programModel extends model $title = "title='{$PRJProgram}'"; } + if($id == 'PRJEstimate') $title = "title={$project->hours->totalEstimate}{$this->config->hourUnit}"; + if($id == 'PRJConsume') $title = "title={$project->hours->totalConsumed}{$this->config->hourUnit}"; + echo ""; switch($id) { @@ -1699,10 +1702,10 @@ class programModel extends model echo $project->teamCount; break; case 'PRJEstimate': - echo $project->hours->totalEstimate; + echo $project->hours->totalEstimate . ' ' . $this->config->hourUnit; break; case 'PRJConsume': - echo $project->hours->totalConsumed; + echo $project->hours->totalConsumed . ' ' . $this->config->hourUnit; break; case 'PRJSurplus': echo $project->hours->totalLeft; diff --git a/module/story/model.php b/module/story/model.php index aef6483d5e..5e08ae4d07 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -2392,7 +2392,7 @@ class storyModel extends model $branches = array(); foreach($stories as $story) { - $story->estimate .= ' ' . $this->lang->story->hour; + $story->estimate .= ' ' . $this->config->hourUnit; if(empty($story->branch) and $story->productType != 'normal') $branches[$story->productBranch][$story->id] = $story->id; } foreach($branches as $branchID => $storyIdList) @@ -3310,6 +3310,10 @@ class storyModel extends model $title = $story->sourceNote; $class .= ' text-ellipsis'; } + else if($id == 'estimate') + { + $title = $story->estimate . ' ' . $this->config->hourUnit; + } else if($id == 'reviewedBy') { $reviewedBy = ''; @@ -3385,7 +3389,7 @@ class storyModel extends model echo ''; break; case 'estimate': - echo $story->estimate . ' ' . $this->lang->story->hour; + echo $story->estimate . ' ' . $this->config->hourUnit; break; case 'stage': if(isset($storyStages[$story->id]) and !empty($branches)) diff --git a/module/task/config.php b/module/task/config.php index edccd5afde..70d3942a39 100644 --- a/module/task/config.php +++ b/module/task/config.php @@ -87,7 +87,7 @@ $config->task->datatable->fieldList['consumed']['required'] = 'no'; $config->task->datatable->fieldList['left']['title'] = 'leftAB'; $config->task->datatable->fieldList['left']['fixed'] = 'no'; -$config->task->datatable->fieldList['left']['width'] = '70'; +$config->task->datatable->fieldList['left']['width'] = '80'; $config->task->datatable->fieldList['left']['required'] = 'no'; $config->task->datatable->fieldList['progress']['title'] = 'progressAB'; diff --git a/module/task/model.php b/module/task/model.php index 58b153dbbe..0e9d4e7189 100644 --- a/module/task/model.php +++ b/module/task/model.php @@ -2963,13 +2963,13 @@ class taskModel extends model $storyChanged ? print("{$this->lang->story->changed}") : print(" " . $this->processStatus('task', $task) . ""); break; case 'estimate': - echo round($task->estimate, 1) . ' ' . $this->lang->hourCommon; + echo round($task->estimate, 1) . ' ' . $this->config->hourUnit; break; case 'consumed': - echo round($task->consumed, 1) . ' ' . $this->lang->hourCommon; + echo round($task->consumed, 1) . ' ' . $this->config->hourUnit; break; case 'left': - echo round($task->left, 1) . ' ' . $this->lang->hourCommon; + echo round($task->left, 1) . ' ' . $this->config->hourUnit; break; case 'progress': echo "{$task->progress}%";