From: Pradeep Nayak
Date: Fri, 7 Apr 2017 22:48:22 +0000 (+0530)
Subject: CRM-20400, Updated completed Text, Added upgrade code
X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=c4aa623c8e246093106b4710031f2f1dda11f967;p=civicrm-core.git
CRM-20400, Updated completed Text, Added upgrade code
----------------------------------------
* CRM-20400: Update the Payment Receipt to use for Contribution pyament
https://issues.civicrm.org/jira/browse/CRM-20400
---
diff --git a/CRM/Upgrade/4.7.19.msg_template/civicrm_msg_template.tpl b/CRM/Upgrade/4.7.19.msg_template/civicrm_msg_template.tpl
new file mode 100644
index 0000000000..30cf37fa3f
--- /dev/null
+++ b/CRM/Upgrade/4.7.19.msg_template/civicrm_msg_template.tpl
@@ -0,0 +1,16 @@
+{php}
+ $dir = SMARTY_DIR . '/../../CRM/Upgrade/4.7.19.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.19.msg_template/message_templates/payment_or_refund_notification_html.tpl b/CRM/Upgrade/4.7.19.msg_template/message_templates/payment_or_refund_notification_html.tpl
new file mode 100644
index 0000000000..709d7915d9
--- /dev/null
+++ b/CRM/Upgrade/4.7.19.msg_template/message_templates/payment_or_refund_notification_html.tpl
@@ -0,0 +1,253 @@
+
+
+
+
+
+
+
+
+{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=emptyBlockStyle }style="padding: 10px; border-bottom: 1px solid #999;background-color: #f7f7f7;"{/capture}
+{capture assign=emptyBlockValueStyle }style="padding: 10px; border-bottom: 1px solid #999;"{/capture}
+
+Dear {$contactDisplayName}
+
+
+
+
+
+
+
+
+
+
+
+ {if $isRefund}
+ {ts}A refund has been issued based on changes in your registration selections.{/ts}
+ {else}
+ {ts}A payment has been received.{/ts}
+ {/if}
+ {ts}Please print this confirmation for your records.{/ts}
+ |
+
+
+
+
+ {if $isRefund}
+
+ {ts}Refund Details{/ts} |
+
+
+
+ {ts}Total Amount{/ts}
+ |
+
+ {$totalAmount|crmMoney}
+ |
+
+
+
+ {ts}You Paid{/ts}
+ |
+
+ {$totalPaid|crmMoney}
+ |
+
+
+
+ {ts}Refund Amount{/ts}
+ |
+
+ {$refundAmount|crmMoney}
+ |
+ |
+ {else}
+
+ {ts}Payment Details{/ts} |
+
+
+
+ {ts}Total Amount{/ts}
+ |
+
+ {$totalAmount|crmMoney}
+ |
+
+
+
+ {ts}This Payment Amount{/ts}
+ |
+
+ {$paymentAmount|crmMoney}
+ |
+
+
+
+ {ts}Balance Owed{/ts}
+ |
+
+ {$amountOwed|crmMoney}
+ | {* This will be zero after final payment. *}
+
+ |
+ |
+ {if $paymentsComplete}
+
+
+ {ts}Thank you for completing payment.{/ts}
+ |
+
+ {/if}
+ {/if}
+ {if $receive_date}
+
+
+ {ts}Transaction Date{/ts}
+ |
+
+ {$receive_date|crmDate}
+ |
+
+ {/if}
+ {if $trxn_id}
+
+
+ {ts}Transaction #{/ts}
+ |
+
+ {$trxn_id}
+ |
+
+ {/if}
+ {if $paidBy}
+
+
+ {ts}Paid By{/ts}
+ |
+
+ {$paidBy}
+ |
+
+ {/if}
+ {if $checkNumber}
+
+
+ {ts}Check Number{/ts}
+ |
+
+ {$checkNumber}
+ |
+
+ {/if}
+
+ |
+
+
+
+
+ {if $contributeMode eq 'direct' and !$isAmountzero}
+
+
+ {ts}Billing Name and Address{/ts}
+ |
+
+
+
+ {$billingName}
+ {$address|nl2br}
+ |
+
+ {/if}
+ {if $contributeMode eq'direct' and !$isAmountzero}
+
+
+ {ts}Credit Card Information{/ts}
+ |
+
+
+
+ {$credit_card_type}
+ {$credit_card_number}
+ {ts}Expires:{/ts} {$credit_card_exp_date|truncate:7:''|crmDate}
+ |
+
+ {/if}
+ {if $component eq 'event'}
+
+
+ {ts}Event Information and Location{/ts}
+ |
+
+
+
+ {$event.event_title}
+ {$event.event_start_date|crmDate}{if $event.event_end_date}-{if $event.event_end_date|date_format:"%Y%m%d" == $event.event_start_date|date_format:"%Y%m%d"}{$event.event_end_date|crmDate:0:1}{else}{$event.event_end_date|crmDate}{/if}{/if}
+ |
+
+
+ {if $event.participant_role}
+
+
+ {ts}Participant Role{/ts}
+ |
+
+ {$event.participant_role}
+ |
+
+ {/if}
+
+ {if $isShowLocation}
+
+
+ {$location.address.1.display|nl2br}
+ |
+
+ {/if}
+
+ {if $location.phone.1.phone || $location.email.1.email}
+
+
+ {ts}Event Contacts:{/ts}
+ |
+
+ {foreach from=$location.phone item=phone}
+ {if $phone.phone}
+
+
+ {if $phone.phone_type}
+ {$phone.phone_type_display}
+ {else}
+ {ts}Phone{/ts}
+ {/if}
+ |
+
+ {$phone.phone} {if $phone.phone_ext} {ts}ext.{/ts} {$phone.phone_ext}{/if}
+ |
+
+ {/if}
+ {/foreach}
+ {foreach from=$location.email item=eventEmail}
+ {if $eventEmail.email}
+
+
+ {ts}Email{/ts}
+ |
+
+ {$eventEmail.email}
+ |
+
+ {/if}
+ {/foreach}
+ {/if} {*phone block close*}
+ {/if}
+
+ |
+
+
+
+
+
+
+
diff --git a/CRM/Upgrade/4.7.19.msg_template/message_templates/payment_or_refund_notification_text.tpl b/CRM/Upgrade/4.7.19.msg_template/message_templates/payment_or_refund_notification_text.tpl
new file mode 100644
index 0000000000..2a53e3a4b6
--- /dev/null
+++ b/CRM/Upgrade/4.7.19.msg_template/message_templates/payment_or_refund_notification_text.tpl
@@ -0,0 +1,102 @@
+Dear {$contactDisplayName}
+{if $isRefund}
+{ts}A refund has been issued based on changes in your registration selections.{/ts}
+{else}
+{ts}A payment has been received.{/ts}
+{/if}
+
+{ts}Please print this confirmation for your records.{/ts}
+
+{if $isRefund}
+===============================================================================
+
+{ts}Refund Details{/ts}
+
+===============================================================================
+{ts}Total Fees{/ts}: {$totalAmount|crmMoney}
+{ts}You Paid{/ts}: {$totalPaid|crmMoney}
+------------------------------------------------------------------------------------
+{ts}Refund Amount{/ts}: {$refundAmount|crmMoney}
+
+{else}
+===============================================================================
+
+{ts}Payment Details{/ts}
+
+===============================================================================
+{ts}Total Fees{/ts}: {$totalAmount|crmMoney}
+{ts}This Payment Amount{/ts}: {$paymentAmount|crmMoney}
+------------------------------------------------------------------------------------
+{ts}Balance Owed{/ts}: {$amountOwed|crmMoney} {* This will be zero after final payment. *}
+
+{if $paymentsComplete}
+
+{ts}Thank you for completing payment.
+{/if}
+{/if}
+{if $receive_date}
+{ts}Transaction Date{/ts}: {$receive_date|crmDate}
+{/if}
+{if $trxn_id}
+{ts}Transaction #{/ts}: {$trxn_id}
+{/if}
+{if $paidBy}
+{ts}Paid By{/ts}: {$paidBy}
+{/if}
+{if $checkNumber}
+{ts}Check Number{/ts}: {$checkNumber}
+{/if}
+{if $contributeMode eq 'direct' and !$isAmountzero}
+
+===============================================================================
+
+{ts}Billing Name and Address{/ts}
+
+===============================================================================
+
+{$billingName}
+{$address}
+{/if}
+
+{if $contributeMode eq 'direct' and !$isAmountzero}
+===========================================================
+{ts}Credit Card Information{/ts}
+
+===============================================================================
+
+{$credit_card_type}
+{$credit_card_number}
+{ts}Expires{/ts}: {$credit_card_exp_date|truncate:7:''|crmDate}
+{/if}
+{if $component eq 'event'}
+===============================================================================
+
+{ts}Event Information and Location{/ts}
+
+===============================================================================
+
+{$event.event_title}
+{$event.event_start_date|crmDate}{if $event.event_end_date}-{if $event.event_end_date|date_format:"%Y%m%d" == $event.event_start_date|date_format:"%Y%m%d"}{$event.event_end_date|crmDate:0:1}{else}{$event.event_end_date|crmDate}{/if}{/if}
+
+{if $event.participant_role}
+{ts}Participant Role{/ts}: {$event.participant_role}
+{/if}
+
+{if $isShowLocation}
+{$location.address.1.display|strip_tags:false}
+{/if}{*End of isShowLocation condition*}
+
+{if $location.phone.1.phone || $location.email.1.email}
+
+{ts}Event Contacts:{/ts}
+{foreach from=$location.phone item=phone}
+{if $phone.phone}
+
+{if $phone.phone_type}{$phone.phone_type_display}{else}{ts}Phone{/ts}{/if}: {$phone.phone}{/if} {if $phone.phone_ext} {ts}ext.{/ts} {$phone.phone_ext}{/if}
+{/foreach}
+{foreach from=$location.email item=eventEmail}
+{if $eventEmail.email}
+
+{ts}Email{/ts}: {$eventEmail.email}{/if}{/foreach}
+{/if}
+{/if}
diff --git a/CRM/Upgrade/Incremental/php/FourSeven.php b/CRM/Upgrade/Incremental/php/FourSeven.php
index f06f714eb9..f53f6ecc61 100644
--- a/CRM/Upgrade/Incremental/php/FourSeven.php
+++ b/CRM/Upgrade/Incremental/php/FourSeven.php
@@ -121,6 +121,9 @@ class CRM_Upgrade_Incremental_php_FourSeven extends CRM_Upgrade_Incremental_Base
. '
' . ts('You can re-enable it by visitng the CKEditor Config screen and setting "fullPage = true" under the Advanced Options of the CiviMail preset.', array(1 => $ck_href))
. '
';
}
+ if ($rev == '4.7.19') {
+ $postUpgradeMessage .= '
' . ts('Default version of the following System Workflow Message Templates have been modified: - Additional Payment Receipt or Refund Notification
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).');
+ }
}
/**
diff --git a/CRM/Upgrade/Incremental/sql/4.7.19.mysql.tpl b/CRM/Upgrade/Incremental/sql/4.7.19.mysql.tpl
index 0b12d05bdc..cadc65e378 100644
--- a/CRM/Upgrade/Incremental/sql/4.7.19.mysql.tpl
+++ b/CRM/Upgrade/Incremental/sql/4.7.19.mysql.tpl
@@ -22,3 +22,5 @@ ON price_field.price_field_id = cpf.id
SET cpf.is_active = 0
WHERE price_field.price_field_id IS NULL;
+-- CRM-20400
+{include file='../CRM/Upgrade/4.7.19.msg_template/civicrm_msg_template.tpl'}
diff --git a/xml/templates/message_templates/payment_or_refund_notification_html.tpl b/xml/templates/message_templates/payment_or_refund_notification_html.tpl
index cbaae64401..709d7915d9 100644
--- a/xml/templates/message_templates/payment_or_refund_notification_html.tpl
+++ b/xml/templates/message_templates/payment_or_refund_notification_html.tpl
@@ -96,7 +96,7 @@
{if $paymentsComplete}
- {ts}Thank-you. This completes your payment for {if $component eq 'event'}{$event.event_title}{/if}.{/ts}
+ {ts}Thank you for completing payment.{/ts}
|
{/if}
diff --git a/xml/templates/message_templates/payment_or_refund_notification_text.tpl b/xml/templates/message_templates/payment_or_refund_notification_text.tpl
index d8ae664013..2a53e3a4b6 100644
--- a/xml/templates/message_templates/payment_or_refund_notification_text.tpl
+++ b/xml/templates/message_templates/payment_or_refund_notification_text.tpl
@@ -31,7 +31,7 @@ Dear {$contactDisplayName}
{if $paymentsComplete}
-{ts}Thank-you. This completes your payment for {/ts}{if $component eq 'event'}{$event.event_title}{/if}.
+{ts}Thank you for completing payment.
{/if}
{/if}
{if $receive_date}