CRM-20990 add to online template
authoreileen <emcnaughton@wikimedia.org>
Mon, 31 Jul 2017 06:36:55 +0000 (18:36 +1200)
committereileen <emcnaughton@wikimedia.org>
Mon, 31 Jul 2017 06:38:55 +0000 (18:38 +1200)
CRM/Contribute/BAO/Contribution.php
CRM/Contribute/BAO/ContributionPage.php
tests/phpunit/api/v3/ContributionTest.php
tests/templates/message_templates/contribution_online_receipt_html.tpl

index 12e055528defa263985b2a16ac15e2054c555df4..ba5f4781a92d069dd0898aa81dd657f8173187d7 100644 (file)
@@ -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)) {
index 41fcca9aaef3bdc12a7701af71b9aee77136d5d4..62ed764106d620a58a5e36d654c22e4d621eb7d7 100644 (file)
@@ -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)) {
index 2b8239ba18199ad535bedb2913d6ddeade26209b..9f7b43da29e080cd8869bda76014f64040efb5d0 100644 (file)
@@ -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();
index e7a5bfc52c2b44cf589500bda09dca802155434c..753af958bf40185ee24ccdd36e194bb7f1487130 100644 (file)
@@ -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}