From 8a7466b4a65942a940191affcc5bb6ec3d690d7b Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Tue, 21 Nov 2023 10:08:36 +1300 Subject: [PATCH] Remove more assignments & create some noise --- CRM/Contribute/BAO/Contribution.php | 3 --- CRM/Contribute/Form/Contribution/Confirm.php | 4 ---- CRM/Upgrade/Incremental/MessageTemplates.php | 9 +++++++++ CRM/Utils/Token.php | 3 +++ 4 files changed, 12 insertions(+), 7 deletions(-) diff --git a/CRM/Contribute/BAO/Contribution.php b/CRM/Contribute/BAO/Contribution.php index 06ec2be5a9..2d3175cb5e 100644 --- a/CRM/Contribute/BAO/Contribution.php +++ b/CRM/Contribute/BAO/Contribution.php @@ -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) { diff --git a/CRM/Contribute/Form/Contribution/Confirm.php b/CRM/Contribute/Form/Contribution/Confirm.php index 0266c9a7e2..49d6c8d3b5 100644 --- a/CRM/Contribute/Form/Contribution/Confirm.php +++ b/CRM/Contribute/Form/Contribution/Confirm.php @@ -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. diff --git a/CRM/Upgrade/Incremental/MessageTemplates.php b/CRM/Upgrade/Incremental/MessageTemplates.php index 146da9e35c..25a286982e 100644 --- a/CRM/Upgrade/Incremental/MessageTemplates.php +++ b/CRM/Upgrade/Incremental/MessageTemplates.php @@ -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'], + ], + ], ]; } diff --git a/CRM/Utils/Token.php b/CRM/Utils/Token.php index 7680c842f1..9e241bcfe8 100644 --- a/CRM/Utils/Token.php +++ b/CRM/Utils/Token.php @@ -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'), -- 2.25.1