From 3b28799db5325fbfb3d5281877252a453a4003a3 Mon Sep 17 00:00:00 2001 From: eileen Date: Mon, 31 Jul 2017 18:36:55 +1200 Subject: [PATCH] CRM-20990 add to online template --- CRM/Contribute/BAO/Contribution.php | 1 + CRM/Contribute/BAO/ContributionPage.php | 1 + tests/phpunit/api/v3/ContributionTest.php | 1 + .../message_templates/contribution_online_receipt_html.tpl | 1 + 4 files changed, 4 insertions(+) diff --git a/CRM/Contribute/BAO/Contribution.php b/CRM/Contribute/BAO/Contribution.php index 12e055528d..ba5f4781a9 100644 --- a/CRM/Contribute/BAO/Contribution.php +++ b/CRM/Contribute/BAO/Contribution.php @@ -4812,6 +4812,7 @@ LIMIT 1;"; if (!$returnMessageText) { list($values['receipt_from_name'], $values['receipt_from_email']) = self::generateFromEmailAndName($input, $contribution); } + $values['contribution_status'] = CRM_Core_PseudoConstant::getLabel('CRM_Contribute_BAO_Contribution', 'contribution_status_id', $contribution->contribution_status_id); $return = $contribution->composeMessageArray($input, $ids, $values, $returnMessageText); // Contribution ID should really always be set. But ? if (!$returnMessageText && (!isset($input['receipt_update']) || $input['receipt_update']) && empty($contribution->receipt_date)) { diff --git a/CRM/Contribute/BAO/ContributionPage.php b/CRM/Contribute/BAO/ContributionPage.php index 41fcca9aae..62ed764106 100644 --- a/CRM/Contribute/BAO/ContributionPage.php +++ b/CRM/Contribute/BAO/ContributionPage.php @@ -386,6 +386,7 @@ class CRM_Contribute_BAO_ContributionPage extends CRM_Contribute_DAO_Contributio 'receipt_date' => !$values['receipt_date'] ? NULL : date('YmdHis', strtotime($values['receipt_date'])), 'pay_later_receipt' => CRM_Utils_Array::value('pay_later_receipt', $values), 'honor_block_is_active' => CRM_Utils_Array::value('honor_block_is_active', $values), + 'contributionStatus' => CRM_Utils_Array::value('contribution_status', $values), ); if ($contributionTypeId = CRM_Utils_Array::value('financial_type_id', $values)) { diff --git a/tests/phpunit/api/v3/ContributionTest.php b/tests/phpunit/api/v3/ContributionTest.php index 2b8239ba18..9f7b43da29 100644 --- a/tests/phpunit/api/v3/ContributionTest.php +++ b/tests/phpunit/api/v3/ContributionTest.php @@ -1741,6 +1741,7 @@ class api_v3_ContributionTest extends CiviUnitTestCase { 'contributeMode:::notify', 'title:::Contribution', 'displayName:::Mr. Anthony Anderson II', + 'contributionStatus:::Completed', )); $mut->stop(); $this->revertTemplateToReservedTemplate(); diff --git a/tests/templates/message_templates/contribution_online_receipt_html.tpl b/tests/templates/message_templates/contribution_online_receipt_html.tpl index e7a5bfc52c..753af958bf 100644 --- a/tests/templates/message_templates/contribution_online_receipt_html.tpl +++ b/tests/templates/message_templates/contribution_online_receipt_html.tpl @@ -61,6 +61,7 @@ price:::{$price} customPre_grouptitle:::{$customPre_grouptitle} customPost_grouptitle:::{$customPost_grouptitle} + contributionStatus:::{$contributionStatus} {foreach from=$lineItem item=value key=priceset} {foreach from=$value item=line} line.html_type:::{$line.html_type} -- 2.25.1