From a80f582ec3eb7fe8414c96131736c91b9793f8d4 Mon Sep 17 00:00:00 2001 From: azammitdcarf Date: Fri, 8 Apr 2011 06:32:51 +0000 Subject: [PATCH] Export to SPSS was failing due to queXS tokens Only include Nap javascript when nap is enabled --- .../admin/export_data_functions.php | 4 +-- include/limesurvey/common.php | 32 +++++++++++++------ 2 files changed, 24 insertions(+), 12 deletions(-) diff --git a/include/limesurvey/admin/export_data_functions.php b/include/limesurvey/admin/export_data_functions.php index baa676d6..af3bd19d 100644 --- a/include/limesurvey/admin/export_data_functions.php +++ b/include/limesurvey/admin/export_data_functions.php @@ -304,7 +304,7 @@ function spss_fieldmap($prefix = 'V') { $fields=array(); if (isset($tokensexist) && $tokensexist == true && $surveyprivate == 'N') { - $tokenattributes=GetTokenFieldsAndNames($surveyid,false); + $tokenattributes=GetTokenFieldsAndNames($surveyid,false,false); foreach ($tokenattributes as $attributefield=>$attributedescription) { //Drop the token field, since it is in the survey too @@ -428,7 +428,7 @@ function spss_getquery() { #See if tokens are being used if (isset($tokensexist) && $tokensexist == true && $surveyprivate == 'N') { $query="SELECT "; - $tokenattributes=GetTokenFieldsAndNames($surveyid,false); + $tokenattributes=GetTokenFieldsAndNames($surveyid,false,false); foreach ($tokenattributes as $attributefield=>$attributedescription) { //Drop the token field, since it is in the survey too if($attributefield!='token' && $attributefield!='callattempts' && $attributefield!='onappointment') { //queXS Addition diff --git a/include/limesurvey/common.php b/include/limesurvey/common.php index 87bb5ac8..856777c2 100644 --- a/include/limesurvey/common.php +++ b/include/limesurvey/common.php @@ -3567,11 +3567,19 @@ function getHeader() { $header.=" dir=\"rtl\" "; } + + include_once("quexs.php"); + $header.= ">\n\t\n" . $css_header - . "\t\t\n" - . "\t\t\n" //queXS Addition - . $js_header; + . "\t\t\n"; + + if (AUTO_LOGOUT_MINUTES !== false) + { + $header .= "\t\t\n"; //queXS Addition + } + + $header .= $js_header; return $header; } @@ -6164,7 +6172,7 @@ function GetTokenConditionsFieldNames($surveyid) * @param mixed $surveyid The survey ID * @return array The fieldnames as key and names as value in an Array */ -function GetTokenFieldsAndNames($surveyid, $onlyAttributes=false) +function GetTokenFieldsAndNames($surveyid, $onlyAttributes=false, $quexs = true) { global $dbprefix, $connect, $clang; if (tokenTableExists($surveyid) === false) @@ -6173,10 +6181,13 @@ function GetTokenFieldsAndNames($surveyid, $onlyAttributes=false) } $extra_attrs=GetAttributeFieldNames($surveyid); $basic_attrs=Array('firstname','lastname','email','token','language','sent','remindersent','remindercount'); - $basic_attrs[] = 'callattempts'; //queXS addition - $basic_attrs[] = 'onappointment'; //queXS addition - $basic_attrs[] = 'perccomplete'; //queXS addition - $basic_attrs[] = 'messagesleft'; //queXS addition + if ($quexs) + { + $basic_attrs[] = 'callattempts'; //queXS addition + $basic_attrs[] = 'onappointment'; //queXS addition + $basic_attrs[] = 'perccomplete'; //queXS addition + $basic_attrs[] = 'messagesleft'; //queXS addition + } $basic_attrs_names=Array( $clang->gT('First Name'), $clang->gT('Last Name'), @@ -6186,12 +6197,13 @@ function GetTokenFieldsAndNames($surveyid, $onlyAttributes=false) $clang->gT('Invitation sent date'), $clang->gT('Last Reminder sent date'), $clang->gT('Total numbers of sent reminders')); - + if ($quexs) + { $basic_attrs_names[] = $clang->gT('queXS: Number of call attempts'); //queXS addition $basic_attrs_names[] = $clang->gT('queXS: On appointment?'); //queXS addition $basic_attrs_names[] = $clang->gT('queXS: Percentage complete'); //queXS addition $basic_attrs_names[] = $clang->gT('queXS: Number of answering machine messages left'); //queXS addition - +} $thissurvey=getSurveyInfo($surveyid); $attdescriptiondata=!empty($thissurvey['attributedescriptions']) ? $thissurvey['attributedescriptions'] : ""; $attdescriptiondata=explode("\n",$attdescriptiondata);