2 +--------------------------------------------------------------------+
3 | CiviCRM version 4.6 |
4 +--------------------------------------------------------------------+
5 | Copyright CiviCRM LLC (c) 2004-2015 |
6 +--------------------------------------------------------------------+
7 | This file is a part of CiviCRM. |
9 | CiviCRM is free software; you can copy, modify, and distribute it |
10 | under the terms of the GNU Affero General Public License |
11 | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
13 | CiviCRM is distributed in the hope that it will be useful, but |
14 | WITHOUT ANY WARRANTY; without even the implied warranty of |
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
16 | See the GNU Affero General Public License for more details. |
18 | You should have received a copy of the GNU Affero General Public |
19 | License and the CiviCRM Licensing Exception along |
20 | with this program; if not, contact CiviCRM LLC |
21 | at info[AT]civicrm[DOT]org. If you have questions about the |
22 | GNU Affero General Public License or the licensing of CiviCRM, |
23 | see the CiviCRM license FAQ at http://civicrm.org/licensing |
24 +--------------------------------------------------------------------+
26 {* This template is used for adding/scheduling reminders. *}
27 <div class="crm-block crm-form-block crm-scheduleReminder-form-block">
28 <div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="top"}</div>
31 <div class="messages status no-popup">
32 <div class="icon inform-icon"></div>
33 {ts 1=$reminderName}WARNING: You are about to delete the Reminder titled <strong>%1</strong>.{/ts} {ts}Do you want to continue?{/ts}
36 <table class="form-layout-compressed">
37 <tr class="crm-scheduleReminder-form-block-title">
38 <td class="right">{$form.title.label}</td><td colspan="3">{$form.title.html}</td>
41 <td class="label">{$form.entity.label}</td>
42 <td>{$form.entity.html}</td>
45 <tr class="crm-scheduleReminder-form-block-when">
46 <td class="right">{$form.start_action_offset.label}</td>
47 <td colspan="3">{include file="CRM/common/jcalendar.tpl" elementName=absolute_date} <strong id='OR'>OR</strong><br /></td>
50 <tr id="relativeDate" class="crm-scheduleReminder-form-block-description">
51 <td class="right"></td>
52 <td colspan="3">{$form.start_action_offset.html} {$form.start_action_unit.html} {$form.start_action_condition.html} {$form.start_action_date.html}</td>
54 <tr id="recordActivity" class="crm-scheduleReminder-form-block-record_activity"><td class="label" width="20%">{$form.record_activity.label}</td>
55 <td>{$form.record_activity.html}</td>
57 <tr id="relativeDateRepeat" class="crm-scheduleReminder-form-block-is_repeat"><td class="label" width="20%">{$form.is_repeat.label}</td>
58 <td>{$form.is_repeat.html} <span class="description">{ts}Enable repetition.{/ts}</span></td>
60 <tr id="repeatFields" class="crm-scheduleReminder-form-block-repeatFields"><td></td><td>
61 <table class="form-layout-compressed">
62 <tr class="crm-scheduleReminder-form-block-repetition_frequency_interval">
63 <td class="label">{$form.repetition_frequency_interval.label} {$form.repetition_frequency_interval.html}</td>
64 <td>{$form.repetition_frequency_unit.html}</td>
66 <tr class="crm-scheduleReminder-form-block-repetition_frequency_interval">
67 <td class="label">{$form.end_frequency_interval.label} {$form.end_frequency_interval.html}
68 <td>{$form.end_frequency_unit.html} {$form.end_action.html} {$form.end_date.html}</td>
74 <td class="label" width="20%">{$form.from_name.label}</td>
75 <td>{$form.from_name.html} {help id="id-from_name_email"}</td>
78 <td class="label" width="20%">{$form.from_email.label}</td>
79 <td>{$form.from_email.html} </td>
81 <tr class="crm-scheduleReminder-form-block-recipient">
82 <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>
84 <tr id="recipientList" class="crm-scheduleReminder-form-block-recipientListing recipient">
85 <td class="right">{$form.recipient_listing.label}</td><td colspan="3">{$form.recipient_listing.html}</td>
87 <tr id="recipientManual" class="crm-scheduleReminder-form-block-recipient_manual_id recipient">
88 <td class="label">{$form.recipient_manual_id.label}</td>
89 <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>
92 <tr id="recipientGroup" class="crm-scheduleReminder-form-block-recipient_group_id recipient">
93 <td class="label">{$form.group_id.label}</td>
94 <td>{$form.group_id.html}</td>
96 <tr id="msgMode" class="crm-scheduleReminder-form-block-mode">
97 <td class="label">{$form.mode.label}</td>
98 <td>{$form.mode.html}</td>
100 <tr class="crm-scheduleReminder-form-block-active">
101 <td class="label"></td>
102 <td>{$form.is_active.html} {$form.is_active.label}</td>
105 <fieldset id="email" class="crm-collapsible" style="display: block;">
106 <legend class="collapsible-title">{ts}Email Screen{/ts}</legend>
108 <table id="email-field-table" class="form-layout-compressed">
109 <tr class="crm-scheduleReminder-form-block-template">
110 <td class="label">{$form.template.label}</td>
111 <td>{$form.template.html}</td>
113 <tr class="crm-scheduleReminder-form-block-subject">
114 <td class="label">{$form.subject.label}</td>
115 <td>{$form.subject.html}</td>
118 {include file="CRM/Contact/Form/Task/EmailCommon.tpl" upload=1 noAttach=1}
122 <fieldset id="sms" class="crm-collapsible"><legend class="collapsible-title">{ts}SMS Screen{/ts}</legend>
124 <table id="sms-field-table" class="form-layout-compressed">
125 <tr id="smsProvider" class="crm-scheduleReminder-form-block-sms_provider_id">
126 <td class="label">{$form.sms_provider_id.label}</td>
127 <td>{$form.sms_provider_id.html}</td>
129 <tr class="crm-scheduleReminder-form-block-sms-template">
130 <td class="label">{$form.SMStemplate.label}</td>
131 <td>{$form.SMStemplate.html}</td>
134 {include file="CRM/Contact/Form/Task/SMSCommon.tpl" upload=1 noAttach=1}
139 {include file="CRM/common/showHideByFieldValue.tpl"
140 trigger_field_id = "is_repeat"
141 trigger_value = "true"
142 target_element_id = "repeatFields"
143 target_element_type = "table-row"
148 {include file="CRM/common/showHideByFieldValue.tpl"
149 trigger_field_id ="recipient"
150 trigger_value = 'manual'
151 target_element_id ="recipientManual"
152 target_element_type ="table-row"
157 {include file="CRM/common/showHideByFieldValue.tpl"
158 trigger_field_id ="recipient"
159 trigger_value = 'group'
160 target_element_id ="recipientGroup"
161 target_element_type ="table-row"
167 <script type='text/javascript'>
169 var $form = $('form.{/literal}{$form.formClass}{literal}'),
170 recipientMapping = eval({/literal}{$recipientMapping}{literal});
172 $('#absolute_date_display', $form).change(function() {
174 $('#relativeDate, #relativeDateRepeat, #repeatFields, #OR', $form).hide();
176 $('#relativeDate, #relativeDateRepeat, #OR', $form).show();
179 if ($('#absolute_date_display', $form).val()) {
180 $('#relativeDate, #relativeDateRepeat, #repeatFields, #OR', $form).hide();
184 $('#mode', $form).change(loadMsgBox);
186 function populateRecipient() {
187 var recipient = $("#recipient", $form).val();
188 if ((recipientMapping[recipient] == 'Participant Status' || recipientMapping[recipient] == 'participant_role') && $('#limit_to').val() != '') {
189 CRM.api3('participant', 'getoptions', {field: recipientMapping[recipient] == 'participant_role' ? 'role_id' : 'status_id', sequential: 1})
190 .done(function(result) {
191 CRM.utils.setOptions($('#recipient_listing', $form), result.values);
193 $("#recipientList", $form).show();
196 $("#recipientList", $form).hide();
202 // CRM-14070 Hide limit-to when entity is activity
203 function showHideLimitTo() {
204 $('#limit_to', $form).toggle(!($('#entity_0', $form).val() == '1'));
205 if ($('#entity_0', $form).val() != '1' || !($('#entity_0').length)) {
206 if ($('#limit_to', $form).val() == '') {
207 $('tr.recipient:visible, #recipientList, #recipient, a.recipient').hide();
208 $('a.limit_to').show();
211 $('a.limit_to, a.recipient').show();
212 $('#recipient').css("margin-left", "12px");
214 $("label[for='recipient']").text('{/literal}{$recipientLabels.other}{literal}');
217 $('#recipient, a.recipient').show()
218 $('#recipient').css("margin-left", "-2px");
219 $('a.limit_to').hide();
220 $("label[for='recipient']").text('{/literal}{$recipientLabels.activity}{literal}');
224 $('#recipient', $form).change(populateRecipient);
226 {/literal}{if !$context}{literal}
227 var entity = $('#entity_0', $form).val();
228 if (!(entity === '2' || entity === '3')) {
229 $('#recipientList', $form).hide();
232 $('#entity_0, #limit_to', $form).change(buildSelects);
236 function buildSelects() {
237 var mappingID = $('#entity_0', $form).val();
238 var isLimit = $('#limit_to', $form).val();
240 $.getJSON(CRM.url('civicrm/ajax/mapping'), {mappingID: mappingID, isLimit: isLimit},
242 CRM.utils.setOptions($('#start_action_date', $form), result.sel4);
243 CRM.utils.setOptions($('#end_date', $form), result.sel4);
244 CRM.utils.setOptions($('#recipient', $form), result.sel5);
245 recipientMapping = result.recipientMapping;
250 {/literal}{else}{literal}
252 $('#limit_to', $form).change(populateRecipient);
253 {/literal}{/if}{literal}
255 function loadMsgBox() {
256 if (cj('#mode').val() == 'Email' || cj('#mode').val() == 0){
260 else if (cj('#mode').val() == 'SMS'){
263 showSaveUpdateChkBox('SMS');
265 else if (cj('#mode').val() == 'User_Preference'){
268 showSaveUpdateChkBox('SMS');
278 <div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="bottom"}</div>