From 4625312e56aad962bd3bafeff7b76679e2d966f1 Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Wed, 4 Jun 2014 10:53:29 +1200 Subject: [PATCH] CRM-14778 remove unused var & move simple assignments to be at start of function --- CRM/Contribute/Form/Contribution/Confirm.php | 2 +- CRM/Contribute/Form/Contribution/Main.php | 22 ++++++++++---------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/CRM/Contribute/Form/Contribution/Confirm.php b/CRM/Contribute/Form/Contribution/Confirm.php index 0f001a4ce8..3b4841b63d 100644 --- a/CRM/Contribute/Form/Contribution/Confirm.php +++ b/CRM/Contribute/Form/Contribution/Confirm.php @@ -1163,7 +1163,7 @@ class CRM_Contribute_Form_Contribution_Confirm extends CRM_Contribute_Form_Contr $lineItems ) { $transaction = new CRM_Core_Transaction(); - $recurringContributionID = $contribSoftContactId = $addressID = NULL; + $contribSoftContactId = $addressID = NULL; // add these values for the recurringContrib function ,CRM-10188 $params['financial_type_id'] = $financialType->id; diff --git a/CRM/Contribute/Form/Contribution/Main.php b/CRM/Contribute/Form/Contribution/Main.php index ed9ec17916..3de6ec707d 100644 --- a/CRM/Contribute/Form/Contribution/Main.php +++ b/CRM/Contribute/Form/Contribution/Main.php @@ -1081,13 +1081,23 @@ class CRM_Contribute_Form_Contribution_Main extends CRM_Contribute_Form_Contribu */ public function postProcess() { $config = CRM_Core_Config::singleton(); - // we first reset the confirm page so it accepts new values $this->controller->resetPage('Confirm'); // get the submitted form values. $params = $this->controller->exportValues($this->_name); + //carry campaign from profile. + if (array_key_exists('contribution_campaign_id', $params)) { + $params['campaign_id'] = $params['contribution_campaign_id']; + } + + if (!empty($params['onbehalfof_id'])) { + $params['organization_id'] = $params['onbehalfof_id']; + } + + $params['currencyID'] = $config->defaultCurrency; + if (!empty($params['priceSetId'])) { $is_quick_config = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceSet', $this->_priceSetId, 'is_quick_config'); if ($is_quick_config) { @@ -1146,16 +1156,6 @@ class CRM_Contribute_Form_Contribution_Main extends CRM_Contribute_Form_Contribu $this->assign('pay_later_receipt', $this->_values['pay_later_receipt']); } - //carry campaign from profile. - if (array_key_exists('contribution_campaign_id', $params)) { - $params['campaign_id'] = $params['contribution_campaign_id']; - } - - if (!empty($params['onbehalfof_id'])) { - $params['organization_id'] = $params['onbehalfof_id']; - } - - $params['currencyID'] = $config->defaultCurrency; // from here on down, $params['amount'] holds a monetary value (or null) rather than an option ID $params['amount'] = self::computeAmount($params, $this); $params['separate_amount'] = $params['amount']; -- 2.25.1