Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/LimeSurvey/LimeSurvey
Browse files Browse the repository at this point in the history
  • Loading branch information
olleharstedt committed Feb 12, 2016
2 parents f08e283 + d638a22 commit fb87e30
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 12 deletions.
2 changes: 1 addition & 1 deletion application/config/version.php
Expand Up @@ -13,7 +13,7 @@
*/

$config['versionnumber'] = "2.50+";
$config['dbversionnumber'] = 255;
$config['dbversionnumber'] = 256;
$config['buildnumber'] = '';
$config['updatable'] = true;
//$config['updaterversion'] = 1;
Expand Down
23 changes: 22 additions & 1 deletion application/helpers/update/updatedb_helper.php
Expand Up @@ -1358,7 +1358,12 @@ function db_upgrade_all($iOldDBVersion) {
// Update DBVersion
$oDB->createCommand()->update('{{settings_global}}',array('stg_value'=>255),"stg_name='DBVersion'");
}

if ( $iOldDBVersion < 256 )
{
upgradeTokenTables256();
alterColumn('{{participants}}', 'email', "text", false);
$oDB->createCommand()->update('{{settings_global}}',array('stg_value'=>256),"stg_name='DBVersion'");
}
$oTransaction->commit();
// Activate schema caching
$oDB->schemaCachingDuration=3600;
Expand All @@ -1385,6 +1390,22 @@ function db_upgrade_all($iOldDBVersion) {
return true;
}


function upgradeTokenTables256()
{
$surveyidresult = dbGetTablesLike("tokens%");
if ($surveyidresult)
{
foreach ( $surveyidresult as $sTableName )
{
alterColumn($sTableName, 'email', "text");
alterColumn($sTableName, 'firstname', "string(150)");
alterColumn($sTableName, 'lastname', "string(150)");
}
}
}


function upgradeSurveyTables255()
{
// We delete all the old boxes, and reinsert new ones
Expand Down
4 changes: 2 additions & 2 deletions application/models/Token.php
Expand Up @@ -83,8 +83,8 @@ public static function createTable($surveyId, array $extraFields = array())
$fields = array(
'tid' => 'pk',
'participant_id' => 'string(50)',
'firstname' => 'string(40)',
'lastname' => 'string(40)',
'firstname' => 'string(150)',
'lastname' => 'string(150)',
'email' => 'text',
'emailstatus' => 'text',
'token' => "string(35) {$sCollation}",
Expand Down
2 changes: 1 addition & 1 deletion application/views/admin/homepagesettings/index.php
Expand Up @@ -38,7 +38,7 @@
<div class="col-sm-1">
<input class="form-control" type="number" id="iBoxesByRow" value="<?php echo $iBoxesByRow;?>" max="6" min="0" name="boxes_by_row"/>
</div>
<label class="col-sm-2 col-sm-offset-1 control-label"><?php eT("Boxes offset:");?></label>
<label class="col-sm-2 col-sm-offset-1 control-label"><?php eT("Box offset:");?></label>
<div class="col-sm-1">
<input class="form-control" type="number" id="iBoxesOffset" value="<?php echo $iBoxesOffset;?>" max="10" min="0" name="boxes_offset"/>
</div>
Expand Down
2 changes: 1 addition & 1 deletion application/views/admin/super/fullpagebar_view.php
Expand Up @@ -50,7 +50,7 @@
<span class="icon-add text-success"></span>
<?php eT("Create a new box");?>
</a>
<a href="<?php echo $this->createUrl('admin/homepagesettings/sa/resetall/');?>" class="btn btn-danger" data-confirm="<?php eT('This will delete all curent boxes to restore the default ones. Are you sure you want to continue ?'); ?>">
<a href="<?php echo $this->createUrl('admin/homepagesettings/sa/resetall/');?>" class="btn btn-danger" data-confirm="<?php eT('This will delete all curent boxes to restore the default ones. Are you sure you want to continue?'); ?>">
<span class="fa fa-refresh"></span>
<?php eT("Reset to default boxes");?>
</a>
Expand Down
4 changes: 2 additions & 2 deletions installer/sql/create-mssql.sql
Expand Up @@ -195,7 +195,7 @@ CREATE TABLE [prefix_participants] (
[participant_id] varchar(50) NOT NULL,
[firstname] nvarchar(150) NULL,
[lastname] nvarchar(150) NULL,
[email] nvarchar(254) NULL,
[email] nvarchar(max) NULL,
[language] varchar(40) NULL,
[blacklisted] varchar(1) NOT NULL,
[owner_uid] int NOT NULL,
Expand Down Expand Up @@ -592,4 +592,4 @@ create index [parent_qid_idx] on [prefix_questions] ([parent_qid]);
--
-- Version Info
--
INSERT INTO [prefix_settings_global] VALUES ('DBVersion', '255');
INSERT INTO [prefix_settings_global] VALUES ('DBVersion', '256');
4 changes: 2 additions & 2 deletions installer/sql/create-mysql.sql
Expand Up @@ -195,7 +195,7 @@ CREATE TABLE `prefix_participants` (
`participant_id` varchar(50) NOT NULL,
`firstname` varchar(150) DEFAULT NULL,
`lastname` varchar(150) DEFAULT NULL,
`email` varchar(254) DEFAULT NULL,
`email` text,
`language` varchar(40) DEFAULT NULL,
`blacklisted` varchar(1) NOT NULL,
`owner_uid` int(11) NOT NULL,
Expand Down Expand Up @@ -598,4 +598,4 @@ CREATE INDEX `parent_qid_idx` ON `prefix_questions` (`parent_qid`);
--
-- Version Info
--
INSERT INTO `prefix_settings_global` VALUES ('DBVersion', '255');
INSERT INTO `prefix_settings_global` VALUES ('DBVersion', '256');
4 changes: 2 additions & 2 deletions installer/sql/create-pgsql.sql
Expand Up @@ -201,7 +201,7 @@ CREATE TABLE prefix_participants (
"participant_id" character varying(50) PRIMARY KEY NOT NULL,
"firstname" character varying(150),
"lastname" character varying(150),
"email" character varying(254),
"email" text,
"language" character varying(40),
"blacklisted" character varying(1) NOT NULL,
"owner_uid" integer NOT NULL,
Expand Down Expand Up @@ -602,4 +602,4 @@ create unique index permissions_idx2 ON prefix_permissions (entity_id, entity, u
--
-- Version Info
--
INSERT INTO prefix_settings_global VALUES ('DBVersion', '255');
INSERT INTO prefix_settings_global VALUES ('DBVersion', '256');

0 comments on commit fb87e30

Please sign in to comment.