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;
+