2 +--------------------------------------------------------------------+
3 | Copyright CiviCRM LLC. All rights reserved. |
5 | This work is published under the GNU AGPLv3 license with some |
6 | permitted exceptions and without any warranty. For full license |
7 | and copyright information, see https://civicrm.org/licensing |
8 +--------------------------------------------------------------------+
10 {* This template is used for adding/scheduling reminders. *}
11 <div class="crm-block crm-form-block crm-scheduleReminder-form-block">
12 <div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="top"}</div>
15 <div class="messages status no-popup">
16 <div class="icon inform-icon"></div>
17 {ts 1=$reminderName}WARNING: You are about to delete the Reminder titled <strong>%1</strong>.{/ts} {ts}Do you want to continue?{/ts}
20 <table class="form-layout-compressed">
21 <tr class="crm-scheduleReminder-form-block-title">
22 <td class="right">{$form.title.label}</td><td colspan="3">{$form.title.html}</td>
25 <td class="label">{$form.entity.label}</td>
26 <td>{$form.entity.html}</td>
29 <tr class="crm-scheduleReminder-form-block-when">
30 <td class="right">{$form.start_action_offset.label}</td>
31 <td colspan="3">{$form.absolute_date.html} <strong id='OR'>OR</strong><br /></td>
34 <tr id="relativeDate" class="crm-scheduleReminder-form-block-description">
35 <td class="right"></td>
36 <td colspan="3">{$form.start_action_offset.html} {$form.start_action_unit.html} {$form.start_action_condition.html} {$form.start_action_date.html}</td>
38 <tr id="recordActivity" class="crm-scheduleReminder-form-block-record_activity"><td class="label" width="20%">{$form.record_activity.label}</td>
39 <td>{$form.record_activity.html}</td>
41 <tr id="relativeDateRepeat" class="crm-scheduleReminder-form-block-is_repeat"><td class="label" width="20%">{$form.is_repeat.label}</td>
42 <td>{$form.is_repeat.html} <span class="description">{ts}Enable repetition.{/ts}</span></td>
44 <tr id="repeatFields" class="crm-scheduleReminder-form-block-repeatFields"><td></td><td>
45 <table class="form-layout-compressed">
46 <tr class="crm-scheduleReminder-form-block-repetition_frequency_interval">
47 <td class="label">{$form.repetition_frequency_interval.label} <span class="crm-marker">*</span> {$form.repetition_frequency_interval.html}</td>
48 <td>{$form.repetition_frequency_unit.html}</td>
50 <tr class="crm-scheduleReminder-form-block-repetition_frequency_interval">
51 <td class="label">{$form.end_frequency_interval.label} <span class="crm-marker">*</span> {$form.end_frequency_interval.html}
52 <td>{$form.end_frequency_unit.html} {$form.end_action.html} {$form.end_date.html}</td>
58 <td class="label" width="20%">{$form.from_name.label}</td>
59 <td>{$form.from_name.html} {help id="id-from_name_email"}</td>
62 <td class="label" width="20%">{$form.from_email.label}</td>
63 <td>{$form.from_email.html} </td>
65 <tr class="crm-scheduleReminder-form-block-recipient">
66 <td id="recipientLabel" class="right">{$form.recipient.label}</td><td colspan="3">{$form.limit_to.html} {help id="limit_to" class="limit_to" title=$form.recipient.label}{$form.recipient.html} {help id="recipient" class="recipient" title=$recipientLabels.activity}</td>
68 <tr id="recipientList" class="crm-scheduleReminder-form-block-recipientListing recipient">
69 <td class="right">{$form.recipient_listing.label}</td><td colspan="3">{$form.recipient_listing.html}</td>
71 <tr id="recipientManual" class="crm-scheduleReminder-form-block-recipient_manual_id recipient">
72 <td class="label">{$form.recipient_manual_id.label}</td>
73 <td>{$form.recipient_manual_id.html}{edit}<div class="description">{ts}You can manually send out the reminders to these recipients.{/ts}</div>{/edit}</td>
76 <tr id="recipientGroup" class="crm-scheduleReminder-form-block-recipient_group_id recipient">
77 <td class="label">{$form.group_id.label}</td>
78 <td>{$form.group_id.html}</td>
80 <tr id="msgMode" class="crm-scheduleReminder-form-block-mode">
81 <td class="label">{$form.mode.label}</td>
82 <td>{$form.mode.html}</td>
85 <tr class="crm-scheduleReminder-form-block-filter-contact-language">
86 <td class="label">{$form.filter_contact_language.label}</td>
87 <td>{$form.filter_contact_language.html} {help id="filter_contact_language"}</td>
89 <tr class="crm-scheduleReminder-form-block-communication-language">
90 <td class="label">{$form.communication_language.label}</td>
91 <td>{$form.communication_language.html} {help id="communication_language"}</td>
94 <tr class="crm-scheduleReminder-form-block-active">
95 <td class="label"></td>
96 <td>{$form.is_active.html} {$form.is_active.label}</td>
99 <fieldset id="email" class="crm-collapsible" style="display: block;">
100 <legend class="collapsible-title">{ts}Email Screen{/ts}</legend>
102 <table id="email-field-table" class="form-layout-compressed">
103 <tr class="crm-scheduleReminder-form-block-template">
104 <td class="label">{$form.template.label}</td>
105 <td>{$form.template.html}</td>
107 <tr class="crm-scheduleReminder-form-block-subject">
108 <td class="label">{$form.subject.label}</td>
109 <td>{$form.subject.html}</td>
112 {include file="CRM/Contact/Form/Task/EmailCommon.tpl" upload=1 noAttach=1}
116 <fieldset id="sms" class="crm-collapsible"><legend class="collapsible-title">{ts}SMS Screen{/ts}</legend>
118 <table id="sms-field-table" class="form-layout-compressed">
119 <tr id="smsProvider" class="crm-scheduleReminder-form-block-sms_provider_id">
120 <td class="label">{$form.sms_provider_id.label}</td>
121 <td>{$form.sms_provider_id.html}</td>
123 <tr class="crm-scheduleReminder-form-block-sms-template">
124 <td class="label">{$form.SMStemplate.label}</td>
125 <td>{$form.SMStemplate.html}</td>
128 {include file="CRM/Contact/Form/Task/SMSCommon.tpl" upload=1 noAttach=1}
133 {include file="CRM/common/showHideByFieldValue.tpl"
134 trigger_field_id = "is_repeat"
135 trigger_value = "true"
136 target_element_id = "repeatFields"
137 target_element_type = "table-row"
142 {include file="CRM/common/showHideByFieldValue.tpl"
143 trigger_field_id ="recipient"
144 trigger_value = 'manual'
145 target_element_id ="recipientManual"
146 target_element_type ="table-row"
151 {include file="CRM/common/showHideByFieldValue.tpl"
152 trigger_field_id ="recipient"
153 trigger_value = 'group'
154 target_element_id ="recipientGroup"
155 target_element_type ="table-row"
161 <script type='text/javascript'>
163 var $form = $('form.{/literal}{$form.formClass}{literal}'),
164 recipientMapping = eval({/literal}{$recipientMapping}{literal});
166 $('#absolute_date_display', $form).change(function() {
168 $('#relativeDate, #relativeDateRepeat, #repeatFields, #OR', $form).hide();
170 $('#relativeDate, #relativeDateRepeat, #OR', $form).show();
173 if ($('#absolute_date_display', $form).val()) {
174 $('#relativeDate, #relativeDateRepeat, #repeatFields, #OR', $form).hide();
178 $('#mode', $form).change(loadMsgBox);
180 function populateRecipient() {
181 var mappingID = $('#entity_0', $form).val() || $('[name^=mappingID]', $form).val();
182 var recipient = $("#recipient", $form).val();
183 $("#recipientList", $form).hide();
184 if ($('#limit_to').val() != '' ) {
185 $.getJSON(CRM.url('civicrm/ajax/recipientListing'), {mappingID: mappingID, recipientType: recipient},
187 if (!CRM._.isEmpty(result.recipients)) {
188 CRM.utils.setOptions($('#recipient_listing', $form), result.recipients);
189 $("#recipientList", $form).show();
198 // CRM-14070 Hide limit-to when entity is activity
199 function showHideLimitTo() {
200 $('#limit_to', $form).toggle(!($('#entity_0', $form).val() == '1'));
201 if ($('#entity_0', $form).val() != '1' || !($('#entity_0').length)) {
202 if ($('#limit_to', $form).val() == '') {
203 $('tr.recipient:visible, #recipientList, #recipient, a.recipient').hide();
204 $('a.limit_to').show();
207 $('a.limit_to, a.recipient').show();
208 $('#recipient').css("margin-left", "12px");
210 $("label[for='recipient']").text('{/literal}{$recipientLabels.other}{literal}');
213 $('#recipient, a.recipient').show()
214 $('#recipient').css("margin-left", "-2px");
215 $('a.limit_to').hide();
216 $("label[for='recipient']").text('{/literal}{$recipientLabels.activity}{literal}');
220 $('#recipient', $form).change(populateRecipient);
222 {/literal}{if !$context}{literal}
223 var entity = $('#entity_0', $form).val();
224 if (!(entity === '2' || entity === '3')) {
225 $('#recipientList', $form).hide();
228 $('#entity_0, #limit_to', $form).change(buildSelects);
232 function buildSelects() {
233 var mappingID = $('#entity_0', $form).val();
234 var isLimit = $('#limit_to', $form).val();
236 $.getJSON(CRM.url('civicrm/ajax/mapping'), {mappingID: mappingID, isLimit: isLimit},
238 CRM.utils.setOptions($('#start_action_date', $form), result.sel4);
239 CRM.utils.setOptions($('#end_date', $form), result.sel4);
240 CRM.utils.setOptions($('#recipient', $form), result.sel5);
241 recipientMapping = result.recipientMapping;
246 {/literal}{else}{literal}
248 $('#limit_to', $form).change(populateRecipient);
249 {/literal}{/if}{literal}
251 function loadMsgBox() {
252 if (cj('#mode').val() == 'Email' || cj('#mode').val() == 0){
256 else if (cj('#mode').val() == 'SMS'){
259 showSaveUpdateChkBox('SMS');
261 else if (cj('#mode').val() == 'User_Preference'){
264 showSaveUpdateChkBox('SMS');
274 <div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="bottom"}</div>