$deprecatedTokens = [
'{case.status_id}' => '{case.status_id:label}',
'{case.case_type_id}' => '{case.case_type_id:label}',
+ '{membership.status}' => '{membership.status_id:label}',
+ '{membership.type}' => '{membership.membership_type_id:label}',
];
$tokenErrors = [];
foreach ($deprecatedTokens as $token => $replacement) {
*
* @return array
*/
- public static function membershipTokens() {
+ public static function membershipTokens(): array {
return [
'{membership.id}' => ts('Membership ID'),
- '{membership.status}' => ts('Membership Status'),
- '{membership.type}' => ts('Membership Type'),
+ '{membership.status_id:label}' => ts('Membership Status'),
+ '{membership.membership_type_id:label}' => ts('Membership Type'),
'{membership.start_date}' => ts('Membership Start Date'),
'{membership.join_date}' => ts('Membership Join Date'),
'{membership.end_date}' => ts('Membership End Date'),
'join_date' => ts('Membership Join Date'),
'start_date' => ts('Membership Start Date'),
'end_date' => ts('Membership End Date'),
- 'status' => ts('Membership Status'),
- 'type' => ts('Membership Type'),
'status_id:label' => ts('Membership Status'),
'membership_type_id:label' => ts('Membership Type'),
],
// FIXME: `select('e.*')` seems too broad.
$e->query
->select('e.*')
- ->select('mt.minimum_fee as fee, e.id as id , e.join_date, e.start_date, e.end_date, membership_type_id as Membership__membership_type_id, status_id as Membership__status_id, ms.name as status, mt.name as type')
- ->join('mt', '!casMailingJoinType civicrm_membership_type mt ON e.membership_type_id = mt.id')
- ->join('ms', '!casMailingJoinType civicrm_membership_status ms ON e.status_id = ms.id');
+ ->select('mt.minimum_fee as fee, e.id as id , e.join_date, e.start_date, e.end_date, membership_type_id as Membership__membership_type_id, status_id as Membership__status_id')
+ ->join('mt', '!casMailingJoinType civicrm_membership_type mt ON e.membership_type_id = mt.id');
}
/**
$this->addTask('Replace legacy last_name smarty token in Online contribution workflow template',
'updateMessageToken', 'contribution_online_receipt', '$last_name', 'contact.last_name', $rev
);
+ $this->addTask('Replace membership status token in action schedule',
+ 'updateActionScheduleToken', 'membership.status', 'membership.status_id:label', $rev
+ );
+ $this->addTask('Replace membership type token in action schedule',
+ 'updateActionScheduleToken', 'membership.type', 'membership.membership_type_id:label', $rev
+ );
}
/**
public function getMembershipTokens(): array {
return [
'{membership.id}' => 'Membership ID',
- '{membership.status}' => 'Membership Status',
- '{membership.type}' => 'Membership Type',
+ '{membership.status_id:label}' => 'Membership Status',
+ '{membership.membership_type_id:label}' => 'Membership Type',
'{membership.start_date}' => 'Membership Start Date',
'{membership.join_date}' => 'Membership Join Date',
'{membership.end_date}' => 'Membership End Date',