Skip to content

Commit

Permalink
Fixed issue #13320: End message is not shown in preview
Browse files Browse the repository at this point in the history
  • Loading branch information
olleharstedt committed Feb 20, 2018
1 parent ed49edb commit 48584d5
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
10 changes: 10 additions & 0 deletions application/helpers/SurveyRuntimeHelper.php
Expand Up @@ -1060,6 +1060,16 @@ private function moveSubmitIfNeeded()
$this->aSurveyInfo['aAssessments'] = doAssessment($this->iSurveyid);
}

// End text
if (trim(str_replace(array('<p>', '</p>'), '', $this->aSurveyInfo['surveyls_endtext'])) == '') {
$this->aSurveyInfo['aCompleted']['showDefault'] = true;
} else {
$this->aSurveyInfo['aCompleted']['showDefault'] = false;
// NOTE: this occurence of template replace should stay here. User from backend could use old replacement keyword
//$this->aSurveyInfo['aCompleted']['sEndText'] = templatereplace($this->aSurveyInfo['surveyls_endtext'], array(), $redata, 'SubmitAssessment', false, null, array(), true);
$this->aSurveyInfo['aCompleted']['sEndText'] = $this->processString($this->aSurveyInfo['surveyls_endtext']);
}

$redata = compact(array_keys(get_defined_vars()));
// can't kill session before end message, otherwise INSERTANS doesn't work.
$completed = templatereplace($this->aSurveyInfo['surveyls_endtext'], array(), $redata, 'SubmitEndtextI', false, null, array(), true);
Expand Down
Expand Up @@ -27,12 +27,19 @@

<div class="{{ aSurveyInfo.class.previewsubmit }}" {{ aSurveyInfo.attr.previewsubmit }}>
<div class='{{ aSurveyInfo.class.previewsubmittext }}' {{ aSurveyInfo.attr.previewsubmittext }}>
{% if (aSurveyInfo.aCompleted.showDefault == true) %}
<p {{ aSurveyInfo.attr.submitwrappertextpa }}>{{ "Thank you!" | t }}</p>
<p {{ aSurveyInfo.attr.submitwrappertextpb }}>{{ "Your survey responses have been recorded." | t }}</p>
{% else %}
{{ aSurveyInfo.aCompleted.sEndText }}
{% endif %}

{# Assessments #}
{% if (aSurveyInfo.aAssessments.show) %}
{{ include('./subviews/messages/assessments.twig') }}
{% endif %}

<br />
<br /><br />
{# TODO: rewrite this before master #}
<strong >
<font size='2' color='red'>
Expand Down

0 comments on commit 48584d5

Please sign in to comment.