Skip to content

Commit

Permalink
New feature: queXMLPDF export with response data
Browse files Browse the repository at this point in the history
Dev: Updated queXMLPDF generation to support inserting response data
Dev: Add icon when viewing responses to allow for a queXMLPDF exports containing response data
Dev: Add button when printable answers enabled for respondent to download queXMLPDF containing response data
Dev: Refactored for develop branch
Dev: Fixed template display for queXMLPDF export
Dev: Added {QUEXMLPDF} button for template
Dev: Fix spacing
  • Loading branch information
adamzammit authored and c-schmitz committed Nov 28, 2017
1 parent a7fa030 commit 52895eb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion application/controllers/PrintanswersController.php
Expand Up @@ -78,7 +78,7 @@ function actionView($surveyid, $printableexport = false)
//Yii::app()->clientScript->registerPackage( 'survey-template' );

//Survey is not finished or don't exist
if (!isset($_SESSION['survey_'.$iSurveyID]['finished']) || !isset($_SESSION['survey_'.$iSurveyID]['srid'])) {
if (!isset($_SESSION['survey_'.$iSurveyID]['srid']))
//display "sorry but your session has expired"
$this->sTemplate = $oTemplate->sTemplateName;
$error = $this->renderPartial("/survey/system/errorWarning", array(
Expand Down
8 changes: 7 additions & 1 deletion application/helpers/replacements_helper.php
Expand Up @@ -88,7 +88,6 @@ function templatereplace($line, $replacements = array(), &$redata = array(), $de
$thissurvey = getSurveyInfo($_surveyid, $s_lang);
}


Yii::app()->loadHelper('surveytranslator');

if (isset($thissurvey['sid'])) {
Expand Down Expand Up @@ -231,6 +230,12 @@ function templatereplace($line, $replacements = array(), &$redata = array(), $de
$iscompleted = $thissurvey['iscompleted'] = false;
}

if (isset($surveyid)) {
$_quexmlpdf=CHtml::link(gT("Save as PDF"),array("/printanswers/view/surveyid/{$surveyid}/printableexport/quexmlpdf"),array('data-toggle'=>'tooltip','data-placement'=>'right','title'=>gT("Note: Print will not include items on this page")));
} else {
$_quexmlpdf = "";
}

$_clearall = "";

if (isset(Yii::app()->session['datestamp'])) {
Expand Down Expand Up @@ -293,6 +298,7 @@ function templatereplace($line, $replacements = array(), &$redata = array(), $de
$coreReplacements['ASSESSMENT_HEADING'] = gT("Your assessment");
$coreReplacements['CHECKJAVASCRIPT'] = '';
$coreReplacements['CLEARALL'] = $_clearall;
$coreReplacements['QUEXMLPDF'] = $_quexmlpdf;
$coreReplacements['CLOSEWINDOW'] = ''; // Obsolete tag - keep this line for compatibility reaons
$coreReplacements['COMPLETED'] = isset($redata['completed']) ? $redata['completed'] : ''; // global
$coreReplacements['DATESTAMP'] = $_datestamp;
Expand Down

0 comments on commit 52895eb

Please sign in to comment.