From b9d288fd2302d66cf564e090fa2282e38e61912f Mon Sep 17 00:00:00 2001 From: guofeilong Date: Mon, 13 Feb 2023 16:56:34 +0800 Subject: [PATCH 001/319] * Code for add langitem.html.php --- module/common/lang/de.php | 1 + module/common/lang/en.php | 1 + module/common/lang/fr.php | 1 + module/common/lang/menu.php | 11 ++++++----- module/common/lang/vi.php | 1 + module/common/lang/zh-cn.php | 1 + module/dev/control.php | 16 ++++++++++++++++ module/dev/view/langitem.html.php | 17 +++++++++++++++++ 8 files changed, 44 insertions(+), 5 deletions(-) create mode 100644 module/dev/view/langitem.html.php diff --git a/module/common/lang/de.php b/module/common/lang/de.php index 400a8dd593..7258017932 100644 --- a/module/common/lang/de.php +++ b/module/common/lang/de.php @@ -249,6 +249,7 @@ $lang->model = 'Model'; $lang->redev = 'Develop'; $lang->browser = 'Browser'; $lang->db = 'Database'; +$lang->langItem = 'Lang Item'; $lang->editor = 'Editor'; $lang->timezone = 'Timezone'; $lang->security = 'Security'; diff --git a/module/common/lang/en.php b/module/common/lang/en.php index 7986be63c8..eb95ced05d 100644 --- a/module/common/lang/en.php +++ b/module/common/lang/en.php @@ -249,6 +249,7 @@ $lang->model = 'Model'; $lang->redev = 'Develop'; $lang->browser = 'Browser'; $lang->db = 'Database'; +$lang->langItem = 'Lang Item'; $lang->editor = 'Editor'; $lang->timezone = 'Timezone'; $lang->security = 'Security'; diff --git a/module/common/lang/fr.php b/module/common/lang/fr.php index e5fffcfc7d..c9d76e2a8d 100644 --- a/module/common/lang/fr.php +++ b/module/common/lang/fr.php @@ -249,6 +249,7 @@ $lang->model = 'Model'; $lang->redev = 'Develop'; $lang->browser = 'Browser'; $lang->db = 'Database'; +$lang->langItem = 'Lang Item'; $lang->editor = 'Editor'; $lang->timezone = 'Timezone'; $lang->security = 'Security'; diff --git a/module/common/lang/menu.php b/module/common/lang/menu.php index 833575eb33..ba57557add 100644 --- a/module/common/lang/menu.php +++ b/module/common/lang/menu.php @@ -624,11 +624,12 @@ $lang->admin->menu->company['subMenu']->browseUser = array('link' => "{$lang->u $lang->admin->menu->company['subMenu']->dept = array('link' => "{$lang->dept->common}|dept|browse", 'subModule' => 'dept'); $lang->admin->menu->company['subMenu']->browseGroup = array('link' => "{$lang->priv}|group|browse", 'subModule' => 'group'); -$lang->admin->menu->dev['subMenu'] = new stdclass(); -$lang->admin->menu->dev['subMenu']->api = array('link' => "API|dev|api"); -$lang->admin->menu->dev['subMenu']->db = array('link' => "$lang->db|dev|db"); -$lang->admin->menu->dev['subMenu']->editor = array('link' => "$lang->editor|dev|editor"); -$lang->admin->menu->dev['subMenu']->entry = array('link' => "{$lang->admin->entry}|entry|browse", 'subModule' => 'entry'); +$lang->admin->menu->dev['subMenu'] = new stdclass(); +$lang->admin->menu->dev['subMenu']->api = array('link' => "API|dev|api"); +$lang->admin->menu->dev['subMenu']->db = array('link' => "$lang->db|dev|db"); +$lang->admin->menu->dev['subMenu']->langItem = array('link' => "{$lang->langItem}|dev|langItem"); +$lang->admin->menu->dev['subMenu']->editor = array('link' => "$lang->editor|dev|editor"); +$lang->admin->menu->dev['subMenu']->entry = array('link' => "{$lang->admin->entry}|entry|browse", 'subModule' => 'entry'); $lang->admin->menu->dev['menuOrder'][5] = 'api'; $lang->admin->menu->dev['menuOrder'][10] = 'db'; diff --git a/module/common/lang/vi.php b/module/common/lang/vi.php index d632cd775d..fed24b15d8 100644 --- a/module/common/lang/vi.php +++ b/module/common/lang/vi.php @@ -27,6 +27,7 @@ $lang->welcome = "%s"; $lang->logout = 'Thoát'; $lang->login = 'Đăng nhập'; $lang->help = 'Trợ giúp'; +$lang->langItem = 'Lang Item'; $lang->aboutZenTao = 'Giới thiệu'; $lang->profile = 'Hồ sơ'; $lang->changePassword = 'Mật khẩu'; diff --git a/module/common/lang/zh-cn.php b/module/common/lang/zh-cn.php index de9520beef..b282fc5e19 100644 --- a/module/common/lang/zh-cn.php +++ b/module/common/lang/zh-cn.php @@ -249,6 +249,7 @@ $lang->model = '模型'; $lang->redev = '二次开发'; $lang->browser = '浏览器'; $lang->db = '数据库'; +$lang->langItem = '语言项'; $lang->editor = '编辑器'; $lang->timezone = '时区'; $lang->security = '安全'; diff --git a/module/dev/control.php b/module/dev/control.php index ee06641655..0559645367 100644 --- a/module/dev/control.php +++ b/module/dev/control.php @@ -81,4 +81,20 @@ class dev extends control $this->display(); } + + /** + * LangItem. + * + * @access public + * @return void + */ + public function langItem() + { + $this->view->title = $this->lang->langItem; + $this->view->position[] = $this->lang->langItem; + + $this->view->tab = 'langItem'; + + $this->display(); + } } diff --git a/module/dev/view/langitem.html.php b/module/dev/view/langitem.html.php new file mode 100644 index 0000000000..975a51eec3 --- /dev/null +++ b/module/dev/view/langitem.html.php @@ -0,0 +1,17 @@ + + * * @package dev + * * @version $Id$ + * * @link http://www.zentao.net + * */ +?> + +
+
+ + From f25bcb9edc43a75c72d5b752061465678b183f34 Mon Sep 17 00:00:00 2001 From: guofeilong Date: Tue, 14 Feb 2023 08:39:58 +0800 Subject: [PATCH 002/319] - Code for dev/control.php refactors. --- module/dev/control.php | 3 --- 1 file changed, 3 deletions(-) diff --git a/module/dev/control.php b/module/dev/control.php index 0559645367..b0d9a5620e 100644 --- a/module/dev/control.php +++ b/module/dev/control.php @@ -91,9 +91,6 @@ class dev extends control public function langItem() { $this->view->title = $this->lang->langItem; - $this->view->position[] = $this->lang->langItem; - - $this->view->tab = 'langItem'; $this->display(); } From 6bf8c6388e6d544e1b5032963764ea1688f0c801 Mon Sep 17 00:00:00 2001 From: guofeilong Date: Tue, 14 Feb 2023 08:45:35 +0800 Subject: [PATCH 003/319] * Code for add menuOrder in langItem . --- module/common/lang/menu.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/module/common/lang/menu.php b/module/common/lang/menu.php index ba57557add..a78c73a6b2 100644 --- a/module/common/lang/menu.php +++ b/module/common/lang/menu.php @@ -633,8 +633,9 @@ $lang->admin->menu->dev['subMenu']->entry = array('link' => "{$lang->admin->e $lang->admin->menu->dev['menuOrder'][5] = 'api'; $lang->admin->menu->dev['menuOrder'][10] = 'db'; -$lang->admin->menu->dev['menuOrder'][15] = 'editor'; -$lang->admin->menu->dev['menuOrder'][20] = 'entry'; +$lang->admin->menu->dev['menuOrder'][15] = 'langItem'; +$lang->admin->menu->dev['menuOrder'][20] = 'editor'; +$lang->admin->menu->dev['menuOrder'][25] = 'entry'; $lang->admin->menu->system['subMenu'] = new stdclass(); $lang->admin->menu->system['subMenu']->mode = array('link' => "{$lang->custom->mode}|custom|mode"); From 00725d482f46954ac91781e3f0021187d200bb77 Mon Sep 17 00:00:00 2001 From: caoyanyi Date: Tue, 14 Feb 2023 10:49:29 +0800 Subject: [PATCH 004/319] * Add section aplit when language get. --- module/custom/model.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/module/custom/model.php b/module/custom/model.php index 9dad54b82c..0930adf920 100644 --- a/module/custom/model.php +++ b/module/custom/model.php @@ -44,7 +44,13 @@ class customModel extends model foreach($allCustomLang as $id => $customLang) { if(isset($sectionLang[$customLang->module][$customLang->section]['all']) && isset($sectionLang[$customLang->module][$customLang->section][$currentLang]) && $customLang->lang == 'all') continue; - $processedLang[$customLang->module][$customLang->section][$customLang->key] = $customLang->value; + + $sections = explode('.', $customLang->section); + $sectionIndex = count($sections) - 1; + $sectionArr = array($customLang->key => $customLang->value); + for($index = $sectionIndex; $index >= 0; $index --) $sectionArr = array($sections[$index] => $sectionArr); + + $processedLang[$customLang->module] = $sectionArr; } return $processedLang; From 31b8e72a3fb22a6af1198fe7190029bd56fa9b80 Mon Sep 17 00:00:00 2001 From: guofeilong Date: Tue, 14 Feb 2023 11:48:07 +0800 Subject: [PATCH 005/319] * Code for css in langitem. --- module/dev/css/langitem.css | 14 ++++++++++++++ module/dev/view/langitem.html.php | 19 ++++++++++++++++++- 2 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 module/dev/css/langitem.css diff --git a/module/dev/css/langitem.css b/module/dev/css/langitem.css new file mode 100644 index 0000000000..55c837e70f --- /dev/null +++ b/module/dev/css/langitem.css @@ -0,0 +1,14 @@ +.flex {display: flex;} +.h-32 {height: 32px;} +.py-6 {padding: 6px 0;} +.my-6 {margin: 6px 0;} +.title {font-size: 13px; color: #313C52; font-weight: 700; height: 40px; text-align: center;} + +/* side-left */ +.main-content > .side-left {flex: 0 0 160px; margin-left: 64px; width: 160px;} +.label-list > .input-label {display: flex; align-items: center; justify-content: center;} + +/* side-right */ +.main-content > .side-right {margin-left: 50px;} +.main-content > .side-right > .input-list > .input-control {position: relative;} +.main-content > .side-right > .input-list > .input-control > i.icon {position: absolute; font-size: 25px; left: -60px; top: 8px;} diff --git a/module/dev/view/langitem.html.php b/module/dev/view/langitem.html.php index 975a51eec3..337fa5bff9 100644 --- a/module/dev/view/langitem.html.php +++ b/module/dev/view/langitem.html.php @@ -11,7 +11,24 @@ * */ ?> -
+
+
+
默认值
+
+
项目集
+
+
+
+
修改值
+
+
+ + +
+
+
+
+
From ff5bc056bde5c66a8a1a9a9dc33b6d5652edd52d Mon Sep 17 00:00:00 2001 From: wangyidong Date: Tue, 14 Feb 2023 13:35:12 +0800 Subject: [PATCH 006/319] * code for replace menu lang. --- db/update18.2.sql | 1 + framework/router.class.php | 15 +++++++++ module/common/model.php | 64 ++++++++++++++++++++++++++++++++++++-- module/custom/model.php | 2 +- 4 files changed, 79 insertions(+), 3 deletions(-) create mode 100644 db/update18.2.sql diff --git a/db/update18.2.sql b/db/update18.2.sql new file mode 100644 index 0000000000..8191f3d34d --- /dev/null +++ b/db/update18.2.sql @@ -0,0 +1 @@ +ALTER TABLE `zt_lang` ADD `systemMode` varchar(10) COLLATE 'utf8_general_ci' NOT NULL DEFAULT 'ALM'; diff --git a/framework/router.class.php b/framework/router.class.php index 9be28106e7..71e76c2776 100755 --- a/framework/router.class.php +++ b/framework/router.class.php @@ -108,6 +108,17 @@ class router extends baseRouter parent::loadLang($moduleName, $appName); + /* Replace main nav lang. */ + if($moduleName == 'common' and $this->dbh and !empty($this->config->db->name)) + { + $customMenus = $this->dbh->query('SELECT * FROM' . TABLE_LANG . "WHERE `module`='common' AND `section`='mainNav' AND `lang`='{$this->clientLang}' AND `vision`='{$this->config->vision}' AND `systemMode`='{$this->config->systemMode}'")->fetchAll(); + foreach($customMenus as $menu) + { + $menuKey = $menu->key; + if(isset($lang->mainNav->$menuKey)) $lang->mainNav->$menuKey = zget($lang->navIcons, $menuKey, '') . " {$menu->value}" . substr($lang->mainNav->$menuKey, strpos($lang->mainNav->$menuKey, '|')); + } + } + /* Merge from the db lang. */ if($moduleName != 'common' and isset($lang->db->custom[$moduleName])) { @@ -284,6 +295,10 @@ class router extends baseRouter $lang->URCommon = isset($URPairs[$config->URSR]) ? $URPairs[$config->URSR] : reset($URPairs); $lang->SRCommon = isset($SRPairs[$config->URSR]) ? $SRPairs[$config->URSR] : reset($SRPairs); } + + /* Replace common lang. */ + $customMenus = $this->dbh->query('SELECT * FROM' . TABLE_LANG . "WHERE `module`='common' AND `lang`='{$this->clientLang}' AND `section`='' AND `vision`='{$config->vision}' AND `systemMode`='{$config->systemMode}'")->fetchAll(); + foreach($customMenus as $menu) if(isset($lang->{$menu->key})) $lang->{$menu->key} = $menu->value; } } diff --git a/module/common/model.php b/module/common/model.php index c6c4974b34..c429d4b5d1 100644 --- a/module/common/model.php +++ b/module/common/model.php @@ -1117,8 +1117,9 @@ class commonModel extends model global $app, $lang, $config; /* Set main menu by app tab and module. */ - self::setMainMenu(); - self::checkMenuVarsReplaced(); + static::replaceMenuLang(); + static::setMainMenu(); + static::checkMenuVarsReplaced(); $activeMenu = ''; $tab = $app->tab; @@ -3535,6 +3536,65 @@ EOD; return true; } + /** + * Replace menu lang. + * + * @static + * @access public + * @return void + */ + public static function replaceMenuLang() + { + global $lang; + foreach($lang->db->custom as $moduleName => $sectionMenus) + { + if(strpos($moduleName, 'Menu') === false) continue; + + $isSecondMenu = strpos($moduleName, 'subMenu') === false; + $moduleName = str_replace($isSecondMenu ? 'Menu' : 'subMenu', '', $moduleName); + + foreach($sectionMenus as $section => $menus) + { + foreach($menus as $key => $value) + { + $settingMenu = null; + /* Get second menu. */ + if($isSecondMenu) + { + $isDropMenu = strpos($section, 'dropMenu') !== false; + if(!$isDropMenu) + { + if(!isset($lang->{$moduleName}->{$section})) break; + if(is_object($lang->{$moduleName}->{$section}) and isset($lang->{$moduleName}->{$section}->{$key})) $settingMenu = &$lang->{$moduleName}->{$section}->{$key}; + if(is_array($lang->{$moduleName}->{$section}) and isset($lang->{$moduleName}->{$section}[$key])) $settingMenu = &$lang->{$moduleName}->{$section}[$key]; + } + else + { + /* Get drop menu in second menu. */ + $dropMenuKey = str_replace('dropMenu', '', $section); + if(!isset($lang->{$moduleName}->menu->{$dropMenuKey}['dropMenu']->{$key})) break; + $settingMenu = &$lang->{$moduleName}->menu->{$dropMenuKey}['dropMenu']->{$key}; + } + } + /* Get third menu. */ + elseif(isset($lang->{$moduleName}->menu->{$section}['subMenu'])) + { + $subMenu = $lang->{$moduleName}->menu->{$section}['subMenu']; + if(is_object($subMenu) and isset($subMenu->{$key})) $settingMenu = &$lang->{$moduleName}->menu->{$section}['subMenu']->{$key}; + if(is_array($subMenu) and isset($subMenu[$key])) $settingMenu = &$lang->{$moduleName}->menu->{$section}['subMenu'][$key]; + } + + /* Set custom menu lang. */ + if(!empty($settingMenu)) + { + if(is_string($settingMenu)) $settingMenu = $value . substr($settingMenu, strpos($settingMenu, '|')); + if(is_array($settingMenu) and isset($settingMenu['link'])) $settingMenu['link'] = $value . substr($settingMenu['link'], strpos($settingMenu['link'], '|')); + } + } + } + } + } + /** * Check valid row. * diff --git a/module/custom/model.php b/module/custom/model.php index 0930adf920..0f45ad973d 100644 --- a/module/custom/model.php +++ b/module/custom/model.php @@ -23,7 +23,7 @@ class customModel extends model try { - $sql = $this->dao->select('*')->from(TABLE_LANG)->where('`lang`')->in("$currentLang,all")->andWhere('vision')->eq($this->config->vision)->orderBy('lang,id')->get(); + $sql = $this->dao->select('*')->from(TABLE_LANG)->where('`lang`')->in("$currentLang,all")->andWhere('vision')->eq($this->config->vision)->andWhere('systemMode')->eq($this->config->systemMode)->orderBy('lang,id')->get(); $stmt = $this->dbh->query($sql); $allCustomLang = array(); From dff2e8a00c1890eab216a9fb75936c98c0b186c3 Mon Sep 17 00:00:00 2001 From: caoyanyi Date: Tue, 14 Feb 2023 14:01:16 +0800 Subject: [PATCH 007/319] * Add search tab. --- module/common/lang/menu.php | 2 +- module/dev/config.php | 3 +++ module/dev/control.php | 9 +++++---- module/dev/lang/de.php | 6 ++++++ module/dev/lang/en.php | 6 ++++++ module/dev/lang/fr.php | 6 ++++++ module/dev/lang/zh-cn.php | 6 ++++++ module/dev/view/langitem.html.php | 9 +++++++++ 8 files changed, 42 insertions(+), 5 deletions(-) diff --git a/module/common/lang/menu.php b/module/common/lang/menu.php index a78c73a6b2..350dc33beb 100644 --- a/module/common/lang/menu.php +++ b/module/common/lang/menu.php @@ -627,7 +627,7 @@ $lang->admin->menu->company['subMenu']->browseGroup = array('link' => "{$lang->p $lang->admin->menu->dev['subMenu'] = new stdclass(); $lang->admin->menu->dev['subMenu']->api = array('link' => "API|dev|api"); $lang->admin->menu->dev['subMenu']->db = array('link' => "$lang->db|dev|db"); -$lang->admin->menu->dev['subMenu']->langItem = array('link' => "{$lang->langItem}|dev|langItem"); +$lang->admin->menu->dev['subMenu']->langItem = array('link' => "{$lang->langItem}|dev|langitem"); $lang->admin->menu->dev['subMenu']->editor = array('link' => "$lang->editor|dev|editor"); $lang->admin->menu->dev['subMenu']->entry = array('link' => "{$lang->admin->entry}|entry|browse", 'subModule' => 'entry'); diff --git a/module/dev/config.php b/module/dev/config.php index 697b172c04..21a21368e9 100644 --- a/module/dev/config.php +++ b/module/dev/config.php @@ -243,3 +243,6 @@ $config->dev->postParams['testcase']['create']['keywords'] = 'string'; $config->disableFeature = array(); if(!helper::hasFeature('waterfall')) $config->disableFeature = array('design', 'stage', 'programplan', 'weekly', 'researchplan', 'researchreport', 'gapanalysis'); + +$config->dev->disableMainMenu = array(); +if($config->systemMode == 'light') $config->dev->disableMainMenu = array('project'); diff --git a/module/dev/control.php b/module/dev/control.php index b0d9a5620e..122251f66e 100644 --- a/module/dev/control.php +++ b/module/dev/control.php @@ -83,15 +83,16 @@ class dev extends control } /** - * LangItem. + * Lang item. * + * @param string $type * @access public * @return void */ - public function langItem() + public function langItem($type = 'common') { - $this->view->title = $this->lang->langItem; - + $this->view->title = $this->lang->langItem; + $this->view->type = $type; $this->display(); } } diff --git a/module/dev/lang/de.php b/module/dev/lang/de.php index 4785a529cc..84bf3954d1 100644 --- a/module/dev/lang/de.php +++ b/module/dev/lang/de.php @@ -177,3 +177,9 @@ if($config->systemMode != 'ALM') unset($lang->dev->groupList['program']); $lang->dev->endGroupList['admin'] = 'Admin'; $lang->dev->endGroupList['system'] = 'System'; $lang->dev->endGroupList['other'] = 'Andere'; + +$lang->dev->featureBar['langItem']['common'] = 'Common'; +$lang->dev->featureBar['langItem']['first'] = 'First Menu'; +$lang->dev->featureBar['langItem']['second'] = 'Second Menu'; +$lang->dev->featureBar['langItem']['third'] = 'Third Menu'; +$lang->dev->featureBar['langItem']['feature'] = 'Search Tab'; diff --git a/module/dev/lang/en.php b/module/dev/lang/en.php index 3218ee96b0..b11c005f6e 100644 --- a/module/dev/lang/en.php +++ b/module/dev/lang/en.php @@ -177,3 +177,9 @@ if($config->systemMode != 'ALM') unset($lang->dev->groupList['program']); $lang->dev->endGroupList['admin'] = 'Admin'; $lang->dev->endGroupList['system'] = 'System'; $lang->dev->endGroupList['other'] = 'Others'; + +$lang->dev->featureBar['langItem']['common'] = 'Common'; +$lang->dev->featureBar['langItem']['first'] = 'First Menu'; +$lang->dev->featureBar['langItem']['second'] = 'Second Menu'; +$lang->dev->featureBar['langItem']['third'] = 'Third Menu'; +$lang->dev->featureBar['langItem']['feature'] = 'Search Tab'; diff --git a/module/dev/lang/fr.php b/module/dev/lang/fr.php index 3218ee96b0..b11c005f6e 100644 --- a/module/dev/lang/fr.php +++ b/module/dev/lang/fr.php @@ -177,3 +177,9 @@ if($config->systemMode != 'ALM') unset($lang->dev->groupList['program']); $lang->dev->endGroupList['admin'] = 'Admin'; $lang->dev->endGroupList['system'] = 'System'; $lang->dev->endGroupList['other'] = 'Others'; + +$lang->dev->featureBar['langItem']['common'] = 'Common'; +$lang->dev->featureBar['langItem']['first'] = 'First Menu'; +$lang->dev->featureBar['langItem']['second'] = 'Second Menu'; +$lang->dev->featureBar['langItem']['third'] = 'Third Menu'; +$lang->dev->featureBar['langItem']['feature'] = 'Search Tab'; diff --git a/module/dev/lang/zh-cn.php b/module/dev/lang/zh-cn.php index 57100dfe2b..a194e1843b 100644 --- a/module/dev/lang/zh-cn.php +++ b/module/dev/lang/zh-cn.php @@ -177,3 +177,9 @@ if($config->systemMode != 'ALM') unset($lang->dev->groupList['program']); $lang->dev->endGroupList['admin'] = '后台'; $lang->dev->endGroupList['system'] = '系统'; $lang->dev->endGroupList['other'] = '其他'; + +$lang->dev->featureBar['langItem']['common'] = '公共'; +$lang->dev->featureBar['langItem']['first'] = '一级菜单'; +$lang->dev->featureBar['langItem']['second'] = '二级菜单'; +$lang->dev->featureBar['langItem']['third'] = '三级菜单'; +$lang->dev->featureBar['langItem']['feature'] = '检索标签'; diff --git a/module/dev/view/langitem.html.php b/module/dev/view/langitem.html.php index 337fa5bff9..16d190701d 100644 --- a/module/dev/view/langitem.html.php +++ b/module/dev/view/langitem.html.php @@ -11,6 +11,15 @@ * */ ?> +
默认值
From ec1d388334b43ab635b7433b2c355a97bc7678c2 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Tue, 14 Feb 2023 14:32:09 +0800 Subject: [PATCH 008/319] * fix bug. --- module/common/model.php | 1 + 1 file changed, 1 insertion(+) diff --git a/module/common/model.php b/module/common/model.php index c429d4b5d1..361eb90429 100644 --- a/module/common/model.php +++ b/module/common/model.php @@ -3546,6 +3546,7 @@ EOD; public static function replaceMenuLang() { global $lang; + if(empty($lang->db->custom)) return; foreach($lang->db->custom as $moduleName => $sectionMenus) { if(strpos($moduleName, 'Menu') === false) continue; From 41ddc2562b255d63f43d4cb75d65e75d7bc680e3 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Tue, 14 Feb 2023 14:38:21 +0800 Subject: [PATCH 009/319] * fix bug. --- module/common/model.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/common/model.php b/module/common/model.php index 361eb90429..dea080e6f2 100644 --- a/module/common/model.php +++ b/module/common/model.php @@ -3558,7 +3558,6 @@ EOD; { foreach($menus as $key => $value) { - $settingMenu = null; /* Get second menu. */ if($isSecondMenu) { @@ -3590,6 +3589,7 @@ EOD; { if(is_string($settingMenu)) $settingMenu = $value . substr($settingMenu, strpos($settingMenu, '|')); if(is_array($settingMenu) and isset($settingMenu['link'])) $settingMenu['link'] = $value . substr($settingMenu['link'], strpos($settingMenu['link'], '|')); + unset($settingMenu); } } } From 87b3c95cebf9cf10554e94866e91721865a2e40a Mon Sep 17 00:00:00 2001 From: guofeilong Date: Wed, 15 Feb 2023 10:00:27 +0800 Subject: [PATCH 010/319] * Langitem: code for task #84531 --- module/dev/css/langitem.css | 8 ++++--- module/dev/js/langitem.js | 35 +++++++++++++++++++++++++++++++ module/dev/view/langitem.html.php | 13 ++++++++---- 3 files changed, 49 insertions(+), 7 deletions(-) create mode 100644 module/dev/js/langitem.js diff --git a/module/dev/css/langitem.css b/module/dev/css/langitem.css index 55c837e70f..eff84ac637 100644 --- a/module/dev/css/langitem.css +++ b/module/dev/css/langitem.css @@ -1,14 +1,16 @@ .flex {display: flex;} .h-32 {height: 32px;} .py-6 {padding: 6px 0;} -.my-6 {margin: 6px 0;} +.my-12 {margin: 12px 0;} .title {font-size: 13px; color: #313C52; font-weight: 700; height: 40px; text-align: center;} /* side-left */ .main-content > .side-left {flex: 0 0 160px; margin-left: 64px; width: 160px;} -.label-list > .input-label {display: flex; align-items: center; justify-content: center;} +.label-list {background: #F8F8F8; padding: 5px 0;} +.label-list > .input-label {display: flex; align-items: center; cursor: pointer; padding-left: 40px;} /* side-right */ .main-content > .side-right {margin-left: 50px;} +.main-content > .side-right > .input-list {padding: 5px 0;} .main-content > .side-right > .input-list > .input-control {position: relative;} -.main-content > .side-right > .input-list > .input-control > i.icon {position: absolute; font-size: 25px; left: -60px; top: 8px;} +.main-content > .side-right > .input-list > .input-control > i.icon {position: absolute; font-size: 25px; left: -40px; top: 3px;} diff --git a/module/dev/js/langitem.js b/module/dev/js/langitem.js new file mode 100644 index 0000000000..b6c10ce50c --- /dev/null +++ b/module/dev/js/langitem.js @@ -0,0 +1,35 @@ +$(function() +{ + $(".input-list").on("click", 'input', function(event) + { + addActive(event.target.id); + }); + $(".input-list").on("blur", 'input', function(event) + { + removeActive(event.target.id); + }); + $('.label-list').on('click', '.input-label', function(e) + { + var clearId = $('.label-list > .text-primary').attr('labelid'); + var clickId = $(e.target).attr('labelid'); + if (clearId && clearId != clickId) + { + removeActive(clearId); + } + if (clickId && clickId != clearId) + { + addActive(clickId); + $('#' + clickId).focus(); + } + }); + function addActive(id) + { + $('[labelid=' + id + ']').addClass('text-primary'); + $('[iconid=' + id + ']').removeClass('hidden'); + }; + function removeActive(id) + { + $('[labelid=' + id + ']').removeClass('text-primary'); + $('[iconid=' + id + ']').addClass('hidden'); + }; +}) diff --git a/module/dev/view/langitem.html.php b/module/dev/view/langitem.html.php index 16d190701d..1e640740b9 100644 --- a/module/dev/view/langitem.html.php +++ b/module/dev/view/langitem.html.php @@ -24,15 +24,20 @@
默认值
-
项目集
+
项目集
+
产品
修改值
-
- - +
+ + +
+
+ +
From 0d5f437607c3cca050fff3aeef58c8e6c390aaee Mon Sep 17 00:00:00 2001 From: caoyanyi Date: Wed, 15 Feb 2023 10:23:54 +0800 Subject: [PATCH 011/319] * Adjust code. --- module/dev/js/langitem.js | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/module/dev/js/langitem.js b/module/dev/js/langitem.js index b6c10ce50c..15e9144419 100644 --- a/module/dev/js/langitem.js +++ b/module/dev/js/langitem.js @@ -1,35 +1,36 @@ $(function() -{ - $(".input-list").on("click", 'input', function(event) +{ + $(".input-list").on("click", 'input', function(event) { addActive(event.target.id); }); - $(".input-list").on("blur", 'input', function(event) + $(".input-list").on("blur", 'input', function(event) { - removeActive(event.target.id); + removeActive(event.target.id); }); + $('.label-list').on('click', '.input-label', function(e) { var clearId = $('.label-list > .text-primary').attr('labelid'); var clickId = $(e.target).attr('labelid'); - if (clearId && clearId != clickId) - { - removeActive(clearId); - } - if (clickId && clickId != clearId) - { + if(clearId && clearId != clickId) removeActive(clearId); + + if(clickId && clickId != clearId) + { addActive(clickId); - $('#' + clickId).focus(); - } + $('#' + clickId).focus(); + } }); + function addActive(id) { $('[labelid=' + id + ']').addClass('text-primary'); $('[iconid=' + id + ']').removeClass('hidden'); - }; + } + function removeActive(id) { $('[labelid=' + id + ']').removeClass('text-primary'); $('[iconid=' + id + ']').addClass('hidden'); - }; + } }) From ff9c2419b235806dd43ba633b819536dbd33b88d Mon Sep 17 00:00:00 2001 From: guofeilong Date: Wed, 15 Feb 2023 11:08:42 +0800 Subject: [PATCH 012/319] * Code for task#84531 --- module/dev/js/langitem.js | 1 + 1 file changed, 1 insertion(+) diff --git a/module/dev/js/langitem.js b/module/dev/js/langitem.js index 15e9144419..cd9e427713 100644 --- a/module/dev/js/langitem.js +++ b/module/dev/js/langitem.js @@ -32,5 +32,6 @@ $(function() { $('[labelid=' + id + ']').removeClass('text-primary'); $('[iconid=' + id + ']').addClass('hidden'); + $('#' + id).blur(); } }) From 3bf16c880e65b064a72b585a5b0a2cd55f7b19cf Mon Sep 17 00:00:00 2001 From: caoyanyi Date: Wed, 15 Feb 2023 11:22:42 +0800 Subject: [PATCH 013/319] * Optimize main and ext files get, and add get default lang function. --- framework/base/router.class.php | 107 ++++++++++++++++-------------- module/dev/control.php | 4 +- module/dev/model.php | 30 +++++++++ module/dev/view/langitem.html.php | 2 +- 4 files changed, 90 insertions(+), 53 deletions(-) diff --git a/framework/base/router.class.php b/framework/base/router.class.php index 5c51cbe7ef..fc837a7ccd 100644 --- a/framework/base/router.class.php +++ b/framework/base/router.class.php @@ -2506,29 +2506,9 @@ class baseRouter if($config and (!isset($config->$moduleName) or !is_object($config->$moduleName))) $config->$moduleName = new stdclass(); - /* 初始化数组。Init the variables. */ - $extConfigFiles = array(); - $commonExtConfigFiles = array(); - $siteExtConfigFiles = array(); - - /* 先获得模块的主配置文件。Get the main config file for current module first. */ - $mainConfigFile = $this->getModulePath($appName, $moduleName) . 'config.php'; - - /* 查找扩展配置文件。Get extension config files. */ - if($config->framework->extensionLevel > 0) $extConfigPath = $this->getModuleExtPath($appName, $moduleName, 'config'); - if($config->framework->extensionLevel >= 1) - { - if(!empty($extConfigPath['common'])) $commonExtConfigFiles = helper::ls($extConfigPath['common'], '.php'); - if(!empty($extConfigPath['xuan'])) $commonExtConfigFiles = array_merge($commonExtConfigFiles, helper::ls($extConfigPath['xuan'], '.php')); - if(!empty($extConfigPath['vision'])) $commonExtConfigFiles = array_merge($commonExtConfigFiles, helper::ls($extConfigPath['vision'], '.php')); - if(!empty($extConfigPath['saas'])) $commonExtConfigFiles = array_merge($commonExtConfigFiles, helper::ls($extConfigPath['saas'], '.php')); - if(!empty($extConfigPath['custom'])) $commonExtConfigFiles = array_merge($commonExtConfigFiles, helper::ls($extConfigPath['custom'], '.php')); - } - if($config->framework->extensionLevel == 2 and !empty($extConfigPath['site'])) $siteExtConfigFiles = helper::ls($extConfigPath['site'], '.php'); - $extConfigFiles = array_merge($commonExtConfigFiles, $siteExtConfigFiles); - /* 将主配置文件和扩展配置文件合并在一起。Put the main config file and extension config files together. */ - $configFiles = array_merge(array($mainConfigFile), $extConfigFiles); + $configFiles = $this->getMainAndExtFiles($moduleName, $appName, 'config'); + if(empty($configFiles)) return false; /* 加载每一个配置文件。Load every config file. */ static $loadedConfigs = array(); @@ -2670,36 +2650,8 @@ class baseRouter */ public function loadLang($moduleName, $appName = '') { - /* 初始化变量。Init vars. */ - $modulePath = $this->getModulePath($appName, $moduleName); - $extLangFiles = array(); - $langFilesToLoad = array(); - - /* 判断主语言文件是否存在。Whether the main lang file exists or not. */ - $mainLangFile = $this->getMainLangFile($moduleName, $appName); - if($mainLangFile) $langFilesToLoad[] = $mainLangFile; - - /* 获取扩展语言文件。If extensionLevel > 0, get extension lang files. */ - if($this->config->framework->extensionLevel > 0) - { - $commonExtLangFiles = array(); - $siteExtLangFiles = array(); - - $extLangPath = $this->getModuleExtPath($appName, $moduleName, 'lang'); - if($this->config->framework->extensionLevel >= 1) - { - if(!empty($extLangPath['common'])) $commonExtLangFiles = helper::ls($extLangPath['common'] . $this->clientLang, '.php'); - if(!empty($extLangPath['xuan'])) $commonExtLangFiles = array_merge($commonExtLangFiles, helper::ls($extLangPath['xuan'] . $this->clientLang, '.php')); - if(!empty($extLangPath['vision'])) $commonExtLangFiles = array_merge($commonExtLangFiles, helper::ls($extLangPath['vision'] . $this->clientLang, '.php')); - if(!empty($extLangPath['custom'])) $commonExtLangFiles = array_merge($commonExtLangFiles, helper::ls($extLangPath['custom'] . $this->clientLang, '.php')); - if(!empty($extLangPath['saas'])) $commonExtLangFiles = array_merge($commonExtLangFiles, helper::ls($extLangPath['saas'] . $this->clientLang, '.php')); - } - if($this->config->framework->extensionLevel == 2 and !empty($extLangPath['site'])) $siteExtLangFiles = helper::ls($extLangPath['site'] . $this->clientLang, '.php'); - $extLangFiles = array_merge($commonExtLangFiles, $siteExtLangFiles); - } - /* 计算最终要加载的语言文件。 Get the lang files to be loaded. */ - $langFilesToLoad = array_merge($langFilesToLoad, $extLangFiles); + $langFilesToLoad = $this->getMainAndExtFiles($moduleName, $appName, 'lang'); if(empty($langFilesToLoad)) return false; /* 加载语言文件。Load lang files. */ @@ -2972,6 +2924,59 @@ class baseRouter { return strtolower(getenv('IS_CONTAINER')) == 'true'; } + + /** + * Get main file and ext files. + * + * @param string $moduleName + * @param string $appName + * @param string $type lang|config|control|model + * @access public + * @return array + */ + public function getMainAndExtFiles($moduleName, $appName = '', $type = 'lang') + { + /* 初始化变量。Init vars. */ + $modulePath = $this->getModulePath($appName, $moduleName); + $extFiles = array(); + $filesToLoad = array(); + + /* 判断主文件是否存在。Whether the main file exists or not. */ + if($type == 'lang') + { + $mainFile = $this->getMainLangFile($moduleName, $appName); + } + else + { + $mainFile = $modulePath . $type . '.php'; + } + if($mainFile) $filesToLoad[] = $mainFile; + + /* 获取扩展文件。If extensionLevel > 0, get extension files. */ + if($this->config->framework->extensionLevel > 0) + { + $commonExtFiles = array(); + $siteExtFiles = array(); + + $extPath = $this->getModuleExtPath($appName, $moduleName, $type); + if($this->config->framework->extensionLevel >= 1) + { + $client = $type == 'lang' and isset($this->client) ? $this->client : ''; + if(!empty($extPath['common'])) $commonExtFiles = helper::ls($extPath['common'] . $client, '.php'); + if(!empty($extPath['xuan'])) $commonExtFiles = array_merge($commonExtFiles, helper::ls($extPath['xuan'] . $client, '.php')); + if(!empty($extPath['vision'])) $commonExtFiles = array_merge($commonExtFiles, helper::ls($extPath['vision'] . $client, '.php')); + if(!empty($extPath['custom'])) $commonExtFiles = array_merge($commonExtFiles, helper::ls($extPath['custom'] . $client, '.php')); + if(!empty($extPath['saas'])) $commonExtFiles = array_merge($commonExtFiles, helper::ls($extPath['saas'] . $client, '.php')); + } + if($this->config->framework->extensionLevel == 2 and !empty($extPath['site'])) $siteExtFiles = helper::ls($extPath['site'] . $client, '.php'); + $extFiles = array_merge($commonExtFiles, $siteExtFiles); + } + + /* 计算最终要加载的文件。 Get the files to be loaded. */ + $filesToLoad = array_merge($filesToLoad, $extFiles); + if(empty($filesToLoad)) return false; + return $filesToLoad; + } } /** diff --git a/module/dev/control.php b/module/dev/control.php index 122251f66e..6f302b651c 100644 --- a/module/dev/control.php +++ b/module/dev/control.php @@ -89,10 +89,12 @@ class dev extends control * @access public * @return void */ - public function langItem($type = 'common') + public function langItem($type = 'common', $module = 'my', $method = 'browse') { + $this->dev->loadLang(); $this->view->title = $this->lang->langItem; $this->view->type = $type; + $this->view->featureBar = $this->lang->dev->featureBar['langItem']; $this->display(); } } diff --git a/module/dev/model.php b/module/dev/model.php index 2380ab8e5a..d370e620d4 100644 --- a/module/dev/model.php +++ b/module/dev/model.php @@ -295,4 +295,34 @@ class devModel extends model { return ltrim(rtrim($line), "* \t\n\r\0\x0B"); } + + /** + * Load default lang. + * + * @access public + * @return object + */ + public function loadDefaultLang() + { + $langFilesToLoad = $this->app->getMainAndExtFiles('common'); + if(empty($langFilesToLoad)) return false; + + $lang = new language(); + $lang->URCommon = $this->lang->URCommon; + $lang->SRCommon = $this->lang->SRCommon; + $lang->productCommon = $this->lang->productCommon; + $lang->projectCommon = $this->lang->projectCommon; + $lang->executionCommon = $this->lang->executionCommon; + if(!isset($lang->common)) $lang->common = new stdclass(); + + $loadedLangs = array(); + foreach($langFilesToLoad as $langFile) + { + if(in_array($langFile, $loadedLangs)) continue; + include $langFile; + $loadedLangs[] = $langFile; + } + + return $lang; + } } diff --git a/module/dev/view/langitem.html.php b/module/dev/view/langitem.html.php index 1e640740b9..a9bbc4502e 100644 --- a/module/dev/view/langitem.html.php +++ b/module/dev/view/langitem.html.php @@ -13,7 +13,7 @@ From ca3508d1df26611c25b130280a069f249aee05de Mon Sep 17 00:00:00 2001 From: guofeilong Date: Thu, 16 Feb 2023 13:40:16 +0800 Subject: [PATCH 022/319] * Code for add menuTree to langItem --- module/dev/config.php | 2 + module/dev/css/langitem.css | 9 ++++ module/dev/js/langitem.js | 59 ++++++++++++++++++++++++++ module/dev/view/langitem.html.php | 69 ++++++++++++++++++------------- 4 files changed, 111 insertions(+), 28 deletions(-) diff --git a/module/dev/config.php b/module/dev/config.php index 21a21368e9..db19feb668 100644 --- a/module/dev/config.php +++ b/module/dev/config.php @@ -241,6 +241,8 @@ $config->dev->postParams['testcase']['create']['expect'] = 'string'; $config->dev->postParams['testcase']['create']['mailto'] = 'string'; $config->dev->postParams['testcase']['create']['keywords'] = 'string'; +$config->dev->arrTypesWithMenu = array('second', 'third', 'feature'); + $config->disableFeature = array(); if(!helper::hasFeature('waterfall')) $config->disableFeature = array('design', 'stage', 'programplan', 'weekly', 'researchplan', 'researchreport', 'gapanalysis'); diff --git a/module/dev/css/langitem.css b/module/dev/css/langitem.css index 837d15c01e..98b680089f 100644 --- a/module/dev/css/langitem.css +++ b/module/dev/css/langitem.css @@ -1,9 +1,18 @@ .flex {display: flex;} +.flex-1 {flex: 1;} +.align-center {align-items: center;} +.justify-center {justify-content: center;} .h-32 {height: 32px;} .py-6 {padding: 6px 0;} .my-12 {margin: 12px 0;} .ml-20 {margin-left: 20px;} .title {font-size: 13px; color: #313C52; font-weight: 700; height: 40px; text-align: center;} +.gap-15 {gap: 15px;} + +/* menu-tree */ +.menu-tree {flex: 0 0 200px; background: #fff; padding: 10px 10px;} +.menu-tree > .tree {padding-top: 20px;} +.menu-tree li {padding: 5px 25px;} /* side-left */ .main-content > .side-left {flex: 0 0 160px; margin-left: 64px;} diff --git a/module/dev/js/langitem.js b/module/dev/js/langitem.js index 033734fc93..633c2d6159 100644 --- a/module/dev/js/langitem.js +++ b/module/dev/js/langitem.js @@ -14,6 +14,8 @@ $(function() handleClickItem($(this).attr('labelid')); }); + initMenu(); + function addActive(id) { $('[labelid=' + id + ']').addClass('text-primary'); @@ -39,4 +41,61 @@ $(function() addActive(clickId); }; } + + function initMenu() + { + if (arrTypesWithMenu.includes(type)) + { + var myTreeData = [{ + title: '水果', + children: [ + {title: '橘子'}, + {title: '瓜'} + ] + }, { + title: '坚果', + children: [ + {title: '向日葵'}, + {title: '瓜子'} + ] + }, { + title: '蔬菜' + }]; + $('#menuTree').tree( + { + data: myTreeData + }); + } + $('#searchInputTree').on('input', function() + { + var val = $(this).val(); + if (!val) + { + var updateData = JSON.parse(JSON.stringify(myTreeData)); + } + else + { + var updateData = []; + for (var i = 0; i < myTreeData.length; i++) + { + var item = {}; + $.extend(true, item, myTreeData[i]) + if (item.children) + { + var children = []; + for (var j = 0; j < item.children.length; j++) + { + if (item.children[j].title.includes(val)) + { + children.push(item.children[j]); + } + } + item.children = children; + } + updateData.push(item); + } + } + $('#menuTree').data('zui.tree').reload(updateData); + }) + } }) diff --git a/module/dev/view/langitem.html.php b/module/dev/view/langitem.html.php index e55a4faa7f..c056fa8737 100644 --- a/module/dev/view/langitem.html.php +++ b/module/dev/view/langitem.html.php @@ -10,6 +10,8 @@ * @link http://www.zentao.net */ ?> + +dev->arrTypesWithMenu); ?> -
-
-
-
默认值
-
- $originalLang):?> -
" class="input-label h-32 my-12">
- -
+
+dev->arrTypesWithMenu , false)):?> + From 1b70d6e8a427cc7c0aea71874fc15ecd9624a7cf Mon Sep 17 00:00:00 2001 From: wangyidong Date: Thu, 16 Feb 2023 13:55:23 +0800 Subject: [PATCH 023/319] * code for task #84532. --- module/common/lang/menu.php | 6 ++-- module/custom/model.php | 7 +++-- module/dev/control.php | 46 ++++++++++++++++++++++++++++--- module/dev/lang/de.php | 13 +++++---- module/dev/lang/en.php | 13 +++++---- module/dev/lang/fr.php | 13 +++++---- module/dev/lang/zh-cn.php | 13 +++++---- module/dev/model.php | 9 ++++-- module/dev/view/langitem.html.php | 2 +- 9 files changed, 84 insertions(+), 38 deletions(-) diff --git a/module/common/lang/menu.php b/module/common/lang/menu.php index 059abacbf3..8f50a3c669 100644 --- a/module/common/lang/menu.php +++ b/module/common/lang/menu.php @@ -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|"; diff --git a/module/custom/model.php b/module/custom/model.php index eaa7e7bad2..debea8d153 100644 --- a/module/custom/model.php +++ b/module/custom/model.php @@ -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; diff --git a/module/dev/control.php b/module/dev/control.php index d6ae39d565..bc495de102 100644 --- a/module/dev/control.php +++ b/module/dev/control.php @@ -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 = '§ion='; + if($type == 'first') $section = '§ion=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')); + } } diff --git a/module/dev/lang/de.php b/module/dev/lang/de.php index d50019e51d..26036eaa07 100644 --- a/module/dev/lang/de.php +++ b/module/dev/lang/de.php @@ -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 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->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 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->confirmRestore = 'Do you want to reset?'; $lang->dev->UR = 'Epic'; $lang->dev->SR = 'Story'; diff --git a/module/dev/lang/en.php b/module/dev/lang/en.php index 4f4f80eb1a..433b82fc65 100644 --- a/module/dev/lang/en.php +++ b/module/dev/lang/en.php @@ -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 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->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 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->confirmRestore = 'Do you want to reset?'; $lang->dev->UR = 'Epic'; $lang->dev->SR = 'Story'; diff --git a/module/dev/lang/fr.php b/module/dev/lang/fr.php index 4f4f80eb1a..433b82fc65 100644 --- a/module/dev/lang/fr.php +++ b/module/dev/lang/fr.php @@ -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 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->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 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->confirmRestore = 'Do you want to reset?'; $lang->dev->UR = 'Epic'; $lang->dev->SR = 'Story'; diff --git a/module/dev/lang/zh-cn.php b/module/dev/lang/zh-cn.php index affa5b12bf..2e8f75bbba 100644 --- a/module/dev/lang/zh-cn.php +++ b/module/dev/lang/zh-cn.php @@ -12,12 +12,13 @@ $lang->dev->desc = '描述'; $lang->dev->noParams = '无参数'; $lang->dev->post = 'POST参数'; -$lang->dev->paramRange = '取值范围:%s'; -$lang->dev->paramDate = '日期格式:YY-mm-dd,如:2019-01-01'; -$lang->dev->paramColor = '颜色格式:#RGB,如:#3da7f5'; -$lang->dev->paramMailto = "填写帐号,多个账号用','分隔。"; -$lang->dev->noteEditor = "编辑器功能因为安全原因被禁用。使用该功能,请到官网下载安装 扩展编辑器 插件。"; -$lang->dev->noteTranslate = "翻译功能因为安全原因被禁用。使用该功能,请到官网下载安装 翻译 插件。"; +$lang->dev->paramRange = '取值范围:%s'; +$lang->dev->paramDate = '日期格式:YY-mm-dd,如:2019-01-01'; +$lang->dev->paramColor = '颜色格式:#RGB,如:#3da7f5'; +$lang->dev->paramMailto = "填写帐号,多个账号用','分隔。"; +$lang->dev->noteEditor = "编辑器功能因为安全原因被禁用。使用该功能,请到官网下载安装 扩展编辑器 插件。"; +$lang->dev->noteTranslate = "翻译功能因为安全原因被禁用。使用该功能,请到官网下载安装 翻译 插件。"; +$lang->dev->confirmRestore = '是否要恢复默认?'; $lang->dev->UR = '用户需求'; $lang->dev->SR = '软件需求'; diff --git a/module/dev/model.php b/module/dev/model.php index 0194d84d0f..eaad5b7e53 100644 --- a/module/dev/model.php +++ b/module/dev/model.php @@ -443,9 +443,12 @@ class devModel extends model { $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($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']); } diff --git a/module/dev/view/langitem.html.php b/module/dev/view/langitem.html.php index 7a79e3b958..09110b1787 100644 --- a/module/dev/view/langitem.html.php +++ b/module/dev/view/langitem.html.php @@ -45,7 +45,7 @@
- + restore, 'hiddenwin', "id='reset' class='btn btn-wide ml-20'");?>
From 9e1cfb2b256b02cfd84eb19eb717a468ce29084b Mon Sep 17 00:00:00 2001 From: wangyidong Date: Thu, 16 Feb 2023 14:53:30 +0800 Subject: [PATCH 024/319] * code for task #84532. --- module/common/lang/menu.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/common/lang/menu.php b/module/common/lang/menu.php index 8f50a3c669..49fff2da37 100644 --- a/module/common/lang/menu.php +++ b/module/common/lang/menu.php @@ -37,7 +37,7 @@ $lang->mainNav->my = "{$lang->navIcons['my']} {$lang->my->shortCommon}|my $lang->mainNav->program = "{$lang->navIcons['program']} {$lang->program->common}|$programModule|$programMethod|"; $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->execution = "{$lang->navIcons['execution']} {$lang->execution->common}|$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|"; From 7c927412cc221ff2e3f2769ebebb8971b6ca061e Mon Sep 17 00:00:00 2001 From: wangyidong Date: Thu, 16 Feb 2023 16:25:22 +0800 Subject: [PATCH 025/319] * adjust code for langitem page. --- module/dev/lang/de.php | 6 ++++-- module/dev/lang/en.php | 6 ++++-- module/dev/lang/fr.php | 6 ++++-- module/dev/lang/zh-cn.php | 6 ++++-- module/dev/view/langitem.html.php | 4 ++-- 5 files changed, 18 insertions(+), 10 deletions(-) diff --git a/module/dev/lang/de.php b/module/dev/lang/de.php index 26036eaa07..eb01161e19 100644 --- a/module/dev/lang/de.php +++ b/module/dev/lang/de.php @@ -20,8 +20,10 @@ $lang->dev->noteEditor = "The editor is disabled for security reasons. To us $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->confirmRestore = 'Do you want to reset?'; -$lang->dev->UR = 'Epic'; -$lang->dev->SR = 'Story'; +$lang->dev->default = 'Default'; +$lang->dev->change = 'Change'; +$lang->dev->UR = 'Epic'; +$lang->dev->SR = 'Story'; $lang->dev->fields = array(); $lang->dev->fields['id'] = 'ID'; diff --git a/module/dev/lang/en.php b/module/dev/lang/en.php index 433b82fc65..b51f9af773 100644 --- a/module/dev/lang/en.php +++ b/module/dev/lang/en.php @@ -20,8 +20,10 @@ $lang->dev->noteEditor = "The editor is disabled for security reasons. To us $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->confirmRestore = 'Do you want to reset?'; -$lang->dev->UR = 'Epic'; -$lang->dev->SR = 'Story'; +$lang->dev->default = 'Default'; +$lang->dev->change = 'Change'; +$lang->dev->UR = 'Epic'; +$lang->dev->SR = 'Story'; $lang->dev->fields = array(); $lang->dev->fields['id'] = 'ID'; diff --git a/module/dev/lang/fr.php b/module/dev/lang/fr.php index 433b82fc65..b51f9af773 100644 --- a/module/dev/lang/fr.php +++ b/module/dev/lang/fr.php @@ -20,8 +20,10 @@ $lang->dev->noteEditor = "The editor is disabled for security reasons. To us $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->confirmRestore = 'Do you want to reset?'; -$lang->dev->UR = 'Epic'; -$lang->dev->SR = 'Story'; +$lang->dev->default = 'Default'; +$lang->dev->change = 'Change'; +$lang->dev->UR = 'Epic'; +$lang->dev->SR = 'Story'; $lang->dev->fields = array(); $lang->dev->fields['id'] = 'ID'; diff --git a/module/dev/lang/zh-cn.php b/module/dev/lang/zh-cn.php index 2e8f75bbba..452eadbabf 100644 --- a/module/dev/lang/zh-cn.php +++ b/module/dev/lang/zh-cn.php @@ -20,8 +20,10 @@ $lang->dev->noteEditor = "编辑器功能因为安全原因被禁用。使 $lang->dev->noteTranslate = "翻译功能因为安全原因被禁用。使用该功能,请到官网下载安装 翻译 插件。"; $lang->dev->confirmRestore = '是否要恢复默认?'; -$lang->dev->UR = '用户需求'; -$lang->dev->SR = '软件需求'; +$lang->dev->default = '默认值'; +$lang->dev->change = '修改值'; +$lang->dev->UR = '用户需求'; +$lang->dev->SR = '软件需求'; $lang->dev->fields = array(); $lang->dev->fields['id'] = '序号'; diff --git a/module/dev/view/langitem.html.php b/module/dev/view/langitem.html.php index 09110b1787..36942ce22c 100644 --- a/module/dev/view/langitem.html.php +++ b/module/dev/view/langitem.html.php @@ -23,7 +23,7 @@
-
默认值
+
dev->default;?>
$originalLang):?>
" class="input-label h-32 my-12">
@@ -31,7 +31,7 @@
-
修改值
+
dev->change?>
$originalLang):?>
From 0e840ae40fde6fb2525593675d25ea6ee98143d5 Mon Sep 17 00:00:00 2001 From: guofeilong Date: Thu, 16 Feb 2023 16:48:15 +0800 Subject: [PATCH 026/319] * Code for change arr to navTypes --- module/dev/config.php | 2 +- module/dev/js/langitem.js | 2 +- module/dev/view/langitem.html.php | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/module/dev/config.php b/module/dev/config.php index db19feb668..23b889cf3c 100644 --- a/module/dev/config.php +++ b/module/dev/config.php @@ -241,7 +241,7 @@ $config->dev->postParams['testcase']['create']['expect'] = 'string'; $config->dev->postParams['testcase']['create']['mailto'] = 'string'; $config->dev->postParams['testcase']['create']['keywords'] = 'string'; -$config->dev->arrTypesWithMenu = array('second', 'third', 'feature'); +$config->dev->navTypes = array('second', 'third', 'feature'); $config->disableFeature = array(); if(!helper::hasFeature('waterfall')) $config->disableFeature = array('design', 'stage', 'programplan', 'weekly', 'researchplan', 'researchreport', 'gapanalysis'); diff --git a/module/dev/js/langitem.js b/module/dev/js/langitem.js index 7be272ce0b..ee7a104ea2 100644 --- a/module/dev/js/langitem.js +++ b/module/dev/js/langitem.js @@ -44,7 +44,7 @@ $(function() function initMenu() { - if (arrTypesWithMenu.includes(type)) + if (navTypes.includes(type)) { var myTreeData = [{ title: '水果', diff --git a/module/dev/view/langitem.html.php b/module/dev/view/langitem.html.php index e869773f81..ad732fe7cc 100644 --- a/module/dev/view/langitem.html.php +++ b/module/dev/view/langitem.html.php @@ -11,7 +11,7 @@ */ ?> -dev->arrTypesWithMenu); ?> +dev->navTypes); ?>
-dev->arrTypesWithMenu , false)):?> +dev->navTypes , false)):?>
-dev->navTypes , false)):?> +dev->navTypes)):?>