Skip to content

Commit

Permalink
Merge branch '2.05' of github.com:LimeSurvey/LimeSurvey into 2.05
Browse files Browse the repository at this point in the history
  • Loading branch information
SamMousa committed Aug 12, 2013
2 parents 788a7ae + 792fac2 commit 8a3638f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
9 changes: 6 additions & 3 deletions application/core/plugins/ExportR/RSyntaxWriter.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ public function init(SurveyObj $survey, $sLanguageCode, FormattingOptions $oOpti
foreach ($tmpFieldmap as $field => $values)
{
$fieldmap[$values['title']] = $values;
if (array_key_exists('sql_name', $values)) {
$fieldmap[$values['sql_name']] = $values;
}
}
$this->customFieldmap = $fieldmap;
}
Expand All @@ -56,8 +59,8 @@ protected function out($content)

protected function outputRecord($headers, $values, FormattingOptions $oOptions)
{
$this->headers = $headers;
foreach ($headers as $id => $title)
$this->headers = $oOptions->selectedColumns;
foreach ($oOptions->selectedColumns as $id => $title)
{
$field = $this->customFieldmap[$title];

Expand Down Expand Up @@ -176,7 +179,7 @@ public function close()
$errors .= "# Variable name was incorrect and was changed from {$field['title']} to $ftitle .\n";
}

$this->out("names(data)[" . $id . "] <- "
$this->out("names(data)[" . $i . "] <- "
. "\"" . $ftitle . "\""); // <AdV> added \n
} else {
$this->out("#sql_name not set");
Expand Down
8 changes: 4 additions & 4 deletions application/helpers/export_helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,8 @@ function SPSSExportData ($iSurveyID, $iLength, $na = '', $q='\'', $header=FALSE)
* @param $field array field from SPSSFieldMap
* @return array or false
*/
function SPSSGetValues ($field = array(), $qidattributes = null ) {
global $iSurveyID, $language, $length_vallabel;
function SPSSGetValues ($field = array(), $qidattributes = null, $language ) {
$length_vallabel = 120;
$clang = Yii::app()->lang;

if (!isset($field['LStype']) || empty($field['LStype'])) return false;
Expand Down Expand Up @@ -329,7 +329,7 @@ function SPSSGetValues ($field = array(), $qidattributes = null ) {
* @return array
*/
function SPSSFieldMap($iSurveyID, $prefix = 'V') {
global $clang, $surveyprivate, $tokensexist, $language;
global $clang, $surveyprivate, $tokensexist;

$typeMap = array(
'5'=>Array('name'=>'5 Point Choice','size'=>1,'SPSStype'=>'F','Scale'=>3),
Expand Down Expand Up @@ -490,7 +490,7 @@ function SPSSFieldMap($iSurveyID, $prefix = 'V') {
'ValueLabels'=>'','VariableLabel'=>$varlabel,"sql_name"=>$fieldname,"size"=>$val_size,
'title'=>$ftitle,'hide'=>$hide,'scale'=>$export_scale, 'scale_id'=>$scale_id);
//Now check if we have to retrieve value labels
$answers = SPSSGetValues($tempArray, $aQuestionAttribs);
$answers = SPSSGetValues($tempArray, $aQuestionAttribs, $language);
if (is_array($answers)) {
//Ok we have answers
if (isset($answers['size'])) {
Expand Down
1 change: 1 addition & 0 deletions scripts/admin/organize.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ $(document).ready(function(){
placeholder: 'placeholder',
revert: 250,
tabSize: 25,
rootID: 'root',
stop: function(event, ui) {
if (ui.item[0].sourceLevel!=ui.placeholder.destinationLevel)
$('ol.organizer').nestedSortable('cancel');
Expand Down

0 comments on commit 8a3638f

Please sign in to comment.