diff --git a/CRM/Contribute/Form/AbstractEditPayment.php b/CRM/Contribute/Form/AbstractEditPayment.php index 974747c88c99..1a9573dd7326 100644 --- a/CRM/Contribute/Form/AbstractEditPayment.php +++ b/CRM/Contribute/Form/AbstractEditPayment.php @@ -516,7 +516,7 @@ protected function assignPaymentRelatedVariables() { } $this->assignProcessors(); $this->assignBillingType(); - CRM_Core_Payment_Form::setPaymentFieldsByProcessor($this, $this->_paymentProcessor, FALSE, TRUE, CRM_Utils_Request::retrieve('payment_instrument_id', 'Integer')); + CRM_Core_Payment_Form::setPaymentFieldsByProcessor($this, $this->_paymentProcessor, FALSE, TRUE, CRM_Utils_Request::retrieve('payment_instrument_id', 'Integer', $this)); } catch (CRM_Core_Exception $e) { CRM_Core_Error::statusBounce($e->getMessage()); diff --git a/CRM/Contribute/Form/Contribution.php b/CRM/Contribute/Form/Contribution.php index 44161e6cd32e..5b4c153daac7 100644 --- a/CRM/Contribute/Form/Contribution.php +++ b/CRM/Contribute/Form/Contribution.php @@ -248,8 +248,6 @@ public function preProcess() { return; } - $this->assign('showCheckNumber', TRUE); - $this->_fromEmails = CRM_Core_BAO_Email::getFromEmail(); if (in_array('CiviPledge', CRM_Core_Config::singleton()->enableComponents) && !$this->_formType) { @@ -552,7 +550,8 @@ public function buildQuickForm() { $paneNames[ts('Premium Information')] = 'Premium'; } - if (CRM_Core_Payment_Form::buildPaymentForm($this, $this->_paymentProcessor, FALSE, TRUE, $this->getDefaultPaymentInstrumentId()) == TRUE) { + $this->payment_instrument_id = CRM_Utils_Array::value('payment_instrument_id', $defaults, $this->getDefaultPaymentInstrumentId()); + if (CRM_Core_Payment_Form::buildPaymentForm($this, $this->_paymentProcessor, FALSE, TRUE, $this->payment_instrument_id) == TRUE) { if (!empty($this->_recurPaymentProcessors)) { $buildRecurBlock = TRUE; if ($this->_ppID) { @@ -704,7 +703,6 @@ public function buildQuickForm() { 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 +837,6 @@ public function buildQuickForm() { if ($totalAmount) { $totalAmount->freeze(); } - $checkNumber->freeze(); $paymentInstrument->freeze(); $trxnId->freeze(); $financialType->freeze(); diff --git a/CRM/Core/Payment/Form.php b/CRM/Core/Payment/Form.php index c4e369bea3a6..4988ee531c79 100644 --- a/CRM/Core/Payment/Form.php +++ b/CRM/Core/Payment/Form.php @@ -207,8 +207,7 @@ public static function getPaymentTypeName($paymentProcessor) { * @return string */ public static function getPaymentTypeLabel($paymentProcessor) { - $paymentProcessorObject = Civi\Payment\System::singleton()->getByProcessor($paymentProcessor); - return ts(($paymentProcessorObject->getPaymentTypeLabel()) . ' Information'); + return ts(($paymentProcessor['object']->getPaymentTypeLabel()) . ' Information'); } /** diff --git a/CRM/Core/Payment/Manual.php b/CRM/Core/Payment/Manual.php index 5e1e8540bb50..833609ad53e7 100644 --- a/CRM/Core/Payment/Manual.php +++ b/CRM/Core/Payment/Manual.php @@ -93,10 +93,7 @@ public function getPaymentFormFields() { 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 3dfc75634f2f..d1c5b7d5a6ae 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"} @@ -174,14 +168,4 @@ {/literal} - {if !$contributionMode} - {include file="CRM/common/showHideByFieldValue.tpl" - trigger_field_id ="payment_instrument_id" - trigger_value = '4' - target_element_id ="checkNumber" - target_element_type ="table-row" - field_type ="select" - invert = 0 - } - {/if} {/if} diff --git a/templates/CRM/Contribute/Form/Contribution.tpl b/templates/CRM/Contribute/Form/Contribution.tpl index abaccbfa8f8d..1f1233130d21 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"} @@ -497,17 +491,6 @@ {/literal}{/if} }); - {if !$contributionMode} - {crmAPI var="checkVal" entity="OptionValue" action="getvalue" version="3" option_group_id="payment_instrument" name="Check" return="value"} - {include file="CRM/common/showHideByFieldValue.tpl" - trigger_field_id ="payment_instrument_id" - trigger_value = $checkVal - target_element_id ="checkNumber" - target_element_type ="table-row" - field_type ="select" - invert = 0 - } - {/if} {/if} {* not delete mode if*} {/if} {* closing of main custom data if *} diff --git a/templates/CRM/Event/Form/EventFees.tpl b/templates/CRM/Event/Form/EventFees.tpl index bdbad615eb18..09d92e517b93 100644 --- a/templates/CRM/Event/Form/EventFees.tpl +++ b/templates/CRM/Event/Form/EventFees.tpl @@ -88,7 +88,6 @@ {include file="CRM/common/jcalendar.tpl" elementName=receive_date} {$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 $showTransactionId } {$form.trxn_id.label}{$form.trxn_id.html} {/if} @@ -102,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} @@ -177,17 +178,6 @@ } {/if} -{if $paid and ($action eq 1 or ( $action eq 2 and !$hasPayment) ) and !$participantMode} -{include file="CRM/common/showHideByFieldValue.tpl" - trigger_field_id ="payment_instrument_id" - trigger_value = '4' - target_element_id ="checkNumber" - target_element_type ="table-row" - field_type ="select" - invert = 0 -} -{/if} - {if $context eq 'standalone' and $outBound_option != 2 }