CRM-14258 - Use select2 for inserting tokens
[civicrm-core.git] / templates / CRM / Contact / Form / Task / Email.tpl
CommitLineData
6a488035
TO
1{*
2 +--------------------------------------------------------------------+
232624b1 3 | CiviCRM version 4.4 |
6a488035
TO
4 +--------------------------------------------------------------------+
5 | Copyright CiviCRM LLC (c) 2004-2013 |
6 +--------------------------------------------------------------------+
7 | This file is a part of CiviCRM. |
8 | |
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. |
12 | |
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. |
17 | |
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 +--------------------------------------------------------------------+
25*}
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}
29 <div class="status">
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>
31 </div>
32{/if}
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>
37 </tr>
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>
40 <td>{$form.to.html}{if $noEmails eq true}&nbsp;&nbsp;{$form.emailAddress.html}{/if}
41 <div class="spacer"></div>
42 <span class="bold"><a href="#" id="addcc">{ts}Add CC{/ts}</a>&nbsp;&nbsp;|&nbsp;&nbsp;<a href="#" id="addbcc">{ts}Add BCC{/ts}</a></span>
43 </td>
44 </tr>
45 <tr class="crm-contactEmail-form-block-cc_id" id="cc" {if ! $form.cc_id.value}style="display:none;"{/if}>
46 <td class="label">{$form.cc_id.label}</td><td>{$form.cc_id.html}</td>
47 </tr>
48 <tr class="crm-contactEmail-form-block-bcc_id" id="bcc" {if ! $form.bcc_id.value}style="display:none;"{/if}>
49 <td class="label">{$form.bcc_id.label}</td><td>{$form.bcc_id.html}</td>
50 </tr>
51
52{if $emailTask}
53 <tr class="crm-contactEmail-form-block-template">
54 <td class="label">{$form.template.label}</td>
55 <td>{$form.template.html}</td>
56 </tr>
57{/if}
58 <tr class="crm-contactEmail-form-block-subject">
59 <td class="label">{$form.subject.label}</td>
ac0a3db5
CW
60 <td>
61 {$form.subject.html|crmAddClass:huge}&nbsp;
62 <input class="crm-token-selector big" data-field="subject" />
63 {help id="id-token-subject" tplFile=$tplFile isAdmin=$isAdmin file="CRM/Contact/Form/Task/Email.hlp"}
6a488035
TO
64 </td>
65 </tr>
66</table>
67
68{include file="CRM/Contact/Form/Task/EmailCommon.tpl"}
69
70<div class="spacer"> </div>
71
72{if $single eq false}
73 {include file="CRM/Contact/Form/Task.tpl"}
74{/if}
75{if $suppressedEmails > 0}
76 {ts count=$suppressedEmails plural='Email will NOT be sent to %count contacts.'}Email will NOT be sent to %count contact.{/ts}
77{/if}
78<div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="bottom"}</div>
79</div>
80<script type="text/javascript">
81var toContact = ccContact = bccContact = '';
82
83{if $toContact}
84 toContact = {$toContact};
85{/if}
86
87{if $ccContact}
88 ccContact = {$ccContact};
89{/if}
90
91{if $bccContact}
92 bccContact = {$bccContact};
93{/if}
94
95{literal}
96cj('#addcc').toggle( function() { cj(this).text('Remove CC');
97 cj('tr#cc').show().find('ul').find('input').focus();
98 },function() { cj(this).text('Add CC');cj('#cc_id').val('');
99 cj('tr#cc ul li:not(:last)').remove();cj('#cc').hide();
100});
101cj('#addbcc').toggle( function() { cj(this).text('Remove BCC');
102 cj('tr#bcc').show().find('ul').find('input').focus();
103 },function() { cj(this).text('Add BCC');cj('#bcc_id').val('');
104 cj('tr#bcc ul li:not(:last)').remove();cj('#bcc').hide();
105});
106
107var hintText = "{/literal}{ts escape='js'}Type in a partial or complete name or email address of an existing contact.{/ts}{literal}";
3f77636a 108var sourceDataUrl = "{/literal}{crmURL p='civicrm/ajax/checkemail' q='id=1' h=0 }{literal}";
6a488035
TO
109var toDataUrl = "{/literal}{crmURL p='civicrm/ajax/checkemail' q='id=1' h=0 }{literal}";
110
111cj( "#to" ).tokenInput( toDataUrl, { prePopulate: toContact, theme: 'facebook', hintText: hintText });
112cj( "#cc_id" ).tokenInput( sourceDataUrl, { prePopulate: ccContact, theme: 'facebook', hintText: hintText });
113cj( "#bcc_id" ).tokenInput( sourceDataUrl, { prePopulate: bccContact, theme: 'facebook', hintText: hintText });
114cj( 'ul.token-input-list-facebook, div.token-input-dropdown-facebook' ).css( 'width', '450px' );
115</script>
116{/literal}
117{include file="CRM/common/formNavigate.tpl"}