From ff708ff0950e91f7b145df8233fe2ad944e98b87 Mon Sep 17 00:00:00 2001 From: Seamus Lee Date: Sat, 5 Jun 2021 03:22:24 +0000 Subject: [PATCH] [php8-compat] Update smarty templates and some php files to get the api_v3_contribution testclass to pass on php8 --- CRM/Contribute/BAO/ContributionPage.php | 1 + CRM/Contribute/Form/Contribution/Confirm.php | 2 +- CRM/Core/Payment/AuthorizeNet.php | 2 +- CRM/Event/BAO/Event.php | 1 + .../contribution_online_receipt_html.tpl | 80 ++++++++++ .../event_online_receipt_text.tpl | 70 ++++++++- .../contribution_invoice_receipt_html.tpl | 8 +- .../contribution_offline_receipt_html.tpl | 28 ++-- .../contribution_offline_receipt_text.tpl | 26 ++-- .../contribution_online_receipt_html.tpl | 58 ++++---- .../contribution_online_receipt_text.tpl | 54 +++---- .../event_offline_receipt_html.tpl | 78 +++++----- .../event_offline_receipt_text.tpl | 140 +++++++++--------- .../event_online_receipt_html.tpl | 84 +++++------ .../event_online_receipt_subject.tpl | 2 +- .../event_online_receipt_text.tpl | 132 ++++++++--------- .../event_registration_receipt_html.tpl | 2 +- .../event_registration_receipt_text.tpl | 2 +- .../membership_offline_receipt_html.tpl | 34 ++--- .../membership_offline_receipt_text.tpl | 34 ++--- .../membership_online_receipt_html.tpl | 60 ++++---- .../membership_online_receipt_text.tpl | 60 ++++---- .../payment_or_refund_notification_html.tpl | 6 +- 23 files changed, 556 insertions(+), 408 deletions(-) diff --git a/CRM/Contribute/BAO/ContributionPage.php b/CRM/Contribute/BAO/ContributionPage.php index d5bfdb00a4..806e8aa683 100644 --- a/CRM/Contribute/BAO/ContributionPage.php +++ b/CRM/Contribute/BAO/ContributionPage.php @@ -365,6 +365,7 @@ class CRM_Contribute_BAO_ContributionPage extends CRM_Contribute_DAO_Contributio 'pay_later_receipt' => $values['pay_later_receipt'] ?? NULL, 'honor_block_is_active' => $values['honor_block_is_active'] ?? NULL, 'contributionStatus' => $values['contribution_status'] ?? NULL, + 'currency' => CRM_Core_DAO::getFieldValue('CRM_Contribute_DAO_Contribution', $values['contribution_id'], 'currency') ?? CRM_Core_Config::singleton()->defaultCurrency, ]; if (!empty($values['financial_type_id'])) { diff --git a/CRM/Contribute/Form/Contribution/Confirm.php b/CRM/Contribute/Form/Contribution/Confirm.php index 7af892ce3d..81a133d696 100644 --- a/CRM/Contribute/Form/Contribution/Confirm.php +++ b/CRM/Contribute/Form/Contribution/Confirm.php @@ -1568,7 +1568,7 @@ class CRM_Contribute_Form_Contribution_Confirm extends CRM_Contribute_Form_Contr */ protected function postProcessMembership( $membershipParams, $contactID, &$form, $premiumParams, - $customFieldsFormatted = NULL, $includeFieldTypes = NULL, $membershipDetails, $membershipTypeIDs, $isPaidMembership, $membershipID, + $customFieldsFormatted, $includeFieldTypes, $membershipDetails, $membershipTypeIDs, $isPaidMembership, $membershipID, $isProcessSeparateMembershipTransaction, $financialTypeID, $unprocessedLineItems) { $membershipContribution = NULL; diff --git a/CRM/Core/Payment/AuthorizeNet.php b/CRM/Core/Payment/AuthorizeNet.php index 664ce502c1..e28bdbf900 100644 --- a/CRM/Core/Payment/AuthorizeNet.php +++ b/CRM/Core/Payment/AuthorizeNet.php @@ -545,7 +545,7 @@ class CRM_Core_Payment_AuthorizeNet extends CRM_Core_Payment { * @return bool|object * @throws \Civi\Payment\Exception\PaymentProcessorException */ - public function cancelSubscription(&$message = '', $params) { + public function cancelSubscription(&$message = '', $params = []) { $template = CRM_Core_Smarty::singleton(); $template->assign('subscriptionType', 'cancel'); diff --git a/CRM/Event/BAO/Event.php b/CRM/Event/BAO/Event.php index 267a00644f..8f347dce0a 100644 --- a/CRM/Event/BAO/Event.php +++ b/CRM/Event/BAO/Event.php @@ -1160,6 +1160,7 @@ WHERE civicrm_event.is_active = 1 'credit_card_exp_date' => CRM_Utils_Date::mysqlToIso(CRM_Utils_Date::format(CRM_Utils_Array::value('credit_card_exp_date', $participantParams))), 'selfcancelxfer_time' => abs($values['event']['selfcancelxfer_time']), 'selfservice_preposition' => $values['event']['selfcancelxfer_time'] < 0 ? 'after' : 'before', + 'currency' => $values['event']['currency'] ?? CRM_Core_Config::singleton()->defaultCurrency, ]); // CRM-13890 : NOTE wait list condition need to be given so that diff --git a/tests/templates/message_templates/contribution_online_receipt_html.tpl b/tests/templates/message_templates/contribution_online_receipt_html.tpl index 753af958bf..c9cdcdb820 100644 --- a/tests/templates/message_templates/contribution_online_receipt_html.tpl +++ b/tests/templates/message_templates/contribution_online_receipt_html.tpl @@ -5,7 +5,9 @@ receive_date:::{$receive_date} receipt_date:::{$receipt_date} + {if !empty($receipt_text)} receipt_text:::{$receipt_text} + {/if} is_pay_later:::{$is_pay_later} displayName:::{$displayName} financialTypeId:::{$financialTypeId} @@ -13,55 +15,116 @@ contactID:::{$contactID} contributionID:::{$contributionID} amount:::{$amount} + {if isset($amount_level)} amount_level:::{$amount_level} + {/if} + {if isset($pay_later_receipt)} pay_later_receipt:::{$pay_later_receipt} + {/if} + {if isset($headerstyle)} headerStyle:::{$headerStyle} + {/if} + {if isset($valueStyle)} valueStyle:::{$valueStyle} + {/if} + {if isset($labelStyle)} labelStyle:::{$labelStyle} + {/if} priceSetID:::{$priceSetID} currency:::{$currency} + {if !empty($is_quick_config)} is_quick_config:::{$is_quick_config} + {/if} + {if !empty($getTaxDetails)} getTaxDetails:::{$getTaxDetails} totalTaxAmount:::{$totalTaxAmount} + {/if} + {if isset($is_monetary)} is_monetary:::{$is_monetary} + {/if} + {if isset($isShare)} isShare:::{$isShare} + {/if} honor_block_is_active:::{$honor_block_is_active} + {if $honor_block_is_active} soft_credit_type:::{$soft_credit_type} + {/if} + {if isset($is_recur)} is_recur:::{$is_recur} + {/if} + {if isset($contributeMode)} contributeMode:::{$contributeMode} + {/if} + {if isset($trxn_id)} trxn_id:::{$trxn_id} + {/if} + {if isset($cancelSubscriptionUrl)} cancelSubscriptionUrl:::{$cancelSubscriptionUrl} updateSubscriptionBillingUrl:::{$updateSubscriptionBillingUrl} updateSubscriptionUrl:::{$updateSubscriptionUrl} + {/if} + {if isset($priceset)} priceset:::{$priceset} + {/if} + {if isset($taxTerm)} taxTerm:::{$taxTerm} + {/if} + {if !empty($pcpBlock)} pcpBlock:::{$pcpBlock} pcp_display_in_roll:::{$pcp_display_in_roll} pcp_roll_nickname:::{$pcp_roll_nickname} pcp_personal_note:::{$pcp_personal_note} + {/if} + {if isset($onBehalfProfile_grouptitle)} onBehalfProfile_grouptitle:::{$onBehalfProfile_grouptitle} + {/if} email:::{$email} + {if isset($contributionPageId)} contributionPageId:::{$contributionPageId} title:::{$title} + {/if} + {if isset($isBillingAddressRequiredForPayLater)} isBillingAddressRequiredForPayLater:::{$isBillingAddressRequiredForPayLater} + {/if} + {if isset($billingName)} billingName:::{$billingName} address:::{$address} + {/if} + {if isset($credit_card_type)} credit_card_type:::{$credit_card_type} credit_card_number:::{$credit_card_number} credit_card_exp_date:::{$credit_card_exp_date} + {/if} + {if isset($selectPremium)} selectPremium:::{$selectPremium} product_name:::{$product_name} option:::{$option} sku:::{$sku} + {/if} + {if isset($start_date)} start_date:::{$start_date} end_date:::{$end_date} + {/if} + {if isset($is_deductible)} is_deductible:::{$is_deductible} + {/if} + {if isset($contact_email)} contact_email:::{$contact_email} + {/if} + {if isset($contact_phone)} contact_phone:::{$contact_phone} + {/if} + {if isset($price)} price:::{$price} + {/if} + {if isset($customPre_grouptitle)} customPre_grouptitle:::{$customPre_grouptitle} + {/if} + {if isset($customPost_grouptitle)} customPost_grouptitle:::{$customPost_grouptitle} + {/if} contributionStatus:::{$contributionStatus} + {if isset($lineItem)} {foreach from=$lineItem item=value key=priceset} {foreach from=$value item=line} line.html_type:::{$line.html_type} @@ -70,19 +133,27 @@ line.description:::{$line.description} line.qty:::{$line.qty} line.unit_price:::{$line.unit_price} + {if isset($line.tax_rate)} line.tax_rate:::{$line.tax_rate} line.tax_amount:::{$line.tax_amount} + {/if} line.line_total:::{$line.line_total} {/foreach} {/foreach} + {/if} + {if !empty($dataArray)} {foreach from=$dataArray item=value key=priceset} dataArray: priceset:::$priceset dataArray: value:::$value {/foreach} + {/if} + {if !empty($honoreeProfile)} {foreach from=$honoreeProfile item=value key=label} honoreeProfile: label:::$label honoreeProfile: value:::$value {/foreach} + {/if} + {if !empty($softCreditTypes)} {foreach from=$softCreditTypes item=softCreditType key=n} softCreditType:::$softCreditType {foreach from=$softCredits.$n item=value key=label} @@ -90,22 +161,31 @@ softCredits: value:::$value {/foreach} {/foreach} + {/if} + {if !empty($onBehalfProfile)} {foreach from=$onBehalfProfile item=onBehalfValue key=onBehalfName} onBehalfName:::$onBehalfName onBehalfValue:::$onBehalfValue {/foreach} + {/if} + {if !empty($customPre)} {foreach from=$customPre item=customValue key=customName} customPre: customName:::$customName customPre: customValue:::$customValue {/foreach} + {/if} + {if !empty($customPost)} {foreach from=$customPost item=customValue key=customName} customPost: customName:::$customName customPost: customValue:::$customValue {/foreach} + {/if} + {if !empty($trackingFields)} {foreach from=$trackingFields item=trackingValue key=trackingName} trackingName:::$trackingName trackingValue:::$trackingValue {/foreach} + {/if} diff --git a/tests/templates/message_templates/event_online_receipt_text.tpl b/tests/templates/message_templates/event_online_receipt_text.tpl index 5b9646a6b9..370b9de737 100644 --- a/tests/templates/message_templates/event_online_receipt_text.tpl +++ b/tests/templates/message_templates/event_online_receipt_text.tpl @@ -1,34 +1,66 @@ {assign var="greeting" value="{contact.email_greeting}"}{if $greeting}{$greeting},{/if} contactID:::{$contactID} +{if !empty($event.confirm_email_text)} event.confirm_email_text:::{$event.confirm_email_text} +{/if} +{if isset($isOnWaitlist)} isOnWaitlist:::{$isOnWaitlist} +{/if} +{if isset($isRequireApproval)} isRequireApproval:::{$isRequireApproval} +{/if} participant_status:::{$participant_status} +{if isset($pricesetFieldsCount)} pricesetFieldsCount:::{$pricesetFieldsCount} +{/if} isPrimary:::{$isPrimary} +{if isset($conference_sessions)} conference_sessions:::{$conference_sessions} +{/if} +{if isset($is_pay_later)} is_pay_later:::{$is_pay_later} +{/if} +{if isset($isAmountzero)} isAmountzero:::{$isAmountzero} +{/if} +{if isset($isAdditionalParticipant)} isAdditionalParticipant:::{$isAdditionalParticipant} +{/if} +{if isset($pay_later_receipt)} pay_later_receipt:::{$pay_later_receipt} +{/if} event.event_title:::{$event.event_title} event.event_start_date:::{$event.event_start_date|date_format:"%A"} event.event_end_date:::{$event.event_end_date|date_format:"%Y%m%d"} +{if isset($event.is_monetary)} event.is_monetary:::{$event.is_monetary} +{/if} +{if !empty($event.fee_label)} event.fee_label:::{$event.fee_label} +{/if} +{if !empty($conference_sessions)} conference_sessions:::{$conference_sessions} -event.participant_role::{$event.participant_role} -defaultRole:::{$defaultRole} +{/if} +{if !empty($event.participant_role)} + event.participant_role::{$event.participant_role} + defaultRole:::{$defaultRole} +{/if} +{if !empty($isShowLocation)} isShowLocation:::{$isShowLocation} location.address.1.display:::{$location.address.1.display} location.phone.1.phone:::{$location.phone.1.phone} location.phone.1.phone_type_display:::{$location.phone.1.phone_type_display} location.phone.1.phone_ext:::{$location.phone.1.phone_ext} location.email.1.email:::{$location.email.1.email} +{/if} +{if !empty($event.is_public)} event.is_public:::{$event.is_public} +{/if} +{if !empty($payer.name)} payer.name:::{$payer.name} -lineitem:::{if $lineItem} +{/if} +lineitem:::{if !empty($lineItem)} {foreach from=$lineItem item=value key=priceset} {foreach from=$value item=line} line.html_type:::{$line.html_type} @@ -37,37 +69,67 @@ lineitem:::{if $lineItem} line.description:::{$line.description} line.qty:::{$line.qty} line.unit_price:::{$line.unit_price} + {if isset($line.tax_rate)} line.tax_rate:::{$line.tax_rate} line.tax_amount:::{$line.tax_amount} + {/if} line.line_total:::{$line.line_total} {/foreach} {/foreach} {/if} +{if !empty($part)} part:::{foreach from=$part item=value key=key} {$key}{$value} {/foreach} +{/if} +{if !empty($dataArray)} dataArray:::{$dataArray} +{/if} +{if isset($totalTaxAmount)} totalTaxAmount:::{$totalTaxAmount} -amounts:::{$amounts} +{/if} +{if !empty($amounts)} +{foreach from=$amounts item=amountValue key=amountKey} +amounts:::$amountKey $amountValue +{/foreach} +{/if} register_date:::{$register_date|crmDate} +{if !empty($receive_date)} receive_date:::{$receive_date|crmDate} +{/if} +{if !empty($financialTypeName)} financialTypeName:::{$financialTypeName} +{/if} +{if !empty($trxn_id)} trxn_id:::{$trxn_id} +{/if} +{if !empty($paidBy)} paidBy:::{$paidBy} +{/if} +{if isset($checkNumber)} checkNumber:::{$checkNumber} +{/if} +{if isset($billingName)} billingName:::{$billingName} +{/if} +{if isset($credit_card_type)} credit_card_type:::{$credit_card_type} credit_card_number:::{$credit_card_number} address:::{$address} credit_card_exp_date:::{$credit_card_exp_date} +{/if} +{if !empty($customPre)} {foreach from=$customPre item=customValue key=customName} customPre: customName:::$customName customPre: customValue:::$customValue {/foreach} +{/if} +{if !empty($customPost)} {foreach from=$customPost item=customValue key=customName} customPost: customName:::$customName customPost: customValue:::$customValue {/foreach} +{/if} diff --git a/xml/templates/message_templates/contribution_invoice_receipt_html.tpl b/xml/templates/message_templates/contribution_invoice_receipt_html.tpl index cd5733cc6a..c9d2f9e251 100644 --- a/xml/templates/message_templates/contribution_invoice_receipt_html.tpl +++ b/xml/templates/message_templates/contribution_invoice_receipt_html.tpl @@ -109,6 +109,7 @@ {ts}Sub Total{/ts} {$subTotal|crmMoney:$currency} + {if !empty($dataArray)} {foreach from=$dataArray item=value key=priceset} @@ -118,9 +119,10 @@ {elseif $priceset == 0} {ts 1=$taxTerm}TOTAL %1{/ts} {$value|crmMoney:$currency} + {/if} - {/if} {/foreach} + {/if} {ts 1=$currency}TOTAL %1{/ts} @@ -339,6 +341,7 @@ {ts}Sub Total{/ts} {$subTotal|crmMoney:$currency} + {if !empty($dataArray)} {foreach from=$dataArray item=value key=priceset} @@ -348,9 +351,10 @@ {elseif $priceset == 0} {ts 1=$taxTerm}TOTAL NO %1{/ts} {$value|crmMoney:$currency} + {/if} - {/if} {/foreach} + {/if}
diff --git a/xml/templates/message_templates/contribution_offline_receipt_html.tpl b/xml/templates/message_templates/contribution_offline_receipt_html.tpl index 4f7b8819f3..d8b9ba9bbe 100644 --- a/xml/templates/message_templates/contribution_offline_receipt_html.tpl +++ b/xml/templates/message_templates/contribution_offline_receipt_html.tpl @@ -22,7 +22,7 @@ {assign var="greeting" value="{contact.email_greeting}"}{if $greeting}

{$greeting},

{/if} - {if $formValues.receipt_text} + {if !empty($formValues.receipt_text)}

{$formValues.receipt_text|htmlize}

{else}

{ts}Below you will find a receipt for this contribution.{/ts}

@@ -54,7 +54,7 @@ - {if $lineItem and !$is_quick_config} + {if !empty($lineItem) and empty($is_quick_config)} {foreach from=$lineItem item=value key=priceset} @@ -63,7 +63,7 @@ {ts}Item{/ts} {ts}Qty{/ts} {ts}Each{/ts} - {if $getTaxDetails} + {if !empty($getTaxDetails)} {ts}Subtotal{/ts} {ts}Tax Rate{/ts} {ts}Tax Amount{/ts} @@ -81,11 +81,11 @@ {$line.unit_price|crmMoney:$currency} - {if $getTaxDetails} + {if !empty($getTaxDetails)} {$line.unit_price*$line.qty|crmMoney:$currency} - {if $line.tax_rate != "" || $line.tax_amount != ""} + {if isset($line.tax_rate) and ($line.tax_rate != "" || $line.tax_amount != "")} {$line.tax_rate|string_format:"%.2f"}% @@ -107,7 +107,7 @@ {/foreach} {/if} - {if $getTaxDetails && $dataArray} + {if !empty($getTaxDetails) && !empty($dataArray)} {ts} Amount before Tax : {/ts} @@ -150,7 +150,7 @@ - {if $receive_date} + {if !empty($receive_date)} {ts}Date Received{/ts} @@ -172,7 +172,7 @@ {/if} - {if $formValues.paidBy and !$formValues.hidden_CreditCard} + {if !empty($formValues.paidBy) and empty($formValues.hidden_CreditCard)} {ts}Paid By{/ts} @@ -181,7 +181,7 @@ {$formValues.paidBy} - {if $formValues.check_number} + {if !empty($formValues.check_number)} {ts}Check Number{/ts} @@ -193,7 +193,7 @@ {/if} {/if} - {if $formValues.trxn_id} + {if !empty($formValues.trxn_id)} {ts}Transaction ID{/ts} @@ -204,7 +204,7 @@ {/if} - {if $ccContribution} + {if !empty($ccContribution)} {ts}Billing Name and Address{/ts} @@ -230,7 +230,7 @@ {/if} - {if $softCreditTypes and $softCredits} + {if !empty($softCreditTypes) and !empty($softCredits)} {foreach from=$softCreditTypes item=softCreditType key=n} @@ -250,7 +250,7 @@ {/foreach} {/if} - {if $customGroup} + {if !empty($customGroup)} {foreach from=$customGroup item=value key=customName} @@ -270,7 +270,7 @@ {/foreach} {/if} - {if $formValues.product_name} + {if !empty($formValues.product_name)} {ts}Premium Information{/ts} diff --git a/xml/templates/message_templates/contribution_offline_receipt_text.tpl b/xml/templates/message_templates/contribution_offline_receipt_text.tpl index 50e0cd4e37..846d1a4498 100644 --- a/xml/templates/message_templates/contribution_offline_receipt_text.tpl +++ b/xml/templates/message_templates/contribution_offline_receipt_text.tpl @@ -1,6 +1,6 @@ {assign var="greeting" value="{contact.email_greeting}"}{if $greeting}{$greeting},{/if} -{if $formValues.receipt_text} +{if !empty($formValues.receipt_text)} {$formValues.receipt_text} {else}{ts}Below you will find a receipt for this contribution.{/ts}{/if} @@ -16,21 +16,21 @@ {capture assign=ts_item}{ts}Item{/ts}{/capture} {capture assign=ts_qty}{ts}Qty{/ts}{/capture} {capture assign=ts_each}{ts}Each{/ts}{/capture} -{if $getTaxDetails} +{if !empty($getTaxDetails)} {capture assign=ts_subtotal}{ts}Subtotal{/ts}{/capture} {capture assign=ts_taxRate}{ts}Tax Rate{/ts}{/capture} {capture assign=ts_taxAmount}{ts}Tax Amount{/ts}{/capture} {/if} {capture assign=ts_total}{ts}Total{/ts}{/capture} -{$ts_item|string_format:"%-30s"} {$ts_qty|string_format:"%5s"} {$ts_each|string_format:"%10s"} {if $getTaxDetails} {$ts_subtotal|string_format:"%10s"} {$ts_taxRate} {$ts_taxAmount|string_format:"%10s"} {/if} {$ts_total|string_format:"%10s"} +{$ts_item|string_format:"%-30s"} {$ts_qty|string_format:"%5s"} {$ts_each|string_format:"%10s"} {if !empty($getTaxDetails)} {$ts_subtotal|string_format:"%10s"} {$ts_taxRate} {$ts_taxAmount|string_format:"%10s"} {/if} {$ts_total|string_format:"%10s"} ---------------------------------------------------------- {foreach from=$value item=line} -{capture assign=ts_item}{if $line.html_type eq 'Text'}{$line.label}{else}{$line.field_title} - {$line.label}{/if} {if $line.description} {$line.description}{/if}{/capture}{$ts_item|truncate:30:"..."|string_format:"%-30s"} {$line.qty|string_format:"%5s"} {$line.unit_price|crmMoney:$currency|string_format:"%10s"} {if $getTaxDetails}{$line.unit_price*$line.qty|crmMoney:$currency|string_format:"%10s"} {if $line.tax_rate != "" || $line.tax_amount != ""} {$line.tax_rate|string_format:"%.2f"} % {$line.tax_amount|crmMoney:$currency|string_format:"%10s"} {else} {/if} {/if} {$line.line_total+$line.tax_amount|crmMoney:$currency|string_format:"%10s"} +{capture assign=ts_item}{if $line.html_type eq 'Text'}{$line.label}{else}{$line.field_title} - {$line.label}{/if} {if $line.description} {$line.description}{/if}{/capture}{$ts_item|truncate:30:"..."|string_format:"%-30s"} {$line.qty|string_format:"%5s"} {$line.unit_price|crmMoney:$currency|string_format:"%10s"} {if !empty($getTaxDetails)}{$line.unit_price*$line.qty|crmMoney:$currency|string_format:"%10s"} {if $line.tax_rate != "" || $line.tax_amount != ""} {$line.tax_rate|string_format:"%.2f"} % {$line.tax_amount|crmMoney:$currency|string_format:"%10s"} {else} {/if} {/if} {$line.line_total+$line.tax_amount|crmMoney:$currency|string_format:"%10s"} {/foreach} {/foreach} {/if} -{if $getTaxDetails && $dataArray} +{if !empty($getTaxDetails) && !empty($dataArray)} {ts}Amount before Tax{/ts} : {$formValues.total_amount-$totalTaxAmount|crmMoney:$currency} {foreach from=$dataArray item=value key=priceset} @@ -46,23 +46,23 @@ {ts}Total Tax Amount{/ts} : {$totalTaxAmount|crmMoney:$currency} {/if} {ts}Total Amount{/ts} : {$formValues.total_amount|crmMoney:$currency} -{if $receive_date} +{if !empty($receive_date)} {ts}Date Received{/ts}: {$receive_date|truncate:10:''|crmDate} {/if} {if $receipt_date} {ts}Receipt Date{/ts}: {$receipt_date|truncate:10:''|crmDate} {/if} -{if $formValues.paidBy and !$formValues.hidden_CreditCard} +{if !empty($formValues.paidBy) and empty($formValues.hidden_CreditCard)} {ts}Paid By{/ts}: {$formValues.paidBy} -{if $formValues.check_number} +{if !empty($formValues.check_number)} {ts}Check Number{/ts}: {$formValues.check_number} {/if} {/if} -{if $formValues.trxn_id} +{if !empty($formValues.trxn_id)} {ts}Transaction ID{/ts}: {$formValues.trxn_id} {/if} -{if $ccContribution} +{if !empty($ccContribution)} =========================================================== {ts}Billing Name and Address{/ts} @@ -78,7 +78,7 @@ {$credit_card_number} {ts}Expires{/ts}: {$credit_card_exp_date|truncate:7:''|crmDate} {/if} -{if $customGroup} +{if !empty($customGroup)} {foreach from=$customGroup item=value key=customName} =========================================================== {$customName} @@ -89,7 +89,7 @@ {/foreach} {/if} -{if $softCreditTypes and $softCredits} +{if !empty($softCreditTypes) and !empty($softCredits)} {foreach from=$softCreditTypes item=softCreditType key=n} =========================================================== {$softCreditType} @@ -100,7 +100,7 @@ {/foreach} {/if} -{if $formValues.product_name} +{if !empty($formValues.product_name)} =========================================================== {ts}Premium Information{/ts} diff --git a/xml/templates/message_templates/contribution_online_receipt_html.tpl b/xml/templates/message_templates/contribution_online_receipt_html.tpl index fd9c0b8e84..280e236f53 100644 --- a/xml/templates/message_templates/contribution_online_receipt_html.tpl +++ b/xml/templates/message_templates/contribution_online_receipt_html.tpl @@ -22,12 +22,12 @@ {assign var="greeting" value="{contact.email_greeting}"}{if $greeting}

{$greeting},

{/if} - {if $receipt_text} + {if !empty($receipt_text)}

{$receipt_text|htmlize}

{/if} {if $is_pay_later} -

{$pay_later_receipt}

{* FIXME: this might be text rather than HTML *} +

{if isset($pay_later_receipt)}{$pay_later_receipt}{/if}

{* FIXME: this might be text rather than HTML *} {/if} @@ -44,7 +44,7 @@ - {if $lineItem and $priceSetID and !$is_quick_config} + {if !empty($lineItem) and !empty($priceSetID) and empty($is_quick_config)} {foreach from=$lineItem item=value key=priceset} @@ -54,7 +54,7 @@ {ts}Item{/ts} {ts}Qty{/ts} {ts}Each{/ts} - {if $dataArray} + {if !empty($dataArray)} {ts}Subtotal{/ts} {ts}Tax Rate{/ts} {ts}Tax Amount{/ts} @@ -72,11 +72,11 @@ {$line.unit_price|crmMoney:$currency} - {if $getTaxDetails} + {if !empty($getTaxDetails)} {$line.unit_price*$line.qty|crmMoney:$currency} - {if $line.tax_rate != "" || $line.tax_amount != ""} + {if isset($line.tax_rate) and ($line.tax_rate != "" || $line.tax_amount != "")} {$line.tax_rate|string_format:"%.2f"}% @@ -97,7 +97,7 @@ {/foreach} - {if $dataArray} + {if !empty($dataArray)} {ts} Amount before Tax : {/ts} @@ -120,7 +120,7 @@ {/foreach} {/if} - {if $totalTaxAmount} + {if isset($totalTaxAmount)} {ts}Total Tax{/ts} @@ -141,7 +141,7 @@ {else} - {if $totalTaxAmount} + {if !empty($totalTaxAmount)} {ts}Total Tax Amount{/ts} @@ -156,7 +156,7 @@ {ts}Amount{/ts} - {$amount|crmMoney:$currency} {if $amount_level} - {$amount_level}{/if} + {$amount|crmMoney:$currency} {if isset($amount_level)} - {$amount_level}{/if} @@ -165,7 +165,7 @@ {/if} - {if $receive_date} + {if !empty($receive_date)} {ts}Date{/ts} @@ -176,7 +176,7 @@ {/if} - {if $is_monetary and $trxn_id} + {if !empty($is_monetary) and !empty($trxn_id)} {ts}Transaction #{/ts} @@ -187,7 +187,7 @@ {/if} - {if $is_recur} + {if !empty($is_recur)} {ts}This is a recurring contribution.{/ts} @@ -228,7 +228,7 @@ {/foreach} - {elseif $softCreditTypes and $softCredits} + {elseif !empty($softCreditTypes) and !empty($softCredits)} {foreach from=$softCreditTypes item=softCreditType key=n} @@ -248,7 +248,7 @@ {/foreach} {/if} - {if $pcpBlock} + {if !empty($pcpBlock)} {ts}Personal Campaign Page{/ts} @@ -284,7 +284,7 @@ {/if} {/if} - {if $onBehalfProfile} + {if !empty($onBehalfProfile)} {$onBehalfProfile_grouptitle} @@ -302,7 +302,7 @@ {/foreach} {/if} - {if $isShare} + {if !empty($isShare)} {capture assign=contributionUrl}{crmURL p='civicrm/contribute/transact' q="reset=1&id=`$contributionPageId`" a=true fe=1 h=1}{/capture} @@ -311,7 +311,7 @@ {/if} - {if $billingName} + {if !empty($billingName)} {ts}Billing Name and Address{/ts} @@ -324,7 +324,7 @@ {$email} - {elseif $email} + {elseif !empty($email)} {ts}Registered Email{/ts} @@ -337,7 +337,7 @@ {/if} - {if $credit_card_type} + {if !empty($credit_card_type)} {ts}Credit Card Information{/ts} @@ -352,7 +352,7 @@ {/if} - {if $selectPremium} + {if !empty($selectPremium)} {ts}Premium Information{/ts} @@ -403,20 +403,20 @@ {/if} - {if $contact_email OR $contact_phone} + {if !empty($contact_email) OR !empty($contact_phone)}

{ts}For information about this premium, contact:{/ts}

- {if $contact_email} + {if !empty($contact_email)}

{$contact_email}

{/if} - {if $contact_phone} + {if !empty($contact_phone)}

{$contact_phone}

{/if} {/if} - {if $is_deductible AND $price} + {if !empty($is_deductible) AND !empty($price)}

{ts 1=$price|crmMoney:$currency}The value of this premium is %1. This may affect the amount of the tax deduction you can claim. Consult your tax advisor for more information.{/ts}

@@ -425,14 +425,14 @@ {/if} {/if} - {if $customPre} + {if !empty($customPre)} {$customPre_grouptitle} {foreach from=$customPre item=customValue key=customName} - {if ($trackingFields and ! in_array($customName, $trackingFields)) or ! $trackingFields} + {if (!empty($trackingFields) and ! in_array($customName, $trackingFields)) or empty($trackingFields)} {$customName} @@ -445,14 +445,14 @@ {/foreach} {/if} - {if $customPost} + {if !empty($customPost)} {$customPost_grouptitle} {foreach from=$customPost item=customValue key=customName} - {if ($trackingFields and ! in_array($customName, $trackingFields)) or ! $trackingFields} + {if (!empty($trackingFields) and ! in_array($customName, $trackingFields)) or empty($trackingFields)} {$customName} diff --git a/xml/templates/message_templates/contribution_online_receipt_text.tpl b/xml/templates/message_templates/contribution_online_receipt_text.tpl index 4c86a366c7..8a0068d5f2 100644 --- a/xml/templates/message_templates/contribution_online_receipt_text.tpl +++ b/xml/templates/message_templates/contribution_online_receipt_text.tpl @@ -1,11 +1,11 @@ {assign var="greeting" value="{contact.email_greeting}"}{if $greeting}{$greeting},{/if} -{if $receipt_text} +{if !empty($receipt_text)} {$receipt_text} {/if} {if $is_pay_later} =========================================================== -{$pay_later_receipt} +{if isset($pay_later_receipt)}{$pay_later_receipt}{/if} =========================================================== {/if} @@ -14,26 +14,26 @@ {ts}Contribution Information{/ts} =========================================================== -{if $lineItem and $priceSetID and !$is_quick_config} +{if $lineItem and $priceSetID and empty($is_quick_config)} {foreach from=$lineItem item=value key=priceset} --------------------------------------------------------- {capture assign=ts_item}{ts}Item{/ts}{/capture} {capture assign=ts_qty}{ts}Qty{/ts}{/capture} {capture assign=ts_each}{ts}Each{/ts}{/capture} -{if $dataArray} +{if !empty($dataArray)} {capture assign=ts_subtotal}{ts}Subtotal{/ts}{/capture} {capture assign=ts_taxRate}{ts}Tax Rate{/ts}{/capture} {capture assign=ts_taxAmount}{ts}Tax Amount{/ts}{/capture} {/if} {capture assign=ts_total}{ts}Total{/ts}{/capture} -{$ts_item|string_format:"%-30s"} {$ts_qty|string_format:"%5s"} {$ts_each|string_format:"%10s"} {if $dataArray} {$ts_subtotal|string_format:"%10s"} {$ts_taxRate} {$ts_taxAmount|string_format:"%10s"} {/if} {$ts_total|string_format:"%10s"} +{$ts_item|string_format:"%-30s"} {$ts_qty|string_format:"%5s"} {$ts_each|string_format:"%10s"} {if !empty($dataArray)} {$ts_subtotal|string_format:"%10s"} {$ts_taxRate} {$ts_taxAmount|string_format:"%10s"} {/if} {$ts_total|string_format:"%10s"} ---------------------------------------------------------- {foreach from=$value item=line} -{capture assign=ts_item}{if $line.html_type eq 'Text'}{$line.label}{else}{$line.field_title} - {$line.label}{/if} {if $line.description} {$line.description}{/if}{/capture}{$ts_item|truncate:30:"..."|string_format:"%-30s"} {$line.qty|string_format:"%5s"} {$line.unit_price|crmMoney:$currency|string_format:"%10s"} {if $dataArray}{$line.unit_price*$line.qty|crmMoney:$currency|string_format:"%10s"} {if $line.tax_rate != "" || $line.tax_amount != ""} {$line.tax_rate|string_format:"%.2f"} % {$line.tax_amount|crmMoney:$currency|string_format:"%10s"} {else} {/if} {/if} {$line.line_total+$line.tax_amount|crmMoney:$currency|string_format:"%10s"} +{capture assign=ts_item}{if $line.html_type eq 'Text'}{$line.label}{else}{$line.field_title} - {$line.label}{/if} {if $line.description} {$line.description}{/if}{/capture}{$ts_item|truncate:30:"..."|string_format:"%-30s"} {$line.qty|string_format:"%5s"} {$line.unit_price|crmMoney:$currency|string_format:"%10s"} {if !empty($dataArray)}{$line.unit_price*$line.qty|crmMoney:$currency|string_format:"%10s"} {if $line.tax_rate != "" || $line.tax_amount != ""} {$line.tax_rate|string_format:"%.2f"} % {$line.tax_amount|crmMoney:$currency|string_format:"%10s"} {else} {/if} {/if} {$line.line_total+$line.tax_amount|crmMoney:$currency|string_format:"%10s"} {/foreach} {/foreach} -{if $dataArray} +{if !empty($dataArray)} {ts}Amount before Tax{/ts}: {$amount-$totalTaxAmount|crmMoney:$currency} {foreach from=$dataArray item=value key=priceset} @@ -45,24 +45,24 @@ {/foreach} {/if} -{if $totalTaxAmount} +{if isset($totalTaxAmount)} {ts}Total Tax Amount{/ts}: {$totalTaxAmount|crmMoney:$currency} {/if} {ts}Total Amount{/ts}: {$amount|crmMoney:$currency} {else} -{ts}Amount{/ts}: {$amount|crmMoney:$currency} {if $amount_level } - {$amount_level} {/if} +{ts}Amount{/ts}: {$amount|crmMoney:$currency} {if isset($amount_level) } - {$amount_level} {/if} {/if} {/if} -{if $receive_date} +{if !empty($receive_date)} {ts}Date{/ts}: {$receive_date|crmDate} {/if} -{if $is_monetary and $trxn_id} +{if !empty($is_monetary) and !empty($trxn_id)} {ts}Transaction #{/ts}: {$trxn_id} {/if} -{if $is_recur} +{if !empty($is_recur)} {ts}This is a recurring contribution.{/ts} {if $cancelSubscriptionUrl} @@ -94,7 +94,7 @@ {foreach from=$honoreeProfile item=value key=label} {$label}: {$value} {/foreach} -{elseif $softCreditTypes and $softCredits} +{elseif !empty($softCreditTypes) and !empty($softCredits)} {foreach from=$softCreditTypes item=softCreditType key=n} =========================================================== {$softCreditType} @@ -104,7 +104,7 @@ {/foreach} {/foreach} {/if} -{if $pcpBlock} +{if !empty($pcpBlock)} =========================================================== {ts}Personal Campaign Page{/ts} @@ -116,7 +116,7 @@ {if $pcp_personal_note}{ts}Personal Note{/ts}: {$pcp_personal_note}{/if} {/if} -{if $onBehalfProfile} +{if !empty($onBehalfProfile)} =========================================================== {ts}On Behalf Of{/ts} @@ -126,7 +126,7 @@ {/foreach} {/if} -{if $billingName} +{if !empty($billingName)} =========================================================== {ts}Billing Name and Address{/ts} @@ -135,14 +135,14 @@ {$address} {$email} -{elseif $email} +{elseif !empty($email)} =========================================================== {ts}Registered Email{/ts} =========================================================== {$email} {/if} {* End billingName or Email*} -{if $credit_card_type} +{if !empty($credit_card_type)} =========================================================== {ts}Credit Card Information{/ts} @@ -153,7 +153,7 @@ {ts}Expires{/ts}: {$credit_card_exp_date|truncate:7:''|crmDate} {/if} -{if $selectPremium } +{if !empty($selectPremium )} =========================================================== {ts}Premium Information{/ts} @@ -171,42 +171,42 @@ {if $end_date} {ts}End Date{/ts}: {$end_date|crmDate} {/if} -{if $contact_email OR $contact_phone} +{if !empty($contact_email) OR !empty($contact_phone)} {ts}For information about this premium, contact:{/ts} -{if $contact_email} +{if !empty($contact_email)} {$contact_email} {/if} -{if $contact_phone} +{if !empty($contact_phone)} {$contact_phone} {/if} {/if} -{if $is_deductible AND $price} +{if !empty($is_deductible) AND !empty($price)} {ts 1=$price|crmMoney:$currency}The value of this premium is %1. This may affect the amount of the tax deduction you can claim. Consult your tax advisor for more information.{/ts}{/if} {/if} -{if $customPre} +{if !empty($customPre)} =========================================================== {$customPre_grouptitle} =========================================================== {foreach from=$customPre item=customValue key=customName} -{if ( $trackingFields and ! in_array( $customName, $trackingFields ) ) or ! $trackingFields} +{if ( !empty($trackingFields) and ! in_array( $customName, $trackingFields ) ) or empty($trackingFields)} {$customName}: {$customValue} {/if} {/foreach} {/if} -{if $customPost} +{if !empty($customPost)} =========================================================== {$customPost_grouptitle} =========================================================== {foreach from=$customPost item=customValue key=customName} -{if ( $trackingFields and ! in_array( $customName, $trackingFields ) ) or ! $trackingFields} +{if ( !empty($trackingFields) and ! in_array( $customName, $trackingFields ) ) or empty($trackingFields)} {$customName}: {$customValue} {/if} {/foreach} diff --git a/xml/templates/message_templates/event_offline_receipt_html.tpl b/xml/templates/message_templates/event_offline_receipt_html.tpl index 876a478e01..15fec07acc 100644 --- a/xml/templates/message_templates/event_offline_receipt_html.tpl +++ b/xml/templates/message_templates/event_offline_receipt_html.tpl @@ -23,22 +23,22 @@ {assign var="greeting" value="{contact.email_greeting}"}{if $greeting}

{$greeting},

{/if} - {if $event.confirm_email_text AND (not $isOnWaitlist AND not $isRequireApproval)} + {if !empty($event.confirm_email_text) AND (empty($isOnWaitlist) AND empty($isRequireApproval))}

{$event.confirm_email_text|htmlize}

{/if} - {if $isOnWaitlist} + {if !empty($isOnWaitlist)}

{ts}You have been added to the WAIT LIST for this event.{/ts}

- {if $isPrimary} + {if !empty($isPrimary)}

{ts}If space becomes available you will receive an email with a link to a web page where you can complete your registration.{/ts}

{/if} - {elseif $isRequireApproval} + {elseif !empty($isRequireApproval)}

{ts}Your registration has been submitted.{/ts}

- {if $isPrimary} + {if !empty($isPrimary)}

{ts}Once your registration has been reviewed, you will receive an email with a link to a web page where you can complete the registration process.{/ts}

{/if} - {elseif $is_pay_later} -

{$pay_later_receipt}

{* FIXME: this might be text rather than HTML *} + {elseif !empty($is_pay_later)} +

{if isset($pay_later_receipt)}{$pay_later_receipt}{/if}

{* FIXME: this might be text rather than HTML *} {/if} @@ -58,7 +58,7 @@ - {if $event.participant_role neq 'Attendee' and $defaultRole} + {if !empty($event.participant_role) and $event.participant_role neq 'Attendee' and !empty($defaultRole)} {ts}Participant Role{/ts} @@ -69,7 +69,7 @@ {/if} - {if $isShowLocation} + {if !empty($isShowLocation)} {$location.address.1.display|nl2br} @@ -77,7 +77,7 @@ {/if} - {if $location.phone.1.phone || $location.email.1.email} + {if !empty($location.phone.1.phone) || !empty($location.email.1.email)} {ts}Event Contacts:{/ts} @@ -113,7 +113,7 @@ {/foreach} {/if} - {if $event.is_public} + {if !empty($event.is_public)} {capture assign=icalFeed}{crmURL p='civicrm/event/ical' q="reset=1&id=`$event.id`" h=0 a=1 fe=1}{/capture} @@ -136,15 +136,15 @@ {/if} - {if $event.is_monetary} + {if !empty($event.is_monetary)} - {$event.fee_label} + {if !empty($event.fee_label)}{$event.fee_label}{/if} - {if $lineItem} + {if !empty($lineItem)} {foreach from=$lineItem item=value key=priceset} {if $value neq 'skip'} {if $isPrimary} @@ -163,13 +163,13 @@ {ts}Item{/ts} {ts}Qty{/ts} {ts}Each{/ts} - {if $dataArray} + {if !empty($dataArray)} {ts}SubTotal{/ts} {ts}Tax Rate{/ts} {ts}Tax Amount{/ts} {/if} {ts}Total{/ts} - {if $pricesetFieldsCount }{ts}Total Participants{/ts}{/if} + {if !empty($pricesetFieldsCount) }{ts}Total Participants{/ts}{/if} {foreach from=$value item=line} @@ -182,7 +182,7 @@ {$line.unit_price|crmMoney} - {if $dataArray} + {if !empty($dataArray)} {$line.unit_price*$line.qty|crmMoney} @@ -201,7 +201,7 @@ {$line.line_total+$line.tax_amount|crmMoney} - {if $pricesetFieldsCount } + {if !empty($pricesetFieldsCount) } {$line.participant_count} @@ -213,7 +213,7 @@ {/if} {/foreach} - {if $dataArray} + {if !empty($dataArray)} {ts}Amount Before Tax:{/ts} @@ -236,7 +236,7 @@ {/if} {/if} - {if $amount && !$lineItem} + {if !empty($amount) && !$lineItem} {foreach from=$amount item=amnt key=level} @@ -245,7 +245,7 @@ {/foreach} {/if} - {if $totalTaxAmount} + {if isset($totalTaxAmount)} {ts}Total Tax Amount{/ts} @@ -265,10 +265,10 @@ {/if} - {$totalAmount|crmMoney} {if $hookDiscount.message}({$hookDiscount.message}){/if} + {if !empty($totalAmount)}{$totalAmount|crmMoney}{/if} {if !empty($hookDiscount.message)}({$hookDiscount.message}){/if} - {if $balanceAmount} + {if isset($balanceAmount)} {ts}Balance{/ts} @@ -278,7 +278,7 @@ {/if} - {if $pricesetFieldsCount } + {if !empty($pricesetFieldsCount) } {ts}Total Participants{/ts} @@ -300,10 +300,10 @@ {/if} - {if $is_pay_later} + {if !empty($is_pay_later)} - {$pay_later_receipt} + {if isset($pay_later_receipt)}{$pay_later_receipt}{/if} {/if} @@ -319,7 +319,7 @@ {/if} - {if $receive_date} + {if !empty($receive_date)} {ts}Transaction Date{/ts} @@ -330,7 +330,7 @@ {/if} - {if $financialTypeName} + {if !empty($financialTypeName)} {ts}Financial Type{/ts} @@ -341,7 +341,7 @@ {/if} - {if $trxn_id} + {if !empty($trxn_id)} {ts}Transaction #{/ts} @@ -352,7 +352,7 @@ {/if} - {if $paidBy} + {if !empty($paidBy)} {ts}Paid By{/ts} @@ -363,7 +363,7 @@ {/if} - {if $checkNumber} + {if !empty($checkNumber)} {ts}Check Number{/ts} @@ -374,7 +374,7 @@ {/if} - {if $billingName} + {if !empty($billingName)} {ts}Billing Name and Address{/ts} @@ -388,7 +388,7 @@ {/if} - {if $credit_card_type} + {if !empty($credit_card_type)} {ts}Credit Card Information{/ts} @@ -407,14 +407,14 @@ {/if} {* End of conditional section for Paid events *} - {if $customPre} + {if !empty($customPre)} {$customPre_grouptitle} {foreach from=$customPre item=value key=customName} - {if ( $trackingFields and ! in_array( $customName, $trackingFields ) ) or ! $trackingFields} + {if ( !empty($trackingFields) and ! in_array( $customName, $trackingFields ) ) or empty($trackingFields)} {$customName} @@ -427,14 +427,14 @@ {/foreach} {/if} - {if $customPost} + {if !empty($customPost)} {$customPost_grouptitle} {foreach from=$customPost item=value key=customName} - {if ( $trackingFields and ! in_array( $customName, $trackingFields ) ) or ! $trackingFields} + {if ( !empty($trackingFields) and ! in_array( $customName, $trackingFields ) ) or empty($trackingFields)} {$customName} @@ -447,7 +447,7 @@ {/foreach} {/if} - {if $customProfile} + {if !empty($customProfile)} {foreach from=$customProfile item=value key=customName} @@ -480,7 +480,7 @@ {/foreach} {/if} - {if $customGroup} + {if !empty($customGroup)} {foreach from=$customGroup item=value key=customName} diff --git a/xml/templates/message_templates/event_offline_receipt_text.tpl b/xml/templates/message_templates/event_offline_receipt_text.tpl index e128670c91..2e8b682de6 100644 --- a/xml/templates/message_templates/event_offline_receipt_text.tpl +++ b/xml/templates/message_templates/event_offline_receipt_text.tpl @@ -1,10 +1,10 @@ {assign var="greeting" value="{contact.email_greeting}"}{if $greeting}{$greeting},{/if} -{if $event.confirm_email_text AND (not $isOnWaitlist AND not $isRequireApproval)} +{if !empty($event.confirm_email_text) AND (empty($isOnWaitlist) AND empty($isRequireApproval))} {$event.confirm_email_text} {/if} -{if $isOnWaitlist} -==========================================================={if $pricesetFieldsCount }===================={/if} +{if !empty($isOnWaitlist)} +==========================================================={if !empty($pricesetFieldsCount) }===================={/if} {ts}You have been added to the WAIT LIST for this event.{/ts} @@ -12,10 +12,10 @@ {ts}If space becomes available you will receive an email with a link to a web page where you can complete your registration.{/ts} {/if} -==========================================================={if $pricesetFieldsCount }===================={/if} +==========================================================={if !empty($pricesetFieldsCount) }===================={/if} -{elseif $isRequireApproval} -==========================================================={if $pricesetFieldsCount }===================={/if} +{elseif !empty($isRequireApproval)} +==========================================================={if !empty($pricesetFieldsCount) }===================={/if} {ts}Your registration has been submitted.{/ts} @@ -23,36 +23,36 @@ {ts}Once your registration has been reviewed, you will receive an email with a link to a web page where you can complete the registration process.{/ts} {/if} -==========================================================={if $pricesetFieldsCount }===================={/if} +==========================================================={if !empty($pricesetFieldsCount) }===================={/if} -{elseif $is_pay_later} +{elseif !empty($is_pay_later)} -==========================================================={if $pricesetFieldsCount }===================={/if} +==========================================================={if !empty($pricesetFieldsCount) }===================={/if} -{$pay_later_receipt} -==========================================================={if $pricesetFieldsCount }===================={/if} +{if isset($pay_later_receipt)}{$pay_later_receipt}{/if} +==========================================================={if !empty($pricesetFieldsCount) }===================={/if} {/if} -==========================================================={if $pricesetFieldsCount }===================={/if} +==========================================================={if !empty($pricesetFieldsCount) }===================={/if} {ts}Event Information and Location{/ts} -==========================================================={if $pricesetFieldsCount }===================={/if} +==========================================================={if !empty($pricesetFieldsCount) }===================={/if} {$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 neq 'Attendee' and $defaultRole} +{if !empty($event.participant_role) and $event.participant_role neq 'Attendee' and empty($defaultRole)} {ts}Participant Role{/ts}: {$event.participant_role} {/if} -{if $isShowLocation} +{if !empty($isShowLocation)} {$location.address.1.display|strip_tags:false} {/if}{*End of isShowLocation condition*} -{if $location.phone.1.phone || $location.email.1.email} +{if !empty($location.phone.1.phone) || !empty($location.email.1.email)} {ts}Event Contacts:{/ts} {foreach from=$location.phone item=phone} @@ -66,59 +66,59 @@ {ts}Email{/ts}: {$eventEmail.email}{/if}{/foreach} {/if} -{if $event.is_public} +{if !empty($event.is_public)} {capture assign=icalFeed}{crmURL p='civicrm/event/ical' q="reset=1&id=`$event.id`" h=0 a=1 fe=1}{/capture} {ts}Download iCalendar File:{/ts} {$icalFeed} {/if} -{if $email} +{if !empty($email)} -==========================================================={if $pricesetFieldsCount }===================={/if} +==========================================================={if !empty($pricesetFieldsCount) }===================={/if} {ts}Registered Email{/ts} -==========================================================={if $pricesetFieldsCount }===================={/if} +==========================================================={if !empty($pricesetFieldsCount) }===================={/if} {$email} {/if} -{if $event.is_monetary} {* This section for Paid events only.*} +{if !empty($event.is_monetary)} {* This section for Paid events only.*} -==========================================================={if $pricesetFieldsCount }===================={/if} +==========================================================={if !empty($pricesetFieldsCount) }===================={/if} -{$event.fee_label} -==========================================================={if $pricesetFieldsCount }===================={/if} +{if !empty($event.fee_label)}{$event.fee_label}{/if} +==========================================================={if !empty($pricesetFieldsCount) }===================={/if} -{if $lineItem}{foreach from=$lineItem item=value key=priceset} +{if !empty($lineItem)}{foreach from=$lineItem item=value key=priceset} {if $value neq 'skip'} -{if $isPrimary} +{if !empty($isPrimary)} {if $lineItem|@count GT 1} {* Header for multi participant registration cases. *} {ts 1=$priceset+1}Participant %1{/ts} {/if} {/if} ----------------------------------------------------------{if $pricesetFieldsCount }--------------------{/if} +---------------------------------------------------------{if !empty($pricesetFieldsCount) }--------------------{/if} {capture assign=ts_item}{ts}Item{/ts}{/capture} {capture assign=ts_qty}{ts}Qty{/ts}{/capture} {capture assign=ts_each}{ts}Each{/ts}{/capture} -{if $dataArray} +{if !empty($dataArray)} {capture assign=ts_subtotal}{ts}Subtotal{/ts}{/capture} {capture assign=ts_taxRate}{ts}Tax Rate{/ts}{/capture} {capture assign=ts_taxAmount}{ts}Tax Amount{/ts}{/capture} {/if} {capture assign=ts_total}{ts}Total{/ts}{/capture} -{capture assign=ts_participant_total}{if $pricesetFieldsCount }{ts}Total Participants{/ts}{/if}{/capture} -{$ts_item|string_format:"%-30s"} {$ts_qty|string_format:"%5s"} {$ts_each|string_format:"%10s"} {if $dataArray} {$ts_subtotal|string_format:"%10s"} {$ts_taxRate|string_format:"%10s"} {$ts_taxAmount|string_format:"%10s"} {/if} {$ts_total|string_format:"%10s"} {$ts_participant_total|string_format:"%10s"} -----------------------------------------------------------{if $pricesetFieldsCount }--------------------{/if} +{capture assign=ts_participant_total}{if !empty($pricesetFieldsCount) }{ts}Total Participants{/ts}{/if}{/capture} +{$ts_item|string_format:"%-30s"} {$ts_qty|string_format:"%5s"} {$ts_each|string_format:"%10s"} {if !empty($dataArray)} {$ts_subtotal|string_format:"%10s"} {$ts_taxRate|string_format:"%10s"} {$ts_taxAmount|string_format:"%10s"} {/if} {$ts_total|string_format:"%10s"} {if !empty($ts_participant_total)}{$ts_participant_total|string_format:"%10s"}{/if} +----------------------------------------------------------{if !empty($pricesetFieldsCount) }--------------------{/if} {foreach from=$value item=line} -{if $pricesetFieldsCount }{capture assign=ts_participant_count}{$line.participant_count}{/capture}{/if} -{capture assign=ts_item}{if $line.html_type eq 'Text'}{$line.label}{else}{$line.field_title} - {$line.label}{/if} {if $line.description} {$line.description}{/if}{/capture}{$ts_item|truncate:30:"..."|string_format:"%-30s"} {$line.qty|string_format:"%5s"} {$line.unit_price|crmMoney|string_format:"%10s"} {if $dataArray} {$line.unit_price*$line.qty|crmMoney:$currency|string_format:"%10s"} {if $line.tax_rate != "" || $line.tax_amount != ""} {$line.tax_rate|string_format:"%.2f"} % {$line.tax_amount|crmMoney:$currency|string_format:"%10s"} {else} {/if} {/if} {$line.line_total+$line.tax_amount|crmMoney|string_format:"%10s"} {$ts_participant_count|string_format:"%10s"} +{if !empty($pricesetFieldsCount) }{capture assign=ts_participant_count}{$line.participant_count}{/capture}{/if} +{capture assign=ts_item}{if $line.html_type eq 'Text'}{$line.label}{else}{$line.field_title} - {$line.label}{/if} {if $line.description} {$line.description}{/if}{/capture}{$ts_item|truncate:30:"..."|string_format:"%-30s"} {$line.qty|string_format:"%5s"} {$line.unit_price|crmMoney|string_format:"%10s"} {if !empty($dataArray)} {$line.unit_price*$line.qty|crmMoney:$currency|string_format:"%10s"} {if isset($line.tax_rate) and ($line.tax_rate != "" || $line.tax_amount != "")} {$line.tax_rate|string_format:"%.2f"} % {$line.tax_amount|crmMoney:$currency|string_format:"%10s"} {else} {/if} {/if} {$line.line_total+$line.tax_amount|crmMoney|string_format:"%10s"} {if !empty($ts_participant_count)}{$ts_participant_count|string_format:"%10s"}{/if} {/foreach} {/if} {/foreach} -{if $dataArray} +{if !empty($dataArray)} {ts}Amount before Tax{/ts}: {$totalAmount-$totalTaxAmount|crmMoney:$currency} {foreach from=$dataArray item=value key=priceset} @@ -131,23 +131,23 @@ {/if} {/if} -{if $amount && !$lineItem} +{if !empty($amount) && !$lineItem} {foreach from=$amount item=amnt key=level}{$amnt.amount|crmMoney} {$amnt.label} {/foreach} {/if} -{if $totalTaxAmount} +{if isset($totalTaxAmount)} {ts}Total Tax Amount{/ts}: {$totalTaxAmount|crmMoney:$currency} {/if} -{if $isPrimary} +{if !empty($isPrimary)} -{if $balanceAmount}{ts}Total Paid{/ts}{else}{ts}Total Amount{/ts}{/if}: {$totalAmount|crmMoney} {if $hookDiscount.message}({$hookDiscount.message}){/if} +{if !empty($balanceAmount)}{ts}Total Paid{/ts}{else}{ts}Total Amount{/ts}{/if}: {if !empty($totalAmount)}{$totalAmount|crmMoney}{/if} {if !empty($hookDiscount.message)}({$hookDiscount.message}){/if} -{if $balanceAmount} +{if !empty($balanceAmount)} {ts}Balance{/ts}: {$balanceAmount|crmMoney} {/if} -{if $pricesetFieldsCount } +{if !empty($pricesetFieldsCount) } {assign var="count" value= 0} {foreach from=$lineItem item=pcount} {assign var="lineItemCount" value=0} @@ -165,12 +165,12 @@ {ts}Total Participants{/ts}: {$count} {/if} -{if $is_pay_later } +{if !empty($is_pay_later) } -==========================================================={if $pricesetFieldsCount }===================={/if} +==========================================================={if !empty($pricesetFieldsCount) }===================={/if} {$pay_later_receipt} -==========================================================={if $pricesetFieldsCount }===================={/if} +==========================================================={if !empty($pricesetFieldsCount) }===================={/if} {/if} @@ -180,35 +180,35 @@ {if $receive_date} {ts}Transaction Date{/ts}: {$receive_date|crmDate} {/if} -{if $financialTypeName} +{if !empty($financialTypeName)} {ts}Financial Type{/ts}: {$financialTypeName} {/if} -{if $trxn_id} +{if !empty($trxn_id)} {ts}Transaction #{/ts}: {$trxn_id} {/if} -{if $paidBy} +{if !empty($paidBy)} {ts}Paid By{/ts}: {$paidBy} {/if} -{if $checkNumber} +{if !empty($checkNumber)} {ts}Check Number{/ts}: {$checkNumber} {/if} -{if $billingName} +{if !empty($billingName)} -==========================================================={if $pricesetFieldsCount }===================={/if} +==========================================================={if !empty($pricesetFieldsCount) }===================={/if} {ts}Billing Name and Address{/ts} -==========================================================={if $pricesetFieldsCount }===================={/if} +==========================================================={if !empty($pricesetFieldsCount) }===================={/if} {$billingName} {$address} {/if} -{if $credit_card_type} +{if !empty($credit_card_type)} =========================================================== {ts}Credit Card Information{/ts} -==========================================================={if $pricesetFieldsCount }===================={/if} +==========================================================={if !empty($pricesetFieldsCount) }===================={/if} {$credit_card_type} {$credit_card_number} @@ -217,53 +217,53 @@ {/if} {/if} {* End of conditional section for Paid events *} -{if $customPre} -==========================================================={if $pricesetFieldsCount }===================={/if} +{if !empty($customPre)} +==========================================================={if !empty($pricesetFieldsCount) }===================={/if} {$customPre_grouptitle} -==========================================================={if $pricesetFieldsCount }===================={/if} +==========================================================={if !empty($pricesetFieldsCount) }===================={/if} {foreach from=$customPre item=value key=customName} -{if ( $trackingFields and ! in_array( $customName, $trackingFields ) ) or ! $trackingFields} +{if ( !empty($trackingFields) and ! in_array( $customName, $trackingFields ) ) or empty($trackingFields)} {$customName}: {$value} {/if} {/foreach} {/if} -{if $customPost} -==========================================================={if $pricesetFieldsCount }===================={/if} +{if !empty($customPost)} +==========================================================={if !empty($pricesetFieldsCount) }===================={/if} {$customPost_grouptitle} -==========================================================={if $pricesetFieldsCount }===================={/if} +==========================================================={if !empty($pricesetFieldsCount) }===================={/if} {foreach from=$customPost item=value key=customName} -{if ( $trackingFields and ! in_array( $customName, $trackingFields ) ) or ! $trackingFields} +{if ( !empty($trackingFields) and ! in_array( $customName, $trackingFields ) ) or empty($trackingFields)} {$customName}: {$value} {/if} {/foreach} {/if} -{if $customProfile} +{if !empty($customProfile)} {foreach from=$customProfile item=value key=customName} -==========================================================={if $pricesetFieldsCount }===================={/if} +==========================================================={if !empty($pricesetFieldsCount) }===================={/if} {ts 1=$customName+1}Participant Information - Participant %1{/ts} -==========================================================={if $pricesetFieldsCount }===================={/if} +==========================================================={if !empty($pricesetFieldsCount) }===================={/if} {foreach from=$value item=val key=field} {if $field eq 'additionalCustomPre' or $field eq 'additionalCustomPost' } {if $field eq 'additionalCustomPre' } -----------------------------------------------------------{if $pricesetFieldsCount }--------------------{/if} +----------------------------------------------------------{if !empty($pricesetFieldsCount) }--------------------{/if} {$additionalCustomPre_grouptitle} -----------------------------------------------------------{if $pricesetFieldsCount }--------------------{/if} +----------------------------------------------------------{if !empty($pricesetFieldsCount) }--------------------{/if} {else} -----------------------------------------------------------{if $pricesetFieldsCount }--------------------{/if} +----------------------------------------------------------{if !empty($pricesetFieldsCount) }--------------------{/if} {$additionalCustomPost_grouptitle} -----------------------------------------------------------{if $pricesetFieldsCount }--------------------{/if} +----------------------------------------------------------{if !empty($pricesetFieldsCount) }--------------------{/if} {/if} {foreach from=$val item=v key=f} @@ -273,12 +273,12 @@ {/foreach} {/foreach} {/if} -{if $customGroup} +{if !empty($customGroup)} {foreach from=$customGroup item=value key=customName} -=========================================================={if $pricesetFieldsCount }===================={/if} +=========================================================={if !empty($pricesetFieldsCount) }===================={/if} {$customName} -=========================================================={if $pricesetFieldsCount }===================={/if} +=========================================================={if !empty($pricesetFieldsCount) }===================={/if} {foreach from=$value item=v key=n} {$n}: {$v} diff --git a/xml/templates/message_templates/event_online_receipt_html.tpl b/xml/templates/message_templates/event_online_receipt_html.tpl index ef73f07f4c..0d95412df9 100644 --- a/xml/templates/message_templates/event_online_receipt_html.tpl +++ b/xml/templates/message_templates/event_online_receipt_html.tpl @@ -27,7 +27,7 @@ {assign var="greeting" value="{contact.email_greeting}"}{if $greeting}

{$greeting},

{/if} - {if $event.confirm_email_text AND (not $isOnWaitlist AND not $isRequireApproval)} + {if !empty($event.confirm_email_text) AND (empty($isOnWaitlist) AND empty($isRequireApproval))}

{$event.confirm_email_text|htmlize}

{else} @@ -38,18 +38,18 @@ {/if}

- {if $isOnWaitlist} + {if !empty($isOnWaitlist)}

{ts}You have been added to the WAIT LIST for this event.{/ts}

- {if $isPrimary} + {if !empty($isPrimary)}

{ts}If space becomes available you will receive an email with a link to a web page where you can complete your registration.{/ts}

{/if} - {elseif $isRequireApproval} + {elseif !empty($isRequireApproval)}

{ts}Your registration has been submitted.{/ts}

- {if $isPrimary} + {if !empty($isPrimary)}

{ts}Once your registration has been reviewed, you will receive an email with a link to a web page where you can complete the registration process.{/ts}

{/if} - {elseif $is_pay_later && !$isAmountzero && !$isAdditionalParticipant} -

{$pay_later_receipt}

{* FIXME: this might be text rather than HTML *} + {elseif !empty($is_pay_later) && empty($isAmountzero) && empty($isAdditionalParticipant)} +

{if isset($pay_later_receipt)}{$pay_later_receipt}{/if}

{* FIXME: this might be text rather than HTML *} {/if} @@ -91,7 +91,7 @@ {/if} - {if $event.participant_role neq 'Attendee' and $defaultRole} + {if !empty($event.participant_role) and $event.participant_role neq 'Attendee' and !empty($defaultRole)} {ts}Participant Role{/ts} @@ -102,7 +102,7 @@ {/if} - {if $isShowLocation} + {if !empty($isShowLocation)} {$location.address.1.display|nl2br} @@ -110,7 +110,7 @@ {/if} - {if $location.phone.1.phone || $location.email.1.email} + {if !empty($location.phone.1.phone) || !empty($location.email.1.email)} {ts}Event Contacts:{/ts} @@ -146,7 +146,7 @@ {/foreach} {/if} - {if $event.is_public} + {if !empty($event.is_public)} {capture assign=icalFeed}{crmURL p='civicrm/event/ical' q="reset=1&id=`$event.id`" h=0 a=1 fe=1}{/capture} @@ -155,7 +155,7 @@ {/if} - {if $event.is_share} + {if !empty($event.is_share)} {capture assign=eventUrl}{crmURL p='civicrm/event/info' q="id=`$event.id`&reset=1" a=true fe=1 h=1}{/capture} @@ -163,7 +163,7 @@ {/if} - {if $payer.name} + {if !empty($payer.name)} {ts}You were registered by:{/ts} @@ -175,22 +175,22 @@ {/if} - {if $event.is_monetary and not $isRequireApproval} + {if !empty($event.is_monetary) and empty($isRequireApproval)} - {$event.fee_label} + {if !empty($event.fee_label)}{$event.fee_label}{/if} - {if $lineItem} + {if !empty($lineItem)} {foreach from=$lineItem item=value key=priceset} {if $value neq 'skip'} {if $isPrimary} {if $lineItem|@count GT 1} {* Header for multi participant registration cases. *} - {ts 1=$priceset+1}Participant %1{/ts} {$part.$priceset.info} + {ts 1=$priceset+1}Participant %1{/ts} {if !empty($part.$priceset)}{$part.$priceset.info}{/if} {/if} @@ -202,13 +202,13 @@ {ts}Item{/ts} {ts}Qty{/ts} {ts}Each{/ts} - {if $dataArray} + {if !empty($dataArray)} {ts}SubTotal{/ts} {ts}Tax Rate{/ts} {ts}Tax Amount{/ts} {/if} {ts}Total{/ts} - {if $pricesetFieldsCount }{ts}Total Participants{/ts}{/if} + {if !empty($pricesetFieldsCount) }{ts}Total Participants{/ts}{/if} {foreach from=$value item=line} @@ -221,11 +221,11 @@ {$line.unit_price|crmMoney:$currency} - {if $dataArray} + {if !empty($dataArray)} {$line.unit_price*$line.qty|crmMoney} - {if $line.tax_rate != "" || $line.tax_amount != ""} + {if isset($line.tax_rate) and ($line.tax_rate != "" || $line.tax_amount != "")} {$line.tax_rate|string_format:"%.2f"}% @@ -240,10 +240,10 @@ {$line.line_total+$line.tax_amount|crmMoney:$currency} - {if $pricesetFieldsCount }{$line.participant_count} {/if} + {if !empty($pricesetFieldsCount) }{$line.participant_count} {/if} {/foreach} - {if $individual} + {if !empty($individual)} {ts}Participant Total{/ts} {$individual.$priceset.totalAmtWithTax-$individual.$priceset.totalTaxAmt|crmMoney} @@ -256,7 +256,7 @@ {/if} {/foreach} - {if $dataArray} + {if !empty($dataArray)} {ts} Amount Before Tax: {/ts} @@ -279,7 +279,7 @@ {/if} {/if} - {if $amounts && !$lineItem} + {if !empty($amounts) && empty($lineItem)} {foreach from=$amounts item=amnt key=level} @@ -289,7 +289,7 @@ {/foreach} {/if} - {if $totalTaxAmount} + {if isset($totalTaxAmount)} {ts}Total Tax Amount{/ts} @@ -305,10 +305,10 @@ {ts}Total Amount{/ts} - {$totalAmount|crmMoney:$currency} {if $hookDiscount.message}({$hookDiscount.message}){/if} + {if !empty($totalAmount)}{$totalAmount|crmMoney:$currency}{/if} {if !empty($hookDiscount.message)}({$hookDiscount.message}){/if} - {if $pricesetFieldsCount } + {if !empty($pricesetFieldsCount) } {ts}Total Participants{/ts} @@ -341,7 +341,7 @@ {/if} - {if $receive_date} + {if !empty($receive_date)} {ts}Transaction Date{/ts} @@ -352,7 +352,7 @@ {/if} - {if $financialTypeName} + {if !empty($financialTypeName)} {ts}Financial Type{/ts} @@ -363,7 +363,7 @@ {/if} - {if $trxn_id} + {if !empty($trxn_id)} {ts}Transaction #{/ts} @@ -374,7 +374,7 @@ {/if} - {if $paidBy} + {if !empty($paidBy)} {ts}Paid By{/ts} @@ -385,7 +385,7 @@ {/if} - {if $checkNumber} + {if !empty($checkNumber)} {ts}Check Number{/ts} @@ -396,7 +396,7 @@ {/if} - {if $billingName} + {if !empty($billingName)} {ts}Billing Name and Address{/ts} @@ -410,7 +410,7 @@ {/if} - {if $credit_card_type} + {if !empty($credit_card_type)} {ts}Credit Card Information{/ts} @@ -430,11 +430,11 @@ {/if} {* End of conditional section for Paid events *} -{if $customPre} +{if !empty($customPre)} {foreach from=$customPre item=customPr key=i} {$customPre_grouptitle.$i} {foreach from=$customPr item=customValue key=customName} - {if ( $trackingFields and ! in_array( $customName, $trackingFields ) ) or ! $trackingFields} + {if ( !empty($trackingFields) and ! in_array( $customName, $trackingFields ) ) or empty($trackingFields)} {$customName} {$customValue} @@ -444,11 +444,11 @@ {/foreach} {/if} -{if $customPost} +{if !empty($customPost)} {foreach from=$customPost item=customPos key=j} {$customPost_grouptitle.$j} {foreach from=$customPos item=customValue key=customName} - {if ( $trackingFields and ! in_array( $customName, $trackingFields ) ) or ! $trackingFields} + {if (!empty($trackingFields) and ! in_array( $customName, $trackingFields ) ) or empty($trackingFields)} {$customName} {$customValue} @@ -458,7 +458,7 @@ {/foreach} {/if} -{if $customProfile} +{if !empty($customProfile)} {foreach from=$customProfile.profile item=eachParticipant key=participantID} {ts 1=$participantID+2}Participant %1{/ts} {foreach from=$eachParticipant item=eachProfile key=pid} @@ -475,10 +475,10 @@ {/if} - {if $event.allow_selfcancelxfer } + {if !empty($event.allow_selfcancelxfer) } - {ts 1=$selfcancelxfer_time 2=$selfservice_preposition}You may transfer your registration to another participant or cancel your registration up to %1 hours %2 the event.{/ts} {if $totalAmount}{ts}Cancellations are not refundable.{/ts}{/if}
+ {ts 1=$selfcancelxfer_time 2=$selfservice_preposition}You may transfer your registration to another participant or cancel your registration up to %1 hours %2 the event.{/ts} {if !empty($totalAmount)}{ts}Cancellations are not refundable.{/ts}{/if}
{capture assign=selfService}{crmURL p='civicrm/event/selfsvcupdate' q="reset=1&pid=`$participant.id`&{contact.checksum}" h=0 a=1 fe=1}{/capture} {ts}Click here to transfer or cancel your registration.{/ts} diff --git a/xml/templates/message_templates/event_online_receipt_subject.tpl b/xml/templates/message_templates/event_online_receipt_subject.tpl index 7bb2730637..da1dab7259 100644 --- a/xml/templates/message_templates/event_online_receipt_subject.tpl +++ b/xml/templates/message_templates/event_online_receipt_subject.tpl @@ -1 +1 @@ -{if $isOnWaitlist}{ts}Wait List Confirmation{/ts}{elseif $isRequireApproval}{ts}Registration Request Confirmation{/ts}{else}{ts}Registration Confirmation{/ts}{/if} - {$event.event_title} - {contact.display_name} +{if !empty($isOnWaitlist)}{ts}Wait List Confirmation{/ts}{elseif !empty($isRequireApproval)}{ts}Registration Request Confirmation{/ts}{else}{ts}Registration Confirmation{/ts}{/if} - {$event.event_title} - {contact.display_name} diff --git a/xml/templates/message_templates/event_online_receipt_text.tpl b/xml/templates/message_templates/event_online_receipt_text.tpl index adca08ff5f..04f25cf514 100644 --- a/xml/templates/message_templates/event_online_receipt_text.tpl +++ b/xml/templates/message_templates/event_online_receipt_text.tpl @@ -1,26 +1,26 @@ {assign var="greeting" value="{contact.email_greeting}"}{if $greeting}{$greeting},{/if} -{if $event.confirm_email_text AND (not $isOnWaitlist AND not $isRequireApproval)} +{if !empty($event.confirm_email_text) AND (empty($isOnWaitlist) AND empty($isRequireApproval))} {$event.confirm_email_text} {else} {ts}Thank you for your registration.{/ts} {if $participant_status}{ts 1=$participant_status}This is a confirmation that your registration has been received and your status has been updated to %1.{/ts} - {else}{if $isOnWaitlist}{ts}This is a confirmation that your registration has been received and your status has been updated to waitlisted.{/ts}{else}{ts}This is a confirmation that your registration has been received and your status has been updated to registered.{/ts}{/if} + {else}{if !empty($isOnWaitlist)}{ts}This is a confirmation that your registration has been received and your status has been updated to waitlisted.{/ts}{else}{ts}This is a confirmation that your registration has been received and your status has been updated to registered.{/ts}{/if} {/if} {/if} -{if $isOnWaitlist} -==========================================================={if $pricesetFieldsCount }===================={/if} +{if !empty($isOnWaitlist)} +==========================================================={if !empty($pricesetFieldsCount)}===================={/if} {ts}You have been added to the WAIT LIST for this event.{/ts} -{if $isPrimary} +{if !empty($isPrimary)} {ts}If space becomes available you will receive an email with a link to a web page where you can complete your registration.{/ts} {/if} -==========================================================={if $pricesetFieldsCount }===================={/if} +==========================================================={if !empty($pricesetFieldsCount)}===================={/if} -{elseif $isRequireApproval} -==========================================================={if $pricesetFieldsCount }===================={/if} +{elseif !empty($isRequireApproval)} +==========================================================={if !empty($pricesetFieldsCount)}===================={/if} {ts}Your registration has been submitted.{/ts} @@ -28,27 +28,27 @@ {ts}Once your registration has been reviewed, you will receive an email with a link to a web page where you can complete the registration process.{/ts} {/if} -==========================================================={if $pricesetFieldsCount }===================={/if} +==========================================================={if !empty($pricesetFieldsCount)}===================={/if} -{elseif $is_pay_later && !$isAmountzero && !$isAdditionalParticipant} +{elseif !empty($is_pay_later) && empty($isAmountzero) && empty($isAdditionalParticipant)} -==========================================================={if $pricesetFieldsCount }===================={/if} +==========================================================={if !empty($pricesetFieldsCount)}===================={/if} -{$pay_later_receipt} -==========================================================={if $pricesetFieldsCount }===================={/if} +{if isset($pay_later_receipt)}{$pay_later_receipt}{/if} +==========================================================={if !empty($pricesetFieldsCount)}===================={/if} {/if} -==========================================================={if $pricesetFieldsCount }===================={/if} +==========================================================={if !empty($pricesetFieldsCount)}===================={/if} {ts}Event Information and Location{/ts} -==========================================================={if $pricesetFieldsCount }===================={/if} +==========================================================={if !empty($pricesetFieldsCount)}===================={/if} {$event.event_title} {$event.event_start_date|date_format:"%A"} {$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|date_format:"%A"} {$event.event_end_date|crmDate}{/if}{/if} -{if $conference_sessions} +{if !empty($conference_sessions)} {ts}Your schedule:{/ts} @@ -66,15 +66,15 @@ {/foreach} {/if} -{if $event.participant_role neq 'Attendee' and $defaultRole} +{if !empty($event.participant_role) and $event.participant_role neq 'Attendee' and !empty($defaultRole)} {ts}Participant Role{/ts}: {$event.participant_role} {/if} -{if $isShowLocation} +{if !empty($isShowLocation)} {$location.address.1.display|strip_tags:false} {/if}{*End of isShowLocation condition*} -{if $location.phone.1.phone || $location.email.1.email} +{if !empty($location.phone.1.phone) || !empty($location.email.1.email)} {ts}Event Contacts:{/ts} {foreach from=$location.phone item=phone} @@ -88,22 +88,22 @@ {ts}Email{/ts}: {$eventEmail.email}{/if}{/foreach} {/if} -{if $event.is_public} +{if !empty($event.is_public)} {capture assign=icalFeed}{crmURL p='civicrm/event/ical' q="reset=1&id=`$event.id`" h=0 a=1 fe=1}{/capture} {ts}Download iCalendar File:{/ts} {$icalFeed} {/if} -{if $payer.name} +{if !empty($payer.name)} You were registered by: {$payer.name} {/if} -{if $event.is_monetary and not $isRequireApproval} {* This section for Paid events only.*} +{if !empty($event.is_monetary) and empty($isRequireApproval)} {* This section for Paid events only.*} -==========================================================={if $pricesetFieldsCount }===================={/if} +==========================================================={if !empty($pricesetFieldsCount)}===================={/if} -{$event.fee_label} -==========================================================={if $pricesetFieldsCount }===================={/if} +{if !empty ($event.fee_label)}{$event.fee_label}{/if} +==========================================================={if !empty($pricesetFieldsCount)}===================={/if} -{if $lineItem}{foreach from=$lineItem item=value key=priceset} +{if !empty($lineItem)}{foreach from=$lineItem item=value key=priceset} {if $value neq 'skip'} {if $isPrimary} @@ -112,33 +112,33 @@ You were registered by: {$payer.name} {/if} {/if} ------------------------------------------------------------{if $pricesetFieldsCount }-----------------------------------------------------{/if} +-----------------------------------------------------------{if !empty($pricesetFieldsCount)}-----------------------------------------------------{/if} {capture assign=ts_item}{ts}Item{/ts}{/capture} {capture assign=ts_qty}{ts}Qty{/ts}{/capture} {capture assign=ts_each}{ts}Each{/ts}{/capture} -{if $dataArray} +{if !empty($dataArray)} {capture assign=ts_subtotal}{ts}Subtotal{/ts}{/capture} {capture assign=ts_taxRate}{ts}Tax Rate{/ts}{/capture} {capture assign=ts_taxAmount}{ts}Tax Amount{/ts}{/capture} {/if} {capture assign=ts_total}{ts}Total{/ts}{/capture} -{if $pricesetFieldsCount }{capture assign=ts_participant_total}{ts}Total Participants{/ts}{/capture}{/if} -{$ts_item|string_format:"%-30s"} {$ts_qty|string_format:"%5s"} {$ts_each|string_format:"%10s"} {if $dataArray} {$ts_subtotal|string_format:"%10s"} {$ts_taxRate|string_format:"%10s"} {$ts_taxAmount|string_format:"%10s"} {/if} {$ts_total|string_format:"%10s"} {$ts_participant_total|string_format:"%10s"} ------------------------------------------------------------{if $pricesetFieldsCount }-----------------------------------------------------{/if} +{if !empty($pricesetFieldsCount) }{capture assign=ts_participant_total}{ts}Total Participants{/ts}{/capture}{/if} +{$ts_item|string_format:"%-30s"} {$ts_qty|string_format:"%5s"} {$ts_each|string_format:"%10s"} {if !empty($dataArray)} {$ts_subtotal|string_format:"%10s"} {$ts_taxRate|string_format:"%10s"} {$ts_taxAmount|string_format:"%10s"} {/if} {$ts_total|string_format:"%10s"} {if !empty($ts_participant_total)}{$ts_participant_total|string_format:"%10s"}{/if} +-----------------------------------------------------------{if !empty($pricesetFieldsCount)}-----------------------------------------------------{/if} {foreach from=$value item=line} -{if $pricesetFieldsCount }{capture assign=ts_participant_count}{$line.participant_count}{/capture}{/if} -{capture assign=ts_item}{if $line.html_type eq 'Text'}{$line.label}{else}{$line.field_title} - {$line.label}{/if} {if $line.description} {$line.description}{/if}{/capture}{$ts_item|truncate:30:"..."|string_format:"%-30s"} {$line.qty|string_format:"%5s"} {$line.unit_price|crmMoney:$currency|string_format:"%10s"} {if $dataArray} {$line.unit_price*$line.qty|crmMoney:$currency|string_format:"%10s"} {if $line.tax_rate != "" || $line.tax_amount != ""} {$line.tax_rate|string_format:"%.2f"} % {$line.tax_amount|crmMoney:$currency|string_format:"%10s"} {else} {/if} {/if} {$line.line_total+$line.tax_amount|crmMoney:$currency|string_format:"%10s"}{$ts_participant_count|string_format:"%10s"} +{if !empty($pricesetFieldsCount) }{capture assign=ts_participant_count}{$line.participant_count}{/capture}{/if} +{capture assign=ts_item}{if $line.html_type eq 'Text'}{$line.label}{else}{$line.field_title} - {$line.label}{/if} {if $line.description} {$line.description}{/if}{/capture}{$ts_item|truncate:30:"..."|string_format:"%-30s"} {$line.qty|string_format:"%5s"} {$line.unit_price|crmMoney:$currency|string_format:"%10s"} {if !empty($dataArray)} {$line.unit_price*$line.qty|crmMoney:$currency|string_format:"%10s"} {if isset($line.tax_rate) and ($line.tax_rate != "" || $line.tax_amount != "")} {$line.tax_rate|string_format:"%.2f"} % {$line.tax_amount|crmMoney:$currency|string_format:"%10s"} {else} {/if} {/if} {$line.line_total+$line.tax_amount|crmMoney:$currency|string_format:"%10s"}{if !empty($ts_participant_count)}{$ts_participant_count|string_format:"%10s"}{/if} {/foreach} ---------------------------------------------------------------------------------------------------------------- -{if $individual}{ts}Participant Total{/ts} {$individual.$priceset.totalAmtWithTax-$individual.$priceset.totalTaxAmt|crmMoney:$currency|string_format:"%29s"} {$individual.$priceset.totalTaxAmt|crmMoney:$currency|string_format:"%33s"} {$individual.$priceset.totalAmtWithTax|crmMoney:$currency|string_format:"%12s"}{/if} +{if !empty($individual)}{ts}Participant Total{/ts} {$individual.$priceset.totalAmtWithTax-$individual.$priceset.totalTaxAmt|crmMoney:$currency|string_format:"%29s"} {$individual.$priceset.totalTaxAmt|crmMoney:$currency|string_format:"%33s"} {$individual.$priceset.totalAmtWithTax|crmMoney:$currency|string_format:"%12s"}{/if} {/if} {""|string_format:"%120s"} {/foreach} {""|string_format:"%120s"} -{if $dataArray} +{if !empty($dataArray)} {ts}Amount before Tax{/ts}: {$totalAmount-$totalTaxAmount|crmMoney:$currency} {foreach from=$dataArray item=value key=priceset} @@ -151,19 +151,19 @@ You were registered by: {$payer.name} {/if} {/if} -{if $amounts && !$lineItem} +{if !empty($amounts) && empty($lineItem)} {foreach from=$amounts item=amnt key=level}{$amnt.amount|crmMoney:$currency} {$amnt.label} {/foreach} {/if} -{if $totalTaxAmount} +{if isset($totalTaxAmount)} {ts}Total Tax Amount{/ts}: {$totalTaxAmount|crmMoney:$currency} {/if} -{if $isPrimary } +{if !empty($isPrimary) } -{ts}Total Amount{/ts}: {$totalAmount|crmMoney:$currency} {if $hookDiscount.message}({$hookDiscount.message}){/if} +{ts}Total Amount{/ts}: {if !empty($totalAmount)}{$totalAmount|crmMoney:$currency}{/if} {if !empty($hookDiscount.message)}({$hookDiscount.message}){/if} -{if $pricesetFieldsCount } +{if !empty($pricesetFieldsCount) } {assign var="count" value= 0} {foreach from=$lineItem item=pcount} {assign var="lineItemCount" value=0} @@ -184,39 +184,39 @@ You were registered by: {$payer.name} {if $register_date} {ts}Registration Date{/ts}: {$register_date|crmDate} {/if} -{if $receive_date} +{if !empty($receive_date)} {ts}Transaction Date{/ts}: {$receive_date|crmDate} {/if} -{if $financialTypeName} +{if !empty($financialTypeName)} {ts}Financial Type{/ts}: {$financialTypeName} {/if} -{if $trxn_id} +{if !empty($trxn_id)} {ts}Transaction #{/ts}: {$trxn_id} {/if} -{if $paidBy} +{if !empty($paidBy)} {ts}Paid By{/ts}: {$paidBy} {/if} -{if $checkNumber} +{if !empty($checkNumber)} {ts}Check Number{/ts}: {$checkNumber} {/if} -{if $billingName} +{if !empty($billingName)} -==========================================================={if $pricesetFieldsCount }===================={/if} +==========================================================={if !empty($pricesetFieldsCount)}===================={/if} {ts}Billing Name and Address{/ts} -==========================================================={if $pricesetFieldsCount }===================={/if} +==========================================================={if !empty($pricesetFieldsCount)}===================={/if} {$billingName} {$address} {/if} -{if $credit_card_type} -==========================================================={if $pricesetFieldsCount }===================={/if} +{if !empty($credit_card_type)} +==========================================================={if !empty($pricesetFieldsCount)}===================={/if} {ts}Credit Card Information{/ts} -==========================================================={if $pricesetFieldsCount }===================={/if} +==========================================================={if !empty($pricesetFieldsCount)}===================={/if} {$credit_card_type} {$credit_card_number} @@ -225,49 +225,49 @@ You were registered by: {$payer.name} {/if} {/if} {* End of conditional section for Paid events *} -{if $customPre} +{if !empty($customPre)} {foreach from=$customPre item=customPr key=i} -==========================================================={if $pricesetFieldsCount }===================={/if} +==========================================================={if !empty($pricesetFieldsCount)}===================={/if} {$customPre_grouptitle.$i} -==========================================================={if $pricesetFieldsCount }===================={/if} +==========================================================={if !empty($pricesetFieldsCount)}===================={/if} {foreach from=$customPr item=customValue key=customName} -{if ( $trackingFields and ! in_array( $customName, $trackingFields ) ) or ! $trackingFields} +{if ( !empty($trackingFields) and ! in_array( $customName, $trackingFields ) ) or empty($trackingFields)} {$customName}: {$customValue} {/if} {/foreach} {/foreach} {/if} -{if $customPost} +{if !empty($customPost)} {foreach from=$customPost item=customPos key=j} -==========================================================={if $pricesetFieldsCount }===================={/if} +==========================================================={if !empty($pricesetFieldsCount)}===================={/if} {$customPost_grouptitle.$j} -==========================================================={if $pricesetFieldsCount }===================={/if} +==========================================================={if !empty($pricesetFieldsCount)}===================={/if} {foreach from=$customPos item=customValue key=customName} -{if ( $trackingFields and ! in_array( $customName, $trackingFields ) ) or ! $trackingFields} +{if ( !empty($trackingFields) and ! in_array( $customName, $trackingFields ) ) or empty($trackingFields)} {$customName}: {$customValue} {/if} {/foreach} {/foreach} {/if} -{if $customProfile} +{if !empty($customProfile)} {foreach from=$customProfile.profile item=eachParticipant key=participantID} -==========================================================={if $pricesetFieldsCount }===================={/if} +==========================================================={if !empty($pricesetFieldsCount)}===================={/if} {ts 1=$participantID+2}Participant Information - Participant %1{/ts} -==========================================================={if $pricesetFieldsCount }===================={/if} +==========================================================={if !empty($pricesetFieldsCount)}===================={/if} {foreach from=$eachParticipant item=eachProfile key=pid} -----------------------------------------------------------{if $pricesetFieldsCount }--------------------{/if} +----------------------------------------------------------{if !empty($pricesetFieldsCount)}--------------------{/if} {$customProfile.title.$pid} -----------------------------------------------------------{if $pricesetFieldsCount }--------------------{/if} +----------------------------------------------------------{if !empty($pricesetFieldsCount)}--------------------{/if} {foreach from=$eachProfile item=val key=field} {foreach from=$val item=v key=f} @@ -278,8 +278,8 @@ You were registered by: {$payer.name} {/foreach} {/if} -{if $event.allow_selfcancelxfer } -{ts 1=$selfcancelxfer_time 2=$selfservice_preposition}You may transfer your registration to another participant or cancel your registration up to %1 hours %2 the event.{/ts} {if $totalAmount}{ts}Cancellations are not refundable.{/ts}{/if} +{if !empty($event.allow_selfcancelxfer) } +{ts 1=$selfcancelxfer_time 2=$selfservice_preposition}You may transfer your registration to another participant or cancel your registration up to %1 hours %2 the event.{/ts} {if !empty($totalAmount)}{ts}Cancellations are not refundable.{/ts}{/if} {capture assign=selfService}{crmURL p='civicrm/event/selfsvcupdate' q="reset=1&pid=`$participant.id`&{contact.checksum}" h=0 a=1 fe=1}{/capture} {ts}Transfer or cancel your registration:{/ts} {$selfService} {/if} diff --git a/xml/templates/message_templates/event_registration_receipt_html.tpl b/xml/templates/message_templates/event_registration_receipt_html.tpl index 0228056581..2040b451fc 100644 --- a/xml/templates/message_templates/event_registration_receipt_html.tpl +++ b/xml/templates/message_templates/event_registration_receipt_html.tpl @@ -21,7 +21,7 @@ {/if} {if $is_pay_later} -

{$pay_later_receipt}

+

{if isset($pay_later_receipt)}{$pay_later_receipt}{/if}

{/if}

Your order number is #{$transaction_id}. {if $line_items && !$is_refund} Information about the workshops will be sent separately to each participant.{/if} diff --git a/xml/templates/message_templates/event_registration_receipt_text.tpl b/xml/templates/message_templates/event_registration_receipt_text.tpl index 8a58ea90c0..5a6807609e 100644 --- a/xml/templates/message_templates/event_registration_receipt_text.tpl +++ b/xml/templates/message_templates/event_registration_receipt_text.tpl @@ -7,7 +7,7 @@ {/if} {if $is_pay_later} - {$pay_later_receipt} + {if isset($pay_later_receipt)}{$pay_later_receipt}{/if} {/if} Your order number is #{$transaction_id}. {if $line_items && !$is_refund} Information about the workshops will be sent separately to each participant.{/if} diff --git a/xml/templates/message_templates/membership_offline_receipt_html.tpl b/xml/templates/message_templates/membership_offline_receipt_html.tpl index 3cc8fe6f4c..2fd5ec20d9 100644 --- a/xml/templates/message_templates/membership_offline_receipt_html.tpl +++ b/xml/templates/message_templates/membership_offline_receipt_html.tpl @@ -24,9 +24,9 @@ {assign var="greeting" value="{contact.email_greeting}"}{if $greeting}

{$greeting},

{/if} - {if $formValues.receipt_text_signup} + {if !empty($formValues.receipt_text_signup)}

{$formValues.receipt_text_signup|htmlize}

- {elseif $formValues.receipt_text_renewal} + {elseif !empty($formValues.receipt_text_renewal)}

{$formValues.receipt_text_renewal|htmlize}

{else}

{ts}Thank you for this contribution.{/ts}

@@ -36,7 +36,7 @@ - {if !$lineItem} + {if empty($lineItem)} {/if} - {if ! $cancelled} - {if !$lineItem} + {if empty($cancelled)} + {if empty($lineItem)} {/if} - {if $lineItem} + {if !empty($lineItem)} {foreach from=$lineItem item=value key=priceset} - {if $dataArray} + {if !empty($dataArray)} @@ -113,11 +113,11 @@ - {if $dataArray} + {if !empty($dataArray)} - {if $line.tax_rate != "" || $line.tax_amount != ""} + {if $line.tax_rate and ($line.tax_rate != "" || $line.tax_amount != "")} @@ -144,7 +144,7 @@ {/foreach} - {if $dataArray} + {if !empty($dataArray)} - {if $receive_date} + {if !empty($receive_date)} {/if} - {if $formValues.paidBy} + {if !empty($formValues.paidBy)} - {if $formValues.check_number} + {if !empty($formValues.check_number)} - {if $isPrimary} + {if !empty($isPrimary)}
{ts}Membership Information{/ts} @@ -51,8 +51,8 @@
{ts}Membership Start Date{/ts} @@ -87,7 +87,7 @@
@@ -95,7 +95,7 @@
{ts}Item{/ts} {ts}Fee{/ts}{ts}SubTotal{/ts} {ts}Tax Rate{/ts} {ts}Tax Amount{/ts} {$line.line_total|crmMoney} {$line.unit_price*$line.qty|crmMoney} {$line.tax_rate|string_format:"%.2f"}%
{ts}Amount Before Tax:{/ts} @@ -184,7 +184,7 @@ {$formValues.total_amount|crmMoney}
{ts}Date Received{/ts} @@ -194,7 +194,7 @@
{ts}Paid By{/ts} @@ -203,7 +203,7 @@ {$formValues.paidBy}
{ts}Check Number{/ts} @@ -220,12 +220,12 @@
- {if $billingName} + {if !empty($billingName)} {/if} - {if $credit_card_type} + {if !empty($credit_card_type)} {/if} - {if $customValues} + {if !empty($customValues)}
{ts}Billing Name and Address{/ts} @@ -239,7 +239,7 @@
{ts}Credit Card Information{/ts} @@ -266,7 +266,7 @@
diff --git a/xml/templates/message_templates/membership_offline_receipt_text.tpl b/xml/templates/message_templates/membership_offline_receipt_text.tpl index 802deb0238..a35591eb3f 100644 --- a/xml/templates/message_templates/membership_offline_receipt_text.tpl +++ b/xml/templates/message_templates/membership_offline_receipt_text.tpl @@ -1,20 +1,20 @@ {assign var="greeting" value="{contact.email_greeting}"}{if $greeting}{$greeting},{/if} -{if $formValues.receipt_text_signup} +{if !empty($formValues.receipt_text_signup)} {$formValues.receipt_text_signup} -{elseif $formValues.receipt_text_renewal} +{elseif !empty($formValues.receipt_text_renewal)} {$formValues.receipt_text_renewal} {else}{ts}Thank you for this contribution.{/ts}{/if} -{if !$lineItem} +{if empty($lineItem)} =========================================================== {ts}Membership Information{/ts} =========================================================== {ts}Membership Type{/ts}: {$membership_name} {/if} -{if ! $cancelled} -{if !$lineItem} +{if empty($cancelled)} +{if empty($lineItem)} {ts}Membership Start Date{/ts}: {$mem_start_date} {ts}Membership End Date{/ts}: {$mem_end_date} {/if} @@ -27,11 +27,11 @@ {if $formValues.contributionType_name} {ts}Financial Type{/ts}: {$formValues.contributionType_name} {/if} -{if $lineItem} +{if !empty($lineItem)} {foreach from=$lineItem item=value key=priceset} {capture assign=ts_item}{ts}Item{/ts}{/capture} {capture assign=ts_total}{ts}Fee{/ts}{/capture} -{if $dataArray} +{if !empty($dataArray)} {capture assign=ts_subtotal}{ts}Subtotal{/ts}{/capture} {capture assign=ts_taxRate}{ts}Tax Rate{/ts}{/capture} {capture assign=ts_taxAmount}{ts}Tax Amount{/ts}{/capture} @@ -39,15 +39,15 @@ {/if} {capture assign=ts_start_date}{ts}Membership Start Date{/ts}{/capture} {capture assign=ts_end_date}{ts}Membership End Date{/ts}{/capture} -{$ts_item|string_format:"%-30s"} {$ts_total|string_format:"%10s"} {if $dataArray} {$ts_subtotal|string_format:"%10s"} {$ts_taxRate|string_format:"%10s"} {$ts_taxAmount|string_format:"%10s"} {$ts_total|string_format:"%10s"} {/if} {$ts_start_date|string_format:"%20s"} {$ts_end_date|string_format:"%20s"} +{$ts_item|string_format:"%-30s"} {$ts_total|string_format:"%10s"} {if !empty($dataArray)} {$ts_subtotal|string_format:"%10s"} {$ts_taxRate|string_format:"%10s"} {$ts_taxAmount|string_format:"%10s"} {$ts_total|string_format:"%10s"} {/if} {$ts_start_date|string_format:"%20s"} {$ts_end_date|string_format:"%20s"} -------------------------------------------------------------------------------------------------- {foreach from=$value item=line} -{capture assign=ts_item}{if $line.html_type eq 'Text'}{$line.label}{else}{$line.field_title} - {$line.label}{/if} {if $line.description} {$line.description}{/if}{/capture}{$ts_item|truncate:30:"..."|string_format:"%-30s"} {$line.line_total|crmMoney|string_format:"%10s"} {if $dataArray} {$line.unit_price*$line.qty|crmMoney:$currency|string_format:"%10s"} {if $line.tax_rate != "" || $line.tax_amount != ""} {$line.tax_rate|string_format:"%.2f"} % {$line.tax_amount|crmMoney:$currency|string_format:"%10s"} {else} {/if} {$line.line_total+$line.tax_amount|crmMoney|string_format:"%10s"} {/if} {$line.start_date|string_format:"%20s"} {$line.end_date|string_format:"%20s"} +{capture assign=ts_item}{if $line.html_type eq 'Text'}{$line.label}{else}{$line.field_title} - {$line.label}{/if} {if $line.description} {$line.description}{/if}{/capture}{$ts_item|truncate:30:"..."|string_format:"%-30s"} {$line.line_total|crmMoney|string_format:"%10s"} {if !empty($dataArray)} {$line.unit_price*$line.qty|crmMoney:$currency|string_format:"%10s"} {if isset($line.tax_rate) and ($line.tax_rate != "" || $line.tax_amount != "")} {$line.tax_rate|string_format:"%.2f"} % {$line.tax_amount|crmMoney:$currency|string_format:"%10s"} {else} {/if} {$line.line_total+$line.tax_amount|crmMoney|string_format:"%10s"} {/if} {$line.start_date|string_format:"%20s"} {$line.end_date|string_format:"%20s"} {/foreach} {/foreach} -{if $dataArray} +{if !empty($dataArray)} {ts}Amount before Tax{/ts}: {$formValues.total_amount-$totalTaxAmount|crmMoney:$currency} {foreach from=$dataArray item=value key=priceset} @@ -66,20 +66,20 @@ {/if} {ts}Amount{/ts}: {$formValues.total_amount|crmMoney} -{if $receive_date} +{if !empty($receive_date)} {ts}Date Received{/ts}: {$receive_date|truncate:10:''|crmDate} {/if} -{if $formValues.paidBy} +{if !empty($formValues.paidBy)} {ts}Paid By{/ts}: {$formValues.paidBy} -{if $formValues.check_number} +{if !empty($formValues.check_number)} {ts}Check Number{/ts}: {$formValues.check_number} {/if} {/if} {/if} {/if} -{if $isPrimary } -{if $billingName} +{if !empty($isPrimary) } +{if !empty($billingName)} =========================================================== {ts}Billing Name and Address{/ts} @@ -89,7 +89,7 @@ {$address} {/if} -{if $credit_card_type} +{if !empty($credit_card_type)} =========================================================== {ts}Credit Card Information{/ts} @@ -100,7 +100,7 @@ {/if} {/if} -{if $customValues} +{if !empty($customValues)} =========================================================== {ts}Membership Options{/ts} diff --git a/xml/templates/message_templates/membership_online_receipt_html.tpl b/xml/templates/message_templates/membership_online_receipt_html.tpl index 3e8073b30d..a2b1b46133 100644 --- a/xml/templates/message_templates/membership_online_receipt_html.tpl +++ b/xml/templates/message_templates/membership_online_receipt_html.tpl @@ -22,12 +22,12 @@ @@ -79,7 +79,7 @@ - {if !$useForMember and $membership_amount and $is_quick_config} + {if !$useForMember and isset($membership_amount) and !empty($is_quick_config)} {/if} - {elseif !$useForMember && $lineItem and $priceSetID and !$is_quick_config} + {elseif empty($useForMember) && !empty($lineItem) and $priceSetID and empty($is_quick_config)} {foreach from=$lineItem item=value key=priceset} @@ -150,7 +150,7 @@ {else} - {if $useForMember && $lineItem and !$is_quick_config} + {if $useForMember && $lineItem and empty($is_quick_config)} {foreach from=$lineItem item=value key=priceset} - {if $dataArray} + {if !empty($dataArray)} @@ -175,11 +175,11 @@ - {if $dataArray} + {if !empty($dataArray)} - {if $line.tax_rate != "" || $line.tax_amount != ""} + {if isset($line.tax_rate) and ($line.tax_rate != "" || $line.tax_amount != "")} @@ -206,7 +206,7 @@ {/foreach} - {if $dataArray} + {if !empty($dataArray)} {/if} - {elseif $membership_amount} + {elseif isset($membership_amount)} @@ -270,7 +270,7 @@ {/if} - {if $receive_date} + {if !empty($receive_date)} {/if} - {if $is_monetary and $trxn_id} + {if !empty($is_monetary) and !empty($trxn_id)} {/if} - {if $membership_trx_id} + {if !empty($membership_trx_id)} {/if} - {if $is_recur} + {if !empty($is_recur)} - {elseif $email} + {elseif !empty($email)} {/if} - {if $credit_card_type} + {if !empty($credit_card_type)} {/if} - {if $selectPremium} + {if !empty($selectPremium)} {/if} - {if $contact_email OR $contact_phone} + {if !empty($contact_email) OR !empty($contact_phone)} {/if} - {if $is_deductible AND $price} + {if !empty($is_deductible) AND !empty($price)} {foreach from=$customPre item=customValue key=customName} - {if ($trackingFields and ! in_array($customName, $trackingFields)) or ! $trackingFields} + {if (!empty($trackingFields) and ! in_array($customName, $trackingFields)) or empty($trackingFields)} {foreach from=$customPost item=customValue key=customName} - {if ($trackingFields and ! in_array($customName, $trackingFields)) or ! $trackingFields} + {if (!empty($trackingFields) and ! in_array($customName, $trackingFields)) or empty($trackingFields)} - {if $event.participant_role} + {if !empty($event.participant_role)} {/if} - {if $isShowLocation} + {if !empty($isShowLocation)} {/if} - {if $location.phone.1.phone || $location.email.1.email} + {if !empty($location.phone.1.phone) || !empty($location.email.1.email)}
{assign var="greeting" value="{contact.email_greeting}"}{if $greeting}

{$greeting},

{/if} - {if $receipt_text} + {if !empty($receipt_text)}

{$receipt_text|htmlize}

{/if} {if $is_pay_later} -

{$pay_later_receipt}

{* FIXME: this might be text rather than HTML *} +

{if isset($pay_later_receipt)}{$pay_later_receipt}{/if}

{* FIXME: this might be text rather than HTML *} {/if}
@@ -108,7 +108,7 @@
@@ -158,7 +158,7 @@
{ts}Item{/ts} {ts}Fee{/ts}{ts}SubTotal{/ts} {ts}Tax Rate{/ts} {ts}Tax Amount{/ts} {$line.line_total|crmMoney} {$line.unit_price*$line.qty|crmMoney} {$line.tax_rate|string_format:"%.2f"}%
{ts}Amount Before Tax:{/ts} @@ -228,7 +228,7 @@ {/foreach} {/if} {/if} - {if $totalTaxAmount} + {if isset($totalTaxAmount)}
{ts}Total Tax Amount{/ts} @@ -243,14 +243,14 @@ {ts}Amount{/ts} - {$amount|crmMoney} {if $amount_level} - {$amount_level}{/if} + {$amount|crmMoney} {if isset($amount_level)} - {$amount_level}{/if}
{ts}Date{/ts} @@ -281,7 +281,7 @@
{ts}Transaction #{/ts} @@ -292,7 +292,7 @@
{ts}Membership Transaction #{/ts} @@ -302,7 +302,7 @@
{ts}This membership will be renewed automatically.{/ts} @@ -338,7 +338,7 @@ {/foreach} {/if} - {if $pcpBlock} + {if !empty($pcpBlock)}
{ts}Personal Campaign Page{/ts} @@ -374,7 +374,7 @@ {/if} {/if} - {if $onBehalfProfile} + {if !empty($onBehalfProfile)}
{$onBehalfProfile_grouptitle} @@ -392,7 +392,7 @@ {/foreach} {/if} - {if $billingName} + {if !empty($billingName)}
{ts}Billing Name and Address{/ts} @@ -405,7 +405,7 @@ {$email}
{ts}Registered Email{/ts} @@ -418,7 +418,7 @@
{ts}Credit Card Information{/ts} @@ -433,7 +433,7 @@
{ts}Premium Information{/ts} @@ -484,20 +484,20 @@

{ts}For information about this premium, contact:{/ts}

- {if $contact_email} + {if !empty($contact_email)}

{$contact_email}

{/if} - {if $contact_phone} + {if !empty($contact_phone)}

{$contact_phone}

{/if}

{ts 1=$price|crmMoney}The value of this premium is %1. This may affect the amount of the tax deduction you can claim. Consult your tax advisor for more information.{/ts}

@@ -506,14 +506,14 @@ {/if} {/if} - {if $customPre} + {if !empty($customPre)}
{$customPre_grouptitle}
{$customName} @@ -526,14 +526,14 @@ {/foreach} {/if} - {if $customPost} + {if !empty($customPost)}
{$customPost_grouptitle}
{$customName} diff --git a/xml/templates/message_templates/membership_online_receipt_text.tpl b/xml/templates/message_templates/membership_online_receipt_text.tpl index 3c97b7e000..d1647bdbe2 100644 --- a/xml/templates/message_templates/membership_online_receipt_text.tpl +++ b/xml/templates/message_templates/membership_online_receipt_text.tpl @@ -1,11 +1,11 @@ {assign var="greeting" value="{contact.email_greeting}"}{if $greeting}{$greeting},{/if} -{if $receipt_text} +{if !empty($receipt_text)} {$receipt_text} {/if} {if $is_pay_later} =========================================================== -{$pay_later_receipt} +{if isset($pay_later_receipt)}{$pay_later_receipt}{/if} =========================================================== {/if} @@ -26,14 +26,14 @@ {ts}Membership Fee{/ts} =========================================================== -{if !$useForMember && $membership_amount && $is_quick_config} +{if !$useForMember && isset($membership_amount) && !empty($is_quick_config)} {ts 1=$membership_name}%1 Membership{/ts}: {$membership_amount|crmMoney} {if $amount && !$is_separate_payment } {ts}Contribution Amount{/ts}: {$amount|crmMoney} ------------------------------------------- {ts}Total{/ts}: {$amount+$membership_amount|crmMoney} {/if} -{elseif !$useForMember && $lineItem and $priceSetID & !$is_quick_config} +{elseif !$useForMember && !empty($lineItem) and !empty($priceSetID) & empty($is_quick_config)} {foreach from=$lineItem item=value key=priceset} --------------------------------------------------------- {capture assign=ts_item}{ts}Item{/ts}{/capture} @@ -49,11 +49,11 @@ {ts}Total Amount{/ts}: {$amount|crmMoney} {else} -{if $useForMember && $lineItem && !$is_quick_config} +{if $useForMember && $lineItem && empty($is_quick_config)} {foreach from=$lineItem item=value key=priceset} {capture assign=ts_item}{ts}Item{/ts}{/capture} {capture assign=ts_total}{ts}Fee{/ts}{/capture} -{if $dataArray} +{if !empty($dataArray)} {capture assign=ts_subtotal}{ts}Subtotal{/ts}{/capture} {capture assign=ts_taxRate}{ts}Tax Rate{/ts}{/capture} {capture assign=ts_taxAmount}{ts}Tax Amount{/ts}{/capture} @@ -61,15 +61,15 @@ {/if} {capture assign=ts_start_date}{ts}Membership Start Date{/ts}{/capture} {capture assign=ts_end_date}{ts}Membership End Date{/ts}{/capture} -{$ts_item|string_format:"%-30s"} {$ts_total|string_format:"%10s"} {if $dataArray} {$ts_subtotal|string_format:"%10s"} {$ts_taxRate|string_format:"%10s"} {$ts_taxAmount|string_format:"%10s"} {$ts_total|string_format:"%10s"} {/if} {$ts_start_date|string_format:"%20s"} {$ts_end_date|string_format:"%20s"} +{$ts_item|string_format:"%-30s"} {$ts_total|string_format:"%10s"} {if !empty($dataArray)} {$ts_subtotal|string_format:"%10s"} {$ts_taxRate|string_format:"%10s"} {$ts_taxAmount|string_format:"%10s"} {$ts_total|string_format:"%10s"} {/if} {$ts_start_date|string_format:"%20s"} {$ts_end_date|string_format:"%20s"} -------------------------------------------------------------------------------------------------- {foreach from=$value item=line} -{capture assign=ts_item}{if $line.html_type eq 'Text'}{$line.label}{else}{$line.field_title} - {$line.label}{/if} {if $line.description} {$line.description}{/if}{/capture}{$ts_item|truncate:30:"..."|string_format:"%-30s"} {$line.line_total|crmMoney|string_format:"%10s"} {if $dataArray} {$line.unit_price*$line.qty|crmMoney:$currency|string_format:"%10s"} {if $line.tax_rate != "" || $line.tax_amount != ""} {$line.tax_rate|string_format:"%.2f"} % {$line.tax_amount|crmMoney:$currency|string_format:"%10s"} {else} {/if} {$line.line_total+$line.tax_amount|crmMoney|string_format:"%10s"} {/if} {$line.start_date|string_format:"%20s"} {$line.end_date|string_format:"%20s"} +{capture assign=ts_item}{if $line.html_type eq 'Text'}{$line.label}{else}{$line.field_title} - {$line.label}{/if} {if $line.description} {$line.description}{/if}{/capture}{$ts_item|truncate:30:"..."|string_format:"%-30s"} {$line.line_total|crmMoney|string_format:"%10s"} {if !empty($dataArray)} {$line.unit_price*$line.qty|crmMoney:$currency|string_format:"%10s"} {if isset($line.tax_rate) and ($line.tax_rate != "" || $line.tax_amount != "")} {$line.tax_rate|string_format:"%.2f"} % {$line.tax_amount|crmMoney:$currency|string_format:"%10s"} {else} {/if} {$line.line_total+$line.tax_amount|crmMoney|string_format:"%10s"} {/if} {$line.start_date|string_format:"%20s"} {$line.end_date|string_format:"%20s"} {/foreach} {/foreach} -{if $dataArray} +{if !empty($dataArray)} {ts}Amount before Tax{/ts}: {$amount-$totalTaxAmount|crmMoney:$currency} {foreach from=$dataArray item=value key=priceset} @@ -83,13 +83,13 @@ -------------------------------------------------------------------------------------------------- {/if} -{if $totalTaxAmount} +{if isset($totalTaxAmount)} {ts}Total Tax Amount{/ts}: {$totalTaxAmount|crmMoney:$currency} {/if} -{ts}Amount{/ts}: {$amount|crmMoney} {if $amount_level } - {$amount_level} {/if} +{ts}Amount{/ts}: {$amount|crmMoney} {if isset($amount_level) } - {$amount_level} {/if} {/if} -{elseif $membership_amount} +{elseif isset($membership_amount)} =========================================================== {ts}Membership Fee{/ts} @@ -97,19 +97,19 @@ {ts 1=$membership_name}%1 Membership{/ts}: {$membership_amount|crmMoney} {/if} -{if $receive_date} +{if !empty($receive_date)} {ts}Date{/ts}: {$receive_date|crmDate} {/if} -{if $is_monetary and $trxn_id} +{if !empty($is_monetary) and !empty($trxn_id)} {ts}Transaction #{/ts}: {$trxn_id} {/if} -{if $membership_trx_id} +{if !empty($membership_trx_id)} {ts}Membership Transaction #{/ts}: {$membership_trx_id} {/if} -{if $is_recur} +{if !empty($is_recur)} {ts}This membership will be renewed automatically.{/ts} {if $cancelSubscriptionUrl} @@ -132,7 +132,7 @@ {/foreach} {/if} -{if $pcpBlock} +{if !empty($pcpBlock)} =========================================================== {ts}Personal Campaign Page{/ts} @@ -144,7 +144,7 @@ {if $pcp_personal_note}{ts}Personal Note{/ts}: {$pcp_personal_note}{/if} {/if} -{if $onBehalfProfile} +{if !empty($onBehalfProfile)} =========================================================== {ts}On Behalf Of{/ts} @@ -154,7 +154,7 @@ {/foreach} {/if} -{if $billingName} +{if !empty($billingName)} =========================================================== {ts}Billing Name and Address{/ts} @@ -163,14 +163,14 @@ {$address} {$email} -{elseif $email} +{elseif !empty($email)} =========================================================== {ts}Registered Email{/ts} =========================================================== {$email} {/if} {* End billingName or email *} -{if $credit_card_type} +{if !empty($credit_card_type)} =========================================================== {ts}Credit Card Information{/ts} @@ -181,7 +181,7 @@ {ts}Expires{/ts}: {$credit_card_exp_date|truncate:7:''|crmDate} {/if} -{if $selectPremium } +{if !empty($selectPremium)} =========================================================== {ts}Premium Information{/ts} @@ -199,42 +199,42 @@ {if $end_date} {ts}End Date{/ts}: {$end_date|crmDate} {/if} -{if $contact_email OR $contact_phone} +{if !empty($contact_email) OR !empty($contact_phone)} {ts}For information about this premium, contact:{/ts} -{if $contact_email} +{if !empty($contact_email)} {$contact_email} {/if} -{if $contact_phone} +{if !empty($contact_phone)} {$contact_phone} {/if} {/if} -{if $is_deductible AND $price} +{if !empty($is_deductible) AND !empty($price)} {ts 1=$price|crmMoney}The value of this premium is %1. This may affect the amount of the tax deduction you can claim. Consult your tax advisor for more information.{/ts}{/if} {/if} -{if $customPre} +{if !empty($customPre)} =========================================================== {$customPre_grouptitle} =========================================================== {foreach from=$customPre item=customValue key=customName} -{if ( $trackingFields and ! in_array( $customName, $trackingFields ) ) or ! $trackingFields} +{if ( !empty($trackingFields) and ! in_array( $customName, $trackingFields ) ) or empty($trackingFields)} {$customName}: {$customValue} {/if} {/foreach} {/if} -{if $customPost} +{if !empty($customPost)} =========================================================== {$customPost_grouptitle} =========================================================== {foreach from=$customPost item=customValue key=customName} -{if ( $trackingFields and ! in_array( $customName, $trackingFields ) ) or ! $trackingFields} +{if ( !empty($trackingFields) and ! in_array( $customName, $trackingFields ) ) or empty($trackingFields)} {$customName}: {$customValue} {/if} {/foreach} 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 8a09aef437..025d2f7b87 100644 --- a/xml/templates/message_templates/payment_or_refund_notification_html.tpl +++ b/xml/templates/message_templates/payment_or_refund_notification_html.tpl @@ -176,7 +176,7 @@
{ts}Participant Role{/ts} @@ -187,7 +187,7 @@
{$location.address.1.display|nl2br} @@ -195,7 +195,7 @@
{ts}Event Contacts:{/ts} -- 2.25.1