From 2ded3de5f17cf9d77c5d80d562b7c54d1e0078c4 Mon Sep 17 00:00:00 2001 From: guanxiying Date: Wed, 20 Nov 2019 16:24:52 +0800 Subject: [PATCH] * Finish task #6562. --- module/upgrade/config.php | 25 ++++++++++++++++++++++ module/upgrade/model.php | 44 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 69 insertions(+) diff --git a/module/upgrade/config.php b/module/upgrade/config.php index 535ca9a301..e4a3279710 100644 --- a/module/upgrade/config.php +++ b/module/upgrade/config.php @@ -23,5 +23,30 @@ $config->upgrade->bearychat['zh-tw'] = '倍洽'; $config->upgrade->bearychat['en'] = 'Bearychat'; $config->upgrade->bearychat['de'] = 'Bearychat'; +$config->upgrade->discardedBugTypes['de']['interface'] = 'UI Optimierung'; +$config->upgrade->discardedBugTypes['de']['newfeature'] = 'Neues Feature'; +$config->upgrade->discardedBugTypes['de']['designchange'] = 'Design Änderung'; +$config->upgrade->discardedBugTypes['de']['trackthings'] = 'Arbeit Verfolgen'; + +$config->upgrade->discardedBugTypes['en']['interface'] = 'Interface'; +$config->upgrade->discardedBugTypes['en']['designchange'] = 'DesignChange'; +$config->upgrade->discardedBugTypes['en']['newfeature'] = 'NewFeature'; +$config->upgrade->discardedBugTypes['en']['trackthings'] = 'Tracking'; + +$config->upgrade->discardedBugTypes['fr']['interface'] = 'Interface'; +$config->upgrade->discardedBugTypes['fr']['designchange'] = 'Design Change'; +$config->upgrade->discardedBugTypes['fr']['newfeature'] = 'Nouvelle fonctionnalité'; +$config->upgrade->discardedBugTypes['fr']['trackthings'] = 'Tracking'; + +$config->upgrade->discardedBugTypes['zh-cn']['interface'] = '界面优化'; +$config->upgrade->discardedBugTypes['zh-cn']['designchange'] = '设计变更'; +$config->upgrade->discardedBugTypes['zh-cn']['newfeature'] = "新增需求"; +$config->upgrade->discardedBugTypes['zh-cn']['trackthings'] = '事务跟踪'; + +$config->upgrade->discardedBugTypes['zh-tw']['interface'] = '界面優化'; +$config->upgrade->discardedBugTypes['zh-tw']['designchange'] = '設計變更'; +$config->upgrade->discardedBugTypes['zh-tw']['newfeature'] = "新增需求"; +$config->upgrade->discardedBugTypes['zh-tw']['trackthings'] = '事務跟蹤'; + $config->delete['10.6'][] = 'module/chat/ext/control/extensions.php'; $config->delete['10.6'][] = 'module/common/ext/model/xuanxuan.php'; diff --git a/module/upgrade/model.php b/module/upgrade/model.php index d8a845d234..4323f31353 100644 --- a/module/upgrade/model.php +++ b/module/upgrade/model.php @@ -3444,4 +3444,48 @@ class upgradeModel extends model public function appendExec($zentaoVersion) { } + + /** + * Fix bug typeList. + * + * @access public + * @return bool + */ + public function fixBugTypeList() + { + foreach($this->config->upgrade->discardedBugTypes as $langCode => $types) + { + $bugs = $this->dao->select('type')->from(TABLE_BUG)->where('type')->in(array_keys($types))->fetchAll('type'); + if(empty($bugs)) return true; + + $usedTypes = array_keys($bugs); + $customedTypeList = $this->dao->select('*')->from(TABLE_LANG) + ->where('lang')->in("$langCode,all") + ->andWhere('module')->eq('bug') + ->andWhere('section')->eq('typeList') + ->fetchPairs('`key`'); + + $typesToSave = array_diff($usedTypes, $customedTypeList); + + if(empty($typesToSave)) continue; + + $langs = array(); + foreach($typesToSave as $type) $langs[$type] = $types[$type]; + + if(empty($customedTypeList)) + { + $lang = new stdclass; + $lang->bug = new stdclass; + $lang->productCommon = ''; + $lang->projectCommon = ''; + $lang->more = ''; + $langFile = $this->app->getModuleRoot() . DS . 'bug' . DS . 'lang' . DS . $langCode . '.php'; + if(is_file($langFile)) include $langFile; + $langs = array_merge($lang->bug->typeList, $langs); + } + + foreach($langs as $type => $typeName) $this->loadModel('custom')->setItem("{$langCode}.bug.typeList.{$type}.1", $typeName); + } + return true; + } }