* code for task #84532.
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
|
||||
|
||||
@@ -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 <a href='https://www.zentao.net/extension-viewExt-150.html' target='_blank'>editor</a>.";
|
||||
$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 <a href='https://www.zentao.net/extension-viewExt-151.html' target='_blank'>translation</a>.";
|
||||
|
||||
$lang->dev->UR = 'Epic';
|
||||
$lang->dev->SR = 'Story';
|
||||
|
||||
$lang->dev->fields = array();
|
||||
$lang->dev->fields['id'] = 'ID';
|
||||
$lang->dev->fields['name'] = 'Feld';
|
||||
|
||||
@@ -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 <a href='https://www.zentao.net/extension-viewExt-150.html' target='_blank'>editor</a>.";
|
||||
$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 <a href='https://www.zentao.net/extension-viewExt-151.html' target='_blank'>translation</a>.";
|
||||
|
||||
$lang->dev->UR = 'Epic';
|
||||
$lang->dev->SR = 'Story';
|
||||
|
||||
$lang->dev->fields = array();
|
||||
$lang->dev->fields['id'] = 'ID';
|
||||
$lang->dev->fields['name'] = 'Feild';
|
||||
|
||||
@@ -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 <a href='https://www.zentao.net/extension-viewExt-150.html' target='_blank'>editor</a>.";
|
||||
$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 <a href='https://www.zentao.net/extension-viewExt-151.html' target='_blank'>translation</a>.";
|
||||
|
||||
$lang->dev->UR = 'Epic';
|
||||
$lang->dev->SR = 'Story';
|
||||
|
||||
$lang->dev->fields = array();
|
||||
$lang->dev->fields['id'] = 'ID';
|
||||
$lang->dev->fields['name'] = 'Feild';
|
||||
|
||||
@@ -20,7 +20,7 @@ $lang->dev->noteEditor = "编辑器功能因为安全原因被禁用。使用
|
||||
$lang->dev->noteTranslate = "翻译功能因为安全原因被禁用。使用该功能,请到官网下载安装 <a href='https://www.zentao.net/extension-viewExt-151.html' target='_blank'>翻译</a> 插件。";
|
||||
|
||||
$lang->dev->UR = '用户需求';
|
||||
$lang->dev->SR = '研发需求';
|
||||
$lang->dev->SR = '软件需求';
|
||||
|
||||
$lang->dev->fields = array();
|
||||
$lang->dev->fields['id'] = '序号';
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -35,11 +35,7 @@
|
||||
<div class="input-list">
|
||||
<?php foreach($originalLangs as $langKey => $originalLang):?>
|
||||
<div class="input-control h-32 my-12">
|
||||
<?php
|
||||
$disabled = '';
|
||||
if($type == 'common' and ($langKey == 'URCommon' or $langKey == 'SRCommon')) $disabled = 'disabled';
|
||||
?>
|
||||
<?php echo html::input("{$moduleName}_{$langKey}", zget($customedLangs, $langKey, ''), "class='form-control shadow-primary-hover {$disabled}' {$disabled} placeholder='{$originalLang}'");?>
|
||||
<?php echo html::input("{$moduleName}_{$langKey}", zget($customedLangs, $langKey, ''), "class='form-control shadow-primary-hover' placeholder='{$originalLang}'");?>
|
||||
<i iconId="<?php echo "{$moduleName}_{$langKey}"?>" class="icon icon-angle-right text-primary hidden"></i>
|
||||
</div>
|
||||
<?php endforeach;?>
|
||||
@@ -47,10 +43,9 @@
|
||||
</div>
|
||||
<div class="side-main"></div>
|
||||
</div>
|
||||
<div class="bottom-btn">
|
||||
<?php echo html::submitButton(); ?>
|
||||
<button id="reset" class="btn btn-wide ml-20"><?php echo $lang->restore?> </button>
|
||||
</div>
|
||||
</form>
|
||||
<div class="bottom-btn">
|
||||
<?php echo html::submitButton(); ?>
|
||||
<button id="reset" class="btn btn-wide ml-20"><?php echo $lang->restore?> </button>
|
||||
</div>
|
||||
</div>
|
||||
<?php include '../../common/view/footer.html.php';?>
|
||||
|
||||
Reference in New Issue
Block a user