Skip to content

Commit

Permalink
Fixed issue #6685 : Export of results broken
Browse files Browse the repository at this point in the history
Dev : just fix Undefined variable: sFilter : can export all result or one answer line. But another bug report for filter
  • Loading branch information
Shnoulle committed Oct 11, 2012
1 parent cca22a3 commit 5faaa17
Showing 1 changed file with 23 additions and 25 deletions.
48 changes: 23 additions & 25 deletions application/controllers/admin/export.php
Expand Up @@ -228,42 +228,40 @@ public function exportresults()
$options->headerSpacesToUnderscores = $convertspacetous;
$options->headingFormat = $exportstyle;
$options->responseCompletionState = incompleteAnsFilterState();
if ( $options->responseCompletionState =='all' ){$options->responseCompletionState =='show';}

//If we have no data for the filter state then default to show all.
if ( $options->responseCompletionState =='all' )
// Replace token information by the column name
if ( in_array('first_name', Yii::app()->request->getPost('attribute_select', array())) )
{
$options->selectedColumns[]="firstname";
}

$dquery = '';
if ( in_array('first_name', Yii::app()->request->getPost('attribute_select', array())) )
{
$options->selectedColumns[]="firstname";
}

if ( in_array('last_name', Yii::app()->request->getPost('attribute_select', array())) )
{
$options->selectedColumns[]="lastname";
}

if ( in_array('email_address', Yii::app()->request->getPost('attribute_select', array())) )
{
$options->selectedColumns[]="email";
}

$attributeFields = getTokenFieldsAndNames($iSurveyID, TRUE);
if ( in_array('last_name', Yii::app()->request->getPost('attribute_select', array())) )
{
$options->selectedColumns[]="lastname";
}

foreach ($attributeFields as $attr_name => $attr_desc)
if ( in_array('email_address', Yii::app()->request->getPost('attribute_select', array())) )
{
$options->selectedColumns[]="email";
}
$attributeFields = getTokenFieldsAndNames($iSurveyID, TRUE);
foreach ($attributeFields as $attr_name => $attr_desc)
{
if ( in_array($attr_name, Yii::app()->request->getPost('attribute_select',array())) )
{
if ( in_array($attr_name, Yii::app()->request->getPost('attribute_select',array())) )
{
$options->selectedColumns[]=$attr_name;
}
$options->selectedColumns[]=$attr_name;
}
}

if (Yii::app()->request->getPost('response_id'))
{
$sFilter='id='.(int)Yii::app()->request->getPost('response_id');
}

else
{
$sFilter='';
}
$resultsService = new ExportSurveyResultsService();
$resultsService->exportSurvey($iSurveyID, $explang, $type, $options, $sFilter);

Expand Down

0 comments on commit 5faaa17

Please sign in to comment.