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_yii@12243 b72ed6b6-b9f8-46b5-92b4-906544132732
  • Loading branch information
c-schmitz committed Jan 27, 2012
1 parent 9bcb8e8 commit ec1772d
Show file tree
Hide file tree
Showing 16 changed files with 46 additions and 46 deletions.
4 changes: 2 additions & 2 deletions application/config/config-defaults.php
Expand Up @@ -388,13 +388,13 @@
$config['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
*/
$config['showXquestions'] = 'choose';
$config['showxquestions'] = 'choose';


/**
Expand Down
2 changes: 1 addition & 1 deletion application/controllers/admin/database.php
Expand Up @@ -1010,7 +1010,7 @@ function index($sa = null)
'printanswers'=> Yii::app()->request->getPost('printanswers'),
'publicstatistics'=> Yii::app()->request->getPost('publicstatistics'),
'autoredirect'=> Yii::app()->request->getPost('autoredirect'),
'showXquestions'=> Yii::app()->request->getPost('showXquestions'),
'showxquestions'=> Yii::app()->request->getPost('showxquestions'),
'showgroupinfo'=> Yii::app()->request->getPost('showgroupinfo'),
'showqnumcode'=> Yii::app()->request->getPost('showqnumcode'),
'shownoanswer'=> Yii::app()->request->getPost('shownoanswer'),
Expand Down
2 changes: 1 addition & 1 deletion application/controllers/admin/globalsettings.php
Expand Up @@ -136,7 +136,7 @@ private function _saveSettings()
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
6 changes: 3 additions & 3 deletions application/controllers/admin/surveyaction.php
Expand Up @@ -1171,7 +1171,7 @@ private function _generalTabEditSurvey($surveyid, $esrow)
private function _tabPresentationNavigation($esrow)
{
$clang = $this->getController()->lang;
global $showXquestions, $showgroupinfo, $showqnumcode;
global $showxquestions, $showgroupinfo, $showqnumcode;

Yii::app()->loadHelper('globalsettings');

Expand All @@ -1180,7 +1180,7 @@ private function _tabPresentationNavigation($esrow)
$aData['clang'] = $clang;
$aData['esrow'] = $esrow;
$aData['shownoanswer'] = $shownoanswer;
$aData['showXquestions'] = $showXquestions;
$aData['showxquestions'] = $showxquestions;
$aData['showgroupinfo'] = $showgroupinfo;
$aData['showqnumcode'] = $showqnumcode;
return $aData;
Expand Down Expand Up @@ -1497,7 +1497,7 @@ function insert($iSurveyId=null)
'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 application/helpers/replacements_helper.php
Expand Up @@ -28,12 +28,12 @@
function templatereplace($line, $replacements = array(), &$redata = array(), $debugSrc = 'Unspecified', $anonymized = false, $questionNum = NULL, $registerdata = array())
{
/*
global $clienttoken,$token,$sitename,$move,$showXquestions,$showqnumcode,$questioncode,$register_errormsg;
global $clienttoken,$token,$sitename,$move,$showxquestions,$showqnumcode,$questioncode,$register_errormsg;
global $s_lang,$errormsg,$saved_id, $totalBoilerplatequestions, $relativeurl, $languagechanger,$captchapath,$loadname;
*/
/*
$allowedvars = array('surveylist', 'sitename', 'clienttoken', 'rooturl', 'thissurvey', 'imageurl', 'defaulttemplate',
'percentcomplete', 'move', 'groupname', 'groupdescription', 'question', 'showXquestions',
'percentcomplete', 'move', 'groupname', 'groupdescription', 'question', 'showxquestions',
'showgroupinfo', 'showqnumcode', 'questioncode', 'answer', 'navigator', 'help', 'totalquestions',
'surveyformat', 'completed', 'register_errormsg', 'notanswered', 'privacy', 'surveyid', 'publicurl',
'templatedir', 'token', 'assessments', 's_lang', 'errormsg', 'clang', 'saved_id', 'usertemplaterootdir',
Expand Down Expand Up @@ -63,7 +63,7 @@ function templatereplace($line, $replacements = array(), &$redata = array(), $de
'saved_id',
'showgroupinfo',
'showqnumcode',
'showXquestions',
'showxquestions',
'sitename',
'surveylist',
'templatedir',
Expand Down Expand Up @@ -95,7 +95,7 @@ function templatereplace($line, $replacements = array(), &$redata = array(), $de
if (!isset($showqnumcode)) { $showqnumcode = Yii::app()->getConfig('showqnumcode'); }
$_surveyid = Yii::app()->getConfig('surveyID');
if (!isset($totalBoilerplatequestions)) { $totalBoilerplatequestions = 0; }
if (!isset($showXquestions)) { $showXquestions = Yii::app()->getConfig('showXquestions'); }
if (!isset($showxquestions)) { $showxquestions = Yii::app()->getConfig('showxquestions'); }
if (!isset($s_lang)) { $s_lang = (isset(Yii::app()->session['survey_'.$_surveyid]['s_lang']) ? Yii::app()->session['survey_'.$_surveyid]['s_lang'] : 'en'); }
if (!isset($captchapath)) { $captchapath = ''; }

Expand Down Expand Up @@ -267,9 +267,9 @@ function templatereplace($line, $replacements = array(), &$redata = array(), $de
if(!isset($totalquestions)) $totalquestions = 0;
$_totalquestionsAsked = $totalquestions - $totalBoilerplatequestions;
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
2 changes: 1 addition & 1 deletion application/helpers/update/upgrade-mssql_helper.php
Expand Up @@ -397,7 +397,7 @@ function db_upgrade($oldversion) {

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

if ($oldversion < 145) //Modify surveys table
{
modifyDatabase("", "ALTER TABLE [prefix_surveys] ADD showXquestions CHAR(1) NULL default 'Y'"); echo $modifyoutput; flush();ob_flush();
modifyDatabase("", "ALTER TABLE [prefix_surveys] ADD showxquestions CHAR(1) NULL default 'Y'"); echo $modifyoutput; flush();ob_flush();
modifyDatabase("", "ALTER TABLE [prefix_surveys] ADD showgroupinfo CHAR(1) NULL default 'B'"); echo $modifyoutput; flush();ob_flush();
modifyDatabase("", "ALTER TABLE [prefix_surveys] ADD shownoanswer CHAR(1) NULL default 'Y'"); echo $modifyoutput; flush();ob_flush();
modifyDatabase("", "ALTER TABLE [prefix_surveys] ADD showqnumcode CHAR(1) NULL default 'X'"); echo $modifyoutput; flush();ob_flush();
Expand Down
2 changes: 1 addition & 1 deletion application/helpers/update/upgrade-mysql_helper.php
Expand Up @@ -393,7 +393,7 @@ function db_upgrade($oldversion) {
if ($oldversion < 145)
{
modifyDatabase("", "ALTER TABLE `prefix_surveys` ADD `savetimings` CHAR(1) NULL default 'N' AFTER `format`"); echo $modifyoutput; flush();@ob_flush();
modifyDatabase("", "ALTER TABLE `prefix_surveys` ADD `showXquestions` CHAR(1) NULL default 'Y'"); echo $modifyoutput; flush();@ob_flush();
modifyDatabase("", "ALTER TABLE `prefix_surveys` ADD `showxquestions` CHAR(1) NULL default 'Y'"); echo $modifyoutput; flush();@ob_flush();
modifyDatabase("", "ALTER TABLE `prefix_surveys` ADD `showgroupinfo` CHAR(1) NULL default 'B'"); echo $modifyoutput; flush();@ob_flush();
modifyDatabase("", "ALTER TABLE `prefix_surveys` ADD `shownoanswer` CHAR(1) NULL default 'Y'"); echo $modifyoutput; flush();@ob_flush();
modifyDatabase("", "ALTER TABLE `prefix_surveys` ADD `showqnumcode` CHAR(1) NULL default 'X'"); echo $modifyoutput; flush();@ob_flush();
Expand Down
2 changes: 1 addition & 1 deletion application/helpers/update/upgrade-postgres_helper.php
Expand Up @@ -235,7 +235,7 @@ function db_upgrade($oldversion) {
if ($oldversion < 145)
{
modifyDatabase("", "ALTER TABLE prefix_surveys ADD savetimings CHAR(1) NULL default 'N'"); echo $modifyoutput; flush();@ob_flush();
modifyDatabase("", "ALTER TABLE prefix_surveys ADD showXquestions CHAR(1) NULL default 'Y'"); echo $modifyoutput; flush();@ob_flush();
modifyDatabase("", "ALTER TABLE prefix_surveys ADD showxquestions CHAR(1) NULL default 'Y'"); echo $modifyoutput; flush();@ob_flush();
modifyDatabase("", "ALTER TABLE prefix_surveys ADD showgroupinfo CHAR(1) NULL default 'B'"); echo $modifyoutput; flush();@ob_flush();
modifyDatabase("", "ALTER TABLE prefix_surveys ADD shownoanswer CHAR(1) NULL default 'Y'"); echo $modifyoutput; flush();@ob_flush();
modifyDatabase("", "ALTER TABLE prefix_surveys ADD showqnumcode CHAR(1) NULL default 'X'"); echo $modifyoutput; flush();@ob_flush();
Expand Down
6 changes: 3 additions & 3 deletions application/models/InstallerConfigForm.php
Expand Up @@ -28,14 +28,14 @@ class InstallerConfigForm extends CFormModel
public $db_names = array(
'mysql' => 'MySQL',
'mysqli' => 'MySQLi',
'sqlite' => 'SQLite',
'sqlite2' => 'SQLite2',
// 'sqlite' => 'SQLite',
// 'sqlite2' => 'SQLite2',
'mssql' => 'Microsoft SQL Server',
'dblib' => 'Microsoft SQL Server (dblib)',
'sqlsrv' => 'Microsoft SQL Server (sqlsrv)',
'sybase' => 'Microsoft SQL Server (sybase)',
'pgsql' => 'PostgreSQL',
'oci' => 'Oracle'
// 'oci' => 'Oracle'
);

// Optional
Expand Down
8 changes: 4 additions & 4 deletions application/views/admin/globalSettings_view.php
Expand Up @@ -364,17 +364,17 @@
<input id='repeatheadings' name='repeatheadings' value='<?php echo $thisrepeatheadings; ?>' size='4' maxlength='4' /></li>

<?php
// 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"';
};
?>
<li><label for="showXquestions"><?php $clang->eT('Show "There are X questions in this survey"'); ?></label>
<select id="showXquestions" name="showXquestions">
<li><label for="showxquestions"><?php $clang->eT('Show "There are X questions in this survey"'); ?></label>
<select id="showxquestions" name="showxquestions">
<option value="show"<?php echo $sel_xq['show']; ?>><?php $clang->eT('Yes'); ?></option>
<option value="hide"<?php echo $sel_xq['hide']; ?>><?php $clang->eT('No'); ?></option>
<option value="choose"<?php echo $sel_xq['choose']; ?>><?php $clang->eT('Survey admin can choose'); ?></option>
Expand Down
18 changes: 9 additions & 9 deletions application/views/admin/survey/subview/tabPresentation_view.php
Expand Up @@ -211,32 +211,32 @@
</select>
</li>

<!-- $show_dis_pre =<li><label for="dis_showXquestions"><?php $clang->eT('Show "There are X questions in this survey"'); ?></label> <input type="hidden" name="showXquestions" id="" value="
$show_dis_mid = " /> <input type="text" name="dis_showXquestions" id="dis_showXquestions" disabled="disabled" value="
<!-- $show_dis_pre =<li><label for="dis_showxquestions"><?php $clang->eT('Show "There are X questions in this survey"'); ?></label> <input type="hidden" name="showxquestions" id="" value="
$show_dis_mid = " /> <input type="text" name="dis_showxquestions" id="dis_showxquestions" disabled="disabled" value="
$show_dis_post = " size="70" /></li> -->
<?php switch ($showXquestions) {
<?php switch ($showxquestions) {
case 'show': ?>
<li><label for="dis_showXquestions"><?php $clang->eT('Show "There are X questions in this survey"'); ?></label> <input type="hidden" name="showXquestions" id="" value="Y" /> <input type="text" name="dis_showXquestions" id="dis_showXquestions" disabled="disabled" value="
<li><label for="dis_showxquestions"><?php $clang->eT('Show "There are X questions in this survey"'); ?></label> <input type="hidden" name="showxquestions" id="" value="Y" /> <input type="text" name="dis_showxquestions" id="dis_showxquestions" disabled="disabled" value="
<?php $clang->eT('Yes (Forced by the system administrator)'); ?>
" size="70" /></li>
<?php break;
case 'hide': ?>
<li><label for="dis_showXquestions"><?php $clang->eT('Show "There are X questions in this survey"'); ?></label> <input type="hidden" name="showXquestions" id="" value="N" /> <input type="text" name="dis_showXquestions" id="dis_showXquestions" disabled="disabled" value="
<li><label for="dis_showxquestions"><?php $clang->eT('Show "There are X questions in this survey"'); ?></label> <input type="hidden" name="showxquestions" id="" value="N" /> <input type="text" name="dis_showxquestions" id="dis_showxquestions" disabled="disabled" value="
<?php $clang->eT('No (Forced by the system administrator)'); ?>
" size="70" /></li>
<?php break;
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"';
}; ?>
<li><label for="showXquestions"><?php $clang->eT('Show "There are X questions in this survey"'); ?></label>
<select id="showXquestions" name="showXquestions">
<li><label for="showxquestions"><?php $clang->eT('Show "There are X questions in this survey"'); ?></label>
<select id="showxquestions" name="showxquestions">
<option value="Y" <?php echo $sel_showxq['Y']; ?>><?php $clang->eT('Yes'); ?></option>
<option value="N" <?php echo $sel_showxq['N']; ?>><?php $clang->eT('No'); ?></option>
</select>
Expand Down
2 changes: 1 addition & 1 deletion installer/sql/create-mssql.sql
Expand Up @@ -276,7 +276,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 installer/sql/create-mssqlnative.sql
Expand Up @@ -284,7 +284,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 installer/sql/create-mysql.sql
Expand Up @@ -282,7 +282,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
18 changes: 9 additions & 9 deletions installer/sql/create-pgsql.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 @@ -274,7 +274,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 @@ -436,11 +436,11 @@ CREATE TABLE prefix_templates_rights (
--
CREATE TABLE prefix_participants (
"participant_id" character varying( 50 ) PRIMARY KEY NOT NULL,
"firstname" character varying( 40 ) NOT NULL,
"lastname" character varying( 40 ) NOT NULL,
"email" character varying( 80 ) NOT NULL,
"language" character varying( 2 ) NOT NULL,
"blacklisted" character( 1 ) NOT NULL,
"firstname" character varying( 40 ) DEFAULT NULL,
"lastname" character varying( 40 ) DEFAULT NULL,
"email" character varying( 80 ) DEFAULT NULL,
"language" character varying( 2 ) DEFAULT NULL,
"blacklisted" character( 1 ) DEFAULT NULL,
"owner_uid" integer NOT NULL
);

Expand Down

0 comments on commit ec1772d

Please sign in to comment.