* change for upgrade.
This commit is contained in:
+1
-1
@@ -17,7 +17,7 @@ if(!function_exists('getWebRoot')){function getWebRoot(){}}
|
||||
|
||||
/* Basic settings. */
|
||||
$config = new config();
|
||||
$config->version = '8.2.6'; // The version of zentaopms. Don't change it.
|
||||
$config->version = '8.3'; // The version of zentaopms. Don't change it.
|
||||
$config->charset = 'UTF-8'; // The charset of zentaopms.
|
||||
$config->cookieLife = time() + 2592000; // The cookie life time.
|
||||
$config->timezone = 'Asia/Shanghai'; // The time zone setting, for more see http://www.php.net/manual/en/timezones.php
|
||||
|
||||
@@ -107,3 +107,4 @@ $lang->upgrade->fromVersions['8_2_2'] = '8.2.2';
|
||||
$lang->upgrade->fromVersions['8_2_3'] = '8.2.3';
|
||||
$lang->upgrade->fromVersions['8_2_4'] = '8.2.4';
|
||||
$lang->upgrade->fromVersions['8_2_5'] = '8.2.5';
|
||||
$lang->upgrade->fromVersions['8_2_6'] = '8.2.6';
|
||||
|
||||
@@ -107,3 +107,4 @@ $lang->upgrade->fromVersions['8_2_2'] = '8.2.2';
|
||||
$lang->upgrade->fromVersions['8_2_3'] = '8.2.3';
|
||||
$lang->upgrade->fromVersions['8_2_4'] = '8.2.4';
|
||||
$lang->upgrade->fromVersions['8_2_5'] = '8.2.5';
|
||||
$lang->upgrade->fromVersions['8_2_6'] = '8.2.6';
|
||||
|
||||
@@ -148,6 +148,11 @@ class upgradeModel extends model
|
||||
case '8_2_3':
|
||||
case '8_2_4':
|
||||
case '8_2_5':
|
||||
case '8_2_6':
|
||||
$this->execSQL($this->getUpgradeFile('8.2.1'));
|
||||
$this->adjustDocModule();
|
||||
$this->updateFileObjectID();
|
||||
$this->moveDocContent();
|
||||
|
||||
default: if(!$this->isError()) $this->setting->updateVersion($this->config->version);
|
||||
}
|
||||
@@ -231,6 +236,7 @@ class upgradeModel extends model
|
||||
case '8_2_3':
|
||||
case '8_2_4':
|
||||
case '8_2_5':
|
||||
case '8_2_6': $confirmContent .= file_get_contents($this->getUpgradeFile('8.2.6'));
|
||||
}
|
||||
return str_replace('zt_', $this->config->db->prefix, $confirmContent);
|
||||
}
|
||||
@@ -1304,6 +1310,15 @@ class upgradeModel extends model
|
||||
*/
|
||||
public function moveDocContent()
|
||||
{
|
||||
$descDoc = $this->dao->query('DESC ' . TABLE_DOC)->fetchAll();
|
||||
$processFields = 0;
|
||||
foreach($descDoc as $field)
|
||||
{
|
||||
if($field->Field == 'content' or $field->Field == 'digest' or $field->Field == 'url') $processFields ++;
|
||||
}
|
||||
if($processFields < 3) return true;
|
||||
|
||||
|
||||
$this->dao->exec('TRUNCATE TABLE ' . TABLE_DOCCONTENT);
|
||||
$stmt = $this->dao->select('id,title,digest,content,url')->from(TABLE_DOC)->query();
|
||||
$fileGroups = $this->dao->select('id,objectID')->from(TABLE_FILE)->where('objectType')->eq('doc')->fetchGroup('objectID', 'id');
|
||||
|
||||
Reference in New Issue
Block a user