Skip to content

Commit

Permalink
Switched DB fields for Google Analytics to lower case
Browse files Browse the repository at this point in the history
git-svn-id: file:///Users/Shitiz/Downloads/lssvn/source/limesurvey_dev@12145 b72ed6b6-b9f8-46b5-92b4-906544132732
  • Loading branch information
c-schmitz committed Jan 20, 2012
1 parent d38eb51 commit bb94853
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 24 deletions.
4 changes: 2 additions & 2 deletions admin/database.php
Expand Up @@ -1143,8 +1143,8 @@ function get_max_question_order($gid)
'usecaptcha'=>$_POST['usecaptcha'],
'emailresponseto'=>trim($_POST['emailresponseto']),
'emailnotificationto'=>trim($_POST['emailnotificationto']),
'googleAnalyticsAPIKey'=>trim($_POST['googleAnalyticsAPIKey']),
'googleAnalyticsStyle'=>trim($_POST['googleAnalyticsStyle']),
'googleanalyticsapikey'=>trim($_POST['googleanalyticsapikey']),
'googleanalyticsstyle'=>trim($_POST['googleanalyticsstyle']),
'tokenlength'=>$_POST['tokenlength']
);

Expand Down
18 changes: 9 additions & 9 deletions admin/editsurveysettings.php
Expand Up @@ -60,8 +60,8 @@
$esrow['showwelcome'] = 'Y';
$esrow['emailresponseto'] = '';
$esrow['assessments'] = 'N';
$esrow['googleAnalyticsAPIKey'] = '';
$esrow['googleAnalyticsStyle'] = '0';
$esrow['googleanalyticsapikey'] = '';
$esrow['googleanalyticsstyle'] = '0';

$dateformatdetails=getDateFormatData($_SESSION['dateformat']);

Expand Down Expand Up @@ -840,25 +840,25 @@

//GOOGLE ANALYTICS PROCESSING
//GOOGLE ANALYTICS API KEY
$editsurvey .= "<li><label for='googleAnalyticsAPIKey'>".$clang->gT("Google Analytics API Key for this Survey?")."</label>\n"
. "<input type='text' value=\"{$esrow['googleAnalyticsAPIKey']}\" name='googleAnalyticsAPIKey' id='googleAnalyticsAPIKey' size='20'/>\n"
$editsurvey .= "<li><label for='googleanalyticsapikey'>".$clang->gT("Google Analytics API Key for this Survey?")."</label>\n"
. "<input type='text' value=\"{$esrow['googleanalyticsapikey']}\" name='googleanalyticsapikey' id='googleanalyticsapikey' size='20'/>\n"
. "</li>\n";

//GOOGLE ANALYTICS STYLE
$editsurvey .= "<li><label for='googleAnalyticsStyle'>".$clang->gT("Google Analytics Style for this Survey?")."</label>\n"
. "<select id='googleAnalyticsStyle' name='googleAnalyticsStyle'>\n"
$editsurvey .= "<li><label for='googleanalyticsstyle'>".$clang->gT("Google Analytics Style for this Survey?")."</label>\n"
. "<select id='googleanalyticsstyle' name='googleanalyticsstyle'>\n"
. "<option value='0'";
if (!$esrow['googleAnalyticsStyle'] || $esrow['googleAnalyticsStyle'] == "0") {
if (!$esrow['googleanalyticsstyle'] || $esrow['googleanalyticsstyle'] == "0") {
$editsurvey .= " selected='selected'";
}
$editsurvey .= ">".$clang->gT("Do not use Google Analytics")."</option>\n"
. "<option value='1'";
if ($esrow['googleAnalyticsStyle'] == "1") {
if ($esrow['googleanalyticsstyle'] == "1") {
$editsurvey .= " selected='selected'";
}
$editsurvey .= ">".$clang->gT("Default Google Analytics")."</option>\n"
. "<option value='2'";
if ($esrow['googleAnalyticsStyle'] == "2") {
if ($esrow['googleanalyticsstyle'] == "2") {
$editsurvey .= " selected='selected'";
}
$editsurvey .= ">".$clang->gT("SurveyName-[SID]/GroupName")."</option>\n"
Expand Down
6 changes: 3 additions & 3 deletions admin/globalsettings.php
Expand Up @@ -94,7 +94,7 @@ function globalsettingssave()
setGlobalSetting('sessionlifetime',$sessionlifetimetemp);
setGlobalSetting('ipInfoDbAPIKey',$_POST['ipInfoDbAPIKey']);
setGlobalSetting('googleMapsAPIKey',$_POST['googleMapsAPIKey']);
setGlobalSetting('googleAnalyticsAPIKey',$_POST['googleAnalyticsAPIKey']);
setGlobalSetting('googleanalyticsapikey',$_POST['googleanalyticsapikey']);
setGlobalSetting('force_ssl',$_POST['force_ssl']);
setGlobalSetting('surveyPreview_require_Auth',strip_tags($_POST['surveyPreview_require_Auth']));
$savetime=trim(strip_tags((float) $_POST['timeadjust']).' hours'); //makes sure it is a number, at least 0
Expand Down Expand Up @@ -262,8 +262,8 @@ function globalsettingsdisplay()
. "<input type='text' size='35' id='ipInfoDbAPIKey' name='ipInfoDbAPIKey' value=\"".htmlspecialchars(getGlobalSetting('ipInfoDbAPIKey'))."\" /></li>"
. "<li><label for='googleMapsAPIKey'>".$clang->gT("Google Maps API key:")."</label>\n"
. "<input type='text' size='35' id='googleMapsAPIKey' name='googleMapsAPIKey' value=\"".htmlspecialchars(getGlobalSetting('googleMapsAPIKey'))."\" /></li>"
. "<li><label for='googleAnalyticsAPIKey'>".$clang->gT("Google Analytics API key:")."</label>\n"
. "<input type='text' size='35' id='googleAnalyticsAPIKey' name='googleAnalyticsAPIKey' value=\"".htmlspecialchars(getGlobalSetting('googleAnalyticsAPIKey'))."\" /></li>"
. "<li><label for='googleanalyticsapikey'>".$clang->gT("Google Analytics API key:")."</label>\n"
. "<input type='text' size='35' id='googleanalyticsapikey' name='googleanalyticsapikey' value=\"".htmlspecialchars(getGlobalSetting('googleanalyticsapikey'))."\" /></li>"
;


Expand Down
4 changes: 2 additions & 2 deletions admin/update/upgrade-mssql.php
Expand Up @@ -594,8 +594,8 @@ function db_upgrade($oldversion) {
}
if ($oldversion < 155)
{
modify_database("","ALTER TABLE [prefix_surveys] ADD [googleAnalyticsStyle] char(1) DEFAULT NULL;"); echo $modifyoutput; flush();@ob_flush();
modify_database("","ALTER TABLE [prefix_surveys] ADD [googleAnalyticsAPIKey] varchar(25) DEFAULT NULL;"); echo $modifyoutput; flush();@ob_flush();
modify_database("","ALTER TABLE [prefix_surveys] ADD [googleanalyticsstyle] char(1) DEFAULT NULL;"); echo $modifyoutput; flush();@ob_flush();
modify_database("","ALTER TABLE [prefix_surveys] ADD [googleanalyticsapikey] varchar(25) DEFAULT NULL;"); echo $modifyoutput; flush();@ob_flush();
modify_database("", "UPDATE [prefix_settings_global] SET stg_value='155' WHERE stg_name='DBVersion'"); echo $modifyoutput; flush();ob_flush();
}
echo '<br /><br />'.sprintf($clang->gT('Database update finished (%s)'),date('Y-m-d H:i:s')).'<br />';
Expand Down
4 changes: 2 additions & 2 deletions admin/update/upgrade-mssqlnative.php
Expand Up @@ -593,8 +593,8 @@ function db_upgrade($oldversion) {
}
if ($oldversion < 155)
{
modify_database("","ALTER TABLE [prefix_surveys] ADD [googleAnalyticsStyle] char(1) DEFAULT NULL;"); echo $modifyoutput; flush();@ob_flush();
modify_database("","ALTER TABLE [prefix_surveys] ADD [googleAnalyticsAPIKey] varchar(25) DEFAULT NULL;"); echo $modifyoutput; flush();@ob_flush();
modify_database("","ALTER TABLE [prefix_surveys] ADD [googleanalyticsstyle] char(1) DEFAULT NULL;"); echo $modifyoutput; flush();@ob_flush();
modify_database("","ALTER TABLE [prefix_surveys] ADD [googleanalyticsapikey] varchar(25) DEFAULT NULL;"); echo $modifyoutput; flush();@ob_flush();
modify_database("", "UPDATE [prefix_settings_global] SET [stg_value]='155' WHERE stg_name='DBVersion'"); echo $modifyoutput; flush();ob_flush();
}

Expand Down
4 changes: 2 additions & 2 deletions admin/update/upgrade-mysql.php
Expand Up @@ -704,8 +704,8 @@ function db_upgrade($oldversion) {
}
if ($oldversion < 155)
{
modify_database("","ALTER TABLE `prefix_surveys` ADD `googleAnalyticsStyle` char(1) DEFAULT NULL;"); echo $modifyoutput; flush();@ob_flush();
modify_database("","ALTER TABLE `prefix_surveys` ADD `googleAnalyticsAPIKey` varchar(25) DEFAULT NULL;"); echo $modifyoutput; flush();@ob_flush();
modify_database("","ALTER TABLE `prefix_surveys` ADD `googleanalyticsstyle` char(1) DEFAULT NULL;"); echo $modifyoutput; flush();@ob_flush();
modify_database("","ALTER TABLE `prefix_surveys` ADD `googleanalyticsapikey` varchar(25) DEFAULT NULL;"); echo $modifyoutput; flush();@ob_flush();
modify_database("", "UPDATE `prefix_settings_global` SET stg_value='155' WHERE stg_name='DBVersion'"); echo $modifyoutput; flush();ob_flush();
}
echo '<br /><br />'.sprintf($clang->gT('Database update finished (%s)'),date('Y-m-d H:i:s')).'<br />';
Expand Down
4 changes: 2 additions & 2 deletions admin/update/upgrade-postgres.php
Expand Up @@ -428,8 +428,8 @@ function db_upgrade($oldversion) {
}
if ($oldversion < 155)
{
modify_database("","ALTER TABLE prefix_surveys ADD googleAnalyticsStyle char(1) DEFAULT NULL;"); echo $modifyoutput; flush();@ob_flush();
modify_database("","ALTER TABLE prefix_surveys ADD googleAnalyticsAPIKey character varying(25) DEFAULT NULL;"); echo $modifyoutput; flush();@ob_flush();
modify_database("","ALTER TABLE prefix_surveys ADD googleanalyticsstyle char(1) DEFAULT NULL;"); echo $modifyoutput; flush();@ob_flush();
modify_database("","ALTER TABLE prefix_surveys ADD googleanalyticsapikey character varying(25) DEFAULT NULL;"); echo $modifyoutput; flush();@ob_flush();
modify_database("", "UPDATE prefix_settings_global SET stg_value='155' WHERE stg_name='DBVersion'"); echo $modifyoutput; flush();ob_flush();
}

Expand Down
4 changes: 2 additions & 2 deletions replacements.php
Expand Up @@ -559,8 +559,8 @@ function templatereplace($line, $replacements=array(), $anonymized=false, $quest
$_assessment_current_total = '';
}

$_googleAnalyticsAPIKey = (isset($thissurvey['googleAnalyticsAPIKey']) ? $thissurvey['googleAnalyticsAPIKey'] : '');
$_googleAnalyticsStyle = (isset($thissurvey['googleAnalyticsStyle']) ? $thissurvey['googleAnalyticsStyle'] : '0');
$_googleAnalyticsAPIKey = (isset($thissurvey['googleanalyticsapikey']) ? $thissurvey['googleanalyticsapikey'] : '');
$_googleAnalyticsStyle = (isset($thissurvey['googleanalyticsstyle']) ? $thissurvey['googleanalyticsstyle'] : '0');

switch ($_googleAnalyticsStyle)
{
Expand Down

0 comments on commit bb94853

Please sign in to comment.