CRM-13966 - Remove another unused autocomplete
[civicrm-core.git] / templates / CRM / Event / Form / ManageEvent / ScheduleReminders.tpl
1 {*
2 +--------------------------------------------------------------------+
3 | CiviCRM version 4.4 |
4 +--------------------------------------------------------------------+
5 | Copyright (C) 2011 Marty Wright |
6 | Licensed to CiviCRM under the Academic Free License version 3.0. |
7 +--------------------------------------------------------------------+
8 | This file is a part of CiviCRM. |
9 | |
10 | CiviCRM is free software; you can copy, modify, and distribute it |
11 | under the terms of the GNU Affero General Public License |
12 | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
13 | |
14 | CiviCRM is distributed in the hope that it will be useful, but |
15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
17 | See the GNU Affero General Public License for more details. |
18 | |
19 | You should have received a copy of the GNU Affero General Public |
20 | License and the CiviCRM Licensing Exception along |
21 | with this program; if not, contact CiviCRM LLC |
22 | at info[AT]civicrm[DOT]org. If you have questions about the |
23 | GNU Affero General Public License or the licensing of CiviCRM, |
24 | see the CiviCRM license FAQ at http://civicrm.org/licensing |
25 +--------------------------------------------------------------------+
26 *}
27 {* This template is used for adding/scheduling reminders. *}
28 <div class="crm-block crm-form-block crm-event-manage-scheduleReminder-form-block">
29
30 {if $rows}
31 <div id="reminder">
32 {include file="CRM/Admin/Page/Reminders.tpl"}
33
34 <div class="action-link">
35 <a href="{crmURL q="action=update&reset=1&id=$eventId&new=1"}" id="newScheduleReminder" class="button"><span><div class="icon add-icon"></div>{ts}Add Reminder{/ts}</span></a>
36 </div>
37 </div>
38
39 {else}
40
41 <div class="crm-submit-buttons">
42 {include file="CRM/common/formButtons.tpl" location="top"}
43 </div>
44 {if $action eq 8}
45 <div class="messages status no-popup">
46 <div class="icon inform-icon"></div>
47 {ts 1=$reminderName}WARNING: You are about to delete the Reminder titled <strong>%1</strong>.{/ts} {ts}Do you want to continue?{/ts}
48 </div>
49 {else}
50 {* added onload javascript for source contact*}
51 {literal}
52 <script type="text/javascript">
53 cj().crmAccordions();
54 var recipient_manual = '';
55 var recipient_manual_id = null;
56 var toDataUrl = "{/literal}{crmURL p='civicrm/ajax/checkemail' q='id=1&noemail=1' h=0 }{literal}"; {/literal}
57
58 {if $recipients}
59 {foreach from=$recipients key=id item=name}
60 {literal} recipient_manual += '{"name":"'+{/literal}"{$name}"{literal}+'","id":"'+{/literal}"{$id}"{literal}+'"},';{/literal}
61 {/foreach}
62 {literal} eval( 'recipient_manual = [' + recipient_manual + ']'); {/literal}
63 {/if}
64
65 {literal}
66 if ( recipient_manual_id ) {
67 eval( 'recipient_manual = ' + recipient_manual_id );
68 }
69
70 cj(document).ready( function( ) {
71 {/literal}
72 {literal}
73
74 eval( 'tokenClass = { tokenList: "token-input-list-facebook", token: "token-input-token-facebook", tokenDelete: "token-input-delete-token-facebook", selectedToken: "token-input-selected-token-facebook", highlightedToken: "token-input-highlighted-token-facebook", dropdown: "token-input-dropdown-facebook", dropdownItem: "token-input-dropdown-item-facebook", dropdownItem2: "token-input-dropdown-item2-facebook", selectedDropdownItem: "token-input-selected-dropdown-item-facebook", inputToken: "token-input-input-token-facebook" } ');
75
76 var tokenDataUrl = "{/literal}{$tokenUrl}{literal}";
77 var hintText = "{/literal}{ts escape='js'}Type in a partial or complete name of an existing recipient.{/ts}{literal}";
78 cj( "#recipient_manual_id").tokenInput( tokenDataUrl, { prePopulate: recipient_manual, classes: tokenClass, hintText: hintText });
79 cj( 'ul.token-input-list-facebook, div.token-input-dropdown-facebook' ).css( 'width', '450px' );
80 </script>
81 {/literal}
82 <table class="form-layout-compressed">
83 <tr class="crm-scheduleReminder-form-block-title">
84 <td class="right">{$form.title.label}</td><td colspan="3">{$form.title.html}</td>
85 </tr>
86 <tr>
87 <td class="label">{$form.entity.label}</td>
88 <td>{$form.entity.html}</td>
89 </tr>
90 <tr class="crm-scheduleReminder-form-block-when">
91 <td class="right">{$form.start_action_offset.label}</td>
92 <td colspan="3">{include file="CRM/common/jcalendar.tpl" elementName=absolute_date} <strong>{ts}OR{/ts}</strong><br /></td>
93 </tr>
94 <tr id="relativeDate" class="crm-scheduleReminder-form-block-description">
95 <td class="right"></td>
96 <td colspan="3">{$form.start_action_offset.html}&nbsp;&nbsp;&nbsp;{$form.start_action_unit.html}&nbsp;&nbsp;&nbsp;{$form.start_action_condition.html}&nbsp;&nbsp;&nbsp;{$form.start_action_date.html}</td>
97 </tr>
98 <tr id="recordActivity" class="crm-scheduleReminder-form-block-record_activity">
99 <td class="label" width="20%">{$form.record_activity.label}</td>
100 <td>{$form.record_activity.html}</td>
101 </tr>
102 <tr id="relativeDateRepeat" class="crm-scheduleReminder-form-block-is_repeat"><td class="label" width="20%">{$form.is_repeat.label}</td>
103 <td>{$form.is_repeat.html}&nbsp;&nbsp;<span class="description">{ts}Enable repetition.{/ts}</span></td>
104 </tr>
105 <tr id="repeatFields" class="crm-scheduleReminder-form-block-repeatFields">
106 <td></td>
107 <td>
108 <table class="form-layout-compressed">
109 <tr class="crm-scheduleReminder-form-block-repetition_frequency_interval">
110 <td class="label">{$form.repetition_frequency_interval.label}&nbsp;&nbsp;&nbsp;{$form.repetition_frequency_interval.html}</td>
111 <td>{$form.repetition_frequency_unit.html}</td>
112 </tr>
113 <tr class="crm-scheduleReminder-form-block-repetition_frequency_interval">
114 <td class="label">{$form.end_frequency_interval.label}&nbsp;&nbsp;&nbsp;{$form.end_frequency_interval.html}
115 <td>{$form.end_frequency_unit.html}&nbsp;&nbsp;&nbsp;{$form.end_action.html}&nbsp;&nbsp;&nbsp;{$form.end_date.html}</td>
116 </tr>
117 </table>
118 </td>
119 </tr>
120 <tr class="crm-scheduleReminder-form-block-recipient">
121 <td class="right">{$form.recipient.label}</td><td colspan="3">{$form.limit_to.html}&nbsp;&nbsp;{$form.recipient.html}&nbsp;&nbsp;{help id="recipient" file="CRM/Admin/Page/ScheduleReminders.hlp" title=$form.recipient.label}</td>
122 </tr>
123 <tr id="recipientList" class="crm-scheduleReminder-form-block-recipientListing">
124 <td class="right">{$form.recipient_listing.label}</td><td colspan="3">{$form.recipient_listing.html}</td>
125 </tr>
126 <tr id="recipientManual" class="crm-scheduleReminder-form-block-recipient_manual_id">
127 <td class="label">{$form.recipient_manual_id.label}</td>
128 <td>{$form.recipient_manual_id.html}{edit}<span class="description">{ts}You can manually send out the reminders to these recipients.{/ts}</span>{/edit}</td>
129 </tr>
130 <tr id="recipientGroup" class="crm-scheduleReminder-form-block-recipient_group_id">
131 <td class="label">{$form.group_id.label}</td>
132 <td>{$form.group_id.html}</td>
133 </tr>
134
135 </table>
136 <fieldset id="compose_id"><legend>{ts}Email{/ts}</legend>
137 <table id="email-field-table" class="form-layout-compressed">
138 <tr class="crm-scheduleReminder-form-block-active">
139 <td class="label"></td>
140 <td>{$form.is_active.html}&nbsp;{$form.is_active.label}</td>
141 </tr>
142 <tr class="crm-scheduleReminder-form-block-template">
143 <td class="label">{$form.template.label}</td>
144 <td>{$form.template.html}</td>
145 </tr>
146 <tr class="crm-scheduleReminder-form-block-subject">
147 <td class="label">{$form.subject.label}</td>
148 <td>{$form.subject.html}</td>
149 </tr>
150 </table>
151 {include file="CRM/Contact/Form/Task/EmailCommon.tpl" upload=1 noAttach=1}
152 </fieldset>
153
154 {include file="CRM/common/showHideByFieldValue.tpl"
155 trigger_field_id = "is_repeat"
156 trigger_value = "true"
157 target_element_id = "repeatFields"
158 target_element_type = "table-row"
159 field_type = "radio"
160 invert = "false"
161 }
162
163 {include file="CRM/common/showHideByFieldValue.tpl"
164 trigger_field_id ="recipient"
165 trigger_value = 'manual'
166 target_element_id ="recipientManual"
167 target_element_type ="table-row"
168 field_type ="select"
169 invert = 0
170 }
171
172 {include file="CRM/common/showHideByFieldValue.tpl"
173 trigger_field_id ="recipient"
174 trigger_value = 'group'
175 target_element_id ="recipientGroup"
176 target_element_type ="table-row"
177 field_type ="select"
178 invert = 0
179 }
180
181 {literal}
182 <script type='text/javascript'>
183 cj(function() {
184 populateRecipient();
185 cj('#recipient').click( function( ) {
186 populateRecipient();
187 });
188 });
189
190 function populateRecipient( ) {
191 var recipientMapping = eval({/literal}{$recipientMapping}{literal});
192 var recipient = cj("#recipient option:selected").val();
193 var postUrl = "{/literal}{crmURL p='civicrm/ajax/populateRecipient' h=0}{literal}";
194 if(recipientMapping[recipient] == 'Participant Status' || recipientMapping[recipient] == 'participant_role'){
195 var elementID = '#recipient_listing';
196 cj( elementID ).html('');
197 cj.post(postUrl, {recipient: recipientMapping[recipient]},
198 function ( response ) {
199 response = eval( response );
200 for (iota = 0; iota < response.length; iota++) {
201 cj( elementID ).get(0).add(new Option(response[iota].name, response[iota].value), document.all ? iota : null);
202 }
203 }
204 );
205 cj("#recipientList").show();
206 } else {
207 cj("#recipientList").hide();
208 }
209 }
210
211 cj('#absolute_date_display').click( function( ) {
212 if(cj('#absolute_date_display').val()) {
213 cj('#relativeDate').hide();
214 cj('#relativeDateRepeat').hide();
215 cj('#repeatFields').hide();
216 } else {
217 cj('#relativeDate').show();
218 cj('#relativeDateRepeat').show();
219 }
220 });
221
222 </script>
223 {/literal}
224 {/if}
225 <div class="crm-submit-buttons">
226 {include file="CRM/common/formButtons.tpl" location="bottom"}</div>
227 </div>
228 {/if}