Merge pull request #13237 from MegaphoneJon/core-571
[civicrm-core.git] / templates / CRM / Contribute / Form / Task / Invoice.tpl
1 {*
2 +--------------------------------------------------------------------+
3 | CiviCRM version 5 |
4 +--------------------------------------------------------------------+
5 | Copyright CiviCRM LLC (c) 2004-2019 |
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="messages status no-popup">
27 <div class="icon inform-icon"></div>
28 {include file="CRM/Contribute/Form/Task.tpl"}
29 </div>
30 {if $selectedOutput ne 'email'}
31 <div class="help">
32 {ts}You may choose to email invoice to contributors OR download a PDF file containing one invoice per page to your local computer by clicking <strong>Process Invoice(s)</strong> . Your browser may display the file for you automatically, or you may need to open it for printing using any PDF reader (such as Adobe&reg; Reader).{/ts}
33 </div>
34 {/if}
35
36 <table class="form-layout-compressed">
37 {if $selectedOutput ne 'email'}
38 <tr>
39 <td class="label">{$form.output.email_invoice.label}</td>
40 <td>{$form.output.email_invoice.html}</td>
41 </tr>
42 {/if}
43 <tr id="selectEmailFrom" style="display: none" class="crm-contactEmail-form-block-fromEmailAddress crm-email-element">
44 <td class="label">{$form.from_email_address.label}</td>
45 <td>{$form.from_email_address.html} {help id="id-from_email" file="CRM/Contact/Form/Task/Email.hlp" isAdmin=$isAdmin}</td>
46 </tr>
47 <tr class="crm-email-element">
48 <td class="label">{$form.email_comment.label}</td>
49 <td>{$form.email_comment.html}</td>
50 </tr>
51 {if $selectedOutput ne 'email'}
52 <tr>
53 <td class="label">{$form.output.pdf_invoice.label}</td>
54 <td>{$form.output.pdf_invoice.html}</td>
55 </tr>
56 {/if}
57 <tr class="crm-pdf-element">
58 <td class="label">{$form.pdf_format_id.label}</td>
59 <td>{$form.pdf_format_id.html}</td>
60 </tr>
61 </table>
62
63 <div class="spacer"></div>
64 <div class="crm-submit-buttons">
65 {$form.buttons.html}
66 </div>
67
68
69 <script type="text/javascript">
70 {literal}
71 CRM.$(function ($) {
72 var o = $('input[name="output"]');
73 if (o.length > 1) {
74 $('.crm-email-element').hide();
75 showhideEmailElements();
76 o.on('click', showhideEmailElements);
77 }
78 else {
79 $('.crm-email-element').show();
80 }
81
82 function showhideEmailElements() {
83 if ($('input[name="output"]:checked').val() == 'email_invoice') {
84 $('.crm-email-element').show();
85 $('.crm-pdf-element').hide();
86 }
87 else {
88 $('.crm-pdf-element').show();
89 $('.crm-email-element').hide();
90 }
91 }
92 });
93 {/literal}
94 </script>
95