Eliminate silly parameter from function signature.
authoreileen <emcnaughton@wikimedia.org>
Sat, 18 Jan 2020 06:46:23 +0000 (19:46 +1300)
committereileen <emcnaughton@wikimedia.org>
Sat, 18 Jan 2020 06:46:48 +0000 (19:46 +1300)
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
CRM/Event/Form/Registration/Confirm.php

index c48703d5432bf00fa6cf79ad41af261cb531a9d0..bcd441f278d909652da1804abb68b471a4d48e81 100644 (file)
@@ -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
       );
 
index 230001b9b6264dac15224d1ad7d7a18c27a8d0a9..65835fbc2675b7ce5da77d4cbe2c533864396a67 100644 (file)
@@ -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);