From 0ad697012fbeafafd21d9087151dcd35448c3b2e Mon Sep 17 00:00:00 2001 From: wangyidong Date: Fri, 22 Nov 2019 11:10:09 +0800 Subject: [PATCH] * set concept setted in upgrade. --- framework/router.class.php | 17 +++++------------ module/upgrade/model.php | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+), 12 deletions(-) diff --git a/framework/router.class.php b/framework/router.class.php index a9ff5e622b..cb4898851b 100755 --- a/framework/router.class.php +++ b/framework/router.class.php @@ -127,7 +127,7 @@ class router extends baseRouter } } - $productCommon = $projectCommon = $storyCommon = 0; + $productCommon = $projectCommon = $storyCommon = $hourCommon = 0; if(!empty($this->config->isINT)) $projectCommon = 1; if($productProject) { @@ -135,21 +135,14 @@ class router extends baseRouter list($productCommon, $projectCommon) = explode('_', $productProject); } - if($storyRequirement) - { - $storyCommon = $storyRequirement->value; - $lang->storyCommon = isset($this->config->storyCommonList[$this->clientLang][(int)$storyCommon]) ? $this->config->storyCommonList[$this->clientLang][(int)$storyCommon] : $this->config->storyCommonList['en'][(int)$storyCommon]; - } - - if($hourPoint) - { - $hourCommon = $hourPoint->value; - $lang->hourCommon = isset($this->config->hourPointCommonList[$this->clientLang][(int)$hourCommon]) ? $this->config->hourPointCommonList[$this->clientLang][(int)$hourCommon] : $this->config->hourPointCommonList['en'][(int)$hourCommon]; - } + if($storyRequirement) $storyCommon = $storyRequirement->value; + if($hourPoint) $hourCommon = $hourPoint->value; /* Set productCommon and projectCommon. Default english lang. */ $lang->productCommon = isset($this->config->productCommonList[$this->clientLang][(int)$productCommon]) ? $this->config->productCommonList[$this->clientLang][(int)$productCommon] : $this->config->productCommonList['en'][(int)$productCommon]; $lang->projectCommon = isset($this->config->projectCommonList[$this->clientLang][(int)$projectCommon]) ? $this->config->projectCommonList[$this->clientLang][(int)$projectCommon] : $this->config->projectCommonList['en'][(int)$projectCommon]; + $lang->storyCommon = isset($this->config->storyCommonList[$this->clientLang][(int)$storyCommon]) ? $this->config->storyCommonList[$this->clientLang][(int)$storyCommon] : $this->config->storyCommonList['en'][(int)$storyCommon]; + $lang->hourCommon = isset($this->config->hourPointCommonList[$this->clientLang][(int)$hourCommon]) ? $this->config->hourPointCommonList[$this->clientLang][(int)$hourCommon] : $this->config->hourPointCommonList['en'][(int)$hourCommon]; } parent::loadLang($moduleName, $appName); diff --git a/module/upgrade/model.php b/module/upgrade/model.php index b828fcba19..4aac51971b 100644 --- a/module/upgrade/model.php +++ b/module/upgrade/model.php @@ -538,6 +538,7 @@ class upgradeModel extends model $this->fixBugTypeList(); $this->adjustPriv11_6_6(); $this->rmEditorAndTranslateDir(); + $this->setConceptSetted(); $this->appendExec('11_6_5'); } @@ -3528,6 +3529,38 @@ class upgradeModel extends model return true; } + /** + * Set concept setted. + * + * @access public + * @return bool + */ + public function setConceptSetted() + { + $this->saveLogs('Run Method ' . __FUNCTION__); + $conceptSetted = $this->dao->select('*')->from(TABLE_CONFIG)->where('owner')->eq('system')->andWhere('module')->eq('common')->andWhere('`key`')->eq('conceptSetted')->fetchAll(); + if(empty($conceptSetted)) + { + $setting = new stdclass(); + $setting->owner = 'system'; + $setting->module = 'custom'; + $setting->key = 'storyRequirement'; + $setting->value = '0'; + $this->dao->replace(TABLE_CONFIG)->data($setting)->exec(); + + $setting->key = 'hourPoint'; + $setting->value = '0'; + $this->dao->replace(TABLE_CONFIG)->data($setting)->exec(); + + $setting->module = 'common'; + $setting->key = 'conceptSetted'; + $setting->value = '1'; + $this->dao->replace(TABLE_CONFIG)->data($setting)->exec(); + } + + return true; + } + /** * Save Logs. *