From 1fc22ffae61dd3ff4dde14550813f21d7490f194 Mon Sep 17 00:00:00 2001 From: "deb.monish" Date: Tue, 8 Mar 2016 02:10:03 +0530 Subject: [PATCH] CRM-18118 QA changes --- CRM/Contribute/Form/Contribution/Confirm.php | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/CRM/Contribute/Form/Contribution/Confirm.php b/CRM/Contribute/Form/Contribution/Confirm.php index 5c733a583d..40119a9469 100644 --- a/CRM/Contribute/Form/Contribution/Confirm.php +++ b/CRM/Contribute/Form/Contribution/Confirm.php @@ -1333,6 +1333,7 @@ class CRM_Contribute_Form_Contribution_Confirm extends CRM_Contribute_Form_Contr $isPending = $this->getIsPending(); $this->assign('membership_name', CRM_Utils_Array::value('name', $membershipType)); + $this->_values['membership_name'] = CRM_Utils_Array::value('name', $membershipType); $isPaidMembership = FALSE; if ($this->_amount >= 0.0 && isset($membershipParams['amount'])) { @@ -1499,12 +1500,8 @@ class CRM_Contribute_Form_Contribution_Confirm extends CRM_Contribute_Form_Contr ); $form->set('renewal_mode', $renewalMode); if (!empty($dates)) { - $form->assign('mem_start_date', - CRM_Utils_Date::customFormat($dates['start_date'], '%Y%m%d') - ); - $form->assign('mem_end_date', - CRM_Utils_Date::customFormat($dates['end_date'], '%Y%m%d') - ); + $form->assign('mem_start_date', CRM_Utils_Date::customFormat($dates['start_date'], '%Y%m%d')); + $form->assign('mem_end_date', CRM_Utils_Date::customFormat($dates['end_date'], '%Y%m%d')); } if (!empty($membershipContribution)) { @@ -1562,7 +1559,7 @@ class CRM_Contribute_Form_Contribution_Confirm extends CRM_Contribute_Form_Contr $form->_values['contribution_id'] = $membershipContributionID; } - if ($form->_paymentProcessor) { + if (empty($form->_params['is_pay_later']) && $form->_paymentProcessor) { // the is_monetary concept probably should be deprecated as it can be calculated from // the existence of 'amount' & seems fragile. if ($form->_values['is_monetary'] && $form->_amount > 0.0 && !$form->_params['is_pay_later']) { @@ -1585,14 +1582,15 @@ class CRM_Contribute_Form_Contribution_Confirm extends CRM_Contribute_Form_Contr return; } - $emailValues = $form->_values; + $emailValues = array_merge($membershipParams, $form->_values); + $emailValues['membership_assign'] = 1; // Finally send an email receipt for pay-later scenario (although it might sometimes be caught above!) if ($totalAmount == 0) { // This feels like a bizarre hack as the variable name doesn't seem to be directly connected to it's use in the template. $emailValues['useForMember'] = 0; - $emailValues['membership_assign'] = 1; $emailValues['amount'] = 0; } + CRM_Contribute_BAO_ContributionPage::sendMail($contactID, $emailValues, $isTest, FALSE, -- 2.25.1