Merge pull request #20093 from larssandergreen/mailings-AB-test-improvements
[civicrm-core.git] / templates / CRM / Financial / Form / PaymentEdit.tpl
1 {*
2 +--------------------------------------------------------------------+
3 | Copyright CiviCRM LLC. All rights reserved. |
4 | |
5 | This work is published under the GNU AGPLv3 license with some |
6 | permitted exceptions and without any warranty. For full license |
7 | and copyright information, see https://civicrm.org/licensing |
8 +--------------------------------------------------------------------+
9 *}
10
11 {crmRegion name="payment-edit-block"}
12 <div id="payment-edit-section" class="crm-section billing_mode-section">
13 {foreach from=$paymentFields key=fieldName item=paymentField}
14 {assign var='name' value=$fieldName}
15 <div class="crm-container {$name}-section">
16 <div class="label">{$form.$name.label}
17 </div>
18 <div class="content">{if $name eq 'total_amount'}{$currency}&nbsp;&nbsp;{/if}{$form.$name.html}
19 </div>
20 <div class="clear"></div>
21 </div>
22 {/foreach}
23 </div>
24 {/crmRegion}
25 <div class="crm-submit-buttons">
26 {include file="CRM/common/formButtons.tpl" location="bottom"}
27 </div>
28
29 {literal}
30 <script type="text/javascript">
31 CRM.$(function ($) {
32
33 showHideFieldsByPaymentInstrumentID();
34 $('#payment_instrument_id').on('change', showHideFieldsByPaymentInstrumentID);
35
36 function showHideFieldsByPaymentInstrumentID() {
37 var paymentInstrumentLabel = $('#payment_instrument_id option:selected').text();
38 if (paymentInstrumentLabel == ts('Credit Card')) {
39 $('.check_number-section').hide();
40 $('.card_type_id-section, .pan_truncation-section').show();
41 }
42 else if (paymentInstrumentLabel == ts('Check')) {
43 $('.card_type_id-section, .pan_truncation-section').hide();
44 $('.check_number-section').show();
45 }
46 else {
47 $('.card_type_id-section, .pan_truncation-section, .check_number-section').hide();
48 }
49 }
50 });
51 </script>
52 {/literal}