From f07e911319fbc9c4431e6d2fb074cb6f7cf69b62 Mon Sep 17 00:00:00 2001 From: Kurund Jalmi Date: Tue, 5 Mar 2013 16:10:34 +0530 Subject: [PATCH] worked on CRM-12011 --- .../civicrm_msg_template.tpl | 16 ++++ .../message_templates/pcp_notify_html.tpl | 96 +++++++++++++++++++ .../message_templates/pcp_notify_text.tpl | 20 ++++ .../Incremental/sql/4.3.beta2.mysql.tpl | 3 +- .../message_templates/pcp_notify_html.tpl | 2 +- .../message_templates/pcp_notify_text.tpl | 2 +- 6 files changed, 135 insertions(+), 4 deletions(-) create mode 100644 CRM/Upgrade/4.3.beta2.msg_template/civicrm_msg_template.tpl create mode 100644 CRM/Upgrade/4.3.beta2.msg_template/message_templates/pcp_notify_html.tpl create mode 100644 CRM/Upgrade/4.3.beta2.msg_template/message_templates/pcp_notify_text.tpl diff --git a/CRM/Upgrade/4.3.beta2.msg_template/civicrm_msg_template.tpl b/CRM/Upgrade/4.3.beta2.msg_template/civicrm_msg_template.tpl new file mode 100644 index 000000000000..581377590c37 --- /dev/null +++ b/CRM/Upgrade/4.3.beta2.msg_template/civicrm_msg_template.tpl @@ -0,0 +1,16 @@ +{php} + $dir = SMARTY_DIR . '/../../CRM/Upgrade/4.3.beta2.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.3.beta2.msg_template/message_templates/pcp_notify_html.tpl b/CRM/Upgrade/4.3.beta2.msg_template/message_templates/pcp_notify_html.tpl new file mode 100644 index 000000000000..6e8e8b230dc0 --- /dev/null +++ b/CRM/Upgrade/4.3.beta2.msg_template/message_templates/pcp_notify_html.tpl @@ -0,0 +1,96 @@ + + + + + + + + +{capture assign=headerStyle}colspan="2" style="text-align: left; padding: 4px; border-bottom: 1px solid #999; background-color: #eee;"{/capture} +{capture assign=labelStyle }style="padding: 4px; border-bottom: 1px solid #999; background-color: #f7f7f7;"{/capture} +{capture assign=valueStyle }style="padding: 4px; border-bottom: 1px solid #999;"{/capture} +{capture assign=pcpURL }{crmURL p="civicrm/pcp/info" q="reset=1&id=`$pcpId`" h=0 a=1}{/capture} + +
+ + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ {ts}Personal Campaign Page Notification{/ts} +
+ {ts}Action{/ts}: + + {if $mode EQ 'Update'} + {ts}Updated personal campaign page{/ts} + {else} + {ts}New personal campaign page{/ts} + {/if} +
+ {ts}Personal Campaign Page Title{/ts} + + {$pcpTitle} +
+ {ts}Current Status{/ts} + + {$pcpStatus} +
+ {ts}View Page{/ts} +
+ {ts}Supporter{/ts} + + {$supporterName} +
+ {ts}Linked to Contribution Page{/ts} + + {$contribPageTitle} +
+ {ts}Manage Personal Campaign Pages{/ts} +
+
+
+ + + diff --git a/CRM/Upgrade/4.3.beta2.msg_template/message_templates/pcp_notify_text.tpl b/CRM/Upgrade/4.3.beta2.msg_template/message_templates/pcp_notify_text.tpl new file mode 100644 index 000000000000..52f9761e58c4 --- /dev/null +++ b/CRM/Upgrade/4.3.beta2.msg_template/message_templates/pcp_notify_text.tpl @@ -0,0 +1,20 @@ +=========================================================== +{ts}Personal Campaign Page Notification{/ts} + +=========================================================== +{ts}Action{/ts}: {if $mode EQ 'Update'}{ts}Updated personal campaign page{/ts}{else}{ts}New personal campaign page{/ts}{/if} +{ts}Personal Campaign Page Title{/ts}: {$pcpTitle} +{ts}Current Status{/ts}: {$pcpStatus} +{capture assign=pcpURL}{crmURL p="civicrm/pcp/info" q="reset=1&id=`$pcpId`" h=0 a=1}{/capture} +{ts}View Page{/ts}: +>> {$pcpURL} + +{ts}Supporter{/ts}: {$supporterName} +>> {$supporterUrl} + +{ts}Linked to Contribution Page{/ts}: {$contribPageTitle} +>> {$contribPageUrl} + +{ts}Manage Personal Campaign Pages{/ts}: +>> {$managePCPUrl} + diff --git a/CRM/Upgrade/Incremental/sql/4.3.beta2.mysql.tpl b/CRM/Upgrade/Incremental/sql/4.3.beta2.mysql.tpl index 0fcae94ef744..a4a582c07ba6 100644 --- a/CRM/Upgrade/Incremental/sql/4.3.beta2.mysql.tpl +++ b/CRM/Upgrade/Incremental/sql/4.3.beta2.mysql.tpl @@ -1,2 +1 @@ --- empty file for now so upgrade will run --- delete if we add contents to this file \ No newline at end of file +{include file='../CRM/Upgrade/4.3.beta2.msg_template/civicrm_msg_template.tpl'} \ No newline at end of file diff --git a/xml/templates/message_templates/pcp_notify_html.tpl b/xml/templates/message_templates/pcp_notify_html.tpl index 13a66bc8758d..6e8e8b230dc0 100644 --- a/xml/templates/message_templates/pcp_notify_html.tpl +++ b/xml/templates/message_templates/pcp_notify_html.tpl @@ -9,7 +9,7 @@ {capture assign=headerStyle}colspan="2" style="text-align: left; padding: 4px; border-bottom: 1px solid #999; background-color: #eee;"{/capture} {capture assign=labelStyle }style="padding: 4px; border-bottom: 1px solid #999; background-color: #f7f7f7;"{/capture} {capture assign=valueStyle }style="padding: 4px; border-bottom: 1px solid #999;"{/capture} -{capture assign=pcpURL }{crmURL p="civicrm/contribute/pcp/info" q="reset=1&id=`$pcpId`" h=0 a=1}{/capture} +{capture assign=pcpURL }{crmURL p="civicrm/pcp/info" q="reset=1&id=`$pcpId`" h=0 a=1}{/capture}
diff --git a/xml/templates/message_templates/pcp_notify_text.tpl b/xml/templates/message_templates/pcp_notify_text.tpl index 5b84d29669e5..52f9761e58c4 100644 --- a/xml/templates/message_templates/pcp_notify_text.tpl +++ b/xml/templates/message_templates/pcp_notify_text.tpl @@ -5,7 +5,7 @@ {ts}Action{/ts}: {if $mode EQ 'Update'}{ts}Updated personal campaign page{/ts}{else}{ts}New personal campaign page{/ts}{/if} {ts}Personal Campaign Page Title{/ts}: {$pcpTitle} {ts}Current Status{/ts}: {$pcpStatus} -{capture assign=pcpURL}{crmURL p="civicrm/contribute/pcp/info" q="reset=1&id=`$pcpId`" h=0 a=1}{/capture} +{capture assign=pcpURL}{crmURL p="civicrm/pcp/info" q="reset=1&id=`$pcpId`" h=0 a=1}{/capture} {ts}View Page{/ts}: >> {$pcpURL}