* Add digital judgment.

This commit is contained in:
tianshujie98
2021-01-14 10:39:15 +08:00
parent 3159469466
commit 1b2ae5c4cc
7 changed files with 36 additions and 25 deletions
+18 -18
View File
@@ -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';
+10 -3
View File
@@ -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', '');
+1 -1
View File
@@ -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';
+1 -1
View File
@@ -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';
+1 -1
View File
@@ -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';
+1 -1
View File
@@ -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';
+4
View File
@@ -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. */