CRM-13863 - Whitelist open-inline contribution links
[civicrm-core.git] / templates / CRM / Contribute / Form / AdditionalPayment.tpl
1 {*
2 +--------------------------------------------------------------------+
3 | CiviCRM version 4.4 |
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 {if $transaction}
27 {if !empty($rows)}
28 <table id='info'>
29 <tr class="columnheader">
30 <th>{ts}Amount{/ts}</th>
31 <th>{ts}Type{/ts}</th>
32 <th>{ts}Paid By{/ts}</th>
33 <th>{ts}Received{/ts}</th>
34 <th>{ts}Transaction ID{/ts}</th>
35 <th>{ts}Status{/ts}</th>
36 </tr>
37 {foreach from=$rows item=row}
38 <tr>
39 <td>{$row.total_amount|crmMoney}</td>
40 <td>{$row.financial_type}</td>
41 <td>{$row.payment_instrument}{if $row.check_number} (#{$row.check_number}){/if}</td>
42 <td>{$row.receive_date|crmDate}</td>
43 <td>{$row.trxn_id}</td>
44 <td>{$row.status}</td>
45 </tr>
46 {/foreach}
47 <table>
48 {else}
49 {if $component eq 'event'}
50 {assign var='entity' value='participant'}
51 {else}
52 {assign var='entity' value=$component}
53 {/if}
54 {ts 1=$entity}No additional payments found for this %1 record{/ts}
55 {/if}
56 <div class="crm-submit-buttons">
57 {include file="CRM/common/formButtons.tpl"}
58 </div>
59 {elseif $formType}
60 {include file="CRM/Contribute/Form/AdditionalInfo/$formType.tpl"}
61 {else}
62
63 {if $paymentType eq 'refund'}
64 <h3>{ts}New Event Refund{/ts}</h3>
65 {else}
66 <h3>{if $component eq 'event'}{if $contributionMode}{ts}Credit Card Event Payment{/ts}{else}{ts}New Event Payment{/ts}{/if}{/if}</h3>
67 {/if}
68 <div class="crm-block crm-form-block crm-payment-form-block">
69
70 {if $contributionMode == 'test'}
71 {assign var=contribMode value="TEST"}
72 {elseif $contributionMode == 'live'}
73 {assign var=contribMode value="LIVE"}
74 {/if}
75
76 {if !$email}
77 <div class="messages status no-popup">
78 <div class="icon inform-icon"></div>&nbsp;{ts}You will not be able to send an automatic email receipt for this payment because there is no email address recorded for this contact. If you want a receipt to be sent when this payment is recorded, click Cancel and then click Edit from the Summary tab to add an email address before recording the payment.{/ts}
79 </div>
80 {/if}
81 <div class="crm-submit-buttons">
82 {include file="CRM/common/formButtons.tpl"}
83 {if $newCredit AND $contributionMode EQ null}
84 {if $contactId}
85 {capture assign=ccModeLink}{crmURL p='civicrm/payment/add' q="reset=1&action=add&cid=`$contactId`&id=`$id`&component=`$component`&mode=live"}{/capture}
86 {/if}
87 {if $paymentType eq 'owed'}
88 <span class="action-link crm-link-credit-card-mode">&nbsp;<a class="open-inline crm-hover-button" href="{$ccModeLink}">&raquo; {ts}submit credit card payment{/ts}</a></span>
89 {/if}
90 {/if}
91 </div>
92 <table class="form-layout-compressed">
93 <tr>
94 <td class="font-size12pt label"><strong>{ts}Participant{/ts}</strong></td><td class="font-size12pt"><strong>{$displayName}</strong></td>
95 </tr>
96 {if $contributionMode}
97 <tr class="crm-payment-form-block-payment_processor_id"><td class="label nowrap">{$form.payment_processor_id.label}<span class="marker"> * </span></td><td>{$form.payment_processor_id.html}</td></tr>
98 {/if}
99 <tr>
100 <td class='label'>{ts}Event{/ts}</td><td>{$eventName}</td>
101 </tr>
102 <tr class="crm-payment-form-block-total_amount">
103 <td class="label">{$form.total_amount.label}</td>
104 <td>
105 <span id='totalAmount'>{$form.currency.html|crmAddClass:eight}&nbsp;{$form.total_amount.html|crmAddClass:eight}</span>&nbsp; <span class="status">{if $paymentType EQ 'refund'}{ts}Refund Due{/ts}{else}{ts}Balance Owed{/ts}{/if}:&nbsp;{$paymentAmt|crmMoney}</span>
106 </td>
107 </tr>
108 </table>
109 <div class="crm-accordion-wrapper crm-accordion_title-accordion crm-accordion-processed" id="paymentDetails_Information">
110 <div class="crm-accordion-header">
111 {if $paymentType EQ 'refund'}{ts}Refund Details{/ts}{else}{ts}Payment Details{/ts}{/if}
112 </div>
113 <div class="crm-accordion-body">
114 <table class="form-layout-compressed" >
115 <tr class="crm-payment-form-block-trxn_date">
116 <td class="label">{$form.trxn_date.label}</td>
117 <td {$valueStyle}>{include file="CRM/common/jcalendar.tpl" elementName=trxn_date}<br />
118 <span class="description">{ts}The date this payment was received.{/ts}</span>
119 </td>
120 </tr>
121 <tr class="crm-payment-form-block-payment_instrument_id">
122 <td class="label">{$form.payment_instrument_id.label}</td>
123 <td {$valueStyle}>{$form.payment_instrument_id.html} {help id="payment_instrument_id"}</td>
124 </td>
125 </tr>
126 {if $showCheckNumber || !$isOnline}
127 <tr id="checkNumber" class="crm-payment-form-block-check_number">
128 <td class="label">{$form.check_number.label}</td>
129 <td>{$form.check_number.html|crmReplace:class:six}</td>
130 </tr>
131 {/if}
132 <tr class="crm-payment-form-block-trxn_id">
133 <td class="label">{$form.trxn_id.label}</td>
134 <td {$valueStyle}>{$form.trxn_id.html|crmReplace:class:twelve} {help id="id-trans_id"}</td>
135 </tr>
136 {if $email and $outBound_option != 2}
137 <tr class="crm-payment-form-block-is_email_receipt">
138 <td class="label">
139 {$form.is_email_receipt.label}</td><td>{$form.is_email_receipt.html}&nbsp;
140 <span class="description">{ts 1=$email}Automatically email a receipt to %1?{/ts}</span>
141 </td>
142 </tr>
143 {/if}
144 <tr id="fromEmail" class="crm-payment-form-block-receipt_date" style="display:none;">
145 <td class="label">{$form.from_email_address.label}</td>
146 <td>{$form.from_email_address.html}</td>
147 </tr>
148 <tr id='notice' class="crm-event-eventfees-form-block-receipt_text">
149 <td class="label">{$form.receipt_text.label}</td>
150 <td><span class="description">
151 {ts}Enter a message you want included at the beginning of the confirmation email.{/ts}
152 </span><br />
153 {$form.receipt_text.html|crmAddClass:huge}
154 </td>
155 </tr>
156 <tr class="crm-payment-form-block-fee_amount"><td class="label">{$form.fee_amount.label}</td><td{$valueStyle}>{$form.fee_amount.html|crmMoney:$currency:'XXX':'YYY'}<br />
157 <span class="description">{ts}Processing fee for this transaction (if applicable).{/ts}</span></td></tr>
158 <tr class="crm-payment-form-block-net_amount"><td class="label">{$form.net_amount.label}</td><td{$valueStyle}>{$form.net_amount.html|crmMoney:$currency:'':1}<br />
159 <span class="description">{ts}Net value of the payment (Total Amount minus Fee).{/ts}</span></td></tr>
160 </table>
161 </div>
162 </div>
163
164 <div class="accordion ui-accordion ui-widget ui-helper-reset">
165 {* Additional Detail / Honoree Information / Premium Information *}
166 {foreach from=$allPanes key=paneName item=paneValue}
167
168 <div class="crm-accordion-wrapper crm-ajax-accordion crm-{$paneValue.id}-accordion {if $paneValue.open neq 'true'}collapsed{/if}">
169 <div class="crm-accordion-header" id="{$paneValue.id}">
170
171 {$paneName}
172 </div><!-- /.crm-accordion-header -->
173 <div class="crm-accordion-body">
174
175 <div class="{$paneValue.id}"></div>
176 </div><!-- /.crm-accordion-body -->
177 </div><!-- /.crm-accordion-wrapper -->
178
179 {/foreach}
180 </div>
181
182
183
184 {literal}
185 <script type="text/javascript">
186
187 var url = "{/literal}{$dataUrl}{literal}";
188
189 cj( function( ) {
190 showHideByValue( 'is_email_receipt', '', 'notice', 'table-row', 'radio', false );
191 showHideByValue( 'is_email_receipt', '', 'fromEmail', 'table-row', 'radio', false );
192 });
193 {/literal}
194 </script>
195
196 <br />
197 <div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="bottom"}</div>
198 </div>
199 {literal}
200 <script type="text/javascript">
201 function verify( ) {
202 if (cj('#is_email_receipt').attr( 'checked' )) {
203 var ok = confirm( '{/literal}{ts escape='js'}Click OK to save this payment record AND send a receipt to the contributor now{/ts}{literal}.' );
204 if (!ok) {
205 return false;
206 }
207 }
208 }
209 </script>
210 {/literal}
211
212 {literal}
213 <script type="text/javascript">
214 cj( function( ) {
215 checkEmailDependancies( );
216 cj('#is_email_receipt').click( function( ) {
217 checkEmailDependancies( );
218 });
219 });
220
221 function checkEmailDependancies( ) {
222 if (cj('#is_email_receipt').attr( 'checked' )) {
223 cj('#fromEmail').show( );
224 cj('#receiptDate').hide( );
225 cj('#notice').show( );
226 }
227 else {
228 cj('#fromEmail').hide( );
229 cj('#notice').hide( );
230 cj('#receiptDate').show( );
231 }
232 }
233
234 // bind first click of accordion header to load crm-accordion-body with snippet
235 // everything else taken care of by cj().crm-accordions()
236 cj(function() {
237 cj('#adjust-option-type').hide();
238 cj('.crm-ajax-accordion .crm-accordion-header').one('click', function() {
239 loadPanes(cj(this).attr('id'));
240 });
241 cj('.crm-ajax-accordion:not(.collapsed) .crm-accordion-header').each(function(index) {
242 loadPanes(cj(this).attr('id'));
243 });
244 });
245 // load panes function call for snippet based on id of crm-accordion-header
246 function loadPanes( id ) {
247 var url = "{/literal}{crmURL p='civicrm/payment/add' q='snippet=4&formType=' h=0}{literal}" + id;
248 {/literal}
249 {if $contributionMode}
250 url = url + "&mode={$contributionMode}";
251 {/if}
252 {if $qfKey}
253 url = url + "&qfKey={$qfKey}";
254 {/if}
255 {literal}
256 if (! cj('div.'+id).html()) {
257 var loading = '<img src="{/literal}{$config->resourceBase}i/loading.gif{literal}" alt="{/literal}{ts escape='js'}loading{/ts}{literal}" />&nbsp;{/literal}{ts escape='js'}Loading{/ts}{literal}...';
258 cj('div.'+id).html(loading);
259 cj.ajax({
260 url : url,
261 success: function(data) { cj('div.'+id).html(data).trigger('crmLoad'); }
262 });
263 }
264 }
265
266 cj('#fee_amount').change( function() {
267 var totalAmount = cj('#total_amount').val();
268 var feeAmount = cj('#fee_amount').val();
269 var netAmount = totalAmount.replace(/,/g, '') - feeAmount.replace(/,/g, '');
270 if (!cj('#net_amount').val()) {
271 cj('#net_amount').val(netAmount);
272 }
273 });
274 </script>
275 {/literal}
276 {if !$contributionMode}
277 {include file="CRM/common/showHideByFieldValue.tpl"
278 trigger_field_id ="payment_instrument_id"
279 trigger_value = '4'
280 target_element_id ="checkNumber"
281 target_element_type ="table-row"
282 field_type ="select"
283 invert = 0
284 }
285 {/if}
286
287 {* include jscript to warn if unsaved form field changes *}
288 {include file="CRM/common/formNavigate.tpl"}
289
290 {/if}
291 {literal}
292 <script type="text/javascript">
293 cj(function() {
294 cj().crmAccordions();
295 });
296 </script>
297 {/literal}