worked on CRM-12011
authorKurund Jalmi <kurund@civicrm.org>
Tue, 5 Mar 2013 10:40:34 +0000 (16:10 +0530)
committerKurund Jalmi <kurund@civicrm.org>
Tue, 5 Mar 2013 10:40:34 +0000 (16:10 +0530)
CRM/Upgrade/4.3.beta2.msg_template/civicrm_msg_template.tpl [new file with mode: 0644]
CRM/Upgrade/4.3.beta2.msg_template/message_templates/pcp_notify_html.tpl [new file with mode: 0644]
CRM/Upgrade/4.3.beta2.msg_template/message_templates/pcp_notify_text.tpl [new file with mode: 0644]
CRM/Upgrade/Incremental/sql/4.3.beta2.mysql.tpl
xml/templates/message_templates/pcp_notify_html.tpl
xml/templates/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 (file)
index 0000000..5813775
--- /dev/null
@@ -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 (file)
index 0000000..6e8e8b2
--- /dev/null
@@ -0,0 +1,96 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <title></title>
+</head>
+<body>
+
+{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}
+
+<center>
+ <table width="620" border="0" cellpadding="0" cellspacing="0" id="crm-event_receipt" style="font-family: Arial, Verdana, sans-serif; text-align: left;">
+
+  <!-- BEGIN HEADER -->
+  <!-- You can add table row(s) here with logo or other header elements -->
+  <!-- END HEADER -->
+
+  <!-- BEGIN CONTENT -->
+
+  <tr>
+   <td>
+    <table style="border: 1px solid #999; margin: 1em 0em 1em; border-collapse: collapse; width:100%;">
+     <tr>
+      <th {$headerStyle}>
+       {ts}Personal Campaign Page Notification{/ts}
+      </th>
+     </tr>
+     <tr>
+      <td {$labelStyle}>
+       {ts}Action{/ts}:
+      </td>
+      <td {$valueStyle}>
+       {if $mode EQ 'Update'}
+        {ts}Updated personal campaign page{/ts}
+       {else}
+        {ts}New personal campaign page{/ts}
+       {/if}
+      </td>
+     </tr>
+     <tr>
+      <td {$labelStyle}>
+       {ts}Personal Campaign Page Title{/ts}
+      </td>
+      <td {$valueStyle}>
+       {$pcpTitle}
+      </td>
+     </tr>
+     <tr>
+      <td {$labelStyle}>
+       {ts}Current Status{/ts}
+      </td>
+      <td {$valueStyle}>
+       {$pcpStatus}
+      </td>
+     </tr>
+
+     <tr>
+      <td {$labelStyle}>
+       <a href="{$pcpURL}">{ts}View Page{/ts}</a>
+      </td>
+      <td></td>
+     </tr>
+     <tr>
+      <td {$labelStyle}>
+       {ts}Supporter{/ts}
+      </td>
+      <td {$valueStyle}>
+       <a href="{$supporterUrl}">{$supporterName}</a>
+      </td>
+     </tr>
+     <tr>
+      <td {$labelStyle}>
+       {ts}Linked to Contribution Page{/ts}
+      </td>
+      <td {$valueStyle}>
+       <a href="{$contribPageUrl}">{$contribPageTitle}</a>
+      </td>
+     </tr>
+     <tr>
+      <td {$labelStyle}>
+       <a href="{$managePCPUrl}">{ts}Manage Personal Campaign Pages{/ts}</a>
+      </td>
+      <td></td>
+     </tr>
+
+    </table>
+   </td>
+  </tr>
+ </table>
+</center>
+
+</body>
+</html>
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 (file)
index 0000000..52f9761
--- /dev/null
@@ -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}
+
index 0fcae94ef744017b35174879a05d9f672bf8c73d..a4a582c07ba67d522e0c57774eab06052f493260 100644 (file)
@@ -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
index 13a66bc8758d09c4e9cc1f988c1ce081d667b28f..6e8e8b230dc0ab2c0ec057a532c68670a1ce6ff8 100644 (file)
@@ -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}
 
 <center>
  <table width="620" border="0" cellpadding="0" cellspacing="0" id="crm-event_receipt" style="font-family: Arial, Verdana, sans-serif; text-align: left;">
index 5b84d29669e56b2bf5b0108357737d39a72ce46f..52f9761e58c418ed975eefefa7d0e5590ffd9fa6 100644 (file)
@@ -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}