From 28a39166963513aed5b93a91af4aedd0452109f7 Mon Sep 17 00:00:00 2001 From: "deb.monish" Date: Mon, 17 Jul 2017 17:39:12 +0530 Subject: [PATCH] CRM-20889: Toggle check_number field on backoffice form as payment form fields --- CRM/Contribute/Form/Contribution.php | 4 ---- CRM/Core/Payment/Manual.php | 5 +---- .../CRM/Contribute/Form/AdditionalPayment.tpl | 6 ------ templates/CRM/Contribute/Form/Contribution.tpl | 6 ------ templates/CRM/Event/Form/EventFees.tpl | 4 +++- templates/CRM/Member/Form/MembershipCommon.tpl | 15 ++++++--------- 6 files changed, 10 insertions(+), 30 deletions(-) diff --git a/CRM/Contribute/Form/Contribution.php b/CRM/Contribute/Form/Contribution.php index 44161e6cd3..85f0630e08 100644 --- a/CRM/Contribute/Form/Contribution.php +++ b/CRM/Contribute/Form/Contribution.php @@ -248,8 +248,6 @@ class CRM_Contribute_Form_Contribution extends CRM_Contribute_Form_AbstractEditP return; } - $this->assign('showCheckNumber', TRUE); - $this->_fromEmails = CRM_Core_BAO_Email::getFromEmail(); if (in_array('CiviPledge', CRM_Core_Config::singleton()->enableComponents) && !$this->_formType) { @@ -704,7 +702,6 @@ class CRM_Contribute_Form_Contribution extends CRM_Contribute_Form_AbstractEditP if ($this->_online) { $this->assign('hideCalender', TRUE); } - $checkNumber = $this->add('text', 'check_number', ts('Check Number'), $attributes['contribution_check_number']); $this->addDateTime('receipt_date', ts('Receipt Date'), FALSE, array('formatType' => 'activityDateTime')); $this->addDateTime('cancel_date', ts('Cancelled / Refunded Date'), FALSE, array('formatType' => 'activityDateTime')); @@ -839,7 +836,6 @@ class CRM_Contribute_Form_Contribution extends CRM_Contribute_Form_AbstractEditP if ($totalAmount) { $totalAmount->freeze(); } - $checkNumber->freeze(); $paymentInstrument->freeze(); $trxnId->freeze(); $financialType->freeze(); diff --git a/CRM/Core/Payment/Manual.php b/CRM/Core/Payment/Manual.php index 5e1e8540bb..833609ad53 100644 --- a/CRM/Core/Payment/Manual.php +++ b/CRM/Core/Payment/Manual.php @@ -93,10 +93,7 @@ class CRM_Core_Payment_Manual extends CRM_Core_Payment { return array('credit_card_type', 'pan_truncation'); } elseif ($paymentInstrument === 'Check') { - // Really we should render check_number here, but we need to review how we edit - // check_numebr since we expose it as editable on the contribution form, - // even though it should only be editable from a transation specific form. - return array(); + return array('check_number'); } return array(); } diff --git a/templates/CRM/Contribute/Form/AdditionalPayment.tpl b/templates/CRM/Contribute/Form/AdditionalPayment.tpl index f0c916c309..d1c5b7d5a6 100644 --- a/templates/CRM/Contribute/Form/AdditionalPayment.tpl +++ b/templates/CRM/Contribute/Form/AdditionalPayment.tpl @@ -104,12 +104,6 @@ {$form.payment_instrument_id.html} {help id="payment_instrument_id"} - {if $showCheckNumber || !$isOnline} - - {$form.check_number.label} - {$form.check_number.html} - - {/if} {$form.trxn_id.label} {$form.trxn_id.html} {help id="id-trans_id"} diff --git a/templates/CRM/Contribute/Form/Contribution.tpl b/templates/CRM/Contribute/Form/Contribution.tpl index 151574ac1b..1f1233130d 100644 --- a/templates/CRM/Contribute/Form/Contribution.tpl +++ b/templates/CRM/Contribute/Form/Contribution.tpl @@ -255,12 +255,6 @@ {$form.payment_instrument_id.html} {help id="payment_instrument_id"} - {if $showCheckNumber || !$isOnline} - - {$form.check_number.label} - {$form.check_number.html} - - {/if} {$form.trxn_id.label} {$form.trxn_id.html} {help id="id-trans_id"} diff --git a/templates/CRM/Event/Form/EventFees.tpl b/templates/CRM/Event/Form/EventFees.tpl index c42ae433dd..09d92e517b 100644 --- a/templates/CRM/Event/Form/EventFees.tpl +++ b/templates/CRM/Event/Form/EventFees.tpl @@ -101,7 +101,9 @@ {/if} -{include file='CRM/Core/BillingBlockWrapper.tpl'} +{if $action neq 2} + {include file='CRM/Core/BillingBlockWrapper.tpl'} +{/if} {if ($email OR $batchEmail) and $outBound_option != 2}
{if $paid}{ts}Registration Confirmation and Receipt{/ts}{else}{ts}Registration Confirmation{/ts}{/if} diff --git a/templates/CRM/Member/Form/MembershipCommon.tpl b/templates/CRM/Member/Form/MembershipCommon.tpl index caf862471b..fcad577e7f 100644 --- a/templates/CRM/Member/Form/MembershipCommon.tpl +++ b/templates/CRM/Member/Form/MembershipCommon.tpl @@ -40,10 +40,6 @@ {$form.payment_instrument_id.label}* {$form.payment_instrument_id.html} {help id="payment_instrument_id" file="CRM/Contribute/Page/Tab.hlp"} - - {$form.check_number.label} - {$form.check_number.html|crmAddClass:six} - {if $action neq 2 } @@ -55,6 +51,12 @@ {$form.contribution_status_id.label} {$form.contribution_status_id.html} + + + + {include file='CRM/Core/BillingBlockWrapper.tpl'} + +
{/if} @@ -106,8 +108,3 @@ {$form.payment_processor_id.html} {/if} - - - {include file='CRM/Core/BillingBlockWrapper.tpl'} - - -- 2.25.1