From: Eileen Date: Mon, 22 Feb 2016 07:28:12 +0000 (+1300) Subject: CRM-18078 make receipt_date available to templates X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=d99241638342d68fb4fd444f8ff74c7f4a9aa974;p=civicrm-core.git CRM-18078 make receipt_date available to templates --- diff --git a/CRM/Contribute/BAO/Contribution.php b/CRM/Contribute/BAO/Contribution.php index 5e630c3e09..c852a92965 100644 --- a/CRM/Contribute/BAO/Contribution.php +++ b/CRM/Contribute/BAO/Contribution.php @@ -2388,6 +2388,10 @@ INNER JOIN civicrm_activity ON civicrm_activity_contact.activity_id = civicrm_ac //not really sure what params might be passed in but lets merge em into values $values = array_merge($this->_gatherMessageValues($input, $values, $ids), $values); + if (!empty($input['receipt_date'])) { + $values['receipt_date'] = $input['receipt_date']; + } + $template = CRM_Core_Smarty::singleton(); $this->_assignMessageVariablesToTemplate($values, $input, $template, $recur, $returnMessageText); //what does recur 'mean here - to do with payment processor return functionality but @@ -4336,6 +4340,7 @@ WHERE eft.financial_trxn_id IN ({$trxnId}, {$baseTrxnId['financialTrxnId']}) 'is_test', 'campaign_id', 'receive_date', + 'receipt_date', ); if (self::isSingleLineItem($primaryContributionID)) { $inputContributionWhiteList[] = 'financial_type_id'; @@ -4602,6 +4607,7 @@ LIMIT 1;"; */ public static function sendMail(&$input, &$ids, $contribution, &$values, $recur = FALSE, $returnMessageText = FALSE) { $input['is_recur'] = $recur; + $input['receipt_date'] = $contribution->receipt_date; // set receipt from e-mail and name in value if (!$returnMessageText) { $session = CRM_Core_Session::singleton(); diff --git a/CRM/Contribute/BAO/ContributionPage.php b/CRM/Contribute/BAO/ContributionPage.php index 5bbe2a142e..e8ff34d45c 100644 --- a/CRM/Contribute/BAO/ContributionPage.php +++ b/CRM/Contribute/BAO/ContributionPage.php @@ -166,6 +166,7 @@ class CRM_Contribute_BAO_ContributionPage extends CRM_Contribute_DAO_Contributio 'useForMember', 'membership_assign', 'amount', + 'receipt_date', ); foreach ($valuesRequiredForTemplate as $valueRequiredForTemplate) { diff --git a/CRM/Contribute/Form/Task/PDF.php b/CRM/Contribute/Form/Task/PDF.php index 44db260955..480de6dfb5 100644 --- a/CRM/Contribute/Form/Task/PDF.php +++ b/CRM/Contribute/Form/Task/PDF.php @@ -180,6 +180,7 @@ AND {$this->_componentClause}"; $input['net_amount'] = $contribution->net_amount; $input['trxn_id'] = $contribution->trxn_id; $input['trxn_date'] = isset($contribution->trxn_date) ? $contribution->trxn_date : NULL; + $input['receipt_date'] = $contribution->receipt_date; // CRM_Contribute_BAO_Contribution::composeMessageArray expects mysql formatted date $objects['contribution']->receive_date = CRM_Utils_Date::isoToMysql($objects['contribution']->receive_date); diff --git a/CRM/Core/Payment/BaseIPN.php b/CRM/Core/Payment/BaseIPN.php index c44d43e8b8..b47cd68726 100644 --- a/CRM/Core/Payment/BaseIPN.php +++ b/CRM/Core/Payment/BaseIPN.php @@ -121,6 +121,7 @@ class CRM_Core_Payment_BaseIPN { return FALSE; } $contribution->receive_date = CRM_Utils_Date::isoToMysql($contribution->receive_date); + $contribution->receipt_date = CRM_Utils_Date::isoToMysql($contribution->receipt_date); $objects['contact'] = &$contact; $objects['contribution'] = &$contribution;