diff --git a/config/zentaopms.php b/config/zentaopms.php index 93e6e0767d..d2727feafb 100644 --- a/config/zentaopms.php +++ b/config/zentaopms.php @@ -44,29 +44,29 @@ $config->executionCommonList['vi'][1] = 'Sprint'; $config->executionCommonList['vi'][2] = 'Giai đoạn'; /* Story common list. */ -$config->hourPointCommonList['zh-cn'][0] = '故事点'; -$config->hourPointCommonList['zh-cn'][1] = '功能点'; -$config->hourPointCommonList['zh-cn'][2] = '代码行'; +$config->hourPointCommonList['zh-cn'][0] = '工时'; +$config->hourPointCommonList['zh-cn'][1] = '故事点'; +$config->hourPointCommonList['zh-cn'][2] = '功能点'; -$config->hourPointCommonList['zh-tw'][0] = '故事点'; -$config->hourPointCommonList['zh-tw'][1] = '功能点'; -$config->hourPointCommonList['zh-tw'][2] = '代碼行'; +$config->hourPointCommonList['zh-tw'][0] = '工时'; +$config->hourPointCommonList['zh-tw'][1] = '故事点'; +$config->hourPointCommonList['zh-tw'][2] = '功能点'; -$config->hourPointCommonList['en'][0] = 'story point'; -$config->hourPointCommonList['en'][1] = 'function point'; -$config->hourPointCommonList['en'][2] = 'loc point'; +$config->hourPointCommonList['en'][0] = 'Hours'; +$config->hourPointCommonList['en'][1] = 'story point'; +$config->hourPointCommonList['en'][2] = 'function point'; -$config->hourPointCommonList['de'][0] = 'story point'; -$config->hourPointCommonList['de'][1] = 'function point'; -$config->hourPointCommonList['de'][2] = 'loc point'; +$config->hourPointCommonList['de'][0] = 'Stunde'; +$config->hourPointCommonList['de'][1] = 'story point'; +$config->hourPointCommonList['de'][2] = 'function point'; -$config->hourPointCommonList['fr'][0] = 'story point'; -$config->hourPointCommonList['fr'][1] = 'function point'; -$config->hourPointCommonList['fr'][2] = 'loc point'; +$config->hourPointCommonList['fr'][0] = 'Heures'; +$config->hourPointCommonList['fr'][1] = 'story point'; +$config->hourPointCommonList['fr'][2] = 'function point'; -$config->hourPointCommonList['vi'][0] = 'điểm'; -$config->hourPointCommonList['vi'][1] = 'function point'; -$config->hourPointCommonList['vi'][2] = 'loc point'; +$config->hourPointCommonList['vi'][0] = 'giờ'; +$config->hourPointCommonList['vi'][1] = 'điểm'; +$config->hourPointCommonList['vi'][2] = 'function point'; $config->manualUrl['home'] = 'https://www.zentao.net/book/zentaopmshelp.html?fullScreen=zentao'; $config->manualUrl['int'] = 'https://www.zentao.pm/book/zentaomanual/zentao-installation-11.html?fullScreen=zentao'; diff --git a/module/custom/control.php b/module/custom/control.php index 2bcfb8dd75..af19259c1f 100644 --- a/module/custom/control.php +++ b/module/custom/control.php @@ -340,6 +340,8 @@ class custom extends control $key = array_search('custom', $this->lang->noMenuModule); unset($this->lang->noMenuModule[$key]); + $unit = zget($this->config->custom, 'hourPoint', '1'); + if(strtolower($this->server->request_method) == "post") { /* Load module and get the data from the post. */ @@ -347,11 +349,16 @@ class custom extends control $data = fixer::input('post')->setIF(!isset($_POST['efficiency']), 'efficiency', 1)->get(); /* Judgment of required items. */ - if(isset($_POST['scaleFactor']) and empty($_POST['scaleFactor'])) + if(($unit != $_POST['hourPoint']) and empty($_POST['scaleFactor'])) { dao::$errors['scaleFactor'] = sprintf($this->lang->error->notempty, $this->lang->custom->convertRelations); $this->send(array('result' => 'fail', 'message' => dao::getError())); } + elseif(($unit != $_POST['hourPoint']) and !is_numeric($_POST['scaleFactor'])) + { + dao::$errors['scaleFactor'] = sprintf($this->lang->error->float, $this->lang->custom->convertRelations); + $this->send(array('result' => 'fail', 'message' => dao::getError())); + } $this->setting->setItem('system.custom.hourPoint', $data->hourPoint); $this->setting->setItem('system.custom.cost', $data->cost); @@ -360,7 +367,7 @@ class custom extends control $this->setting->setItem('system.project.defaultWorkhours', $data->defaultWorkhours); /* Update story estimate field. */ - if(isset($_POST['scaleFactor'])) + if($unit != $_POST['hourPoint']) { $stories = $this->dao->select('*')->from(TABLE_STORY)->fetchAll(); foreach($stories as $story) @@ -378,7 +385,7 @@ class custom extends control $this->view->position[] = $this->lang->custom->common; $this->view->position[] = $this->lang->custom->estimateConfig; - $this->view->unit = zget($this->config->custom, 'hourPoint', '1'); + $this->view->unit = $unit; $this->view->cost = zget($this->config->custom, 'cost', ''); $this->view->efficiency = zget($this->config->custom, 'efficiency', ''); $this->view->hours = zget($this->config->project, 'defaultWorkhours', ''); diff --git a/module/custom/lang/de.php b/module/custom/lang/de.php index 393f6b7954..f1276ded73 100644 --- a/module/custom/lang/de.php +++ b/module/custom/lang/de.php @@ -222,7 +222,7 @@ $lang->custom->conceptOptions->story['0'] = 'Requirement'; $lang->custom->conceptOptions->story['1'] = 'Story'; $lang->custom->conceptOptions->hourPoint = array(); -$lang->custom->conceptOptions->hourPoint['0'] = 'Working Hours'; +$lang->custom->conceptOptions->hourPoint['0'] = 'Stunde'; $lang->custom->conceptOptions->hourPoint['1'] = 'Story Point'; $lang->custom->conceptOptions->hourPoint['2'] = 'Function Point'; diff --git a/module/custom/lang/en.php b/module/custom/lang/en.php index c9d74bf964..0a3aae2165 100644 --- a/module/custom/lang/en.php +++ b/module/custom/lang/en.php @@ -222,7 +222,7 @@ $lang->custom->conceptOptions->story['0'] = 'Requirement'; $lang->custom->conceptOptions->story['1'] = 'Story'; $lang->custom->conceptOptions->hourPoint = array(); -$lang->custom->conceptOptions->hourPoint['0'] = 'Working Hours'; +$lang->custom->conceptOptions->hourPoint['0'] = 'Hours'; $lang->custom->conceptOptions->hourPoint['1'] = 'Story Point'; $lang->custom->conceptOptions->hourPoint['2'] = 'Function Point'; diff --git a/module/custom/lang/fr.php b/module/custom/lang/fr.php index 78779b975a..b6f3bcfe39 100644 --- a/module/custom/lang/fr.php +++ b/module/custom/lang/fr.php @@ -222,7 +222,7 @@ $lang->custom->conceptOptions->story['0'] = 'Exigence'; $lang->custom->conceptOptions->story['1'] = 'Story'; $lang->custom->conceptOptions->hourPoint = array(); -$lang->custom->conceptOptions->hourPoint['0'] = 'Working Hours'; +$lang->custom->conceptOptions->hourPoint['0'] = 'Heures'; $lang->custom->conceptOptions->hourPoint['1'] = 'Story Point'; $lang->custom->conceptOptions->hourPoint['2'] = 'Function Point'; diff --git a/module/custom/lang/vi.php b/module/custom/lang/vi.php index 7eafc0c175..8698dc01b5 100644 --- a/module/custom/lang/vi.php +++ b/module/custom/lang/vi.php @@ -222,7 +222,7 @@ $lang->custom->conceptOptions->story['0'] = 'Điều kiện'; $lang->custom->conceptOptions->story['1'] = 'Câu chuyện'; $lang->custom->conceptOptions->hourPoint = array(); -$lang->custom->conceptOptions->hourPoint['0'] = 'Working Hours'; +$lang->custom->conceptOptions->hourPoint['0'] = 'giờ'; $lang->custom->conceptOptions->hourPoint['1'] = 'Điểm'; $lang->custom->conceptOptions->hourPoint['2'] = 'Function Point'; diff --git a/module/story/model.php b/module/story/model.php index 77a1acb31c..20f48707ad 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -1569,6 +1569,10 @@ class storyModel extends model { dao::$errors['hourPointValue'] = sprintf($this->lang->error->notempty, $this->lang->story->convertRelations); } + elseif(isset($data->hourPointValue) and !is_numeric($data->hourPointValue)) + { + dao::$errors['hourPointValue'] = sprintf($this->lang->error->float, $this->lang->story->convertRelations); + } if(dao::isError()) return false; /* Create tasks. */