* code for task #84532.

This commit is contained in:
wangyidong
2023-02-16 13:55:23 +08:00
parent bb1cc9d480
commit 1b70d6e8a4
9 changed files with 84 additions and 38 deletions

View File

@@ -35,9 +35,9 @@ if(defined('TUTORIAL'))
$lang->mainNav = new stdclass();
$lang->mainNav->my = "{$lang->navIcons['my']} {$lang->my->shortCommon}|my|index|";
$lang->mainNav->program = "{$lang->navIcons['program']} {$lang->program->common}|$programModule|$programMethod|";
$lang->mainNav->product = "{$lang->navIcons['product']} {$lang->product->common}|$productModule|$productMethod|";
$lang->mainNav->project = "{$lang->navIcons['project']} {$lang->project->common}|$projectModule|$projectMethod|";
$lang->mainNav->execution = "{$lang->navIcons['execution']} {$lang->execution->common}|$executionModule|$executionMethod|";
$lang->mainNav->product = "{$lang->navIcons['product']} {$lang->productCommon}|$productModule|$productMethod|";
$lang->mainNav->project = "{$lang->navIcons['project']} {$lang->projectCommon}|$projectModule|$projectMethod|";
$lang->mainNav->execution = "{$lang->navIcons['execution']} {$lang->executionCommon}|$executionModule|$executionMethod|";
$lang->mainNav->qa = "{$lang->navIcons['qa']} {$lang->qa->common}|qa|index|";
$lang->mainNav->devops = "{$lang->navIcons['devops']} DevOps|repo|browse|";
$lang->mainNav->kanban = "{$lang->navIcons['kanban']} {$lang->kanban->common}|kanban|space|";

View File

@@ -778,13 +778,14 @@ class customModel extends model
/**
* Edit UR and SR concept.
*
* @param int $key
* @param int $key
* @param string $lang zh-cn|zh-tw|en|fr|de
* @access public
* @return bool
*/
public function updateURAndSR($key = 0)
public function updateURAndSR($key = 0, $lang = '')
{
$lang = $this->app->getClientLang();
if(empty($lang)) $lang = $this->app->getClientLang();
$data = fixer::input('post')->get();
if(!$data->SRName || !$data->URName) return false;

View File

@@ -83,9 +83,12 @@ class dev extends control
}
/**
* Lang item.
* Custom menu lang item.
*
* @param string $type
* @param string $type common|first|second|third|feature
* @param string $module
* @param string $method
* @param string $language zh_cn|en|fr|de|zh_tw
* @access public
* @return void
*/
@@ -119,7 +122,7 @@ class dev extends control
$_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);
$this->custom->updateURAndSR($this->config->custom->URSR, $language);
}
return $this->send(array('result' => 'success', 'locate' => 'reload', 'message' => $this->lang->saveSuccess));
@@ -133,7 +136,42 @@ class dev extends control
$this->view->originalLangs = $this->dev->getOriginalLang($type, $module, $method, $language);
$this->view->customedLangs = $this->dev->getCustomedLang($type, $module, $method, $language);
$this->view->moduleName = $moduleName;
$this->view->language = $language;
$this->view->language = str_replace('-', '_', $language);
$this->display();
}
/**
* Reset customed menu lang.
*
* @param string $type common|first|second|third|feature
* @param string $module
* @param string $language zh_cn|en|fr|de|zh_tw
* @param string $confirm no|yes
* @access public
* @return void
*/
public function resetLang($type = 'common', $module = '', $language = 'zh_cn', $confirm = 'no')
{
if($confirm == 'no') return print(js::confirm($this->lang->dev->confirmRestore, inlink('resetLang', "type={$type}&module={$module}&language={$language}&confirm=yes")));
$language = str_replace('_', '-', $language);
$section = '';
if($type == 'common') $section = '&section=';
if($type == 'first') $section = '&section=mainNav';
$this->loadModel('custom')->deleteItems("lang={$language}&module={$module}&vision={$this->config->vision}{$section}");
if($type == 'common' and $this->config->custom->URSR)
{
$oldValue = $this->dao->select('*')->from(TABLE_LANG)->where('`key`')->eq($this->config->custom->URSR)->andWhere('section')->eq('URSRList')->andWhere('lang')->eq($language)->andWhere('module')->eq('custom')->fetch('value');
if($oldValue)
{
$oldValue = json_decode($oldValue);
$_POST = array();
$_POST['SRName'] = zget($oldValue, 'defaultSRName', $oldValue->SRName);
$_POST['URName'] = zget($oldValue, 'defaultURName', $oldValue->URName);
$this->custom->updateURAndSR($this->config->custom->URSR, $language);
}
}
return print(js::reload('parent'));
}
}

View File

@@ -12,12 +12,13 @@ $lang->dev->desc = 'Beschreibung';
$lang->dev->noParams = 'Keine Parameter';
$lang->dev->post = 'POST Parameter';
$lang->dev->paramRange = 'Parameter Range: %s';
$lang->dev->paramDate = 'Date format: YY-mm-dd, e.g 2019-01-01';
$lang->dev->paramColor = 'Color format: #RGB, e.g. #3da7f5';
$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->paramRange = 'Parameter Range: %s';
$lang->dev->paramDate = 'Date format: YY-mm-dd, e.g 2019-01-01';
$lang->dev->paramColor = 'Color format: #RGB, e.g. #3da7f5';
$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->confirmRestore = 'Do you want to reset?';
$lang->dev->UR = 'Epic';
$lang->dev->SR = 'Story';

View File

@@ -12,12 +12,13 @@ $lang->dev->desc = 'Description';
$lang->dev->noParams = 'No Parameters';
$lang->dev->post = 'POST Parameter';
$lang->dev->paramRange = 'Parameter Range: %s';
$lang->dev->paramDate = 'Date format: YY-mm-dd, e.g 2019-01-01';
$lang->dev->paramColor = 'Color format: #RGB, e.g. #3da7f5';
$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->paramRange = 'Parameter Range: %s';
$lang->dev->paramDate = 'Date format: YY-mm-dd, e.g 2019-01-01';
$lang->dev->paramColor = 'Color format: #RGB, e.g. #3da7f5';
$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->confirmRestore = 'Do you want to reset?';
$lang->dev->UR = 'Epic';
$lang->dev->SR = 'Story';

View File

@@ -12,12 +12,13 @@ $lang->dev->desc = 'Description';
$lang->dev->noParams = 'No Parameters';
$lang->dev->post = 'POST Parameter';
$lang->dev->paramRange = 'Parameter Range: %s';
$lang->dev->paramDate = 'Date format: YY-mm-dd, e.g 2019-01-01';
$lang->dev->paramColor = 'Color format: #RGB, e.g. #3da7f5';
$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->paramRange = 'Parameter Range: %s';
$lang->dev->paramDate = 'Date format: YY-mm-dd, e.g 2019-01-01';
$lang->dev->paramColor = 'Color format: #RGB, e.g. #3da7f5';
$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->confirmRestore = 'Do you want to reset?';
$lang->dev->UR = 'Epic';
$lang->dev->SR = 'Story';

View File

@@ -12,12 +12,13 @@ $lang->dev->desc = '描述';
$lang->dev->noParams = '无参数';
$lang->dev->post = 'POST参数';
$lang->dev->paramRange = '取值范围:%s';
$lang->dev->paramDate = '日期格式YY-mm-dd2019-01-01';
$lang->dev->paramColor = '颜色格式:#RGB#3da7f5';
$lang->dev->paramMailto = "填写帐号,多个账号用','分隔。";
$lang->dev->noteEditor = "编辑器功能因为安全原因被禁用。使用该功能,请到官网下载安装 <a href='https://www.zentao.net/extension-viewExt-150.html' target='_blank'>扩展编辑器</a> 插件。";
$lang->dev->noteTranslate = "翻译功能因为安全原因被禁用。使用该功能,请到官网下载安装 <a href='https://www.zentao.net/extension-viewExt-151.html' target='_blank'>翻译</a> 插件。";
$lang->dev->paramRange = '取值范围:%s';
$lang->dev->paramDate = '日期格式YY-mm-dd2019-01-01';
$lang->dev->paramColor = '颜色格式:#RGB#3da7f5';
$lang->dev->paramMailto = "填写帐号,多个账号用','分隔。";
$lang->dev->noteEditor = "编辑器功能因为安全原因被禁用。使用该功能,请到官网下载安装 <a href='https://www.zentao.net/extension-viewExt-150.html' target='_blank'>扩展编辑器</a> 插件。";
$lang->dev->noteTranslate = "翻译功能因为安全原因被禁用。使用该功能,请到官网下载安装 <a href='https://www.zentao.net/extension-viewExt-151.html' target='_blank'>翻译</a> 插件。";
$lang->dev->confirmRestore = '是否要恢复默认?';
$lang->dev->UR = '用户需求';
$lang->dev->SR = '软件需求';

View File

@@ -443,9 +443,12 @@ class devModel extends model
{
$URSRList = $this->custom->getItems("lang={$clientLang}&module=custom&section=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($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']);
}

View File

@@ -45,7 +45,7 @@
</div>
<div class="bottom-btn">
<?php echo html::submitButton(); ?>
<button id="reset" class="btn btn-wide ml-20"><?php echo $lang->restore?> </button>
<?php echo html::a(inlink('resetLang', "type={$type}&module={$moduleName}&language={$language}"), $lang->restore, 'hiddenwin', "id='reset' class='btn btn-wide ml-20'");?>
</div>
</form>
<?php include '../../common/view/footer.html.php';?>