From 7a0f6c655bd472cb3ee455ff906c2dafffb588de Mon Sep 17 00:00:00 2001 From: eileen Date: Sat, 18 Jan 2020 19:46:23 +1300 Subject: [PATCH] Eliminate silly parameter from function signature. Removes the isAdditionalAmount parameter which is only used to adjust the amount key on the value variable. Value is reset each participant so we don't need to worry about it being 'cumulative' --- CRM/Event/Form/Participant.php | 2 +- CRM/Event/Form/Registration/Confirm.php | 12 +++--------- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/CRM/Event/Form/Participant.php b/CRM/Event/Form/Participant.php index c48703d543..bcd441f278 100644 --- a/CRM/Event/Form/Participant.php +++ b/CRM/Event/Form/Participant.php @@ -1184,7 +1184,7 @@ class CRM_Event_Form_Participant extends CRM_Contribute_Form_AbstractEditPayment $contributions[] = $contribution = CRM_Event_Form_Registration_Confirm::processContribution( $this, $this->_params, $result, $contactID, - FALSE, FALSE, + FALSE, $this->_paymentProcessor ); diff --git a/CRM/Event/Form/Registration/Confirm.php b/CRM/Event/Form/Registration/Confirm.php index 230001b9b6..65835fbc26 100644 --- a/CRM/Event/Form/Registration/Confirm.php +++ b/CRM/Event/Form/Registration/Confirm.php @@ -576,13 +576,12 @@ class CRM_Event_Form_Registration_Confirm extends CRM_Event_Form_Registration { // if paid event add a contribution record //if primary participant contributing additional amount //append (multiple participants) to its fee level. CRM-4196. - $isAdditionalAmount = FALSE; if (count($params) > 1) { - $isAdditionalAmount = TRUE; + $value['amount_level'] .= ts(' (multiple participants)') . CRM_Core_DAO::VALUE_SEPARATOR; } //passing contribution id is already registered. - $contribution = self::processContribution($this, $value, $result, $contactID, $pending, $isAdditionalAmount, $this->_paymentProcessor); + $contribution = self::processContribution($this, $value, $result, $contactID, $pending, $this->_paymentProcessor); $value['contributionID'] = $contribution->id; $value['contributionTypeID'] = $contribution->financial_type_id; $value['receive_date'] = $contribution->receive_date; @@ -904,7 +903,6 @@ class CRM_Event_Form_Registration_Confirm extends CRM_Event_Form_Registration { * @param array $result * @param int $contactID * @param bool $pending - * @param bool $isAdditionalAmount * @param array $paymentProcessor * * @return \CRM_Contribute_BAO_Contribution @@ -914,7 +912,7 @@ class CRM_Event_Form_Registration_Confirm extends CRM_Event_Form_Registration { */ public static function processContribution( &$form, $params, $result, $contactID, - $pending = FALSE, $isAdditionalAmount = FALSE, + $pending = FALSE, $paymentProcessor = NULL ) { $transaction = new CRM_Core_Transaction(); @@ -925,10 +923,6 @@ class CRM_Event_Form_Registration_Confirm extends CRM_Event_Form_Registration { if (!empty($form->_values['event']['is_email_confirm'])) { $receiptDate = $now; } - //CRM-4196 - if ($isAdditionalAmount) { - $params['amount_level'] = $params['amount_level'] . ts(' (multiple participants)') . CRM_Core_DAO::VALUE_SEPARATOR; - } // CRM-20264: fetch CC type ID and number (last 4 digit) and assign it back to $params CRM_Contribute_Form_AbstractEditPayment::formatCreditCardDetails($params); -- 2.25.1