Skip to content

Commit

Permalink
Fixed issue #09126: Survey's token and EM variables aren't set when e…
Browse files Browse the repository at this point in the history
…xporting printing results view to PDF format.
  • Loading branch information
Shnoulle committed Jul 9, 2014
1 parent e86b028 commit 51f8b95
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions application/controllers/PrintanswersController.php
Expand Up @@ -141,8 +141,6 @@ function actionView($surveyid,$printableexport=FALSE)
{
if (substr($sFieldname,0,4) == 'gid_')
{


$sOutput .= "\t<tr class='printanswersgroup'><td colspan='2'>{$fname[0]}</td></tr>\n";
}
elseif (substr($sFieldname,0,4)=='qid_')
Expand All @@ -162,6 +160,8 @@ function actionView($surveyid,$printableexport=FALSE)
}
}
$sOutput .= "</table>\n";
$sData['thissurvey']=$aSurveyInfo;
$sOutput=templatereplace($sOutput, array() , $sData, '', $aSurveyInfo['anonymized']=="Y",NULL, array(), true);// Do a static replacement
if($sExportType == 'pdf')
{
$oPDF->writeHTML($sOutput);
Expand All @@ -181,7 +181,6 @@ function actionView($surveyid,$printableexport=FALSE)

sendCacheHeaders();
doHeader();
$sData['thissurvey']=$aSurveyInfo;
echo templatereplace(file_get_contents(getTemplatePath($sTemplate).'/startpage.pstpl'),array(),$sData);
echo templatereplace(file_get_contents(getTemplatePath($sTemplate).'/printanswers.pstpl'),array('ANSWERTABLE'=>$sOutput),$sData);
echo templatereplace(file_get_contents(getTemplatePath($sTemplate).'/endpage.pstpl'),array(),$sData);
Expand Down

0 comments on commit 51f8b95

Please sign in to comment.