* Remove unused code.

This commit is contained in:
孙广明
2022-03-16 15:48:03 +08:00
parent 83738dadb6
commit d058c26177

View File

@@ -35,11 +35,7 @@ class control extends baseControl
$this->app->setOpenApp();
if(defined('IN_USE') or (defined('RUN_MODE') and RUN_MODE != 'api'))
{
$this->setPreference();
$this->forceUpgrade();
}
if(defined('IN_USE') or (defined('RUN_MODE') and RUN_MODE != 'api')) $this->setPreference();
if(!isset($this->config->bizVersion)) return false;
@@ -127,39 +123,6 @@ class control extends baseControl
}
}
/**
* If change the edition, trigger the upgrade process.
*
* @access public
* @return void
*/
public function forceUpgrade()
{
$installedVersion = $this->loadModel('setting')->getVersion();
/* Means open source upgrade to biz or max. */
if(is_numeric($installedVersion[0]) and $this->config->edition != 'open')
{
$this->loadModel('setting')->setItem('system.common.global.version', $this->config->version);
$this->loadModel('effort')->convertEstToEffort();
$this->loadModel('upgrade')->importBuildinModules();
$this->upgrade->addSubStatus();
}
/* Max only has new system mode. */
if($installedVersion[0] != 'm' and $this->config->edition == 'max')
{
$this->loadModel('setting')->setItem('system.common.global.version', $this->config->version);
if($this->config->systemMode == 'classic' and $this->app->getModuleName() != 'upgrade')
{
$this->loadModel('setting')->setItem('system.common.global.mode', 'new');
$this->locate(helper::createLink('upgrade', 'mergeTips'));
}
}
return true;
}
/**
* 企业版部分功能是从然之合并过来的。然之代码中调用loadModel方法时传递了一个非空的appName在禅道中会导致错误。
* 调用父类的loadModel方法来避免这个错误。