2 +--------------------------------------------------------------------+
3 | CiviCRM version 4.7 |
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 <div class="crm-block crm-form-block crm-contactEmail-form-block">
27 <div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="top"}</div>
28 {if $suppressedEmails > 0}
30 <p>{ts count=$suppressedEmails plural='Email will NOT be sent to %count contacts - (no email address on file, or communication preferences specify DO NOT EMAIL, or contact is deceased).'}Email will NOT be sent to %count contact - (no email address on file, or communication preferences specify DO NOT EMAIL, or contact is deceased).{/ts}</p>
33 <table class="form-layout-compressed">
34 <tr class="crm-contactEmail-form-block-fromEmailAddress">
35 <td class="label">{$form.fromEmailAddress.label}</td>
36 <td>{$form.fromEmailAddress.html} {help id="id-from_email" file="CRM/Contact/Form/Task/Email.hlp" isAdmin=$isAdmin}</td>
38 <tr class="crm-contactEmail-form-block-recipient">
39 <td class="label">{if $single eq false}{ts}Recipient(s){/ts}{else}{$form.to.label}{/if}</td>
41 {$form.to.html}{if $noEmails eq true} {$form.emailAddress.html}{/if}
44 <tr class="crm-contactEmail-form-block-cc_id" {if !$form.cc_id.value}style="display:none;"{/if}>
45 <td class="label">{$form.cc_id.label}</td>
48 <a class="crm-hover-button clear-cc-link" rel="cc_id" title="{ts}Clear{/ts}" href="#"><span class="icon ui-icon-close"></span></a>
51 <tr class="crm-contactEmail-form-block-bcc_id" {if !$form.bcc_id.value}style="display:none;"{/if}>
52 <td class="label">{$form.bcc_id.label}</td>
55 <a class="crm-hover-button clear-cc-link" rel="bcc_id" title="{ts}Clear{/ts}" href="#"><span class="icon ui-icon-close"></span></a>
62 <a href="#" rel="cc_id" class="add-cc-link crm-hover-button" {if $form.cc_id.value}style="display:none;"{/if}>{ts}Add CC{/ts}</a>
63 <a href="#" rel="bcc_id" class="add-cc-link crm-hover-button" {if $form.bcc_id.value}style="display:none;"{/if}>{ts}Add BCC{/ts}</a>
69 <tr class="crm-contactEmail-form-block-template">
70 <td class="label">{$form.template.label}</td>
71 <td>{$form.template.html}</td>
74 <tr class="crm-contactEmail-form-block-subject">
75 <td class="label">{$form.subject.label}</td>
77 {$form.subject.html|crmAddClass:huge}
78 <input class="crm-token-selector big" data-field="subject" />
79 {help id="id-token-subject" tplFile=$tplFile isAdmin=$isAdmin file="CRM/Contact/Form/Task/Email.hlp"}
84 {include file="CRM/Contact/Form/Task/EmailCommon.tpl"}
86 <div class="spacer"> </div>
89 {include file="CRM/Contact/Form/Task.tpl"}
91 {if $suppressedEmails > 0}
92 {ts count=$suppressedEmails plural='Email will NOT be sent to %count contacts.'}Email will NOT be sent to %count contact.{/ts}
94 <div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="bottom"}</div>
96 <script type="text/javascript">
100 var $form = $("form.{/literal}{$form.formClass}{literal}");
102 $('.add-cc-link', $form).click(function(e) {
104 var type = $(this).attr('rel');
106 $('.crm-contactEmail-form-block-'+type, $form).show();
109 $('.clear-cc-link', $form).click(function(e) {
111 var type = $(this).attr('rel');
112 $('.add-cc-link[rel='+type+']', $form).show();
113 $('.crm-contactEmail-form-block-'+type, $form).hide().find('input.crm-ajax-select').select2('data', []);
116 var sourceDataUrl = "{/literal}{crmURL p='civicrm/ajax/checkemail' q='id=1' h=0 }{literal}";
118 function emailSelect(el, prepopulate) {
119 $(el, $form).data('api-entity', 'contact').css({width: '40em', 'max-width': '90%'}).crmSelect2({
120 minimumInputLength: 1,
124 data: function(term) {
129 results: function(response) {
135 }).select2('data', prepopulate);
139 var toContact = {if $toContact}{$toContact}{else}''{/if},
140 ccContact = {if $ccContact}{$ccContact}{else}''{/if},
141 bccContact = {if $bccContact}{$bccContact}{else}''{/if};
143 emailSelect('#to', toContact);
144 emailSelect('#cc_id', ccContact);
145 emailSelect('#bcc_id', bccContact);