Merge pull request #12457 from omarabuhussein/dev/core#253
[civicrm-core.git] / templates / CRM / Financial / Form / PaymentEdit.tpl
CommitLineData
9b2e3ee6
MD
1{*
2 +--------------------------------------------------------------------+
fee14197 3 | CiviCRM version 5 |
9b2e3ee6 4 +--------------------------------------------------------------------+
6b83d5bd 5 | Copyright CiviCRM LLC (c) 2004-2019 |
9b2e3ee6
MD
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
27{crmRegion name="payment-edit-block"}
28 <div id="payment-edit-section" class="crm-section billing_mode-section">
4ee75265 29 {foreach from=$paymentFields key=fieldName item=paymentField}
30 {assign var='name' value=$fieldName}
9b2e3ee6
MD
31 <div class="crm-container {$name}-section">
32 <div class="label">{$form.$name.label}
9b2e3ee6
MD
33 </div>
34 <div class="content">{if $name eq 'total_amount'}{$currency}&nbsp;&nbsp;{/if}{$form.$name.html}
9b2e3ee6
MD
35 </div>
36 <div class="clear"></div>
37 </div>
38 {/foreach}
39 </div>
40{/crmRegion}
41<div class="crm-submit-buttons">
42 {include file="CRM/common/formButtons.tpl" location="bottom"}
43</div>
4ee75265 44
45{literal}
46<script type="text/javascript">
47CRM.$(function ($) {
48
49 showHideFieldsByPaymentInstrumentID();
50 $('#payment_instrument_id').on('change', showHideFieldsByPaymentInstrumentID);
51
52 function showHideFieldsByPaymentInstrumentID() {
53 var paymentInstrumentLabel = $('#payment_instrument_id option:selected').text();
54 if (paymentInstrumentLabel == ts('Credit Card')) {
55 $('.check_number-section').hide();
56 $('.card_type_id-section, .pan_truncation-section').show();
57 }
58 else if (paymentInstrumentLabel == ts('Check')) {
59 $('.card_type_id-section, .pan_truncation-section').hide();
60 $('.check_number-section').show();
61 }
62 else {
63 $('.card_type_id-section, .pan_truncation-section, .check_number-section').hide();
64 }
65 }
66});
67</script>
68{/literal}