Merge remote-tracking branch 'upstream/4.4' into 4.4-master-2014-08-04-22-25-32
[civicrm-core.git] / templates / CRM / Event / Form / ManageEvent / ScheduleReminders.tpl
1 {*
2 +--------------------------------------------------------------------+
3 | CiviCRM version 4.5 |
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 <table class="form-layout-compressed">
51 <tr class="crm-scheduleReminder-form-block-title">
52 <td class="right">{$form.title.label}</td><td colspan="3">{$form.title.html}</td>
53 </tr>
54 <tr>
55 <td class="label">{$form.entity.label}</td>
56 <td>{$form.entity.html}</td>
57 </tr>
58 <tr class="crm-scheduleReminder-form-block-when">
59 <td class="right">{$form.start_action_offset.label}</td>
60 <td colspan="3">{include file="CRM/common/jcalendar.tpl" elementName=absolute_date} <strong>{ts}OR{/ts}</strong><br /></td>
61 </tr>
62 <tr id="relativeDate" class="crm-scheduleReminder-form-block-description">
63 <td class="right"></td>
64 <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>
65 </tr>
66 <tr id="recordActivity" class="crm-scheduleReminder-form-block-record_activity">
67 <td class="label" width="20%">{$form.record_activity.label}</td>
68 <td>{$form.record_activity.html}</td>
69 </tr>
70 <tr id="relativeDateRepeat" class="crm-scheduleReminder-form-block-is_repeat"><td class="label" width="20%">{$form.is_repeat.label}</td>
71 <td>{$form.is_repeat.html}&nbsp;&nbsp;<span class="description">{ts}Enable repetition.{/ts}</span></td>
72 </tr>
73 <tr id="repeatFields" class="crm-scheduleReminder-form-block-repeatFields">
74 <td></td>
75 <td>
76 <table class="form-layout-compressed">
77 <tr class="crm-scheduleReminder-form-block-repetition_frequency_interval">
78 <td class="label">{$form.repetition_frequency_interval.label}&nbsp;&nbsp;&nbsp;{$form.repetition_frequency_interval.html}</td>
79 <td>{$form.repetition_frequency_unit.html}</td>
80 </tr>
81 <tr class="crm-scheduleReminder-form-block-repetition_frequency_interval">
82 <td class="label">{$form.end_frequency_interval.label}&nbsp;&nbsp;&nbsp;{$form.end_frequency_interval.html}
83 <td>{$form.end_frequency_unit.html}&nbsp;&nbsp;&nbsp;{$form.end_action.html}&nbsp;&nbsp;&nbsp;{$form.end_date.html}</td>
84 </tr>
85 </table>
86 </td>
87 </tr>
88 <tr class="crm-scheduleReminder-form-block-recipient">
89 <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>
90 </tr>
91 <tr id="recipientList" class="crm-scheduleReminder-form-block-recipientListing">
92 <td class="right">{$form.recipient_listing.label}</td><td colspan="3">{$form.recipient_listing.html}</td>
93 </tr>
94 <tr id="recipientManual" class="crm-scheduleReminder-form-block-recipient_manual_id">
95 <td class="label">{$form.recipient_manual_id.label}</td>
96 <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>
97 </tr>
98 <tr id="recipientGroup" class="crm-scheduleReminder-form-block-recipient_group_id">
99 <td class="label">{$form.group_id.label}</td>
100 <td>{$form.group_id.html}</td>
101 </tr>
102
103 </table>
104 <fieldset id="compose_id"><legend>{ts}Email{/ts}</legend>
105 <table id="email-field-table" class="form-layout-compressed">
106 <tr class="crm-scheduleReminder-form-block-active">
107 <td class="label"></td>
108 <td>{$form.is_active.html}&nbsp;{$form.is_active.label}</td>
109 </tr>
110 <tr class="crm-scheduleReminder-form-block-template">
111 <td class="label">{$form.template.label}</td>
112 <td>{$form.template.html}</td>
113 </tr>
114 <tr class="crm-scheduleReminder-form-block-subject">
115 <td class="label">{$form.subject.label}</td>
116 <td>{$form.subject.html}</td>
117 </tr>
118 </table>
119 {include file="CRM/Contact/Form/Task/EmailCommon.tpl" upload=1 noAttach=1}
120 </fieldset>
121
122 {include file="CRM/common/showHideByFieldValue.tpl"
123 trigger_field_id = "is_repeat"
124 trigger_value = "true"
125 target_element_id = "repeatFields"
126 target_element_type = "table-row"
127 field_type = "radio"
128 invert = "false"
129 }
130
131 {include file="CRM/common/showHideByFieldValue.tpl"
132 trigger_field_id ="recipient"
133 trigger_value = 'manual'
134 target_element_id ="recipientManual"
135 target_element_type ="table-row"
136 field_type ="select"
137 invert = 0
138 }
139
140 {include file="CRM/common/showHideByFieldValue.tpl"
141 trigger_field_id ="recipient"
142 trigger_value = 'group'
143 target_element_id ="recipientGroup"
144 target_element_type ="table-row"
145 field_type ="select"
146 invert = 0
147 }
148
149 {literal}
150 <script type='text/javascript'>
151 CRM.$(function($) {
152 populateRecipient();
153 cj('#recipient').click( function( ) {
154 populateRecipient();
155 });
156 });
157
158 function populateRecipient( ) {
159 var recipientMapping = eval({/literal}{$recipientMapping}{literal});
160 var recipient = cj("#recipient option:selected").val();
161 var postUrl = "{/literal}{crmURL p='civicrm/ajax/populateRecipient' h=0}{literal}";
162 if(recipientMapping[recipient] == 'Participant Status' || recipientMapping[recipient] == 'participant_role'){
163 var elementID = '#recipient_listing';
164 cj( elementID ).html('');
165 cj.post(postUrl, {recipient: recipientMapping[recipient]},
166 function ( response ) {
167 response = eval( response );
168 for (iota = 0; iota < response.length; iota++) {
169 cj( elementID ).get(0).add(new Option(response[iota].name, response[iota].value), document.all ? iota : null);
170 }
171 }
172 );
173 cj("#recipientList").show();
174 } else {
175 cj("#recipientList").hide();
176 }
177 }
178
179 cj('#absolute_date_display').click( function( ) {
180 if(cj('#absolute_date_display').val()) {
181 cj('#relativeDate').hide();
182 cj('#relativeDateRepeat').hide();
183 cj('#repeatFields').hide();
184 } else {
185 cj('#relativeDate').show();
186 cj('#relativeDateRepeat').show();
187 }
188 });
189
190 </script>
191 {/literal}
192 {/if}
193 <div class="crm-submit-buttons">
194 {include file="CRM/common/formButtons.tpl" location="bottom"}</div>
195 </div>
196 {/if}