diff --git a/application/controllers/PrintanswersController.php b/application/controllers/PrintanswersController.php index 6d47c6e0d11..37dc02fbca5 100644 --- a/application/controllers/PrintanswersController.php +++ b/application/controllers/PrintanswersController.php @@ -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( diff --git a/application/helpers/replacements_helper.php b/application/helpers/replacements_helper.php index 9fd2c597b91..b926bb20c2a 100644 --- a/application/helpers/replacements_helper.php +++ b/application/helpers/replacements_helper.php @@ -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'])) { @@ -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'])) { @@ -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;