Skip to content

Commit

Permalink
Fixed PostgreSQL installation issues
Browse files Browse the repository at this point in the history
Fixed casing on showxquestions field

git-svn-id: file:///Users/Shitiz/Downloads/lssvn/source/limesurvey_dev@12242 b72ed6b6-b9f8-46b5-92b4-906544132732
  • Loading branch information
c-schmitz committed Jan 27, 2012
1 parent 619e113 commit ded3358
Show file tree
Hide file tree
Showing 15 changed files with 34 additions and 35 deletions.
4 changes: 2 additions & 2 deletions admin/database.php
Expand Up @@ -1137,7 +1137,7 @@ function get_max_question_order($gid)
'printanswers'=>$_POST['printanswers'],
'publicstatistics'=>$_POST['publicstatistics'],
'autoredirect'=>$_POST['autoredirect'],
'showXquestions'=>$_POST['showXquestions'],
'showxquestions'=>$_POST['showxquestions'],
'showgroupinfo'=>$_POST['showgroupinfo'],
'showqnumcode'=>$_POST['showqnumcode'],
'shownoanswer'=>$_POST['shownoanswer'],
Expand Down Expand Up @@ -1438,7 +1438,7 @@ function get_max_question_order($gid)
'allowsave'=>$_POST['allowsave'],
'navigationdelay'=>$_POST['navigationdelay'],
'autoredirect'=>$_POST['autoredirect'],
'showXquestions'=>$_POST['showXquestions'],
'showxquestions'=>$_POST['showxquestions'],
'showgroupinfo'=>$_POST['showgroupinfo'],
'showqnumcode'=>$_POST['showqnumcode'],
'shownoanswer'=>$_POST['shownoanswer'],
Expand Down
14 changes: 7 additions & 7 deletions admin/editsurveysettings.php
Expand Up @@ -438,10 +438,10 @@
. "</select></li>";

// Show {THEREAREXQUESTIONS} block
$show_dis_pre = "\n\t<li>\n\t\t<label for=\"dis_showXquestions\">".$clang->gT('Show "There are X questions in this survey"')."</label>\n\t\t".'<input type="hidden" name="showXquestions" id="" value="';
$show_dis_mid = "\" />\n\t\t".'<input type="text" name="dis_showXquestions" id="dis_showXquestions" disabled="disabled" value="';
$show_dis_pre = "\n\t<li>\n\t\t<label for=\"dis_showxquestions\">".$clang->gT('Show "There are X questions in this survey"')."</label>\n\t\t".'<input type="hidden" name="showxquestions" id="" value="';
$show_dis_mid = "\" />\n\t\t".'<input type="text" name="dis_showxquestions" id="dis_showxquestions" disabled="disabled" value="';
$show_dis_post = "\" size=\"70\" />\n\t</li>\n";
switch ($showXquestions) {
switch ($showxquestions) {
case 'show':
$editsurvey .= $show_dis_pre.'Y'.$show_dis_mid.$clang->gT('Yes (Forced by the system administrator)').$show_dis_post;
break;
Expand All @@ -451,15 +451,15 @@
case 'choose':
default:
$sel_showxq = array( 'Y' => '' , 'N' => '' );
if (isset($esrow['showXquestions'])) {
$set_showxq = $esrow['showXquestions'];
if (isset($esrow['showxquestions'])) {
$set_showxq = $esrow['showxquestions'];
$sel_showxq[$set_showxq] = ' selected="selected"';
}
if (empty($sel_showxq['Y']) && empty($sel_showxq['N'])) {
$sel_showxq['Y'] = ' selected="selected"';
};
$editsurvey .= "\n\t<li>\n\t\t<label for=\"showXquestions\">".$clang->gT('Show "There are X questions in this survey"')."</label>\n\t\t"
. "<select id=\"showXquestions\" name=\"showXquestions\">\n\t\t\t"
$editsurvey .= "\n\t<li>\n\t\t<label for=\"showxquestions\">".$clang->gT('Show "There are X questions in this survey"')."</label>\n\t\t"
. "<select id=\"showxquestions\" name=\"showxquestions\">\n\t\t\t"
. '<option value="Y"'.$sel_showxq['Y'].'>'.$clang->gT('Yes')."</option>\n\t\t\t"
. '<option value="N"'.$sel_showxq['N'].'>'.$clang->gT('No')."</option>\n\t\t"
. "</select>\n\t</li>\n";
Expand Down
10 changes: 5 additions & 5 deletions admin/globalsettings.php
Expand Up @@ -81,7 +81,7 @@ function globalsettingssave()
setGlobalSetting('siteadminemail',strip_tags($_POST['siteadminemail']));
setGlobalSetting('siteadminname',strip_tags($_POST['siteadminname']));
setGlobalSetting('shownoanswer',sanitize_int($_POST['shownoanswer']));
setGlobalSetting('showXquestions',($_POST['showXquestions']));
setGlobalSetting('showxquestions',($_POST['showxquestions']));
setGlobalSetting('showgroupinfo',($_POST['showgroupinfo']));
setGlobalSetting('showqnumcode',($_POST['showqnumcode']));
$repeatheadingstemp=(int)($_POST['repeatheadings']);
Expand Down Expand Up @@ -457,16 +457,16 @@ function globalsettingsdisplay()
. "\t\t<input id='repeatheadings' name='repeatheadings' value='$thisrepeatheadings' size='4' maxlength='4' /></li>\n";


// showXquestions
$set_xq=getGlobalSetting('showXquestions');
// showxquestions
$set_xq=getGlobalSetting('showxquestions');
$sel_xq = array( 'hide' => '' , 'show' => '' , 'choose' => '');
$sel_xq[$set_xq] = ' selected="selected"';
if( empty($sel_xq['hide']) && empty($sel_xq['show']) && empty($sel_xq['choose']))
{
$sel_xq['choose'] = ' selected="selected"';
};
$editsurvey .= "\t<li><label for=\"showXquestions\">".$clang->gT('Show "There are X questions in this survey"')."</label>\n"
. "\t\t<select id=\"showXquestions\" name=\"showXquestions\">\n"
$editsurvey .= "\t<li><label for=\"showxquestions\">".$clang->gT('Show "There are X questions in this survey"')."</label>\n"
. "\t\t<select id=\"showxquestions\" name=\"showxquestions\">\n"
. "\t\t\t<option value=\"show\"{$sel_xq['show']}>".$clang->gT('Yes')."</option>\n"
. "\t\t\t<option value=\"hide\"{$sel_xq['hide']}>".$clang->gT('No')."</option>\n"
. "\t\t\t<option value=\"choose\"{$sel_xq['choose']}>".$clang->gT('Survey admin can choose')."</option>\n"
Expand Down
2 changes: 1 addition & 1 deletion admin/install/create-mssql.sql
Expand Up @@ -280,7 +280,7 @@ CREATE TABLE [prefix_surveys] (
[allowsave] char(1) default 'Y',
[autonumber_start] bigint default '0',
[autoredirect] char(1) default 'N',
[showXquestions] char(1) default 'Y',
[showxquestions] char(1) default 'Y',
[showgroupinfo] char(1) default 'B',
[shownoanswer] char(1) default 'Y',
[showqnumcode] char(1) default 'X',
Expand Down
2 changes: 1 addition & 1 deletion admin/install/create-mssqlnative.sql
Expand Up @@ -289,7 +289,7 @@ CREATE TABLE [prefix_surveys] (
[allowsave] char(1) default 'Y',
[autonumber_start] bigint default '0',
[autoredirect] char(1) default 'N',
[showXquestions] char(1) default 'Y',
[showxquestions] char(1) default 'Y',
[showgroupinfo] char(1) default 'B',
[shownoanswer] char(1) default 'Y',
[showqnumcode] char(1) default 'X',
Expand Down
2 changes: 1 addition & 1 deletion admin/install/create-mysql.sql
Expand Up @@ -286,7 +286,7 @@ CREATE TABLE `prefix_surveys` (
`emailresponseto` text default NULL,
`emailnotificationto` text default NULL,
`tokenlength` tinyint(2) default '15',
`showXquestions` char(1) default 'Y',
`showxquestions` char(1) default 'Y',
`showgroupinfo` char(1) default 'B',
`shownoanswer` char(1) default 'Y',
`showqnumcode` char(1) default 'X',
Expand Down
11 changes: 5 additions & 6 deletions admin/install/create-postgres.sql
Expand Up @@ -71,8 +71,8 @@ CREATE TABLE prefix_defaultvalues (
--

CREATE TABLE prefix_expression_errors (
id integer NOT NULL AUTO_INCREMENT,
errortime varchar(50) DEFAULT NULL,
id serial,
errortime character varying(50) DEFAULT NULL,
sid integer DEFAULT NULL,
gid integer DEFAULT NULL,
qid integer DEFAULT NULL,
Expand All @@ -95,7 +95,7 @@ CREATE TABLE prefix_groups (
group_order integer DEFAULT 0 NOT NULL,
description text,
"language" character varying(20) DEFAULT 'en'::character varying NOT NULL,
randomization_group varying(20) DEFAULT ''::character varying NOT NULL,
randomization_group character varying(20) DEFAULT ''::character varying NOT NULL,
grelevance text DEFAULT NULL,
CONSTRAINT prefix_groups_pkey PRIMARY KEY (gid, "language")
);
Expand Down Expand Up @@ -279,7 +279,7 @@ CREATE TABLE prefix_surveys (
printanswers character(1) DEFAULT 'N'::bpchar,
autonumber_start integer DEFAULT 0,
autoredirect character(1) DEFAULT 'N'::bpchar,
showXquestions character(1) DEFAULT 'Y'::bpchar,
showxquestions character(1) DEFAULT 'Y'::bpchar,
showgroupinfo character(1) DEFAULT 'B'::bpchar,
shownoanswer character(1) DEFAULT 'Y'::bpchar,
showqnumcode character(1) DEFAULT 'X'::bpchar,
Expand Down Expand Up @@ -419,8 +419,7 @@ CREATE TABLE prefix_users (
templateeditormode character(7) DEFAULT 'default'::bpchar,
questionselectormode character(7) DEFAULT 'default'::bpchar,
one_time_pw bytea,
"dateformat" integer DEFAULT 1 NOT NULL,
participant_panel integer NOT NULL DEFAULT '0'
"dateformat" integer DEFAULT 1 NOT NULL
);


Expand Down
2 changes: 1 addition & 1 deletion admin/update/upgrade-all.php
Expand Up @@ -67,7 +67,7 @@ function upgrade_question_attributes148()

$sAttributeQuery = "select q.qid,attribute,value from {$sDBPrefix}question_attributes qa , {$sDBPrefix}questions q where q.qid=qa.qid and sid={$surveyid}";
$oAttributeResult = db_execute_assoc($sAttributeQuery);
$aAllAttributes=questionAttributes(true);
$aAllAttributes = questionAttributes(true);
foreach ( $oAttributeResult->FetchRow() as $aAttributeRow)
{
if (isset($aAllAttributes[$aAttributeRow['attribute']]['i18n']) && $aAllAttributes[$aAttributeRow['attribute']]['i18n'])
Expand Down
2 changes: 1 addition & 1 deletion admin/update/upgrade-mssql.php
Expand Up @@ -399,7 +399,7 @@ function db_upgrade($oldversion) {

if ($oldversion < 145) //Modify surveys table
{
modify_database("", "ALTER TABLE [prefix_surveys] ADD showXquestions CHAR(1) NULL default 'Y'"); echo $modifyoutput; flush();ob_flush();
modify_database("", "ALTER TABLE [prefix_surveys] ADD showxquestions CHAR(1) NULL default 'Y'"); echo $modifyoutput; flush();ob_flush();
modify_database("", "ALTER TABLE [prefix_surveys] ADD showgroupinfo CHAR(1) NULL default 'B'"); echo $modifyoutput; flush();ob_flush();
modify_database("", "ALTER TABLE [prefix_surveys] ADD shownoanswer CHAR(1) NULL default 'Y'"); echo $modifyoutput; flush();ob_flush();
modify_database("", "ALTER TABLE [prefix_surveys] ADD showqnumcode CHAR(1) NULL default 'X'"); echo $modifyoutput; flush();ob_flush();
Expand Down
2 changes: 1 addition & 1 deletion admin/update/upgrade-mssqlnative.php
Expand Up @@ -399,7 +399,7 @@ function db_upgrade($oldversion) {

if ($oldversion < 145) //Modify surveys table
{
modify_database("", "ALTER TABLE [prefix_surveys] ADD showXquestions CHAR(1) NULL default 'Y'"); echo $modifyoutput; flush();ob_flush();
modify_database("", "ALTER TABLE [prefix_surveys] ADD showxquestions CHAR(1) NULL default 'Y'"); echo $modifyoutput; flush();ob_flush();
modify_database("", "ALTER TABLE [prefix_surveys] ADD showgroupinfo CHAR(1) NULL default 'B' "); echo $modifyoutput; flush();ob_flush();
modify_database("", "ALTER TABLE [prefix_surveys] ADD shownoanswer CHAR(1) NULL default 'Y' "); echo $modifyoutput; flush();ob_flush();
modify_database("", "ALTER TABLE [prefix_surveys] ADD showqnumcode CHAR(1) NULL default 'X'"); echo $modifyoutput; flush();ob_flush();
Expand Down
2 changes: 1 addition & 1 deletion admin/update/upgrade-mysql.php
Expand Up @@ -392,7 +392,7 @@ function db_upgrade($oldversion) {
if ($oldversion < 145)
{
modify_database("", "ALTER TABLE `prefix_surveys` ADD `savetimings` CHAR(1) NULL default 'N' AFTER `format`"); echo $modifyoutput; flush();@ob_flush();
modify_database("", "ALTER TABLE `prefix_surveys` ADD `showXquestions` CHAR(1) NULL default 'Y'"); echo $modifyoutput; flush();@ob_flush();
modify_database("", "ALTER TABLE `prefix_surveys` ADD `showxquestions` CHAR(1) NULL default 'Y'"); echo $modifyoutput; flush();@ob_flush();
modify_database("", "ALTER TABLE `prefix_surveys` ADD `showgroupinfo` CHAR(1) NULL default 'B'"); echo $modifyoutput; flush();@ob_flush();
modify_database("", "ALTER TABLE `prefix_surveys` ADD `shownoanswer` CHAR(1) NULL default 'Y'"); echo $modifyoutput; flush();@ob_flush();
modify_database("", "ALTER TABLE `prefix_surveys` ADD `showqnumcode` CHAR(1) NULL default 'X'"); echo $modifyoutput; flush();@ob_flush();
Expand Down
2 changes: 1 addition & 1 deletion admin/update/upgrade-postgres.php
Expand Up @@ -234,7 +234,7 @@ function db_upgrade($oldversion) {
if ($oldversion < 145)
{
modify_database("", "ALTER TABLE prefix_surveys ADD savetimings CHAR(1) NULL default 'N'"); echo $modifyoutput; flush();ob_flush();
modify_database("", "ALTER TABLE prefix_surveys ADD showXquestions CHAR(1) NULL default 'Y'"); echo $modifyoutput; flush();ob_flush();
modify_database("", "ALTER TABLE prefix_surveys ADD showxquestions CHAR(1) NULL default 'Y'"); echo $modifyoutput; flush();ob_flush();
modify_database("", "ALTER TABLE prefix_surveys ADD showgroupinfo CHAR(1) NULL default 'B'"); echo $modifyoutput; flush();ob_flush();
modify_database("", "ALTER TABLE prefix_surveys ADD shownoanswer CHAR(1) NULL default 'Y'"); echo $modifyoutput; flush();ob_flush();
modify_database("", "ALTER TABLE prefix_surveys ADD showqnumcode CHAR(1) NULL default 'X'"); echo $modifyoutput; flush();ob_flush();
Expand Down
2 changes: 1 addition & 1 deletion common.php
Expand Up @@ -252,7 +252,7 @@
require ($homedir.'/globalsettings.php');
SSL_mode();// This really should be at the top but for it to utilise getGlobalSetting() it has to be here

$showXquestions = getGlobalSetting('showXquestions');
$showxquestions = getGlobalSetting('showxquestions');
$showgroupinfo = getGlobalSetting('showgroupinfo');
$showqnumcode = getGlobalSetting('showqnumcode');

Expand Down
4 changes: 2 additions & 2 deletions config-defaults.php
Expand Up @@ -472,13 +472,13 @@
$updatecheckperiod=7;

/**
* @var $showXquestions string allows you to control whether or not
* @var $showxquestions string allows you to control whether or not
* {THEREAREXQUESTIONS} is displayed (if it is included in a template)
* hide = always hide {THEREAREXQUESTIONS}
* show = always show {THEREAREXQUESTIONS}
* choose = allow survey admins to choose
*/
$showXquestions = 'choose';
$showxquestions = 'choose';


/**
Expand Down
8 changes: 4 additions & 4 deletions replacements.php
Expand Up @@ -21,7 +21,7 @@ function templatereplace($line, $replacements=array(), $anonymized=false, $quest
global $percentcomplete, $move;
global $groupname, $groupdescription;
global $question;
global $showXquestions, $showgroupinfo, $showqnumcode;
global $showxquestions, $showgroupinfo, $showqnumcode;
global $answer, $navigator;
global $help, $surveyformat;
global $completed, $register_errormsg;
Expand Down Expand Up @@ -208,9 +208,9 @@ function templatereplace($line, $replacements=array(), $anonymized=false, $quest
$_totalquestionsAsked = 0;
}
if (
$showXquestions == 'show' ||
($showXquestions == 'choose' && !isset($thissurvey['showXquestions'])) ||
($showXquestions == 'choose' && $thissurvey['showXquestions'] == 'Y')
$showxquestions == 'show' ||
($showxquestions == 'choose' && !isset($thissurvey['showxquestions'])) ||
($showxquestions == 'choose' && $thissurvey['showxquestions'] == 'Y')
)
{
if ($_totalquestionsAsked < 1)
Expand Down

0 comments on commit ded3358

Please sign in to comment.