Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Dev: added notes about templatereplace() that should not be removed. …
…Concerns user entries from admin interface such as mail (in A-UI, users should still be able to use old replacement keywords for now, to transition to LS3 will be easier)
  • Loading branch information
LouisGac committed Feb 23, 2017
1 parent 6979764 commit 9a81aa9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 2 additions & 2 deletions application/helpers/SurveyRuntimeHelper.php
Expand Up @@ -1276,8 +1276,7 @@ private function moveSubmitIfNeeded()

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

/// TODO: TWIG TOKENS !!!!!

//Update the token if needed and send a confirmation email
if (isset($_SESSION['survey_'.$surveyid]['token'])){
submittokens();
Expand All @@ -1304,6 +1303,7 @@ private function moveSubmitIfNeeded()
$completed = "<p>".gT("Thank you!")."</p>";
$completed .= "<p>".gT("Your survey responses have been recorded.")."</p>";
}else{
// 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 );
}

Expand Down
5 changes: 5 additions & 0 deletions application/helpers/frontend_helper.php
Expand Up @@ -525,6 +525,8 @@ function submittokens($quotaexit=false)
$dateformatdatat=getDateFormatData($thissurvey['surveyls_dateformat']);
$numberformatdatat = getRadixPointData($thissurvey['surveyls_numberformat']);
$redata=array('thissurvey'=>$thissurvey);

// NOTE: this occurence of template replace should stay here. User from backend could use old replacement keyword
$subject=templatereplace($subject,$aReplacementVars,$redata,'email_confirm_subj', false, NULL, array(), true );

$subject=html_entity_decode($subject,ENT_QUOTES,$emailcharset);
Expand All @@ -540,6 +542,7 @@ function submittokens($quotaexit=false)

$message=$thissurvey['email_confirm'];
//$message=ReplaceFields($message, $fieldsarray, true);
// NOTE: this occurence of template replace should stay here. User from backend could use old replacement keyword
$message=templatereplace($message,$aReplacementVars,$redata,'email_confirm', false, NULL, array(), true );
if (!$ishtml)
{
Expand Down Expand Up @@ -746,6 +749,7 @@ function sendSubmitNotifications($surveyid)
$redata=compact(array_keys(get_defined_vars()));
if (count($aEmailNotificationTo)>0)
{
// NOTE: those occurences of template replace should stay here. User from backend could use old replacement keyword
$sMessage=templatereplace($thissurvey['email_admin_notification'],$aReplacementVars,$redata,'admin_notification',$thissurvey['anonymized'] == "Y",NULL, array(), true);
$sSubject=templatereplace($thissurvey['email_admin_notification_subj'],$aReplacementVars,$redata,'admin_notification_subj',($thissurvey['anonymized'] == "Y"),NULL, array(), true);
foreach ($aEmailNotificationTo as $sRecipient)
Expand Down Expand Up @@ -778,6 +782,7 @@ function sendSubmitNotifications($surveyid)
}
if (count($aEmailResponseTo)>0)
{
// NOTE: those occurences of template replace should stay here. User from backend could use old replacement keyword
$sMessage=templatereplace($thissurvey['email_admin_responses'],$aReplacementVars,$redata,'detailed_admin_notification',$thissurvey['anonymized'] == "Y",NULL, array(), true);
$sSubject=templatereplace($thissurvey['email_admin_responses_subj'],$aReplacementVars,$redata,'detailed_admin_notification_subj',$thissurvey['anonymized'] == "Y",NULL, array(), true);
foreach ($aEmailResponseTo as $sRecipient)
Expand Down

0 comments on commit 9a81aa9

Please sign in to comment.