diff --git a/application/controllers/admin/remotecontrol.php b/application/controllers/admin/remotecontrol.php index 6b60217c67b..2f774468229 100644 --- a/application/controllers/admin/remotecontrol.php +++ b/application/controllers/admin/remotecontrol.php @@ -691,7 +691,7 @@ function export_reponses($sSessionKey, $iSurveyID, $sDocumentType, $sLanguageCod Yii::app()->loadHelper('admin/exportresults'); if (!hasSurveyPermission($iSurveyID, 'responses', 'export')) return array('status' => 'No permission'); if (is_null($sLanguageCode)) $sLanguageCode=getBaseLanguageFromSurveyID($iSurveyID); - if (is_null($aFields)) $aFields=array_keys(createFieldMap($iSurveyID,'full',true,false,$sLanguageCode)); + if (is_null($aFields)) $aFields=array_keys(createFieldMap($iSurveyID,'full',true,false,$sLanguageCode)); //AJS# if($sDocumentType=='xls'){ // Cut down to the first 255 fields $aFields=array_slice($aFields,0,255); diff --git a/application/helpers/admin/statistics_helper.php b/application/helpers/admin/statistics_helper.php index a2a74c99b91..3afe574db19 100644 --- a/application/helpers/admin/statistics_helper.php +++ b/application/helpers/admin/statistics_helper.php @@ -277,11 +277,12 @@ function buildSelects($allfields, $surveyid, $language) { $selects=array(); $aQuestionMap=array(); - $fieldmap=createFieldMap($surveyid, "full", false, false, $language); + $fieldmap=createFieldMap($surveyid, "full", false, false, $language); //AJS# foreach ($fieldmap as $field) { - if(isset($field['qid']) && $field['qid']!='') - $aQuestionMap[]=$field['sid'].'X'.$field['gid'].'X'.$field['qid']; + $q = $field['q']; + if(isset($q->id) && $q->id!='') + $aQuestionMap[]=$q->surveyid.'X'.$q->gid.'X'.$q->id; } // creates array of post variable names @@ -514,7 +515,7 @@ function buildOutputList($rt, $language, $surveyid, $outputType, $sql) { $statlangcode = getBaseLanguageFromSurveyID($surveyid); $statlang = new Limesurvey_lang($statlangcode); $firstletter = substr($rt, 0, 1); - $fieldmap=createFieldMap($surveyid, "full", false, false, $language); + $fieldmap=createFieldMap($surveyid, "full", false, false, $language); //AJS# $sDatabaseType = Yii::app()->db->getDriverName(); $statisticsoutput=""; @@ -3121,8 +3122,6 @@ function generate_statistics($surveyid, $allfields, $q2show='all', $usegraph=0, $surveylanguagecodes = Survey::model()->findByPk($surveyid)->additionalLanguages; $surveylanguagecodes[] = Survey::model()->findByPk($surveyid)->language; - $fieldmap=createFieldMap($surveyid, "full", false, false, $statlang->getlangcode()); - // Set language for questions and answers to base language of this survey $language=$statlangcode; diff --git a/application/helpers/export_helper.php b/application/helpers/export_helper.php index 7446da8ea8d..328c3fe0573 100644 --- a/application/helpers/export_helper.php +++ b/application/helpers/export_helper.php @@ -151,7 +151,7 @@ function SPSSGetValues ($field = array()) { function SPSSFieldMap($iSurveyID, $prefix = 'V') { global $clang, $surveyprivate, $tokensexist, $language; - $fieldmap = createFieldMap($iSurveyID,'full',false,false,getBaseLanguageFromSurveyID($iSurveyID)); + $fieldmap = createFieldMap($iSurveyID,'full',false,false,getBaseLanguageFromSurveyID($iSurveyID)); //AJS# #See if tokens are being used $tokensexist = Yii::app()->db->schema->getTable('{{tokens_'.$iSurveyID . '}}');