From 18160a0941692757d4d2546d68e355f4dab58294 Mon Sep 17 00:00:00 2001 From: Aaron Schmitz Date: Wed, 15 Aug 2012 04:40:30 -0500 Subject: [PATCH] Remove type from fieldmap. --- application/helpers/common_helper.php | 2 +- application/helpers/expressions/em_manager_helper.php | 2 +- application/modules/ArrayQuestion.php | 3 +-- application/modules/CheckQuestion.php | 5 ++--- application/modules/CommentCheckQuestion.php | 4 ++-- application/modules/CommentListQuestion.php | 4 ++-- application/modules/DualRadioArrayQuestion.php | 3 +-- application/modules/FileQuestion.php | 3 +-- application/modules/ListQuestion.php | 4 ++-- application/modules/MultinumericalQuestion.php | 3 +-- application/modules/MultitextQuestion.php | 3 +-- application/modules/NumberArrayQuestion.php | 3 +-- application/modules/QuestionModule.php | 3 +-- application/modules/RankingQuestion.php | 3 +-- application/modules/TextArrayQuestion.php | 3 +-- 15 files changed, 19 insertions(+), 29 deletions(-) diff --git a/application/helpers/common_helper.php b/application/helpers/common_helper.php index cd95df1f661..cbc7c612483 100644 --- a/application/helpers/common_helper.php +++ b/application/helpers/common_helper.php @@ -1492,7 +1492,7 @@ function getExtendedAnswer($iSurveyID, $sFieldCode, $sValue, $oLanguage) } return $sValue; } - $fieldmap = createFieldMap($iSurveyID,'short',false,false,$sLanguage); //AJS + $fieldmap = createFieldMap($iSurveyID,'short',false,false,$sLanguage); //AJS# if (isset($fieldmap[$sFieldCode])) $fields = $fieldmap[$sFieldCode]; else diff --git a/application/helpers/expressions/em_manager_helper.php b/application/helpers/expressions/em_manager_helper.php index e2c346acd71..f6a4245655d 100644 --- a/application/helpers/expressions/em_manager_helper.php +++ b/application/helpers/expressions/em_manager_helper.php @@ -2372,7 +2372,7 @@ private function setVariableAndTokenMappingsForExpressionManager($surveyid,$forc $this->em->SetSurveyMode($this->surveyMode); // TODO - do I need to force refresh, or trust that createFieldMap will cache langauges properly? - $fieldmap=createFieldMap($surveyid,$style='full',$forceRefresh,false,$_SESSION['LEMlang']); + $fieldmap=createFieldMap($surveyid,$style='full',$forceRefresh,false,$_SESSION['LEMlang']); //AJS# $this->sid= $surveyid; $this->runtimeTimings[] = array(__METHOD__ . '.createFieldMap',(microtime(true) - $now)); diff --git a/application/modules/ArrayQuestion.php b/application/modules/ArrayQuestion.php index 3f2ba993f28..ed96274a2d4 100644 --- a/application/modules/ArrayQuestion.php +++ b/application/modules/ArrayQuestion.php @@ -17,7 +17,7 @@ protected function getChildren() return $this->children = dbExecuteAssoc($ansquery)->readAll(); //Checked } - public function createFieldmap($type=null) + public function createFieldmap() { $map = array(); $abrows = getSubQuestions($this); @@ -25,7 +25,6 @@ public function createFieldmap($type=null) { $fieldname="{$this->surveyid}X{$this->gid}X{$this->id}{$abrow['title']}"; $field['fieldname']=$fieldname; - $field['type']=$type; $field['sid']=$this->surveyid; $field['gid']=$this->gid; $field['qid']=$this->id; diff --git a/application/modules/CheckQuestion.php b/application/modules/CheckQuestion.php index b6ad08e8548..ad83aee7315 100644 --- a/application/modules/CheckQuestion.php +++ b/application/modules/CheckQuestion.php @@ -336,7 +336,7 @@ public function getHelp() return ''; } - public function createFieldmap($type=null) + public function createFieldmap() { $clang = Yii::app()->lang; $map = array(); @@ -345,7 +345,6 @@ public function createFieldmap($type=null) { $fieldname="{$this->surveyid}X{$this->gid}X{$this->id}{$abrow['title']}"; $field['fieldname']=$fieldname; - $field['type']=$type; $field['sid']=$this->surveyid; $field['gid']=$this->gid; $field['qid']=$this->id; @@ -378,7 +377,7 @@ public function createFieldmap($type=null) } if ($this->isother=='Y') { - $other = parent::createFieldmap($type); + $other = parent::createFieldmap(); $other = $other[$this->fieldname]; $other['fieldname'].='other'; $other['aid']='other'; diff --git a/application/modules/CommentCheckQuestion.php b/application/modules/CommentCheckQuestion.php index 52de4c1a598..79c919a4eeb 100644 --- a/application/modules/CommentCheckQuestion.php +++ b/application/modules/CommentCheckQuestion.php @@ -206,11 +206,11 @@ public function getDataEntry($idrow, &$fnames, $language) return $output; } - public function createFieldmap($type=null) + public function createFieldmap() { $clang = Yii::app()->lang; $map = array(); - $tmp = parent::createFieldmap($type); + $tmp = parent::createFieldmap(); foreach($tmp as $field) { $comment = $field; diff --git a/application/modules/CommentListQuestion.php b/application/modules/CommentListQuestion.php index 6c49fac23da..fa5f1b7e91a 100644 --- a/application/modules/CommentListQuestion.php +++ b/application/modules/CommentListQuestion.php @@ -185,10 +185,10 @@ public function getDataEntry($idrow, &$fnames, $language) return $output; } - public function createFieldmap($type=null) + public function createFieldmap() { $clang = Yii::app()->lang; - $map = QuestionModule::createFieldmap($type); + $map = QuestionModule::createFieldmap(); $comment = $map[$this->fieldname]; $comment['fieldname'].='comment'; $comment['aid']='comment'; diff --git a/application/modules/DualRadioArrayQuestion.php b/application/modules/DualRadioArrayQuestion.php index b495c7854a1..f897a49d729 100644 --- a/application/modules/DualRadioArrayQuestion.php +++ b/application/modules/DualRadioArrayQuestion.php @@ -597,7 +597,7 @@ public function getAnswerHTML() return $answer; } - public function createFieldmap($type=null) + public function createFieldmap() { $clang = Yii::app()->lang; $abrows = getSubQuestions($this); @@ -606,7 +606,6 @@ public function createFieldmap($type=null) { $fieldname="{$this->surveyid}X{$this->gid}X{$this->id}{$abrow['title']}#0"; $field['fieldname']=$fieldname; - $field['type']=$type; $field['sid']=$this->surveyid; $field['gid']=$this->gid; $field['qid']=$this->id; diff --git a/application/modules/FileQuestion.php b/application/modules/FileQuestion.php index a43e969ff62..9ab4f31b605 100644 --- a/application/modules/FileQuestion.php +++ b/application/modules/FileQuestion.php @@ -208,13 +208,12 @@ public function getFileValidationMessage() return $qtitle; } - public function createFieldmap($type=null) + public function createFieldmap() { $clang = Yii::app()->lang; $qidattributes= getQuestionAttributeValues($this->id); $fieldname="{$this->surveyid}X{$this->gid}X{$this->id}"; $field['fieldname']=$fieldname; - $field['type']=$type; $field['sid']=$this->surveyid; $field['gid']=$this->gid; $field['qid']=$this->id; diff --git a/application/modules/ListQuestion.php b/application/modules/ListQuestion.php index 2c42aca999c..7dda94dcbed 100644 --- a/application/modules/ListQuestion.php +++ b/application/modules/ListQuestion.php @@ -340,10 +340,10 @@ public function getHelp() return ''; } - public function createFieldmap($type=null) + public function createFieldmap() { $clang = Yii::app()->lang; - $map = parent::createFieldmap($type); + $map = parent::createFieldmap(); if($this->isother=='Y') { $other = $map[$this->fieldname]; diff --git a/application/modules/MultinumericalQuestion.php b/application/modules/MultinumericalQuestion.php index 613aef73f48..b885b949523 100644 --- a/application/modules/MultinumericalQuestion.php +++ b/application/modules/MultinumericalQuestion.php @@ -366,7 +366,7 @@ public function getHeaderIncludes() } } - public function createFieldmap($type=null) + public function createFieldmap() { $map = array(); $abrows = getSubQuestions($this); @@ -374,7 +374,6 @@ public function createFieldmap($type=null) { $fieldname="{$this->surveyid}X{$this->gid}X{$this->id}{$abrow['title']}"; $field['fieldname']=$fieldname; - $field['type']=$type; $field['sid']=$this->surveyid; $field['gid']=$this->gid; $field['qid']=$this->id; diff --git a/application/modules/MultitextQuestion.php b/application/modules/MultitextQuestion.php index 1be32a17b6e..b0ecd426220 100644 --- a/application/modules/MultitextQuestion.php +++ b/application/modules/MultitextQuestion.php @@ -202,7 +202,7 @@ protected function getChildren() return $this->children = dbExecuteAssoc($ansquery)->readAll(); //Checked } - public function createFieldmap($type=null) + public function createFieldmap() { $map = array(); $abrows = getSubQuestions($this); @@ -210,7 +210,6 @@ public function createFieldmap($type=null) { $fieldname="{$this->surveyid}X{$this->gid}X{$this->id}{$abrow['title']}"; $field['fieldname']=$fieldname; - $field['type']=$type; $field['sid']=$this->surveyid; $field['gid']=$this->gid; $field['qid']=$this->id; diff --git a/application/modules/NumberArrayQuestion.php b/application/modules/NumberArrayQuestion.php index cb3200b593a..74ed0669be6 100644 --- a/application/modules/NumberArrayQuestion.php +++ b/application/modules/NumberArrayQuestion.php @@ -410,7 +410,7 @@ public function getDataEntry($idrow, &$fnames, $language) return $output; } - public function createFieldmap($type=null) + public function createFieldmap() { $map = array(); $abrows = getSubQuestions($this); @@ -427,7 +427,6 @@ public function createFieldmap($type=null) { $fieldname="{$this->surveyid}X{$this->gid}X{$this->id}{$abrow['title']}_{$answer['title']}"; $field['fieldname']= $fieldname; - $field['type']=$type; $field['sid']=$this->surveyid; $field['gid']=$this->gid; $field['qid']=$this->id; diff --git a/application/modules/QuestionModule.php b/application/modules/QuestionModule.php index 318b5ae2b43..3768ccdfbaf 100644 --- a/application/modules/QuestionModule.php +++ b/application/modules/QuestionModule.php @@ -150,10 +150,9 @@ public function getPopup($notanswered=null) return false; } - public function createFieldmap($type=null) + public function createFieldmap() { $map['fieldname']=$this->fieldname; - $map['type']=$type; $map['sid']=$this->surveyid; $map['gid']=$this->gid; $map['qid']=$this->id; diff --git a/application/modules/RankingQuestion.php b/application/modules/RankingQuestion.php index 54bb2d2c69b..e783da78c00 100644 --- a/application/modules/RankingQuestion.php +++ b/application/modules/RankingQuestion.php @@ -291,7 +291,7 @@ public function getHeaderIncludes() return array('ranking.js' => 'js', 'ranking.css' => 'css'); } - public function createFieldmap($type=null) + public function createFieldmap() { $clang = Yii::app()->lang; $data = Answers::model()->findAllByAttributes(array('qid' => $this->id, 'language' => $this->language)); @@ -299,7 +299,6 @@ public function createFieldmap($type=null) { $fieldname="{$this->surveyid}X{$this->gid}X{$this->id}$i"; $field['fieldname']=$fieldname; - $field['type']=$type; $field['sid']=$this->surveyid; $field['gid']=$this->gid; $field['qid']=$this->id; diff --git a/application/modules/TextArrayQuestion.php b/application/modules/TextArrayQuestion.php index cf215cc00ea..59107b3fa58 100644 --- a/application/modules/TextArrayQuestion.php +++ b/application/modules/TextArrayQuestion.php @@ -387,7 +387,7 @@ public function getDataEntry($idrow, &$fnames, $language) return $output; } - public function createFieldmap($type=null) + public function createFieldmap() { $map = array(); $abrows = getSubQuestions($this); @@ -404,7 +404,6 @@ public function createFieldmap($type=null) { $fieldname="{$this->surveyid}X{$this->gid}X{$this->id}{$abrow['title']}_{$answer['title']}"; $field['fieldname']= $fieldname; - $field['type']=$type; $field['sid']=$this->surveyid; $field['gid']=$this->gid; $field['qid']=$this->id;