Skip to content

Commit

Permalink
Dev: end message
Browse files Browse the repository at this point in the history
  • Loading branch information
LouisGac committed Feb 23, 2017
1 parent 9a81aa9 commit fd885eb
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
9 changes: 5 additions & 4 deletions application/helpers/SurveyRuntimeHelper.php
Expand Up @@ -1276,7 +1276,7 @@ private function moveSubmitIfNeeded()

$content = '';
$content .= templatereplace(file_get_contents($sTemplateViewPath."startpage.pstpl"), array(), $redata, 'SubmitStartpage', false, NULL, array(), true );

//Update the token if needed and send a confirmation email
if (isset($_SESSION['survey_'.$surveyid]['token'])){
submittokens();
Expand All @@ -1299,12 +1299,13 @@ private function moveSubmitIfNeeded()

$this->content = $content;


if (trim(str_replace(array('<p>','</p>'),'',$thissurvey['surveyls_endtext'])) == ''){
$completed = "<p>".gT("Thank you!")."</p>";
$completed .= "<p>".gT("Your survey responses have been recorded.")."</p>";
$thissurvey['aCompleted']['showDefault']=true;
}else{
$thissurvey['aCompleted']['showDefault']=false;
// NOTE: this occurence of template replace should stay here. User from backend could use old replacement keyword
$completed = templatereplace($thissurvey['surveyls_endtext'], array(), $redata, 'SubmitAssessment', false, NULL, array(), true );
$thissurvey['aCompleted']['sEndText'] = templatereplace($thissurvey['surveyls_endtext'], array(), $redata, 'SubmitAssessment', false, NULL, array(), true );
}

// Link to Print Answer Preview **********
Expand Down
10 changes: 9 additions & 1 deletion templates/default/views/layout-submit.twig
Expand Up @@ -44,12 +44,20 @@
{# This will display the script and the hidden inputs needed for Expression Manager #}
{{ aSurveyInfo.EM.ScriptsAndHiddenInputs }}

{% if (aSurveyInfo.aCompleted.showDefault == true) %}
<p>{{ "Thank you!" | t }}</p>
<p>{{ "Your survey responses have been recorded." | t }}</p>
{% else %}
{{ aSurveyInfo.aCompleted.sEndText }}
{% endif %}

{# Assessments #}
{% if (aSurveyInfo.aAssesments.show == true) %}
{{ include('./subviews/assessment.twig') }}
{% endif %}




</form> <!-- main form -->
</div> <!-- main col -->
</div> <!-- main row -->
Expand Down

0 comments on commit fd885eb

Please sign in to comment.