CRM_Upgrade_Incremental_MessageTemplates
in package
Tags
Table of Contents
Properties
- $upgradeVersion : string
- Version we are upgrading to.
Methods
- __construct() : mixed
- CRM_Upgrade_Incremental_MessageTemplates constructor.
- getTemplatesToUpdate() : array<string|int, mixed>
- Get any required template updates.
- getUneditedTemplates() : array<string|int, mixed>
- Get all the is_default templates that are the unchanged from their is_reserved counterpart, which at the time this runs was the version shipped with core when it was last changed.
- getUpgradeMessages() : mixed
- Get the upgrade messages.
- getUpgradeVersion() : string
- replaceTokenInActionSchedule() : void
- Replace a token with the new preferred option.
- replaceTokenInGreetingOptions() : void
- Replace a token with the new preferred option in a print label.
- replaceTokenInMessageTemplates() : void
- Replace a token with the new preferred option in non-workflow templates.
- replaceTokenInPrintLabel() : void
- Replace a token with the new preferred option in a print label.
- replaceTokenInTemplate() : void
- Replace a token with the new preferred option.
- setUpgradeVersion() : mixed
- updateReservedAndMaybeDefaultTemplates() : bool
- Make sure *all* reserved ones get updated. Might be inefficient because we either already updated or there were no changes to a given template, but there's only about 30.
- updateTemplates() : void
- Update message templates.
- getTemplateUpdates() : array<string|int, mixed>
- Get any templates that have been updated.
Properties
$upgradeVersion
Version we are upgrading to.
protected
string
$upgradeVersion
Methods
__construct()
CRM_Upgrade_Incremental_MessageTemplates constructor.
public
__construct(string $upgradeVersion) : mixed
Parameters
- $upgradeVersion : string
getTemplatesToUpdate()
Get any required template updates.
public
getTemplatesToUpdate() : array<string|int, mixed>
Return values
array<string|int, mixed>getUneditedTemplates()
Get all the is_default templates that are the unchanged from their is_reserved counterpart, which at the time this runs was the version shipped with core when it was last changed.
public
static getUneditedTemplates() : array<string|int, mixed>
This cannot be used before 5.26, as workflow_name was only added in 5.26.
Return values
array<string|int, mixed>getUpgradeMessages()
Get the upgrade messages.
public
getUpgradeMessages() : mixed
getUpgradeVersion()
public
getUpgradeVersion() : string
Return values
stringreplaceTokenInActionSchedule()
Replace a token with the new preferred option.
public
replaceTokenInActionSchedule(string $old, string $new) : void
Parameters
- $old : string
- $new : string
replaceTokenInGreetingOptions()
Replace a token with the new preferred option in a print label.
public
replaceTokenInGreetingOptions(string $old, string $new) : void
Parameters
- $old : string
- $new : string
Tags
replaceTokenInMessageTemplates()
Replace a token with the new preferred option in non-workflow templates.
public
replaceTokenInMessageTemplates(string $old, string $new) : void
Parameters
- $old : string
- $new : string
replaceTokenInPrintLabel()
Replace a token with the new preferred option in a print label.
public
replaceTokenInPrintLabel(string $old, string $new) : void
Parameters
- $old : string
- $new : string
replaceTokenInTemplate()
Replace a token with the new preferred option.
public
replaceTokenInTemplate(string $workflowName, string $old, string $new) : void
Parameters
- $workflowName : string
- $old : string
- $new : string
setUpgradeVersion()
public
setUpgradeVersion(string $upgradeVersion) : mixed
Parameters
- $upgradeVersion : string
updateReservedAndMaybeDefaultTemplates()
Make sure *all* reserved ones get updated. Might be inefficient because we either already updated or there were no changes to a given template, but there's only about 30.
public
static updateReservedAndMaybeDefaultTemplates(CRM_Queue_TaskContext $ctx) : bool
This runs near the final steps of the upgrade, otherwise the earlier checks that run during the individual revisions wouldn't accurately be checking against the right is_reserved version to see if it had changed.
Parameters
- $ctx : CRM_Queue_TaskContext
Tags
Return values
boolupdateTemplates()
Update message templates.
public
updateTemplates() : void
getTemplateUpdates()
Get any templates that have been updated.
protected
getTemplateUpdates() : array<string|int, mixed>