Remove more assignments & create some noise
authorEileen McNaughton <emcnaughton@wikimedia.org>
Mon, 20 Nov 2023 21:08:36 +0000 (10:08 +1300)
committerEileen McNaughton <emcnaughton@wikimedia.org>
Mon, 20 Nov 2023 21:08:36 +0000 (10:08 +1300)
CRM/Contribute/BAO/Contribution.php
CRM/Contribute/Form/Contribution/Confirm.php
CRM/Upgrade/Incremental/MessageTemplates.php
CRM/Utils/Token.php

index 06ec2be5a9968109468d06d49ea76ded4d1378a9..2d3175cb5e2c1f94ab7c964630f20c90f2218c75 100644 (file)
@@ -2636,9 +2636,6 @@ INNER JOIN civicrm_activity ON civicrm_activity_contact.activity_id = civicrm_ac
             $template->assign('membership_name',
               CRM_Member_PseudoConstant::membershipType($membership->membership_type_id)
             );
-            $template->assign('mem_start_date', $membership->start_date);
-            $template->assign('mem_join_date', $membership->join_date);
-            $template->assign('mem_end_date', $membership->end_date);
             $membership_status = CRM_Member_PseudoConstant::membershipStatus($membership->status_id, NULL, 'label');
             $template->assign('mem_status', $membership_status);
             if ($membership_status === 'Pending' && $membership->is_pay_later == 1) {
index 0266c9a7e2d9739b3bdeb512676090ffd0f12f76..49d6c8d3b57a7e928918d189b24eba58087d5fd5 100644 (file)
@@ -1533,10 +1533,6 @@ class CRM_Contribute_Form_Contribution_Confirm extends CRM_Contribute_Form_Contr
         );
 
         $this->set('renewal_mode', $renewalMode);
-        if (!empty($dates)) {
-          $this->assign('mem_start_date', CRM_Utils_Date::customFormat($dates['start_date'], '%Y%m%d'));
-          $this->assign('mem_end_date', CRM_Utils_Date::customFormat($dates['end_date'], '%Y%m%d'));
-        }
 
         if (!empty($membershipContribution)) {
           // Next line is probably redundant. Checks prevent it happening twice.
index 146da9e35c55ca05a4c90250366ddabc759251db..25a286982e4a283ff505686fd2cbb1a48b4dfc8d 100644 (file)
@@ -368,6 +368,15 @@ class CRM_Upgrade_Incremental_MessageTemplates {
           ['name' => 'event_offline_receipt', 'type' => 'subject'],
         ],
       ],
+      [
+        'version' => '5.69.alpha1',
+        'upgrade_descriptor' => ts('Significant changes to the template and available variables. Text version is discontinued'),
+        'templates' => [
+          ['name' => 'membership_online_receipt', 'type' => 'text'],
+          ['name' => 'membership_online_receipt', 'type' => 'html'],
+          ['name' => 'membership_online_receipt', 'type' => 'subject'],
+        ],
+      ],
     ];
   }
 
index 7680c842f1be605a168748b572840c63be7f711f..9e241bcfe833a43dba6f07784800bc2b045c004c 100644 (file)
@@ -1779,6 +1779,9 @@ class CRM_Utils_Token {
         ],
         'membership_online_receipt' => [
           '$dataArray' => ts('found within $taxBreakDown'),
+          '$mem_start_date' => 'membership.start_date',
+          '$mem_end_date' => 'membership.end_date',
+          '$mem_join_date' => 'membership.join_date',
         ],
         'event_offline_receipt' => [
           '$contributeMode' => ts('no longer available / relevant'),