* set concept setted in upgrade.

This commit is contained in:
wangyidong
2019-11-22 11:10:09 +08:00
parent 41c693d07a
commit 0ad697012f
2 changed files with 38 additions and 12 deletions
+5 -12
View File
@@ -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);
+33
View File
@@ -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.
*