Skip to content

Commit

Permalink
Fixed issue #18368: export_statistics from API Yields error
Browse files Browse the repository at this point in the history
  • Loading branch information
lapiudevgit committed Jun 5, 2023
1 parent 01ac6e1 commit da5b36a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions application/helpers/remotecontrol/remotecontrol_handle.php
Expand Up @@ -573,16 +573,17 @@ public function export_statistics($sSessionKey, $iSurveyID, $docType = 'pdf', $s
$aSummary = createCompleteSGQA($iSurveyID, $oAllQuestions, $sLanguage);

$helper = new statistics_helper();
$tempDir = Yii::app()->getConfig("tempdir");
switch ($docType) {
case 'pdf':
$sTempFile = sanitize_filename(
$sTempFile = $tempDir . DIRECTORY_SEPARATOR . sanitize_filename(
$helper->generate_statistics($iSurveyID, $aSummary, $aSummary, $graph, $docType, 'F', $sLanguage)
);
$sResult = file_get_contents($sTempFile);
unlink($sTempFile);
break;
case 'xls':
$sTempFile = sanitize_filename(
$sTempFile = $tempDir . DIRECTORY_SEPARATOR . sanitize_filename(
$helper->generate_statistics($iSurveyID, $aSummary, $aSummary, '0', $docType, 'F', $sLanguage)
);
$sResult = file_get_contents($sTempFile);
Expand Down

0 comments on commit da5b36a

Please sign in to comment.