/
remind.php
96 lines (86 loc) · 5.02 KB
/
remind.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
<?php echo PrepareEditorScript(true, $this); ?>
<div class='header ui-widget-header'>
<?php $clang->eT("Send email reminder"); ?></div><br />
<?php if ($thissurvey['active'] != 'Y') { ?>
<div class='messagebox ui-corner-all'><div class='warningheader'><?php $clang->eT('Warning!'); ?></div><?php $clang->eT("This survey is not yet activated and so your participants won't be able to fill out the survey."); ?></div>
<?php } ?>
<div id='tabs'>
<ul>
<?php
foreach ($surveylangs as $language)
{
//GET SURVEY DETAILS
echo '<li><a href="#tabpage_' . $language . '">' . getLanguageNameFromCode($language, false);
if ($language == $baselang)
{
echo "(" . $clang->gT("Base language") . ")";
}
echo "</a></li>";
}
?>
</ul>
<?php echo CHtml::form(array("admin/tokens/sa/email/action/remind/surveyid/{$surveyid}"), 'post', array('id'=>'sendreminder', 'class'=>'form30')); ?>
<?php
foreach ($surveylangs as $language)
{
//GET SURVEY DETAILS
if (!$thissurvey[$language]['email_remind'])
{
$thissurvey[$language]['email_remind'] = str_replace("\n", "\r\n", $clang->gT("Dear {FIRSTNAME},\n\nRecently we invited you to participate in a survey.\n\nWe note that you have not yet completed the survey, and wish to remind you that the survey is still available should you wish to take part.\n\nThe survey is titled:\n\"{SURVEYNAME}\"\n\n\"{SURVEYDESCRIPTION}\"\n\nTo participate, please click on the link below.\n\nSincerely,\n\n{ADMINNAME} ({ADMINEMAIL})\n\n----------------------------------------------\nClick here to do the survey:\n{SURVEYURL}") . "\n\n" . $clang->gT("If you do not want to participate in this survey and don't want to receive any more invitations please click the following link:\n{OPTOUTURL}"));
}
echo "<div id='tabpage_{$language}'><ul>"
. "<li><label for='from_$language' >" . $clang->gT("From") . ":</label>\n"
. "<input type='text' size='50' name='from_$language' id='from_$language' value=\"".htmlspecialchars($thissurvey['adminname'],ENT_QUOTES,'UTF-8')." <".htmlspecialchars($thissurvey['adminemail'],ENT_QUOTES,'UTF-8').">\" /></li>\n"
. "<li><label for='subject_$language' >" . $clang->gT("Subject") . ":</label>";
$fieldsarray["{ADMINNAME}"] = $thissurvey['adminname'];
$fieldsarray["{ADMINEMAIL}"] = $thissurvey['adminemail'];
$fieldsarray["{SURVEYNAME}"] = $thissurvey[$language]['name'];
$fieldsarray["{SURVEYDESCRIPTION}"] = $thissurvey[$language]['description'];
$fieldsarray["{EXPIRY}"] = $thissurvey["expiry"];
$subject = Replacefields($thissurvey[$language]['email_remind_subj'], $fieldsarray, false);
$textarea = Replacefields($thissurvey[$language]['email_remind'], $fieldsarray, false);
if ($ishtml !== true)
{
$textarea = str_replace(array('<x>', '</x>'), array(''), $textarea);
}
echo "<input type='text' size='83' id='subject_$language' name='subject_$language' value=\"$subject\" /></li><li>\n"
. "<label for='message_$language'>" . $clang->gT("Message") . ":</label>\n"
. "<div class='htmleditor'>\n"
. "<textarea name='message_$language' id='message_$language' rows='20' cols='80' >";
echo htmlspecialchars($textarea);
echo "</textarea>"
. "</div>\n"
. getEditor("email-rem", "message_$language", "[" . $clang->gT("Reminder Email:", "js") . "](" . $language . ")", $surveyid, '', '', "tokens")
. "</li>\n"
. "</ul></div>";
}
?>
<ul>
<?php
if (count($tokenids)>0)
{ ?>
<li>
<label><?php $clang->eT("Send reminder to token ID(s):"); ?></label>
<?php echo short_implode(", ", "-", (array) $tokenids); ?></li>
<?php } ?>
<li><label for='bypassbademails'>
<?php $clang->eT("Bypass token with failing email addresses"); ?>:</label>
<select id='bypassbademails' name='bypassbademails'>
<option value='Y'><?php $clang->eT("Yes"); ?></option>
<option value='N'><?php $clang->eT("No"); ?></option>
</select></li>
<li><label for='minreminderdelay'>
<?php $clang->eT("Min days between reminders"); ?>:</label>
<input type='text' value='' name='minreminderdelay' id='minreminderdelay' /></li>
<li><label for='maxremindercount'>
<?php $clang->eT("Max reminders"); ?>:</label>
<input type='text' value='' name='maxremindercount' id='maxremindercount' /></li>
</ul><p>
<input type='submit' value='<?php $clang->eT("Send Reminders"); ?>' />
<input type='hidden' name='ok' value='absolutely' />
<input type='hidden' name='subaction' value='remind' />
<?php if (!empty($tokenids)) { ?>
<input type='hidden' name='tokenids' value='<?php echo implode('|', (array) $tokenids); ?>' />
<?php } ?>
</form>
</div>