[php8-compat] Fix api_v3_PaymentTest failures by putting in more guards into message...
authorSeamus Lee <seamuslee001@gmail.com>
Sun, 6 Jun 2021 22:53:56 +0000 (22:53 +0000)
committerSeamus Lee <seamuslee001@gmail.com>
Sun, 6 Jun 2021 22:53:56 +0000 (22:53 +0000)
xml/templates/message_templates/event_offline_receipt_html.tpl
xml/templates/message_templates/event_offline_receipt_text.tpl
xml/templates/message_templates/event_online_receipt_html.tpl
xml/templates/message_templates/event_online_receipt_text.tpl
xml/templates/message_templates/membership_offline_receipt_html.tpl
xml/templates/message_templates/payment_or_refund_notification_html.tpl
xml/templates/message_templates/payment_or_refund_notification_text.tpl

index 5d7e661646194d32dc2446f6988f9647e295486c..3f4b816c744295a144a39959aa09e5925ec48c35 100644 (file)
         {/if}
        {/foreach}
        {if !empty($dataArray)}
+        {if isset($totalAmount) and isset($totalTaxAmount)}
         <tr>
          <td {$labelStyle}>
           {ts}Amount Before Tax:{/ts}
           {$totalAmount-$totalTaxAmount|crmMoney}
          </td>
         </tr>
+        {/if}
         {foreach from=$dataArray item=value key=priceset}
           <tr>
            {if $priceset || $priceset == 0}
index c250fc316d79bfb13c57fc780167f1b8c11c2cb2..c5c1741a81f9c9af78475e3eaa341952874689b0 100644 (file)
 {/foreach}
 
 {if !empty($dataArray)}
+{if isset($totalAmount) and isset($totalTaxAmount)}
 {ts}Amount before Tax{/ts}: {$totalAmount-$totalTaxAmount|crmMoney:$currency}
+{/if}
 
 {foreach from=$dataArray item=value key=priceset}
 {if $priceset || $priceset == 0}
index 2d37975d052bd88c12aa8f51f9e0558c082c5dd9..07b9e71a4cc247d074c60f308f5829e3526f56f2 100644 (file)
         {/if}
        {/foreach}
        {if !empty($dataArray)}
+        {if isset($totalAmount) and isset($totalTaxAmount)}
         <tr>
          <td {$labelStyle}>
           {ts} Amount Before Tax: {/ts}
           {$totalAmount-$totalTaxAmount|crmMoney}
          </td>
         </tr>
+        {/if}
         {foreach from=$dataArray item=value key=priceset}
          <tr>
           {if $priceset || $priceset == 0}
index fba539841ab8d42c07045316f77c49b3e563a979..610b9b274a4bdd5387cfc4d4d97c6bff0c5ca6ff 100644 (file)
@@ -139,7 +139,9 @@ You were registered by: {$payer.name}
 {""|string_format:"%120s"}
 
 {if !empty($dataArray)}
+{if isset($totalAmount) and isset($totalTaxAmount)}
 {ts}Amount before Tax{/ts}: {$totalAmount-$totalTaxAmount|crmMoney:$currency}
+{/if}
 
 {foreach from=$dataArray item=value key=priceset}
 {if $priceset || $priceset == 0}
index 7a47a7717a7141e553d0573b751826deeaebfacb..c40dd6eac84712b25991310cc635829c161a58a5 100644 (file)
                   </tr>
                 {/foreach}
                 {if !empty($dataArray)}
+                  {if isset($formValues.total_amount) and isset($totalTaxAmount)}
                   <tr>
                     <td {$labelStyle}>
                       {ts}Amount Before Tax:{/ts}
                       {$formValues.total_amount-$totalTaxAmount|crmMoney}
                     </td>
                   </tr>
+                  {/if}
                   {foreach from=$dataArray item=value key=priceset}
                     <tr>
                       {if $priceset}
index 025d2f7b871aaa4e7ea3a978bde4a24da6cae341..f463c1022a8dd3cbfcb45804b34134eda5eff405 100644 (file)
@@ -71,7 +71,7 @@
         </td>
       </tr>
     {/if}
-    {if $trxn_id}
+    {if !empty($trxn_id)}
       <tr>
         <td {$labelStyle}>
         {ts}Transaction #{/ts}
@@ -81,7 +81,7 @@
         </td>
       </tr>
     {/if}
-    {if $paidBy}
+    {if !empty($paidBy)}
       <tr>
         <td {$labelStyle}>
         {ts}Paid By{/ts}
@@ -91,7 +91,7 @@
         </td>
       </tr>
     {/if}
-    {if $checkNumber}
+    {if !empty($checkNumber)}
       <tr>
         <td {$labelStyle}>
         {ts}Check Number{/ts}
   <tr>
     <th {$headerStyle}>{ts}Contribution Details{/ts}</th>
   </tr>
+  {if isset($totalAmount)}
   <tr>
     <td {$labelStyle}>
       {ts}Total Fee{/ts}
       {$totalAmount|crmMoney}
     </td>
   </tr>
+  {/if}
+  {if isset($totalPaid)}
   <tr>
     <td {$labelStyle}>
       {ts}Total Paid{/ts}
       {$totalPaid|crmMoney}
     </td>
   </tr>
+  {/if}
+  {if isset($amountOwed)}
   <tr>
     <td {$labelStyle}>
       {ts}Balance Owed{/ts}
       {$amountOwed|crmMoney}
     </td> {* This will be zero after final payment. *}
   </tr>
+  {/if}
   </table>
 
   </td>
     <tr>
       <td>
   <table style="border: 1px solid #999; margin: 1em 0em 1em; border-collapse: collapse; width:100%;">
-    {if $billingName || $address}
+    {if !empty($billingName) || !empty($address)}
           <tr>
             <th {$headerStyle}>
         {ts}Billing Name and Address{/ts}
           </tr>
           <tr>
             <td colspan="2" {$valueStyle}>
-        {$billingName}<br />
-        {$address|nl2br}
+        {if !empty($billingName)}{$billingName}{/if}<br />
+        {if !empty($address)}{$address|nl2br}{/if}
             </td>
           </tr>
     {/if}
-    {if $credit_card_number}
+    {if !empty($credit_card_number)}
           <tr>
             <th {$headerStyle}>
         {ts}Credit Card Information{/ts}
index 5529ec39da1c851e6162b59219e482dbbdb85c5c..3499b2f9f63c453fbe5de4fde0a3d5a645ed030b 100644 (file)
 {if $receive_date}
 {ts}Transaction Date{/ts}: {$receive_date|crmDate}
 {/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}
 
 {ts}Contribution Details{/ts}
 
 ===============================================================================
+{if isset($totalAmount)}
 {ts}Total Fee{/ts}: {$totalAmount|crmMoney}
+{/if}
+{if isset($totalPaid)}
 {ts}Total Paid{/ts}: {$totalPaid|crmMoney}
+{/if}
+{if isset($amountOwed)}
 {ts}Balance Owed{/ts}: {$amountOwed|crmMoney} {* This will be zero after final payment. *}
+{/if}
 
 
-{if $billingName || $address}
+{if !empty($billingName) || !empty($address)}
 
 ===============================================================================
 
 {ts}Billing Name and Address{/ts}
 
 ===============================================================================
-
+{if !empty($billingName)}
 {$billingName}
+{/if}
+{if !empty($address)}
 {$address}
 {/if}
+{/if}
 
-{if $credit_card_number}
+{if !empty($credit_card_number)}
 ===========================================================
 {ts}Credit Card Information{/ts}
 
 {$event.event_title}
 {$event.event_start_date|crmDate}{if $event.event_end_date}-{if $event.event_end_date|date_format:"%Y%m%d" == $event.event_start_date|date_format:"%Y%m%d"}{$event.event_end_date|crmDate:0:1}{else}{$event.event_end_date|crmDate}{/if}{/if}
 
-{if $event.participant_role}
+{if !empty($event.participant_role)}
 {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}