diff --git a/module/custom/model.php b/module/custom/model.php index ae2f629a47..eaa7e7bad2 100644 --- a/module/custom/model.php +++ b/module/custom/model.php @@ -789,9 +789,14 @@ class customModel extends model if(!$data->SRName || !$data->URName) return false; + $oldValue = $this->dao->select('*')->from(TABLE_LANG)->where('`key`')->eq($key)->andWhere('section')->eq('URSRList')->andWhere('lang')->eq($lang)->andWhere('module')->eq('custom')->fetch('value'); + $oldValue = json_decode($oldValue); + $URSRList = new stdclass(); - $URSRList->SRName = $data->SRName; - $URSRList->URName = $data->URName; + $URSRList->SRName = $data->SRName; + $URSRList->URName = $data->URName; + $URSRList->defaultSRName = zget($oldValue, 'defaultSRName', $oldValue->SRName); + $URSRList->defaultURName = zget($oldValue, 'defaultURName', $oldValue->URName); $value = json_encode($URSRList); $this->dao->update(TABLE_LANG)->set('value')->eq($value) diff --git a/module/dev/control.php b/module/dev/control.php index b9441f8f12..d6ae39d565 100644 --- a/module/dev/control.php +++ b/module/dev/control.php @@ -95,9 +95,9 @@ class dev extends control $moduleName = $module; if($type == 'common') $moduleName = 'common'; if($type == 'second') $moduleName = $module . 'Menu'; - if($type == 'third') $moduleName = $module . 'subMenu'; + if($type == 'third') $moduleName = $module . 'SubMenu'; - if($_POST) + if($this->server->request_method == 'POST') { $section = ''; if($type == 'common') $section = '§ion='; @@ -105,6 +105,7 @@ class dev extends control $this->loadModel('custom')->deleteItems("lang={$language}&module={$moduleName}&vision={$this->config->vision}{$section}"); $data = fixer::input('post')->get(); + if($type == 'common') unset($data->common_SRCommon, $data->common_URCommon); foreach($data as $langKey => $customedLang) { if(strpos($langKey, "{$moduleName}_") !== 0) continue; @@ -112,6 +113,15 @@ class dev extends control $this->custom->setItem("{$language}." . str_replace('_', '.', $langKey), $customedLang); } + if($type == 'common' and $this->config->custom->URSR) + { + $post = $_POST; + $_POST = array(); + if(!empty($post['common_SRCommon'])) $_POST['SRName'] = $post['common_SRCommon']; + if(!empty($post['common_URCommon'])) $_POST['URName'] = $post['common_URCommon']; + $this->custom->updateURAndSR($this->config->custom->URSR); + } + return $this->send(array('result' => 'success', 'locate' => 'reload', 'message' => $this->lang->saveSuccess)); } diff --git a/module/dev/lang/de.php b/module/dev/lang/de.php index 84bf3954d1..d50019e51d 100644 --- a/module/dev/lang/de.php +++ b/module/dev/lang/de.php @@ -19,6 +19,9 @@ $lang->dev->paramMailto = "User account. Separate accounts by ','."; $lang->dev->noteEditor = "The editor is disabled for security reasons. To use this feature, please go to the official website to download and install the plugin of the editor."; $lang->dev->noteTranslate = "The translation is disabled for security reasons. To use this feature, please go to the official website to download and install the plugin of translation."; +$lang->dev->UR = 'Epic'; +$lang->dev->SR = 'Story'; + $lang->dev->fields = array(); $lang->dev->fields['id'] = 'ID'; $lang->dev->fields['name'] = 'Feld'; diff --git a/module/dev/lang/en.php b/module/dev/lang/en.php index b11c005f6e..4f4f80eb1a 100644 --- a/module/dev/lang/en.php +++ b/module/dev/lang/en.php @@ -19,6 +19,9 @@ $lang->dev->paramMailto = "User account. Separate accounts by ','."; $lang->dev->noteEditor = "The editor is disabled for security reasons. To use this feature, please go to the official website to download and install the plugin of the editor."; $lang->dev->noteTranslate = "The translation is disabled for security reasons. To use this feature, please go to the official website to download and install the plugin of translation."; +$lang->dev->UR = 'Epic'; +$lang->dev->SR = 'Story'; + $lang->dev->fields = array(); $lang->dev->fields['id'] = 'ID'; $lang->dev->fields['name'] = 'Feild'; diff --git a/module/dev/lang/fr.php b/module/dev/lang/fr.php index b11c005f6e..4f4f80eb1a 100644 --- a/module/dev/lang/fr.php +++ b/module/dev/lang/fr.php @@ -19,6 +19,9 @@ $lang->dev->paramMailto = "User account. Separate accounts by ','."; $lang->dev->noteEditor = "The editor is disabled for security reasons. To use this feature, please go to the official website to download and install the plugin of the editor."; $lang->dev->noteTranslate = "The translation is disabled for security reasons. To use this feature, please go to the official website to download and install the plugin of translation."; +$lang->dev->UR = 'Epic'; +$lang->dev->SR = 'Story'; + $lang->dev->fields = array(); $lang->dev->fields['id'] = 'ID'; $lang->dev->fields['name'] = 'Feild'; diff --git a/module/dev/lang/zh-cn.php b/module/dev/lang/zh-cn.php index a277760592..affa5b12bf 100644 --- a/module/dev/lang/zh-cn.php +++ b/module/dev/lang/zh-cn.php @@ -20,7 +20,7 @@ $lang->dev->noteEditor = "编辑器功能因为安全原因被禁用。使用 $lang->dev->noteTranslate = "翻译功能因为安全原因被禁用。使用该功能,请到官网下载安装 翻译 插件。"; $lang->dev->UR = '用户需求'; -$lang->dev->SR = '研发需求'; +$lang->dev->SR = '软件需求'; $lang->dev->fields = array(); $lang->dev->fields['id'] = '序号'; diff --git a/module/dev/model.php b/module/dev/model.php index b476cc9cd4..0194d84d0f 100644 --- a/module/dev/model.php +++ b/module/dev/model.php @@ -340,6 +340,7 @@ class devModel extends model $originalLangs['executionCommon'] = $this->config->executionCommonList[$clientLang][$projectKey]; $originalLangs['URCommon'] = $this->lang->dev->UR; $originalLangs['SRCommon'] = $this->lang->dev->SR; + if(!$this->config->URAndSR) unset($originalLangs['SRCommon']); } elseif($type == 'feature') { @@ -433,10 +434,20 @@ class devModel extends model $clientLang = $this->app->getClientLang(); if($type == 'common') { - $customeds = $this->loadModel('custom')->getItems("lang={$clientLang}&module=common§ion=&vision={$this->config->vision}&systemMode={$this->config->systemMode}"); + $customeds = $this->loadModel('custom')->getItems("lang={$clientLang}&module=common§ion=&vision={$this->config->vision}"); foreach($customeds as $customed) $customedLangs[$customed->key] = $customed->value; + $customedLangs['URCommon'] = $this->lang->dev->UR == $this->lang->URCommon ? '' : $this->lang->URCommon; $customedLangs['SRCommon'] = $this->lang->dev->SR == $this->lang->SRCommon ? '' : $this->lang->SRCommon; + if($this->config->custom->URSR) + { + $URSRList = $this->custom->getItems("lang={$clientLang}&module=custom§ion=URSRList&key={$this->config->custom->URSR}&vision={$this->config->vision}"); + $URSRList = array_shift($URSRList); + $URSRList = json_decode($URSRList->value); + $customedLangs['URCommon'] = $this->lang->dev->UR == $URSRList->URName ? '' : $URSRList->URName; + $customedLangs['SRCommon'] = $this->lang->dev->SR == $URSRList->SRName ? '' : $URSRList->SRName; + } + if(!$this->config->URAndSR) unset($customedLangs['SRCommon']); } return $customedLangs; diff --git a/module/dev/view/langitem.html.php b/module/dev/view/langitem.html.php index e55a4faa7f..7a79e3b958 100644 --- a/module/dev/view/langitem.html.php +++ b/module/dev/view/langitem.html.php @@ -35,11 +35,7 @@
$originalLang):?>
- - + " class="icon icon-angle-right text-primary hidden">
@@ -47,10 +43,9 @@
+
+ + +
-
- - -
-