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. |
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">
53 var recipient_manual = '';
54 var recipient_manual_id = null;
55 var toDataUrl = "{/literal}{crmURL p='civicrm/ajax/checkemail' q='id=1&noemail=1' h=0 }{literal}"; {/literal}
58 {foreach from=$recipients key=id item=name}
59 {literal} recipient_manual += '{"name":"'+{/literal}"{$name}"{literal}+'","id":"'+{/literal}"{$id}"{literal}+'"},';{/literal}
61 {literal} eval( 'recipient_manual = [' + recipient_manual + ']'); {/literal}
65 if ( recipient_manual_id ) {
66 eval( 'recipient_manual = ' + recipient_manual_id );
69 cj(document).ready( function( ) {
73 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 var tokenDataUrl = "{/literal}{$tokenUrl}{literal}";
76 var hintText = "{/literal}{ts escape='js'}Type in a partial or complete name of an existing recipient.{/ts}{literal}";
77 cj( "#recipient_manual_id").tokenInput( tokenDataUrl, { prePopulate: recipient_manual, classes: tokenClass, hintText: hintText });
78 cj( 'ul.token-input-list-facebook, div.token-input-dropdown-facebook' ).css( 'width', '450px' );
81 <table class="form-layout-compressed">
82 <tr class="crm-scheduleReminder-form-block-title">
83 <td class="right">{$form.title.label}</td><td colspan="3">{$form.title.html}</td>
86 <td class="label">{$form.entity.label}</td>
87 <td>{$form.entity.html}</td>
89 <tr class="crm-scheduleReminder-form-block-when">
90 <td class="right">{$form.start_action_offset.label}</td>
91 <td colspan="3">{include file="CRM/common/jcalendar.tpl" elementName=absolute_date} <strong>{ts}OR{/ts}</strong><br /></td>
93 <tr id="relativeDate" class="crm-scheduleReminder-form-block-description">
94 <td class="right"></td>
95 <td colspan="3">{$form.start_action_offset.html} {$form.start_action_unit.html} {$form.start_action_condition.html} {$form.start_action_date.html}</td>
97 <tr id="recordActivity" class="crm-scheduleReminder-form-block-record_activity">
98 <td class="label" width="20%">{$form.record_activity.label}</td>
99 <td>{$form.record_activity.html}</td>
101 <tr id="relativeDateRepeat" class="crm-scheduleReminder-form-block-is_repeat"><td class="label" width="20%">{$form.is_repeat.label}</td>
102 <td>{$form.is_repeat.html} <span class="description">{ts}Enable repetition.{/ts}</span></td>
104 <tr id="repeatFields" class="crm-scheduleReminder-form-block-repeatFields">
107 <table class="form-layout-compressed">
108 <tr class="crm-scheduleReminder-form-block-repetition_frequency_interval">
109 <td class="label">{$form.repetition_frequency_interval.label} {$form.repetition_frequency_interval.html}</td>
110 <td>{$form.repetition_frequency_unit.html}</td>
112 <tr class="crm-scheduleReminder-form-block-repetition_frequency_interval">
113 <td class="label">{$form.end_frequency_interval.label} {$form.end_frequency_interval.html}
114 <td>{$form.end_frequency_unit.html} {$form.end_action.html} {$form.end_date.html}</td>
119 <tr class="crm-scheduleReminder-form-block-recipient">
120 <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>
122 <tr id="recipientList" class="crm-scheduleReminder-form-block-recipientListing">
123 <td class="right">{$form.recipient_listing.label}</td><td colspan="3">{$form.recipient_listing.html}</td>
125 <tr id="recipientManual" class="crm-scheduleReminder-form-block-recipient_manual_id">
126 <td class="label">{$form.recipient_manual_id.label}</td>
127 <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 id="recipientGroup" class="crm-scheduleReminder-form-block-recipient_group_id">
130 <td class="label">{$form.group_id.label}</td>
131 <td>{$form.group_id.html}</td>
135 <fieldset id="compose_id"><legend>{ts}Email{/ts}</legend>
136 <table id="email-field-table" class="form-layout-compressed">
137 <tr class="crm-scheduleReminder-form-block-active">
138 <td class="label"></td>
139 <td>{$form.is_active.html} {$form.is_active.label}</td>
141 <tr class="crm-scheduleReminder-form-block-template">
142 <td class="label">{$form.template.label}</td>
143 <td>{$form.template.html}</td>
145 <tr class="crm-scheduleReminder-form-block-subject">
146 <td class="label">{$form.subject.label}</td>
147 <td>{$form.subject.html}</td>
150 {include file="CRM/Contact/Form/Task/EmailCommon.tpl" upload=1 noAttach=1}
153 {include file="CRM/common/showHideByFieldValue.tpl"
154 trigger_field_id = "is_repeat"
155 trigger_value = "true"
156 target_element_id = "repeatFields"
157 target_element_type = "table-row"
162 {include file="CRM/common/showHideByFieldValue.tpl"
163 trigger_field_id ="recipient"
164 trigger_value = 'manual'
165 target_element_id ="recipientManual"
166 target_element_type ="table-row"
171 {include file="CRM/common/showHideByFieldValue.tpl"
172 trigger_field_id ="recipient"
173 trigger_value = 'group'
174 target_element_id ="recipientGroup"
175 target_element_type ="table-row"
181 <script type='text/javascript'>
184 cj('#recipient').click( function( ) {
189 function populateRecipient( ) {
190 var recipientMapping = eval({/literal}{$recipientMapping}{literal});
191 var recipient = cj("#recipient option:selected").val();
192 var postUrl = "{/literal}{crmURL p='civicrm/ajax/populateRecipient' h=0}{literal}";
193 if(recipientMapping[recipient] == 'Participant Status' || recipientMapping[recipient] == 'participant_role'){
194 var elementID = '#recipient_listing';
195 cj( elementID ).html('');
196 cj.post(postUrl, {recipient: recipientMapping[recipient]},
197 function ( response ) {
198 response = eval( response );
199 for (iota = 0; iota < response.length; iota++) {
200 cj( elementID ).get(0).add(new Option(response[iota].name, response[iota].value), document.all ? iota : null);
204 cj("#recipientList").show();
206 cj("#recipientList").hide();
210 cj('#absolute_date_display').click( function( ) {
211 if(cj('#absolute_date_display').val()) {
212 cj('#relativeDate').hide();
213 cj('#relativeDateRepeat').hide();
214 cj('#repeatFields').hide();
216 cj('#relativeDate').show();
217 cj('#relativeDateRepeat').show();
224 <div class="crm-submit-buttons">
225 {include file="CRM/common/formButtons.tpl" location="bottom"}</div>