From 75c075cc2a5ae56a20f179e463b9bd22b36075ad Mon Sep 17 00:00:00 2001 From: Andrew Cormick-Dockery Date: Thu, 6 Oct 2016 23:05:22 +0000 Subject: [PATCH] Move upgrades to 4.7.13 as requested --- .../4.7.13.msg_template/civicrm_msg_template.tpl | 16 ++++++++++++++++ .../contribution_recurring_notify_html.tpl | 0 .../contribution_recurring_notify_text.tpl | 0 .../membership_online_receipt_html.tpl | 0 .../membership_online_receipt_text.tpl | 0 5 files changed, 16 insertions(+) create mode 100644 CRM/Upgrade/4.7.13.msg_template/civicrm_msg_template.tpl rename CRM/Upgrade/{4.7.11.msg_template => 4.7.13.msg_template}/message_templates/contribution_recurring_notify_html.tpl (100%) rename CRM/Upgrade/{4.7.11.msg_template => 4.7.13.msg_template}/message_templates/contribution_recurring_notify_text.tpl (100%) rename CRM/Upgrade/{4.7.11.msg_template => 4.7.13.msg_template}/message_templates/membership_online_receipt_html.tpl (100%) rename CRM/Upgrade/{4.7.11.msg_template => 4.7.13.msg_template}/message_templates/membership_online_receipt_text.tpl (100%) diff --git a/CRM/Upgrade/4.7.13.msg_template/civicrm_msg_template.tpl b/CRM/Upgrade/4.7.13.msg_template/civicrm_msg_template.tpl new file mode 100644 index 0000000000..d1d05c351f --- /dev/null +++ b/CRM/Upgrade/4.7.13.msg_template/civicrm_msg_template.tpl @@ -0,0 +1,16 @@ +{php} + $dir = SMARTY_DIR . '/../../CRM/Upgrade/4.7.13.msg_template/message_templates'; + $templates = array(); + foreach (preg_grep('/\.tpl$/', scandir($dir)) as $filename) { + $parts = explode('_', basename($filename, '.tpl')); + $templates[] = array('type' => array_pop($parts), 'name' => implode('_', $parts), 'filename' => "$dir/$filename"); + } + $this->assign('templates', $templates); +{/php} + +{foreach from=$templates item=tpl} + {fetch assign=content file=$tpl.filename} + SELECT @workflow_id := MAX(id) FROM civicrm_option_value WHERE name = '{$tpl.name}'; + SELECT @content := msg_{$tpl.type} FROM civicrm_msg_template WHERE workflow_id = @workflow_id AND is_reserved = 1 LIMIT 1; + UPDATE civicrm_msg_template SET msg_{$tpl.type} = '{$content|escape:"quotes"}' WHERE workflow_id = @workflow_id AND (is_reserved = 1 OR (is_default = 1 AND msg_{$tpl.type} = @content)); +{/foreach} diff --git a/CRM/Upgrade/4.7.11.msg_template/message_templates/contribution_recurring_notify_html.tpl b/CRM/Upgrade/4.7.13.msg_template/message_templates/contribution_recurring_notify_html.tpl similarity index 100% rename from CRM/Upgrade/4.7.11.msg_template/message_templates/contribution_recurring_notify_html.tpl rename to CRM/Upgrade/4.7.13.msg_template/message_templates/contribution_recurring_notify_html.tpl diff --git a/CRM/Upgrade/4.7.11.msg_template/message_templates/contribution_recurring_notify_text.tpl b/CRM/Upgrade/4.7.13.msg_template/message_templates/contribution_recurring_notify_text.tpl similarity index 100% rename from CRM/Upgrade/4.7.11.msg_template/message_templates/contribution_recurring_notify_text.tpl rename to CRM/Upgrade/4.7.13.msg_template/message_templates/contribution_recurring_notify_text.tpl diff --git a/CRM/Upgrade/4.7.11.msg_template/message_templates/membership_online_receipt_html.tpl b/CRM/Upgrade/4.7.13.msg_template/message_templates/membership_online_receipt_html.tpl similarity index 100% rename from CRM/Upgrade/4.7.11.msg_template/message_templates/membership_online_receipt_html.tpl rename to CRM/Upgrade/4.7.13.msg_template/message_templates/membership_online_receipt_html.tpl diff --git a/CRM/Upgrade/4.7.11.msg_template/message_templates/membership_online_receipt_text.tpl b/CRM/Upgrade/4.7.13.msg_template/message_templates/membership_online_receipt_text.tpl similarity index 100% rename from CRM/Upgrade/4.7.11.msg_template/message_templates/membership_online_receipt_text.tpl rename to CRM/Upgrade/4.7.13.msg_template/message_templates/membership_online_receipt_text.tpl -- 2.25.1