From 8405f11600d7f17daf06ec7c25db747194221ff3 Mon Sep 17 00:00:00 2001 From: holan20180123 <56391770@qq.com> Date: Thu, 14 Jan 2021 14:43:25 +0800 Subject: [PATCH] * Finish task #8957. --- db/update20.0.beta3.sql | 3 +++ module/custom/control.php | 23 ++++++++++++++++++----- module/custom/lang/de.php | 3 +++ module/custom/lang/en.php | 3 +++ module/custom/lang/fr.php | 3 +++ module/custom/lang/vi.php | 3 +++ module/custom/lang/zh-cn.php | 3 +++ module/custom/lang/zh-tw.php | 3 +++ module/custom/view/set.html.php | 23 ++++++++++++++++++++++- module/program/lang/de.php | 20 +++++++++++++++++--- module/program/lang/en.php | 20 +++++++++++++++++--- module/program/lang/fr.php | 20 +++++++++++++++++--- module/program/lang/vi.php | 20 +++++++++++++++++--- module/program/lang/zh-cn.php | 20 +++++++++++++++++--- module/program/lang/zh-tw.php | 20 +++++++++++++++++--- 15 files changed, 163 insertions(+), 24 deletions(-) diff --git a/db/update20.0.beta3.sql b/db/update20.0.beta3.sql index 1f8a5809ae..8013d471d3 100644 --- a/db/update20.0.beta3.sql +++ b/db/update20.0.beta3.sql @@ -10,3 +10,6 @@ INSERT INTO `zt_grouppriv` (`group`, `module`, `method`) VALUES (9, 'product', 'dashboard'), (10, 'product', 'dashboard'), (11, 'product', 'dashboard'); + +REPLACE INTO `zt_config` (`owner`, `module`, `section`, `key`, `value`) VALUES ('system', 'program', '', 'unitList', 'CNY,USD'); +REPLACE INTO `zt_config` (`owner`, `module`, `section`, `key`, `value`) VALUES ('system', 'program', '', 'mainCurrency', 'CNY'); diff --git a/module/custom/control.php b/module/custom/control.php index 2bcfb8dd75..50a96b3c81 100644 --- a/module/custom/control.php +++ b/module/custom/control.php @@ -48,13 +48,20 @@ class custom extends control $this->app->loadLang($module); $fieldList = zget($this->lang->$module, $field, ''); + if($module == 'program' and $field == 'unitList') + { + $this->app->loadConfig($module); + $unitList = zget($this->config->$module, 'unitList', ''); + $this->view->unitList = explode(',', $unitList); + $this->view->mainCurrency = zget($this->config->$module, 'mainCurrency', 'rmb'); + } if(($module == 'story' or $module == 'testcase') and $field == 'review') { $this->app->loadConfig($module); $this->view->users = $this->loadModel('user')->getPairs('noclosed|nodeleted'); - $this->view->needReview = zget($this->config->$module, 'needReview', 1); - $this->view->forceReview = zget($this->config->$module, 'forceReview', ''); - $this->view->forceNotReview = zget($this->config->$module, 'forceNotReview', ''); + $this->view->needReview = zget($this->config->$module, 'needReview', 1); + $this->view->forceReview = zget($this->config->$module, 'forceReview', ''); + $this->view->forceNotReview = zget($this->config->$module, 'forceNotReview', ''); } if($module == 'task' and $field == 'hours') { @@ -65,7 +72,7 @@ class custom extends control if($module == 'bug' and $field == 'longlife') { $this->app->loadConfig('bug'); - $this->view->longlife = $this->config->bug->longlife; + $this->view->longlife = $this->config->bug->longlife; } if($module == 'block' and $field == 'closed') { @@ -83,7 +90,13 @@ class custom extends control if(strtolower($this->server->request_method) == "post") { - if($module == 'story' and $field == 'review') + if($module == 'program' and $field == 'unitList') + { + $data = fixer::input('post')->join('unitList', ',')->get(); + if(empty($data->unitList)) $this->send(array('result' => 'fail', 'message' => $this->lang->custom->currencyNotEmpty)); + $this->loadModel('setting')->setItems("system.$module", $data); + } + elseif($module == 'story' and $field == 'review') { $data = fixer::input('post')->join('forceReview', ',')->get(); $this->loadModel('setting')->setItems("system.$module", $data); diff --git a/module/custom/lang/de.php b/module/custom/lang/de.php index 393f6b7954..62d3f229df 100644 --- a/module/custom/lang/de.php +++ b/module/custom/lang/de.php @@ -69,6 +69,7 @@ $lang->custom->tipRangeList[1] = 'Yes'; $lang->custom->regionMustNumber = 'The interval must be a number!'; $lang->custom->tipNotEmpty = 'The prompt can not be empty!'; +$lang->custom->currencyNotEmpty = 'You have to select one currency at least.'; $lang->custom->numberError = 'The interval must be greater than zero!'; @@ -88,6 +89,8 @@ $lang->custom->object['user'] = 'User'; $lang->custom->object['block'] = 'ClosedBlock'; $lang->custom->program = new stdClass(); +$lang->custom->program->currencySetting = 'Currency Setting'; +$lang->custom->program->mainCurrency = 'Main Currency'; $lang->custom->program->fields['unitList'] = 'Unit List'; $lang->custom->story = new stdClass(); diff --git a/module/custom/lang/en.php b/module/custom/lang/en.php index c9d74bf964..6ca2ba419e 100644 --- a/module/custom/lang/en.php +++ b/module/custom/lang/en.php @@ -69,6 +69,7 @@ $lang->custom->tipRangeList[1] = 'Yes'; $lang->custom->regionMustNumber = 'The interval must be a number!'; $lang->custom->tipNotEmpty = 'The prompt can not be empty!'; +$lang->custom->currencyNotEmpty = 'You have to select one currency at least.'; $lang->custom->numberError = 'The interval must be greater than zero!'; @@ -88,6 +89,8 @@ $lang->custom->object['user'] = 'User'; $lang->custom->object['block'] = 'Block'; $lang->custom->program = new stdClass(); +$lang->custom->program->currencySetting = 'Currency Setting'; +$lang->custom->program->mainCurrency = 'Main Currency'; $lang->custom->program->fields['unitList'] = 'Unit List'; $lang->custom->story = new stdClass(); diff --git a/module/custom/lang/fr.php b/module/custom/lang/fr.php index 78779b975a..8705875aa1 100644 --- a/module/custom/lang/fr.php +++ b/module/custom/lang/fr.php @@ -69,6 +69,7 @@ $lang->custom->tipRangeList[1] = 'Yes'; $lang->custom->regionMustNumber = 'The interval must be a number!'; $lang->custom->tipNotEmpty = 'The prompt can not be empty!'; +$lang->custom->currencyNotEmpty = 'You have to select one currency at least.'; $lang->custom->numberError = 'The interval must be greater than zero!'; @@ -88,6 +89,8 @@ $lang->custom->object['user'] = 'Utilisateur'; $lang->custom->object['block'] = 'Bloc'; $lang->custom->program = new stdClass(); +$lang->custom->program->currencySetting = 'Currency Setting'; +$lang->custom->program->mainCurrency = 'Main Currency'; $lang->custom->program->fields['unitList'] = 'Unit List'; $lang->custom->story = new stdClass(); diff --git a/module/custom/lang/vi.php b/module/custom/lang/vi.php index 7eafc0c175..370efe763b 100644 --- a/module/custom/lang/vi.php +++ b/module/custom/lang/vi.php @@ -69,6 +69,7 @@ $lang->custom->tipRangeList[1] = 'Yes'; $lang->custom->regionMustNumber = 'The interval must be a number!'; $lang->custom->tipNotEmpty = 'The prompt can not be empty!'; +$lang->custom->currencyNotEmpty = 'You have to select one currency at least.'; $lang->custom->numberError = 'The interval must be greater than zero!'; @@ -88,6 +89,8 @@ $lang->custom->object['user'] = 'Người dùng'; $lang->custom->object['block'] = 'Block'; $lang->custom->program = new stdClass(); +$lang->custom->program->currencySetting = 'Currency Setting'; +$lang->custom->program->mainCurrency = 'Main Currency'; $lang->custom->program->fields['unitList'] = 'Unit List'; $lang->custom->story = new stdClass(); diff --git a/module/custom/lang/zh-cn.php b/module/custom/lang/zh-cn.php index 68450bb704..209db3e42c 100644 --- a/module/custom/lang/zh-cn.php +++ b/module/custom/lang/zh-cn.php @@ -69,6 +69,7 @@ $lang->custom->tipRangeList[1] = '是'; $lang->custom->regionMustNumber = '区间必须是数字'; $lang->custom->tipNotEmpty = '提示语不能为空'; +$lang->custom->currencyNotEmpty = '至少选择一种货币'; $lang->custom->numberError = '区间必须大于零'; @@ -88,6 +89,8 @@ $lang->custom->object['user'] = '用户'; $lang->custom->object['block'] = '区块'; $lang->custom->program = new stdClass(); +$lang->custom->program->currencySetting = '货币设置'; +$lang->custom->program->mainCurrency = '主要货币'; $lang->custom->program->fields['unitList'] = '预算单位'; $lang->custom->story = new stdClass(); diff --git a/module/custom/lang/zh-tw.php b/module/custom/lang/zh-tw.php index 0871aa4d9d..1ef0e7209b 100644 --- a/module/custom/lang/zh-tw.php +++ b/module/custom/lang/zh-tw.php @@ -44,6 +44,8 @@ $lang->custom->configureWaterfall = "瀑布自定義"; $lang->custom->configureScrum = "敏捷自定義"; $lang->custom->object['program'] = '項目'; +$lang->custom->program->currencySetting = '貨幣設置'; +$lang->custom->program->mainCurrency = '主要貨幣'; $lang->custom->program->fields['unitList'] = '預算單位'; $lang->custom->unitList['efficiency'] = '工時/'; @@ -64,6 +66,7 @@ $lang->custom->tipRangeList[1] = '是'; $lang->custom->regionMustNumber = '區間必須是數字'; $lang->custom->tipNotEmpty = '提示語不能為空'; +$lang->custom->currencyNotEmpty = '至少選擇一種貨幣'; $lang->custom->numberError = '區間必須大於零'; diff --git a/module/custom/view/set.html.php b/module/custom/view/set.html.php index 55fc05dd45..ca93102386 100644 --- a/module/custom/view/set.html.php +++ b/module/custom/view/set.html.php @@ -31,6 +31,9 @@ EOT; +
- + + + + + + + + + + + + + + + + + +
custom->program->currencySetting;?>
program->unitList, $unitList);?>
custom->program->mainCurrency;?>program->unitList, $mainCurrency, "class='form-control chosen' required");?>
+ diff --git a/module/program/lang/de.php b/module/program/lang/de.php index fb53e1c206..9b6a6086f4 100644 --- a/module/program/lang/de.php +++ b/module/program/lang/de.php @@ -93,9 +93,23 @@ $lang->program->morePRJ = 'More Project'; $lang->program->productNotEmpty = 'Please link products or create products.'; $lang->program->existProductName = 'Product name already exists.'; -$lang->program->unitList[''] = ''; -$lang->program->unitList['wanyuan'] = 'Wanyuan'; -$lang->program->unitList['dollar'] = 'Dollars'; +$lang->program->unitList['CNY'] = 'RMB ¥'; +$lang->program->unitList['USD'] = 'USD $'; +$lang->program->unitList['HKD'] = 'HKD $'; +$lang->program->unitList['NTD'] = 'New Taiwan $'; +$lang->program->unitList['EUR'] = 'Euro €'; +$lang->program->unitList['DEM'] = 'Deutsche Mark'; +$lang->program->unitList['CHF'] = 'Swiss Franc'; +$lang->program->unitList['FRF'] = 'French Franc'; +$lang->program->unitList['GBP'] = 'Pound £'; +$lang->program->unitList['NLG'] = 'Florin'; +$lang->program->unitList['CAD'] = 'Canadian $'; +$lang->program->unitList['RUR'] = 'Russian Ruble'; +$lang->program->unitList['INR'] = 'Indian ₹'; +$lang->program->unitList['AUD'] = 'Australian $'; +$lang->program->unitList['NZD'] = 'New Zealand $'; +$lang->program->unitList['THB'] = 'Thai Baht'; +$lang->program->unitList['SGD'] = 'Singapore $'; $lang->program->modelList['scrum'] = "Scrum"; $lang->program->modelList['waterfall'] = "CMMI"; diff --git a/module/program/lang/en.php b/module/program/lang/en.php index 7ca91bba3e..25477ac339 100644 --- a/module/program/lang/en.php +++ b/module/program/lang/en.php @@ -93,9 +93,23 @@ $lang->program->morePRJ = 'More Project'; $lang->program->productNotEmpty = 'Please link products or create products.'; $lang->program->existProductName = 'Product name already exists.'; -$lang->program->unitList[''] = ''; -$lang->program->unitList['wanyuan'] = 'Wanyuan'; -$lang->program->unitList['dollar'] = 'Dollars'; +$lang->program->unitList['CNY'] = 'RMB ¥'; +$lang->program->unitList['USD'] = 'USD $'; +$lang->program->unitList['HKD'] = 'HKD $'; +$lang->program->unitList['NTD'] = 'New Taiwan $'; +$lang->program->unitList['EUR'] = 'Euro €'; +$lang->program->unitList['DEM'] = 'Deutsche Mark'; +$lang->program->unitList['CHF'] = 'Swiss Franc'; +$lang->program->unitList['FRF'] = 'French Franc'; +$lang->program->unitList['GBP'] = 'Pound £'; +$lang->program->unitList['NLG'] = 'Florin'; +$lang->program->unitList['CAD'] = 'Canadian $'; +$lang->program->unitList['RUR'] = 'Russian Ruble'; +$lang->program->unitList['INR'] = 'Indian ₹'; +$lang->program->unitList['AUD'] = 'Australian $'; +$lang->program->unitList['NZD'] = 'New Zealand $'; +$lang->program->unitList['THB'] = 'Thai Baht'; +$lang->program->unitList['SGD'] = 'Singapore $'; $lang->program->modelList['scrum'] = "Scrum"; $lang->program->modelList['waterfall'] = "CMMI"; diff --git a/module/program/lang/fr.php b/module/program/lang/fr.php index d13a09d2f2..7ca077c7c4 100644 --- a/module/program/lang/fr.php +++ b/module/program/lang/fr.php @@ -93,9 +93,23 @@ $lang->program->morePRJ = 'More Projects'; $lang->program->productNotEmpty = 'Please link products or create products.'; $lang->program->existProductName = 'Product name already exists.'; -$lang->program->unitList[''] = ''; -$lang->program->unitList['wanyuan'] = 'Wanyuan'; -$lang->program->unitList['dollar'] = 'Dollars'; +$lang->program->unitList['CNY'] = 'RMB ¥'; +$lang->program->unitList['USD'] = 'USD $'; +$lang->program->unitList['HKD'] = 'HKD $'; +$lang->program->unitList['NTD'] = 'New Taiwan $'; +$lang->program->unitList['EUR'] = 'Euro €'; +$lang->program->unitList['DEM'] = 'Deutsche Mark'; +$lang->program->unitList['CHF'] = 'Swiss Franc'; +$lang->program->unitList['FRF'] = 'French Franc'; +$lang->program->unitList['GBP'] = 'Pound £'; +$lang->program->unitList['NLG'] = 'Florin'; +$lang->program->unitList['CAD'] = 'Canadian $'; +$lang->program->unitList['RUR'] = 'Russian Ruble'; +$lang->program->unitList['INR'] = 'Indian ₹'; +$lang->program->unitList['AUD'] = 'Australian $'; +$lang->program->unitList['NZD'] = 'New Zealand $'; +$lang->program->unitList['THB'] = 'Thai Baht'; +$lang->program->unitList['SGD'] = 'Singapore $'; $lang->program->modelList['scrum'] = "Scrum"; $lang->program->modelList['waterfall'] = "CMMI"; diff --git a/module/program/lang/vi.php b/module/program/lang/vi.php index d13a09d2f2..7ca077c7c4 100644 --- a/module/program/lang/vi.php +++ b/module/program/lang/vi.php @@ -93,9 +93,23 @@ $lang->program->morePRJ = 'More Projects'; $lang->program->productNotEmpty = 'Please link products or create products.'; $lang->program->existProductName = 'Product name already exists.'; -$lang->program->unitList[''] = ''; -$lang->program->unitList['wanyuan'] = 'Wanyuan'; -$lang->program->unitList['dollar'] = 'Dollars'; +$lang->program->unitList['CNY'] = 'RMB ¥'; +$lang->program->unitList['USD'] = 'USD $'; +$lang->program->unitList['HKD'] = 'HKD $'; +$lang->program->unitList['NTD'] = 'New Taiwan $'; +$lang->program->unitList['EUR'] = 'Euro €'; +$lang->program->unitList['DEM'] = 'Deutsche Mark'; +$lang->program->unitList['CHF'] = 'Swiss Franc'; +$lang->program->unitList['FRF'] = 'French Franc'; +$lang->program->unitList['GBP'] = 'Pound £'; +$lang->program->unitList['NLG'] = 'Florin'; +$lang->program->unitList['CAD'] = 'Canadian $'; +$lang->program->unitList['RUR'] = 'Russian Ruble'; +$lang->program->unitList['INR'] = 'Indian ₹'; +$lang->program->unitList['AUD'] = 'Australian $'; +$lang->program->unitList['NZD'] = 'New Zealand $'; +$lang->program->unitList['THB'] = 'Thai Baht'; +$lang->program->unitList['SGD'] = 'Singapore $'; $lang->program->modelList['scrum'] = "Scrum"; $lang->program->modelList['waterfall'] = "CMMI"; diff --git a/module/program/lang/zh-cn.php b/module/program/lang/zh-cn.php index 4812831458..f2930ae61c 100644 --- a/module/program/lang/zh-cn.php +++ b/module/program/lang/zh-cn.php @@ -93,9 +93,23 @@ $lang->program->morePRJ = '更多项目'; $lang->program->productNotEmpty = '请关联产品或创建产品。'; $lang->program->existProductName = '产品名称已存在。'; -$lang->program->unitList[''] = ''; -$lang->program->unitList['wanyuan'] = '万元'; -$lang->program->unitList['dollar'] = 'Dollars'; +$lang->program->unitList['CNY'] = '人民币'; +$lang->program->unitList['USD'] = '美元'; +$lang->program->unitList['HKD'] = '港元'; +$lang->program->unitList['NTD'] = '台元'; +$lang->program->unitList['EUR'] = '欧元'; +$lang->program->unitList['DEM'] = '马克'; +$lang->program->unitList['CHF'] = '瑞士法郎'; +$lang->program->unitList['FRF'] = '法国法郎'; +$lang->program->unitList['GBP'] = '英镑'; +$lang->program->unitList['NLG'] = '荷兰盾'; +$lang->program->unitList['CAD'] = '加拿大元'; +$lang->program->unitList['RUR'] = '卢布'; +$lang->program->unitList['INR'] = '卢比'; +$lang->program->unitList['AUD'] = '澳大利亚元'; +$lang->program->unitList['NZD'] = '新西兰元'; +$lang->program->unitList['THB'] = '泰国铢'; +$lang->program->unitList['SGD'] = '新加坡元'; $lang->program->modelList['scrum'] = "Scrum"; $lang->program->modelList['waterfall'] = "瀑布"; diff --git a/module/program/lang/zh-tw.php b/module/program/lang/zh-tw.php index d19b79f098..c086b9fa7d 100644 --- a/module/program/lang/zh-tw.php +++ b/module/program/lang/zh-tw.php @@ -92,9 +92,23 @@ $lang->program->future = '待定'; $lang->program->productNotEmpty = '請關聯產品或創建產品。'; $lang->program->existProductName = '產品名稱已存在。'; -$lang->program->unitList[''] = ''; -$lang->program->unitList['wanyuan'] = '萬元'; -$lang->program->unitList['dollar'] = 'Dollars'; +$lang->program->unitList['CNY'] = '人民幣'; +$lang->program->unitList['USD'] = '美元'; +$lang->program->unitList['HKD'] = '港元'; +$lang->program->unitList['NTD'] = '台元'; +$lang->program->unitList['EUR'] = '歐元'; +$lang->program->unitList['DEM'] = '馬克'; +$lang->program->unitList['CHF'] = '瑞士法郎'; +$lang->program->unitList['FRF'] = '法國法郎'; +$lang->program->unitList['GBP'] = '英鎊'; +$lang->program->unitList['NLG'] = '荷蘭盾'; +$lang->program->unitList['CAD'] = '加拿大元'; +$lang->program->unitList['RUR'] = '盧布'; +$lang->program->unitList['INR'] = '盧比'; +$lang->program->unitList['AUD'] = '澳大利亞元'; +$lang->program->unitList['NZD'] = '新西蘭元'; +$lang->program->unitList['THB'] = '泰國銖'; +$lang->program->unitList['SGD'] = '新加坡元'; $lang->program->modelList['scrum'] = "Scrum"; $lang->program->modelList['waterfall'] = "瀑布";
custom->storyReview;?>