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. |
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. |
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. |
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 +--------------------------------------------------------------------+
27 {* This template is used for adding/scheduling reminders. *}
28 <div class="crm-block crm-form-block crm-event-manage-scheduleReminder-form-block">
32 {include file="CRM/Admin/Page/Reminders.tpl"}
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>
41 <div class="crm-submit-buttons">
42 {include file="CRM/common/formButtons.tpl" location="top"}
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}
50 {* added onload javascript for source contact*}
52 <script type="text/javascript">
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}
59 {foreach from=$recipients key=id item=name}
60 {literal} recipient_manual += '{"name":"'+{/literal}"{$name}"{literal}+'","id":"'+{/literal}"{$id}"{literal}+'"},';{/literal}
62 {literal} eval( 'recipient_manual = [' + recipient_manual + ']'); {/literal}
66 if ( recipient_manual_id ) {
67 eval( 'recipient_manual = ' + recipient_manual_id );
70 cj(document).ready( function( ) {
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" } ');
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' );
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>
87 <td class="label">{$form.entity.label}</td>
88 <td>{$form.entity.html}</td>
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>
94 <tr id="relativeDate" class="crm-scheduleReminder-form-block-description">
95 <td class="right"></td>
96 <td colspan="3">{$form.start_action_offset.html} {$form.start_action_unit.html} {$form.start_action_condition.html} {$form.start_action_date.html}</td>
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>
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} <span class="description">{ts}Enable repetition.{/ts}</span></td>
105 <tr id="repeatFields" class="crm-scheduleReminder-form-block-repeatFields">
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} {$form.repetition_frequency_interval.html}</td>
111 <td>{$form.repetition_frequency_unit.html}</td>
113 <tr class="crm-scheduleReminder-form-block-repetition_frequency_interval">
114 <td class="label">{$form.end_frequency_interval.label} {$form.end_frequency_interval.html}
115 <td>{$form.end_frequency_unit.html} {$form.end_action.html} {$form.end_date.html}</td>
120 <tr class="crm-scheduleReminder-form-block-recipient">
121 <td class="right">{$form.recipient.label}</td><td colspan="3">{$form.limit_to.html} {$form.recipient.html} {help id="recipient" file="CRM/Admin/Page/ScheduleReminders.hlp" title=$form.recipient.label}</td>
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>
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>
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>
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} {$form.is_active.label}</td>
142 <tr class="crm-scheduleReminder-form-block-template">
143 <td class="label">{$form.template.label}</td>
144 <td>{$form.template.html}</td>
146 <tr class="crm-scheduleReminder-form-block-subject">
147 <td class="label">{$form.subject.label}</td>
148 <td>{$form.subject.html}</td>
151 {include file="CRM/Contact/Form/Task/EmailCommon.tpl" upload=1 noAttach=1}
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"
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"
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"
182 <script type='text/javascript'>
185 cj('#recipient').click( function( ) {
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);
205 cj("#recipientList").show();
207 cj("#recipientList").hide();
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();
217 cj('#relativeDate').show();
218 cj('#relativeDateRepeat').show();
225 <div class="crm-submit-buttons">
226 {include file="CRM/common/formButtons.tpl" location="bottom"}</div>