Skip to content

Commit

Permalink
Dev: upgraded DB version and assets
Browse files Browse the repository at this point in the history
  • Loading branch information
LouisGac committed Nov 28, 2017
1 parent a4b8b32 commit 549dfb7
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 4 deletions.
4 changes: 2 additions & 2 deletions application/config/version.php
Expand Up @@ -14,8 +14,8 @@

$config['versionnumber'] = '3.0.0-RC.3'; //The current version of this branch
$config['masterversion'] = '2.67.3'; //The current masters version merged into this branch
$config['dbversionnumber'] = 330;
$config['dbversionnumber'] = 331;
$config['buildnumber'] = '';
$config['updatable'] = true;
$config['assetsversionnumber'] = '3012';
$config['assetsversionnumber'] = '3013';
return $config;
50 changes: 50 additions & 0 deletions application/helpers/update/updatedb_helper.php
Expand Up @@ -712,6 +712,14 @@ function db_upgrade_all($iOldDBVersion, $bSilent = false)
$oTransaction->commit();
}


if ($iOldDBVersion < 331) {
$oTransaction = $oDB->beginTransaction();
upgrade331($oDB);
$oDB->createCommand()->update('{{settings_global}}', array('stg_value'=>331), "stg_name='DBVersion'");
$oTransaction->commit();
}

} catch (Exception $e) {
Yii::app()->setConfig('Updating', false);
$oTransaction->rollback();
Expand Down Expand Up @@ -755,6 +763,48 @@ function db_upgrade_all($iOldDBVersion, $bSilent = false)
return true;
}

/**
* @param $oDB
* @return void
*/
function upgrade331($oDB)
{
$oDB->createCommand()->update('{{templates}}', array(
'name' => 'bootswatch',
'folder' => 'bootswatch',
'title' => 'Bootswatch Theme',
'description' => '<strong>LimeSurvey Bootwatch Theme</strong><br>Based on BootsWatch Themes: <a href=\'https://bootswatch.com/3/\'>Visit BootsWatch page</a>',
), "name='default'");

$oDB->createCommand()->update('{{templates}}', array(
'extends' => 'bootswatch',
), "extends='default'");

$oDB->createCommand()->update('{{template_configuration}}', array(
'template_name' => 'bootswatch',
), "template_name='default'");

$oDB->createCommand()->update('{{templates}}', array(
'description' => '<strong>LimeSurvey Material Design Theme</strong><br> A theme based on FezVrasta\'s Material design for Bootstrap 3 <a href=\'https://cdn.rawgit.com/FezVrasta/bootstrap-material-design/gh-pages-v3/index.html\'></a>',
), "name='material'");

$oDB->createCommand()->update('{{templates}}', array(
'name' => 'fruity',
'folder' => 'fruity',
'title' => 'Fruity Theme',
'description' => '<strong>LimeSurvey Fruity Theme</strong><br>Some color themes for a flexible use. This theme offers many options.',
), "name='monochrome'");

$oDB->createCommand()->update('{{templates}}', array(
'extends' => 'fruity',
), "extends='monochrome'");

$oDB->createCommand()->update('{{template_configuration}}', array(
'template_name' => 'fruity',
), "template_name='monochrome'");

}

/**
* @param $oDB
* @return void
Expand Down
4 changes: 2 additions & 2 deletions installer/create-database.php
Expand Up @@ -725,9 +725,9 @@ function createDatabase($oDB){
$oDB->createCommand()->createIndex('{{idx4_templates}}', '{{templates}}', 'extends', false);

$headerArray = ['name','folder','title','creation_date','author','author_email','author_url','copyright','license','version','api_version','view_folder','files_folder','description','last_update','owner_id','extends'];
$oDB->createCommand()->insert("{{templates}}", array_combine($headerArray, ['bootswatch', 'bootswatch', 'Bootswatch Theme', date('Y-m-d H:i:s'), 'Louis Gac', 'louis.gac@limesurvey.org', 'https://www.limesurvey.org/', 'Copyright (C) 2007-2017 The LimeSurvey Project Team\\r\\nAll rights reserved.', 'License: GNU/GPL License v2 or later, see LICENSE.php\\r\\n\\r\\nLimeSurvey is free software. This version may have been modified pursuant to the GNU General Public License, and as distributed it includes or is derivative of works licensed under the GNU General Public License or other free or open source software licenses. See COPYRIGHT.php for copyright notices and details.', '1.0', '3.0', 'views', 'files', "<strong>LimeSurvey Material Design Theme</strong><br> A theme based on FezVrasta's Material design for Bootstrap 3 <a href='https://cdn.rawgit.com/FezVrasta/bootstrap-material-design/gh-pages-v3/index.html'></a>", NULL, 1, '']));
$oDB->createCommand()->insert("{{templates}}", array_combine($headerArray, ['bootswatch', 'bootswatch', 'Bootswatch Theme', date('Y-m-d H:i:s'), 'Louis Gac', 'louis.gac@limesurvey.org', 'https://www.limesurvey.org/', 'Copyright (C) 2007-2017 The LimeSurvey Project Team\\r\\nAll rights reserved.', 'License: GNU/GPL License v2 or later, see LICENSE.php\\r\\n\\r\\nLimeSurvey is free software. This version may have been modified pursuant to the GNU General Public License, and as distributed it includes or is derivative of works licensed under the GNU General Public License or other free or open source software licenses. See COPYRIGHT.php for copyright notices and details.', '1.0', '3.0', 'views', 'files', "", NULL, 1, '']));

$oDB->createCommand()->insert("{{templates}}", array_combine($headerArray,['material', 'material', 'Material Theme', date('Y-m-d H:i:s'), 'Louis Gac', 'louis.gac@limesurvey.org', 'https://www.limesurvey.org/', 'Copyright (C) 2007-2017 The LimeSurvey Project Team\\r\\nAll rights reserved.', 'License: GNU/GPL License v2 or later, see LICENSE.php\\r\\n\\r\\nLimeSurvey is free software. This version may have been modified pursuant to the GNU General Public License, and as distributed it includes or is derivative of works licensed under the GNU General Public License or other free or open source software licenses. See COPYRIGHT.php for copyright notices and details.', '1.0', '3.0', 'views', 'files', '<strong>LimeSurvey Advanced Theme</strong><br> A theme extending default, to show the inheritance concept. Notice the options, differents from Default.<br><small>uses FezVrasta\'s Material design theme for Bootstrap 3</small>', NULL, 1, 'default']));
$oDB->createCommand()->insert("{{templates}}", array_combine($headerArray,['material', 'material', 'Material Theme', date('Y-m-d H:i:s'), 'Louis Gac', 'louis.gac@limesurvey.org', 'https://www.limesurvey.org/', 'Copyright (C) 2007-2017 The LimeSurvey Project Team\\r\\nAll rights reserved.', 'License: GNU/GPL License v2 or later, see LICENSE.php\\r\\n\\r\\nLimeSurvey is free software. This version may have been modified pursuant to the GNU General Public License, and as distributed it includes or is derivative of works licensed under the GNU General Public License or other free or open source software licenses. See COPYRIGHT.php for copyright notices and details.', '1.0', '3.0', 'views', 'files', '<strong>LimeSurvey Material Design Theme</strong><br> A theme based on FezVrasta\'s Material design for Bootstrap 3 <a href=\'https://cdn.rawgit.com/FezVrasta/bootstrap-material-design/gh-pages-v3/index.html\'></a>', NULL, 1, 'default']));

$oDB->createCommand()->insert("{{templates}}", array_combine($headerArray,['fruity', 'fruity', 'Fruity Theme', date('Y-m-d H:i:s'), 'Louis Gac', 'louis.gac@limesurvey.org', 'https://www.limesurvey.org/', 'Copyright (C) 2007-2017 The LimeSurvey Project Team\\r\\nAll rights reserved.', 'License: GNU/GPL License v2 or later, see LICENSE.php\\r\\n\\r\\nLimeSurvey is free software. This version may have been modified pursuant to the GNU General Public License, and as distributed it includes or is derivative of works licensed under the GNU General Public License or other free or open source software licenses. See COPYRIGHT.php for copyright notices and details.', '1.0', '3.0', 'views', 'files', '<strong>LimeSurvey Fruity Theme</strong><br>Some color themes for a flexible use. This theme offers many options.', NULL, 1, '']));

Expand Down

0 comments on commit 549dfb7

Please sign in to comment.