Merge pull request #6254 from yashodha/CRM-16853.fixes
authorYashodha Chaku <yashodha.chaku@webaccessglobal.com>
Tue, 21 Jul 2015 05:20:59 +0000 (10:50 +0530)
committerYashodha Chaku <yashodha.chaku@webaccessglobal.com>
Tue, 21 Jul 2015 05:20:59 +0000 (10:50 +0530)
CRM-16853

CRM/Contribute/Form/Contribution/Confirm.php
CRM/Upgrade/4.7.alpha1.msg_template/civicrm_msg_template.tpl [new file with mode: 0644]
CRM/Upgrade/4.7.alpha1.msg_template/message_templates/pcp_owner_notify_html.tpl [new file with mode: 0644]
CRM/Upgrade/4.7.alpha1.msg_template/message_templates/pcp_owner_notify_text.tpl [new file with mode: 0644]
CRM/Upgrade/Incremental/php/FourSeven.php
CRM/Upgrade/Incremental/sql/4.7.alpha1.mysql.tpl
xml/templates/message_templates/pcp_owner_notify_html.tpl
xml/templates/message_templates/pcp_owner_notify_text.tpl

index 9cc6b49d4f3227cef48a9c0f8d8cd41f25a22d59..76ee59cd7869c1dad4c2692341a40afa1d7f2f4a 100644 (file)
@@ -1459,6 +1459,7 @@ class CRM_Contribute_Form_Contribution_Confirm extends CRM_Contribute_Form_Contr
         'donors_email' => $email,
         'pcpInfoURL' => $pcpInfoURL,
         'is_honor_roll_enabled' => $contributionSoft->pcp_display_in_roll,
+        'currency' => $contributionSoft->currency,
       );
       $domainValues = CRM_Core_BAO_Domain::getNameAndEmail();
       $sendTemplateParams = array(
diff --git a/CRM/Upgrade/4.7.alpha1.msg_template/civicrm_msg_template.tpl b/CRM/Upgrade/4.7.alpha1.msg_template/civicrm_msg_template.tpl
new file mode 100644 (file)
index 0000000..c2c68d1
--- /dev/null
@@ -0,0 +1,16 @@
+{php}
+  $dir = SMARTY_DIR . '/../../CRM/Upgrade/4.7.alpha1.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.alpha1.msg_template/message_templates/pcp_owner_notify_html.tpl b/CRM/Upgrade/4.7.alpha1.msg_template/message_templates/pcp_owner_notify_html.tpl
new file mode 100644 (file)
index 0000000..78de6ad
--- /dev/null
@@ -0,0 +1,27 @@
+<!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}
+
+  <p>{ts}You have received a donation at your personal page{/ts}: <a href="{$pcpInfoURL}">{$page_title}</a></p>
+  <p>{ts}Your fundraising total has been updated.{/ts}<br/>
+    {ts}The donor's information is listed below.  You can choose to contact them and convey your thanks if you wish.{/ts} <br/>
+    {if $is_honor_roll_enabled}
+      {ts}The donor's name has been added to your honor roll unless they asked not to be included.{/ts}<br/>
+    {/if}
+  </p>
+  <table width="620" border="0" cellpadding="0" cellspacing="0" id="crm-event_receipt" style="font-family: Arial, Verdana, sans-serif; text-align: left;">
+    <tr><td>{ts}Receive Date{/ts}:</td><td> {$receive_date|crmDate}</td></tr>
+    <tr><td>{ts}Amount{/ts}:</td><td> {$total_amount|crmMoney:$currency}</td></tr>
+    <tr><td>{ts}Name{/ts}:</td><td> {$donors_display_name}</td></tr>
+    <tr><td>{ts}Email{/ts}:</td><td> {$donors_email}</td></tr>
+  </table>
+</body>
+</html>
diff --git a/CRM/Upgrade/4.7.alpha1.msg_template/message_templates/pcp_owner_notify_text.tpl b/CRM/Upgrade/4.7.alpha1.msg_template/message_templates/pcp_owner_notify_text.tpl
new file mode 100644 (file)
index 0000000..ea9ae9b
--- /dev/null
@@ -0,0 +1,20 @@
+===========================================================
+{ts}Personal Campaign Page Owner Notification{/ts}
+
+===========================================================
+{ts}You have received a donation at your personal page{/ts}: {$page_title}
+>> {$pcpInfoURL}
+
+{ts}Your fundraising total has been updated.{/ts}
+{ts}The donor's information is listed below.  You can choose to contact them and convey your thanks if you wish.{/ts}
+{if $is_honor_roll_enabled}
+    {ts}The donor's name has been added to your honor roll unless they asked not to be included.{/ts}
+{/if}
+
+{ts}Receive Date{/ts}: {$receive_date|crmDate}
+
+{ts}Amount{/ts}: {$total_amount|crmMoney:$currency}
+
+{ts}Name{/ts}: {$donors_display_name}
+
+{ts}Email{/ts}: {$donors_email}
index 9d044aad43c66029ba3f3b69d2e67ccf1031bd6c..792fb64c2c594866e4bb42ca5c621f8ecb5e80dd 100644 (file)
@@ -91,6 +91,8 @@ class CRM_Upgrade_Incremental_php_FourSeven {
         $postUpgradeMessage .= '<p>' . $msg . '</p>';
       }
       $postUpgradeMessage .= '<p>' . ts('CiviCRM now includes the easy-to-use CKEditor Configurator. To customize the features and display of your wysiwyg editor, visit the <a %1>Display Preferences</a> page. <a %2>Learn more...</a>', array(1 => $dsp_href, 2 => $blog_href)) . '</p>';
+
+      $postUpgradeMessage .= '<br /><br />' . ts('Default version of the following System Workflow Message Templates have been modified: <ul><li>Personal Campaign Pages - Owner Notification</li></ul> If you have modified these templates, please review the new default versions and implement updates as needed to your copies (Administer > Communications > Message Templates > System Workflow Messages).');
     }
   }
 
index 3856d6a831efb4dc2a4fdb45ecdf1658ca485479..2b3ed8f6c4f2c46ed68e4f72f1fa505e3e5f3847 100644 (file)
@@ -19,3 +19,8 @@ UPDATE civicrm_option_value SET {localize field="label"}label = 'Activity Detail
 
 UPDATE civicrm_option_value SET {localize field="label"}label = 'Activity Summary Report'{/localize}
   WHERE value = 'activitySummary' AND option_group_id = @option_group_id_report;
+
+--CRM-16853 PCP Owner Notification
+
+{include file='../CRM/Upgrade/4.7.alpha1.msg_template/civicrm_msg_template.tpl'}
+
index 007ee41956ce70aeb7d8cf0302e407885be7e227..78de6adb7c5519d69d7e8130c5fd9c1cce4be7f1 100644 (file)
@@ -19,7 +19,7 @@
   </p>
   <table width="620" border="0" cellpadding="0" cellspacing="0" id="crm-event_receipt" style="font-family: Arial, Verdana, sans-serif; text-align: left;">
     <tr><td>{ts}Receive Date{/ts}:</td><td> {$receive_date|crmDate}</td></tr>
-    <tr><td>{ts}Amount{/ts}:</td><td> {$total_amount|crmMoney}</td></tr>
+    <tr><td>{ts}Amount{/ts}:</td><td> {$total_amount|crmMoney:$currency}</td></tr>
     <tr><td>{ts}Name{/ts}:</td><td> {$donors_display_name}</td></tr>
     <tr><td>{ts}Email{/ts}:</td><td> {$donors_email}</td></tr>
   </table>
index 3edd98a62f637a849e9fb8322374b21c72174caa..ea9ae9b2c231e0c29b297a544e444690a6978aa5 100644 (file)
@@ -13,7 +13,7 @@
 
 {ts}Receive Date{/ts}: {$receive_date|crmDate}
 
-{ts}Amount{/ts}: {$total_amount|crmMoney}
+{ts}Amount{/ts}: {$total_amount|crmMoney:$currency}
 
 {ts}Name{/ts}: {$donors_display_name}