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 @@