diff --git a/CRM/Contribute/BAO/ContributionPage.php b/CRM/Contribute/BAO/ContributionPage.php index d5bfdb00a49a98954020eddf74f26e0992fc710c..806e8aa6834d74e0bb696eb134968ed91464a3e2 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 7af892ce3d6cf53528f6e0bef55c4e446322af47..81a133d6963fa85813bb050eaa69a136ab5e10b3 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 664ce502c1ea86d8273a4264285b5f6e000df568..e28bdbf900a5f4487e50a316495b431a11e8719a 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 267a00644f37c1715e74a9f0c0ca8d0560993779..8f347dce0a3920071bac23c07964133017b16d8b 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 753af958bf40185ee24ccdd36e194bb7f1487130..c9cdcdb8201a05be0853129905c068577212b0fe 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 @@ <body> 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} </body> </html> diff --git a/tests/templates/message_templates/event_online_receipt_text.tpl b/tests/templates/message_templates/event_online_receipt_text.tpl index 5b9646a6b9dd9a4abf78398ac966fdcb239720cf..370b9de737a66736a7b585ed1abbe6f532aab78a 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 cd5733cc6a52642d239e93ee4f436d9dbfea861d..c9d2f9e25172f0687f2eff052b5edddfd706dafe 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 @@ <td style="text-align:right;"><font size="1">{ts}Sub Total{/ts}</font></td> <td style="text-align:right;"><font size="1">{$subTotal|crmMoney:$currency}</font></td> </tr> + {if !empty($dataArray)} {foreach from=$dataArray item=value key=priceset} <tr> <td colspan="3"></td> @@ -118,9 +119,10 @@ {elseif $priceset == 0} <td style="text-align:right;white-space: nowrap"><font size="1">{ts 1=$taxTerm}TOTAL %1{/ts}</font></td> <td style="text-align:right"><font size="1" align="right">{$value|crmMoney:$currency}</font> </td> + {/if} </tr> - {/if} {/foreach} + {/if} <tr> <td colspan="3"></td> <td style="text-align:right;white-space: nowrap"><b><font size="1">{ts 1=$currency}TOTAL %1{/ts}</font></b></td> @@ -339,6 +341,7 @@ <td style="padding-left:28px;text-align:right;"><font size="1">{ts}Sub Total{/ts}</font></td> <td style="padding-left:28px;text-align:right;"><font size="1">{$subTotal|crmMoney:$currency}</font></td> </tr> + {if !empty($dataArray)} {foreach from=$dataArray item=value key=priceset} <tr> <td colspan="3"></td> @@ -348,9 +351,10 @@ {elseif $priceset == 0} <td style="padding-left:28px;text-align:right;"><font size="1">{ts 1=$taxTerm}TOTAL NO %1{/ts}</font></td> <td style="padding-left:28px;text-align:right;"><font size="1" align="right">{$value|crmMoney:$currency}</font> </td> + {/if} </tr> - {/if} {/foreach} + {/if} <tr> <td colspan="3"></td> <td colspan="2"><hr></hr></td> diff --git a/xml/templates/message_templates/contribution_offline_receipt_html.tpl b/xml/templates/message_templates/contribution_offline_receipt_html.tpl index 4f7b8819f3bcee8a36bfb359cbeb7adf193f3ab2..d8b9ba9bbe34c7468316da8136ff72d2577ab2bc 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 @@ <tr> <td> {assign var="greeting" value="{contact.email_greeting}"}{if $greeting}<p>{$greeting},</p>{/if} - {if $formValues.receipt_text} + {if !empty($formValues.receipt_text)} <p>{$formValues.receipt_text|htmlize}</p> {else} <p>{ts}Below you will find a receipt for this contribution.{/ts}</p> @@ -54,7 +54,7 @@ </td> </tr> - {if $lineItem and !$is_quick_config} + {if !empty($lineItem) and empty($is_quick_config)} {foreach from=$lineItem item=value key=priceset} <tr> <td colspan="2" {$valueStyle}> @@ -63,7 +63,7 @@ <th>{ts}Item{/ts}</th> <th>{ts}Qty{/ts}</th> <th>{ts}Each{/ts}</th> - {if $getTaxDetails} + {if !empty($getTaxDetails)} <th>{ts}Subtotal{/ts}</th> <th>{ts}Tax Rate{/ts}</th> <th>{ts}Tax Amount{/ts}</th> @@ -81,11 +81,11 @@ <td> {$line.unit_price|crmMoney:$currency} </td> - {if $getTaxDetails} + {if !empty($getTaxDetails)} <td> {$line.unit_price*$line.qty|crmMoney:$currency} </td> - {if $line.tax_rate != "" || $line.tax_amount != ""} + {if isset($line.tax_rate) and ($line.tax_rate != "" || $line.tax_amount != "")} <td> {$line.tax_rate|string_format:"%.2f"}% </td> @@ -107,7 +107,7 @@ </tr> {/foreach} {/if} - {if $getTaxDetails && $dataArray} + {if !empty($getTaxDetails) && !empty($dataArray)} <tr> <td {$labelStyle}> {ts} Amount before Tax : {/ts} @@ -150,7 +150,7 @@ </td> </tr> - {if $receive_date} + {if !empty($receive_date)} <tr> <td {$labelStyle}> {ts}Date Received{/ts} @@ -172,7 +172,7 @@ </tr> {/if} - {if $formValues.paidBy and !$formValues.hidden_CreditCard} + {if !empty($formValues.paidBy) and empty($formValues.hidden_CreditCard)} <tr> <td {$labelStyle}> {ts}Paid By{/ts} @@ -181,7 +181,7 @@ {$formValues.paidBy} </td> </tr> - {if $formValues.check_number} + {if !empty($formValues.check_number)} <tr> <td {$labelStyle}> {ts}Check Number{/ts} @@ -193,7 +193,7 @@ {/if} {/if} - {if $formValues.trxn_id} + {if !empty($formValues.trxn_id)} <tr> <td {$labelStyle}> {ts}Transaction ID{/ts} @@ -204,7 +204,7 @@ </tr> {/if} - {if $ccContribution} + {if !empty($ccContribution)} <tr> <th {$headerStyle}> {ts}Billing Name and Address{/ts} @@ -230,7 +230,7 @@ </tr> {/if} - {if $softCreditTypes and $softCredits} + {if !empty($softCreditTypes) and !empty($softCredits)} {foreach from=$softCreditTypes item=softCreditType key=n} <tr> <th {$headerStyle}> @@ -250,7 +250,7 @@ {/foreach} {/if} - {if $customGroup} + {if !empty($customGroup)} {foreach from=$customGroup item=value key=customName} <tr> <th {$headerStyle}> @@ -270,7 +270,7 @@ {/foreach} {/if} - {if $formValues.product_name} + {if !empty($formValues.product_name)} <tr> <th {$headerStyle}> {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 50e0cd4e3708dec1b4946cdd6568e8064c34133b..846d1a4498a3855227c6086cc6ea6990d767d50c 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 fd9c0b8e847ad25ea09d0ce075f69722fcf96f07..280e236f5376653ae9d9eda3cf7d0bf4617362d0 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 @@ <tr> <td> {assign var="greeting" value="{contact.email_greeting}"}{if $greeting}<p>{$greeting},</p>{/if} - {if $receipt_text} + {if !empty($receipt_text)} <p>{$receipt_text|htmlize}</p> {/if} {if $is_pay_later} - <p>{$pay_later_receipt}</p> {* FIXME: this might be text rather than HTML *} + <p>{if isset($pay_later_receipt)}{$pay_later_receipt}{/if}</p> {* FIXME: this might be text rather than HTML *} {/if} </td> @@ -44,7 +44,7 @@ </th> </tr> - {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} <tr> @@ -54,7 +54,7 @@ <th>{ts}Item{/ts}</th> <th>{ts}Qty{/ts}</th> <th>{ts}Each{/ts}</th> - {if $dataArray} + {if !empty($dataArray)} <th>{ts}Subtotal{/ts}</th> <th>{ts}Tax Rate{/ts}</th> <th>{ts}Tax Amount{/ts}</th> @@ -72,11 +72,11 @@ <td> {$line.unit_price|crmMoney:$currency} </td> - {if $getTaxDetails} + {if !empty($getTaxDetails)} <td> {$line.unit_price*$line.qty|crmMoney:$currency} </td> - {if $line.tax_rate != "" || $line.tax_amount != ""} + {if isset($line.tax_rate) and ($line.tax_rate != "" || $line.tax_amount != "")} <td> {$line.tax_rate|string_format:"%.2f"}% </td> @@ -97,7 +97,7 @@ </td> </tr> {/foreach} - {if $dataArray} + {if !empty($dataArray)} <tr> <td {$labelStyle}> {ts} Amount before Tax : {/ts} @@ -120,7 +120,7 @@ {/foreach} {/if} - {if $totalTaxAmount} + {if isset($totalTaxAmount)} <tr> <td {$labelStyle}> {ts}Total Tax{/ts} @@ -141,7 +141,7 @@ {else} - {if $totalTaxAmount} + {if !empty($totalTaxAmount)} <tr> <td {$labelStyle}> {ts}Total Tax Amount{/ts} @@ -156,7 +156,7 @@ {ts}Amount{/ts} </td> <td {$valueStyle}> - {$amount|crmMoney:$currency} {if $amount_level} - {$amount_level}{/if} + {$amount|crmMoney:$currency} {if isset($amount_level)} - {$amount_level}{/if} </td> </tr> @@ -165,7 +165,7 @@ {/if} - {if $receive_date} + {if !empty($receive_date)} <tr> <td {$labelStyle}> {ts}Date{/ts} @@ -176,7 +176,7 @@ </tr> {/if} - {if $is_monetary and $trxn_id} + {if !empty($is_monetary) and !empty($trxn_id)} <tr> <td {$labelStyle}> {ts}Transaction #{/ts} @@ -187,7 +187,7 @@ </tr> {/if} - {if $is_recur} + {if !empty($is_recur)} <tr> <td colspan="2" {$labelStyle}> {ts}This is a recurring contribution.{/ts} @@ -228,7 +228,7 @@ </td> </tr> {/foreach} - {elseif $softCreditTypes and $softCredits} + {elseif !empty($softCreditTypes) and !empty($softCredits)} {foreach from=$softCreditTypes item=softCreditType key=n} <tr> <th {$headerStyle}> @@ -248,7 +248,7 @@ {/foreach} {/if} - {if $pcpBlock} + {if !empty($pcpBlock)} <tr> <th {$headerStyle}> {ts}Personal Campaign Page{/ts} @@ -284,7 +284,7 @@ {/if} {/if} - {if $onBehalfProfile} + {if !empty($onBehalfProfile)} <tr> <th {$headerStyle}> {$onBehalfProfile_grouptitle} @@ -302,7 +302,7 @@ {/foreach} {/if} - {if $isShare} + {if !empty($isShare)} <tr> <td colspan="2" {$valueStyle}> {capture assign=contributionUrl}{crmURL p='civicrm/contribute/transact' q="reset=1&id=`$contributionPageId`" a=true fe=1 h=1}{/capture} @@ -311,7 +311,7 @@ </tr> {/if} - {if $billingName} + {if !empty($billingName)} <tr> <th {$headerStyle}> {ts}Billing Name and Address{/ts} @@ -324,7 +324,7 @@ {$email} </td> </tr> - {elseif $email} + {elseif !empty($email)} <tr> <th {$headerStyle}> {ts}Registered Email{/ts} @@ -337,7 +337,7 @@ </tr> {/if} - {if $credit_card_type} + {if !empty($credit_card_type)} <tr> <th {$headerStyle}> {ts}Credit Card Information{/ts} @@ -352,7 +352,7 @@ </tr> {/if} - {if $selectPremium} + {if !empty($selectPremium)} <tr> <th {$headerStyle}> {ts}Premium Information{/ts} @@ -403,20 +403,20 @@ </td> </tr> {/if} - {if $contact_email OR $contact_phone} + {if !empty($contact_email) OR !empty($contact_phone)} <tr> <td colspan="2" {$valueStyle}> <p>{ts}For information about this premium, contact:{/ts}</p> - {if $contact_email} + {if !empty($contact_email)} <p>{$contact_email}</p> {/if} - {if $contact_phone} + {if !empty($contact_phone)} <p>{$contact_phone}</p> {/if} </td> </tr> {/if} - {if $is_deductible AND $price} + {if !empty($is_deductible) AND !empty($price)} <tr> <td colspan="2" {$valueStyle}> <p>{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}</p> @@ -425,14 +425,14 @@ {/if} {/if} - {if $customPre} + {if !empty($customPre)} <tr> <th {$headerStyle}> {$customPre_grouptitle} </th> </tr> {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)} <tr> <td {$labelStyle}> {$customName} @@ -445,14 +445,14 @@ {/foreach} {/if} - {if $customPost} + {if !empty($customPost)} <tr> <th {$headerStyle}> {$customPost_grouptitle} </th> </tr> {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)} <tr> <td {$labelStyle}> {$customName} diff --git a/xml/templates/message_templates/contribution_online_receipt_text.tpl b/xml/templates/message_templates/contribution_online_receipt_text.tpl index 4c86a366c7bb9b868cc304ba2af53efc1f857c8c..8a0068d5f245a64b96ca757a422d3a9c29f8cf03 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 876a478e017532cdd51fb905994047aa5689e201..15fec07acc58f33b3f23ece9d95e6b749e176651 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 @@ <td> {assign var="greeting" value="{contact.email_greeting}"}{if $greeting}<p>{$greeting},</p>{/if} - {if $event.confirm_email_text AND (not $isOnWaitlist AND not $isRequireApproval)} + {if !empty($event.confirm_email_text) AND (empty($isOnWaitlist) AND empty($isRequireApproval))} <p>{$event.confirm_email_text|htmlize}</p> {/if} - {if $isOnWaitlist} + {if !empty($isOnWaitlist)} <p>{ts}You have been added to the WAIT LIST for this event.{/ts}</p> - {if $isPrimary} + {if !empty($isPrimary)} <p>{ts}If space becomes available you will receive an email with a link to a web page where you can complete your registration.{/ts}</p> {/if} - {elseif $isRequireApproval} + {elseif !empty($isRequireApproval)} <p>{ts}Your registration has been submitted.{/ts}</p> - {if $isPrimary} + {if !empty($isPrimary)} <p>{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}</p> {/if} - {elseif $is_pay_later} - <p>{$pay_later_receipt}</p> {* FIXME: this might be text rather than HTML *} + {elseif !empty($is_pay_later)} + <p>{if isset($pay_later_receipt)}{$pay_later_receipt}{/if}</p> {* FIXME: this might be text rather than HTML *} {/if} </td> @@ -58,7 +58,7 @@ </td> </tr> - {if $event.participant_role neq 'Attendee' and $defaultRole} + {if !empty($event.participant_role) and $event.participant_role neq 'Attendee' and !empty($defaultRole)} <tr> <td {$labelStyle}> {ts}Participant Role{/ts} @@ -69,7 +69,7 @@ </tr> {/if} - {if $isShowLocation} + {if !empty($isShowLocation)} <tr> <td colspan="2" {$valueStyle}> {$location.address.1.display|nl2br} @@ -77,7 +77,7 @@ </tr> {/if} - {if $location.phone.1.phone || $location.email.1.email} + {if !empty($location.phone.1.phone) || !empty($location.email.1.email)} <tr> <td colspan="2" {$labelStyle}> {ts}Event Contacts:{/ts} @@ -113,7 +113,7 @@ {/foreach} {/if} - {if $event.is_public} + {if !empty($event.is_public)} <tr> <td colspan="2" {$valueStyle}> {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)} <tr> <th {$headerStyle}> - {$event.fee_label} + {if !empty($event.fee_label)}{$event.fee_label}{/if} </th> </tr> - {if $lineItem} + {if !empty($lineItem)} {foreach from=$lineItem item=value key=priceset} {if $value neq 'skip'} {if $isPrimary} @@ -163,13 +163,13 @@ <th>{ts}Item{/ts}</th> <th>{ts}Qty{/ts}</th> <th>{ts}Each{/ts}</th> - {if $dataArray} + {if !empty($dataArray)} <th>{ts}SubTotal{/ts}</th> <th>{ts}Tax Rate{/ts}</th> <th>{ts}Tax Amount{/ts}</th> {/if} <th>{ts}Total{/ts}</th> - {if $pricesetFieldsCount }<th>{ts}Total Participants{/ts}</th>{/if} + {if !empty($pricesetFieldsCount) }<th>{ts}Total Participants{/ts}</th>{/if} </tr> {foreach from=$value item=line} <tr> @@ -182,7 +182,7 @@ <td> {$line.unit_price|crmMoney} </td> - {if $dataArray} + {if !empty($dataArray)} <td> {$line.unit_price*$line.qty|crmMoney} </td> @@ -201,7 +201,7 @@ <td> {$line.line_total+$line.tax_amount|crmMoney} </td> - {if $pricesetFieldsCount } + {if !empty($pricesetFieldsCount) } <td> {$line.participant_count} </td> @@ -213,7 +213,7 @@ </tr> {/if} {/foreach} - {if $dataArray} + {if !empty($dataArray)} <tr> <td {$labelStyle}> {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} <tr> <td colspan="2" {$valueStyle}> @@ -245,7 +245,7 @@ </tr> {/foreach} {/if} - {if $totalTaxAmount} + {if isset($totalTaxAmount)} <tr> <td {$labelStyle}> {ts}Total Tax Amount{/ts} @@ -265,10 +265,10 @@ {/if} </td> <td {$valueStyle}> - {$totalAmount|crmMoney} {if $hookDiscount.message}({$hookDiscount.message}){/if} + {if !empty($totalAmount)}{$totalAmount|crmMoney}{/if} {if !empty($hookDiscount.message)}({$hookDiscount.message}){/if} </td> </tr> - {if $balanceAmount} + {if isset($balanceAmount)} <tr> <td {$labelStyle}> {ts}Balance{/ts} @@ -278,7 +278,7 @@ </td> </tr> {/if} - {if $pricesetFieldsCount } + {if !empty($pricesetFieldsCount) } <tr> <td {$labelStyle}> {ts}Total Participants{/ts}</td> @@ -300,10 +300,10 @@ </td> </tr> {/if} - {if $is_pay_later} + {if !empty($is_pay_later)} <tr> <td colspan="2" {$labelStyle}> - {$pay_later_receipt} + {if isset($pay_later_receipt)}{$pay_later_receipt}{/if} </td> </tr> {/if} @@ -319,7 +319,7 @@ </tr> {/if} - {if $receive_date} + {if !empty($receive_date)} <tr> <td {$labelStyle}> {ts}Transaction Date{/ts} @@ -330,7 +330,7 @@ </tr> {/if} - {if $financialTypeName} + {if !empty($financialTypeName)} <tr> <td {$labelStyle}> {ts}Financial Type{/ts} @@ -341,7 +341,7 @@ </tr> {/if} - {if $trxn_id} + {if !empty($trxn_id)} <tr> <td {$labelStyle}> {ts}Transaction #{/ts} @@ -352,7 +352,7 @@ </tr> {/if} - {if $paidBy} + {if !empty($paidBy)} <tr> <td {$labelStyle}> {ts}Paid By{/ts} @@ -363,7 +363,7 @@ </tr> {/if} - {if $checkNumber} + {if !empty($checkNumber)} <tr> <td {$labelStyle}> {ts}Check Number{/ts} @@ -374,7 +374,7 @@ </tr> {/if} - {if $billingName} + {if !empty($billingName)} <tr> <th {$headerStyle}> {ts}Billing Name and Address{/ts} @@ -388,7 +388,7 @@ </tr> {/if} - {if $credit_card_type} + {if !empty($credit_card_type)} <tr> <th {$headerStyle}> {ts}Credit Card Information{/ts} @@ -407,14 +407,14 @@ {/if} {* End of conditional section for Paid events *} - {if $customPre} + {if !empty($customPre)} <tr> <th {$headerStyle}> {$customPre_grouptitle} </th> </tr> {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)} <tr> <td {$labelStyle}> {$customName} @@ -427,14 +427,14 @@ {/foreach} {/if} - {if $customPost} + {if !empty($customPost)} <tr> <th {$headerStyle}> {$customPost_grouptitle} </th> </tr> {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)} <tr> <td {$labelStyle}> {$customName} @@ -447,7 +447,7 @@ {/foreach} {/if} - {if $customProfile} + {if !empty($customProfile)} {foreach from=$customProfile item=value key=customName} <tr> <th {$headerStyle}> @@ -480,7 +480,7 @@ {/foreach} {/if} - {if $customGroup} + {if !empty($customGroup)} {foreach from=$customGroup item=value key=customName} <tr> <th {$headerStyle}> diff --git a/xml/templates/message_templates/event_offline_receipt_text.tpl b/xml/templates/message_templates/event_offline_receipt_text.tpl index e128670c91d03e7e7b5fbd3a9d754d5a5443ff87..2e8b682de605c28397dd8b7cb48ee31015678736 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 ef73f07f4c918f931d7d6612e3bb25f6e7f3cfc9..0d95412df9c9f593459e9d626301df93b0270866 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 @@ <td> {assign var="greeting" value="{contact.email_greeting}"}{if $greeting}<p>{$greeting},</p>{/if} - {if $event.confirm_email_text AND (not $isOnWaitlist AND not $isRequireApproval)} + {if !empty($event.confirm_email_text) AND (empty($isOnWaitlist) AND empty($isRequireApproval))} <p>{$event.confirm_email_text|htmlize}</p> {else} @@ -38,18 +38,18 @@ {/if} <p> - {if $isOnWaitlist} + {if !empty($isOnWaitlist)} <p>{ts}You have been added to the WAIT LIST for this event.{/ts}</p> - {if $isPrimary} + {if !empty($isPrimary)} <p>{ts}If space becomes available you will receive an email with a link to a web page where you can complete your registration.{/ts}</p> {/if} - {elseif $isRequireApproval} + {elseif !empty($isRequireApproval)} <p>{ts}Your registration has been submitted.{/ts}</p> - {if $isPrimary} + {if !empty($isPrimary)} <p>{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}</p> {/if} - {elseif $is_pay_later && !$isAmountzero && !$isAdditionalParticipant} - <p>{$pay_later_receipt}</p> {* FIXME: this might be text rather than HTML *} + {elseif !empty($is_pay_later) && empty($isAmountzero) && empty($isAdditionalParticipant)} + <p>{if isset($pay_later_receipt)}{$pay_later_receipt}{/if}</p> {* FIXME: this might be text rather than HTML *} {/if} </td> @@ -91,7 +91,7 @@ </tr> {/if} - {if $event.participant_role neq 'Attendee' and $defaultRole} + {if !empty($event.participant_role) and $event.participant_role neq 'Attendee' and !empty($defaultRole)} <tr> <td {$labelStyle}> {ts}Participant Role{/ts} @@ -102,7 +102,7 @@ </tr> {/if} - {if $isShowLocation} + {if !empty($isShowLocation)} <tr> <td colspan="2" {$valueStyle}> {$location.address.1.display|nl2br} @@ -110,7 +110,7 @@ </tr> {/if} - {if $location.phone.1.phone || $location.email.1.email} + {if !empty($location.phone.1.phone) || !empty($location.email.1.email)} <tr> <td colspan="2" {$labelStyle}> {ts}Event Contacts:{/ts} @@ -146,7 +146,7 @@ {/foreach} {/if} - {if $event.is_public} + {if !empty($event.is_public)} <tr> <td colspan="2" {$valueStyle}> {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 @@ </tr> {/if} - {if $event.is_share} + {if !empty($event.is_share)} <tr> <td colspan="2" {$valueStyle}> {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 @@ </td> </tr> {/if} - {if $payer.name} + {if !empty($payer.name)} <tr> <th {$headerStyle}> {ts}You were registered by:{/ts} @@ -175,22 +175,22 @@ </td> </tr> {/if} - {if $event.is_monetary and not $isRequireApproval} + {if !empty($event.is_monetary) and empty($isRequireApproval)} <tr> <th {$headerStyle}> - {$event.fee_label} + {if !empty($event.fee_label)}{$event.fee_label}{/if} </th> </tr> - {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. *} <tr> <td colspan="2" {$labelStyle}> - {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} </td> </tr> {/if} @@ -202,13 +202,13 @@ <th>{ts}Item{/ts}</th> <th>{ts}Qty{/ts}</th> <th>{ts}Each{/ts}</th> - {if $dataArray} + {if !empty($dataArray)} <th>{ts}SubTotal{/ts}</th> <th>{ts}Tax Rate{/ts}</th> <th>{ts}Tax Amount{/ts}</th> {/if} <th>{ts}Total{/ts}</th> - {if $pricesetFieldsCount }<th>{ts}Total Participants{/ts}</th>{/if} + {if !empty($pricesetFieldsCount) }<th>{ts}Total Participants{/ts}</th>{/if} </tr> {foreach from=$value item=line} <tr> @@ -221,11 +221,11 @@ <td {$tdStyle}> {$line.unit_price|crmMoney:$currency} </td> - {if $dataArray} + {if !empty($dataArray)} <td {$tdStyle}> {$line.unit_price*$line.qty|crmMoney} </td> - {if $line.tax_rate != "" || $line.tax_amount != ""} + {if isset($line.tax_rate) and ($line.tax_rate != "" || $line.tax_amount != "")} <td {$tdStyle}> {$line.tax_rate|string_format:"%.2f"}% </td> @@ -240,10 +240,10 @@ <td {$tdStyle}> {$line.line_total+$line.tax_amount|crmMoney:$currency} </td> - {if $pricesetFieldsCount }<td {$tdStyle}>{$line.participant_count}</td> {/if} + {if !empty($pricesetFieldsCount) }<td {$tdStyle}>{$line.participant_count}</td> {/if} </tr> {/foreach} - {if $individual} + {if !empty($individual)} <tr {$participantTotal}> <td colspan=3>{ts}Participant Total{/ts}</td> <td colspan=2>{$individual.$priceset.totalAmtWithTax-$individual.$priceset.totalTaxAmt|crmMoney}</td> @@ -256,7 +256,7 @@ </tr> {/if} {/foreach} - {if $dataArray} + {if !empty($dataArray)} <tr> <td {$labelStyle}> {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} <tr> <td colspan="2" {$valueStyle}> @@ -289,7 +289,7 @@ {/foreach} {/if} - {if $totalTaxAmount} + {if isset($totalTaxAmount)} <tr> <td {$labelStyle}> {ts}Total Tax Amount{/ts} @@ -305,10 +305,10 @@ {ts}Total Amount{/ts} </td> <td {$valueStyle}> - {$totalAmount|crmMoney:$currency} {if $hookDiscount.message}({$hookDiscount.message}){/if} + {if !empty($totalAmount)}{$totalAmount|crmMoney:$currency}{/if} {if !empty($hookDiscount.message)}({$hookDiscount.message}){/if} </td> </tr> - {if $pricesetFieldsCount } + {if !empty($pricesetFieldsCount) } <tr> <td {$labelStyle}> {ts}Total Participants{/ts}</td> @@ -341,7 +341,7 @@ </tr> {/if} - {if $receive_date} + {if !empty($receive_date)} <tr> <td {$labelStyle}> {ts}Transaction Date{/ts} @@ -352,7 +352,7 @@ </tr> {/if} - {if $financialTypeName} + {if !empty($financialTypeName)} <tr> <td {$labelStyle}> {ts}Financial Type{/ts} @@ -363,7 +363,7 @@ </tr> {/if} - {if $trxn_id} + {if !empty($trxn_id)} <tr> <td {$labelStyle}> {ts}Transaction #{/ts} @@ -374,7 +374,7 @@ </tr> {/if} - {if $paidBy} + {if !empty($paidBy)} <tr> <td {$labelStyle}> {ts}Paid By{/ts} @@ -385,7 +385,7 @@ </tr> {/if} - {if $checkNumber} + {if !empty($checkNumber)} <tr> <td {$labelStyle}> {ts}Check Number{/ts} @@ -396,7 +396,7 @@ </tr> {/if} - {if $billingName} + {if !empty($billingName)} <tr> <th {$headerStyle}> {ts}Billing Name and Address{/ts} @@ -410,7 +410,7 @@ </tr> {/if} - {if $credit_card_type} + {if !empty($credit_card_type)} <tr> <th {$headerStyle}> {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} <tr> <th {$headerStyle}>{$customPre_grouptitle.$i}</th></tr> {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)} <tr> <td {$labelStyle}>{$customName}</td> <td {$valueStyle}>{$customValue}</td> @@ -444,11 +444,11 @@ {/foreach} {/if} -{if $customPost} +{if !empty($customPost)} {foreach from=$customPost item=customPos key=j} <tr> <th {$headerStyle}>{$customPost_grouptitle.$j}</th></tr> {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)} <tr> <td {$labelStyle}>{$customName}</td> <td {$valueStyle}>{$customValue}</td> @@ -458,7 +458,7 @@ {/foreach} {/if} -{if $customProfile} +{if !empty($customProfile)} {foreach from=$customProfile.profile item=eachParticipant key=participantID} <tr><th {$headerStyle}>{ts 1=$participantID+2}Participant %1{/ts} </th></tr> {foreach from=$eachParticipant item=eachProfile key=pid} @@ -475,10 +475,10 @@ {/if} </table> - {if $event.allow_selfcancelxfer } + {if !empty($event.allow_selfcancelxfer) } <tr> <td colspan="2" {$valueStyle}> - {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}<br /> + {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}<br /> {capture assign=selfService}{crmURL p='civicrm/event/selfsvcupdate' q="reset=1&pid=`$participant.id`&{contact.checksum}" h=0 a=1 fe=1}{/capture} <a href="{$selfService}">{ts}Click here to transfer or cancel your registration.{/ts}</a> </td> diff --git a/xml/templates/message_templates/event_online_receipt_subject.tpl b/xml/templates/message_templates/event_online_receipt_subject.tpl index 7bb27306377a75307af7c30c9f2d313d60cd2b2e..da1dab7259d0c8149603df0d72d4a517e8294771 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 adca08ff5f4b8afcb89f5e9530c2417ec5f7ec01..04f25cf5146858f4cfb396fcf7b1a1c18b2fd65a 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 022805658116ec155dd5940c639b58840b1a79d1..2040b451fca78e61335d1eb270b9f0a9102517a4 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} - <p>{$pay_later_receipt}</p> + <p>{if isset($pay_later_receipt)}{$pay_later_receipt}{/if}</p> {/if} <p>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 8a58ea90c0fb88426d96b1c731a8d0354b8038e2..5a6807609e65be01a9dc05229bbacb38f8f6abab 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 3cc8fe6f4c30c4458036ffc66de93786f82bb6c3..2fd5ec20d97c78ae0e3f7d8f58a41e6d0c5a2dfa 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 @@ <tr> <td> {assign var="greeting" value="{contact.email_greeting}"}{if $greeting}<p>{$greeting},</p>{/if} - {if $formValues.receipt_text_signup} + {if !empty($formValues.receipt_text_signup)} <p>{$formValues.receipt_text_signup|htmlize}</p> - {elseif $formValues.receipt_text_renewal} + {elseif !empty($formValues.receipt_text_renewal)} <p>{$formValues.receipt_text_renewal|htmlize}</p> {else} <p>{ts}Thank you for this contribution.{/ts}</p> @@ -36,7 +36,7 @@ <tr> <td> <table style="border: 1px solid #999; margin: 1em 0em 1em; border-collapse: collapse; width:100%;"> - {if !$lineItem} + {if empty($lineItem)} <tr> <th {$headerStyle}> {ts}Membership Information{/ts} @@ -51,8 +51,8 @@ </td> </tr> {/if} - {if ! $cancelled} - {if !$lineItem} + {if empty($cancelled)} + {if empty($lineItem)} <tr> <td {$labelStyle}> {ts}Membership Start Date{/ts} @@ -87,7 +87,7 @@ </tr> {/if} - {if $lineItem} + {if !empty($lineItem)} {foreach from=$lineItem item=value key=priceset} <tr> <td colspan="2" {$valueStyle}> @@ -95,7 +95,7 @@ <tr> <th>{ts}Item{/ts}</th> <th>{ts}Fee{/ts}</th> - {if $dataArray} + {if !empty($dataArray)} <th>{ts}SubTotal{/ts}</th> <th>{ts}Tax Rate{/ts}</th> <th>{ts}Tax Amount{/ts}</th> @@ -113,11 +113,11 @@ <td> {$line.line_total|crmMoney} </td> - {if $dataArray} + {if !empty($dataArray)} <td> {$line.unit_price*$line.qty|crmMoney} </td> - {if $line.tax_rate != "" || $line.tax_amount != ""} + {if $line.tax_rate and ($line.tax_rate != "" || $line.tax_amount != "")} <td> {$line.tax_rate|string_format:"%.2f"}% </td> @@ -144,7 +144,7 @@ </td> </tr> {/foreach} - {if $dataArray} + {if !empty($dataArray)} <tr> <td {$labelStyle}> {ts}Amount Before Tax:{/ts} @@ -184,7 +184,7 @@ {$formValues.total_amount|crmMoney} </td> </tr> - {if $receive_date} + {if !empty($receive_date)} <tr> <td {$labelStyle}> {ts}Date Received{/ts} @@ -194,7 +194,7 @@ </td> </tr> {/if} - {if $formValues.paidBy} + {if !empty($formValues.paidBy)} <tr> <td {$labelStyle}> {ts}Paid By{/ts} @@ -203,7 +203,7 @@ {$formValues.paidBy} </td> </tr> - {if $formValues.check_number} + {if !empty($formValues.check_number)} <tr> <td {$labelStyle}> {ts}Check Number{/ts} @@ -220,12 +220,12 @@ </td> </tr> - {if $isPrimary} + {if !empty($isPrimary)} <tr> <td> <table style="border: 1px solid #999; margin: 1em 0em 1em; border-collapse: collapse; width:100%;"> - {if $billingName} + {if !empty($billingName)} <tr> <th {$headerStyle}> {ts}Billing Name and Address{/ts} @@ -239,7 +239,7 @@ </tr> {/if} - {if $credit_card_type} + {if !empty($credit_card_type)} <tr> <th {$headerStyle}> {ts}Credit Card Information{/ts} @@ -266,7 +266,7 @@ </tr> {/if} - {if $customValues} + {if !empty($customValues)} <tr> <td> <table style="border: 1px solid #999; margin: 1em 0em 1em; border-collapse: collapse; width:100%;"> diff --git a/xml/templates/message_templates/membership_offline_receipt_text.tpl b/xml/templates/message_templates/membership_offline_receipt_text.tpl index 802deb0238d6ed84fdbba339726eca8536b285d7..a35591eb3f03811e63b8ceb932df3d13c25a2509 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 3e8073b30d405934c53a8bec0359cc45b7239432..a2b1b461332efe9211b97e11d0870031ee6a7462 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 @@ <tr> <td> {assign var="greeting" value="{contact.email_greeting}"}{if $greeting}<p>{$greeting},</p>{/if} - {if $receipt_text} + {if !empty($receipt_text)} <p>{$receipt_text|htmlize}</p> {/if} {if $is_pay_later} - <p>{$pay_later_receipt}</p> {* FIXME: this might be text rather than HTML *} + <p>{if isset($pay_later_receipt)}{$pay_later_receipt}{/if}</p> {* FIXME: this might be text rather than HTML *} {/if} </td> @@ -79,7 +79,7 @@ </th> </tr> - {if !$useForMember and $membership_amount and $is_quick_config} + {if !$useForMember and isset($membership_amount) and !empty($is_quick_config)} <tr> <td {$labelStyle}> @@ -108,7 +108,7 @@ </tr> {/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} <tr> @@ -150,7 +150,7 @@ </tr> {else} - {if $useForMember && $lineItem and !$is_quick_config} + {if $useForMember && $lineItem and empty($is_quick_config)} {foreach from=$lineItem item=value key=priceset} <tr> <td colspan="2" {$valueStyle}> @@ -158,7 +158,7 @@ <tr> <th>{ts}Item{/ts}</th> <th>{ts}Fee{/ts}</th> - {if $dataArray} + {if !empty($dataArray)} <th>{ts}SubTotal{/ts}</th> <th>{ts}Tax Rate{/ts}</th> <th>{ts}Tax Amount{/ts}</th> @@ -175,11 +175,11 @@ <td> {$line.line_total|crmMoney} </td> - {if $dataArray} + {if !empty($dataArray)} <td> {$line.unit_price*$line.qty|crmMoney} </td> - {if $line.tax_rate != "" || $line.tax_amount != ""} + {if isset($line.tax_rate) and ($line.tax_rate != "" || $line.tax_amount != "")} <td> {$line.tax_rate|string_format:"%.2f"}% </td> @@ -206,7 +206,7 @@ </td> </tr> {/foreach} - {if $dataArray} + {if !empty($dataArray)} <tr> <td {$labelStyle}> {ts}Amount Before Tax:{/ts} @@ -228,7 +228,7 @@ {/foreach} {/if} {/if} - {if $totalTaxAmount} + {if isset($totalTaxAmount)} <tr> <td {$labelStyle}> {ts}Total Tax Amount{/ts} @@ -243,14 +243,14 @@ {ts}Amount{/ts} </td> <td {$valueStyle}> - {$amount|crmMoney} {if $amount_level} - {$amount_level}{/if} + {$amount|crmMoney} {if isset($amount_level)} - {$amount_level}{/if} </td> </tr> {/if} - {elseif $membership_amount} + {elseif isset($membership_amount)} <tr> @@ -270,7 +270,7 @@ {/if} - {if $receive_date} + {if !empty($receive_date)} <tr> <td {$labelStyle}> {ts}Date{/ts} @@ -281,7 +281,7 @@ </tr> {/if} - {if $is_monetary and $trxn_id} + {if !empty($is_monetary) and !empty($trxn_id)} <tr> <td {$labelStyle}> {ts}Transaction #{/ts} @@ -292,7 +292,7 @@ </tr> {/if} - {if $membership_trx_id} + {if !empty($membership_trx_id)} <tr> <td {$labelStyle}> {ts}Membership Transaction #{/ts} @@ -302,7 +302,7 @@ </td> </tr> {/if} - {if $is_recur} + {if !empty($is_recur)} <tr> <td colspan="2" {$labelStyle}> {ts}This membership will be renewed automatically.{/ts} @@ -338,7 +338,7 @@ {/foreach} {/if} - {if $pcpBlock} + {if !empty($pcpBlock)} <tr> <th {$headerStyle}> {ts}Personal Campaign Page{/ts} @@ -374,7 +374,7 @@ {/if} {/if} - {if $onBehalfProfile} + {if !empty($onBehalfProfile)} <tr> <th {$headerStyle}> {$onBehalfProfile_grouptitle} @@ -392,7 +392,7 @@ {/foreach} {/if} - {if $billingName} + {if !empty($billingName)} <tr> <th {$headerStyle}> {ts}Billing Name and Address{/ts} @@ -405,7 +405,7 @@ {$email} </td> </tr> - {elseif $email} + {elseif !empty($email)} <tr> <th {$headerStyle}> {ts}Registered Email{/ts} @@ -418,7 +418,7 @@ </tr> {/if} - {if $credit_card_type} + {if !empty($credit_card_type)} <tr> <th {$headerStyle}> {ts}Credit Card Information{/ts} @@ -433,7 +433,7 @@ </tr> {/if} - {if $selectPremium} + {if !empty($selectPremium)} <tr> <th {$headerStyle}> {ts}Premium Information{/ts} @@ -484,20 +484,20 @@ </td> </tr> {/if} - {if $contact_email OR $contact_phone} + {if !empty($contact_email) OR !empty($contact_phone)} <tr> <td colspan="2" {$valueStyle}> <p>{ts}For information about this premium, contact:{/ts}</p> - {if $contact_email} + {if !empty($contact_email)} <p>{$contact_email}</p> {/if} - {if $contact_phone} + {if !empty($contact_phone)} <p>{$contact_phone}</p> {/if} </td> </tr> {/if} - {if $is_deductible AND $price} + {if !empty($is_deductible) AND !empty($price)} <tr> <td colspan="2" {$valueStyle}> <p>{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}</p> @@ -506,14 +506,14 @@ {/if} {/if} - {if $customPre} + {if !empty($customPre)} <tr> <th {$headerStyle}> {$customPre_grouptitle} </th> </tr> {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)} <tr> <td {$labelStyle}> {$customName} @@ -526,14 +526,14 @@ {/foreach} {/if} - {if $customPost} + {if !empty($customPost)} <tr> <th {$headerStyle}> {$customPost_grouptitle} </th> </tr> {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)} <tr> <td {$labelStyle}> {$customName} diff --git a/xml/templates/message_templates/membership_online_receipt_text.tpl b/xml/templates/message_templates/membership_online_receipt_text.tpl index 3c97b7e00002374723944b059b0f207f9900b86b..d1647bdbe20fdb61854e4b865cb214d4ea63d03b 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 8a09aef437dea0a675f59080cc7a07b4d5c3a817..025d2f7b871aaa4e7ea3a978bde4a24da6cae341 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 @@ </td> </tr> - {if $event.participant_role} + {if !empty($event.participant_role)} <tr> <td {$labelStyle}> {ts}Participant Role{/ts} @@ -187,7 +187,7 @@ </tr> {/if} - {if $isShowLocation} + {if !empty($isShowLocation)} <tr> <td colspan="2" {$valueStyle}> {$location.address.1.display|nl2br} @@ -195,7 +195,7 @@ </tr> {/if} - {if $location.phone.1.phone || $location.email.1.email} + {if !empty($location.phone.1.phone) || !empty($location.email.1.email)} <tr> <td colspan="2" {$labelStyle}> {ts}Event Contacts:{/ts}