[php8-compat] Update smarty templates and some php files to get the api_v3_contributi...
[civicrm-core.git] / xml / templates / message_templates / contribution_online_receipt_html.tpl
index 1bf18025383d49c7bdcee819b50918c33395d590..280e236f5376653ae9d9eda3cf7d0bf4617362d0 100644 (file)
@@ -11,7 +11,7 @@
 {capture assign=valueStyle }style="padding: 4px; border-bottom: 1px solid #999;"{/capture}
 
 <center>
<table width="500" border="0" cellpadding="0" cellspacing="0" id="crm-event_receipt" style="font-family: Arial, Verdana, sans-serif; text-align: left;">
 <table id="crm-event_receipt" style="font-family: Arial, Verdana, sans-serif; text-align: left; width:100%; max-width:700px; padding:0; margin:0; border:0px;">
 
   <!-- BEGIN HEADER -->
   <!-- You can add table row(s) here with logo or other header elements -->
   <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>
   </tr>
   </table>
-  <table width="500" style="border: 1px solid #999; margin: 1em 0em 1em; border-collapse: collapse;">
+  <table style="width:100%; max-width:500px; border: 1px solid #999; margin: 1em 0em 1em; border-collapse: collapse;">
 
      {if $amount}
 
@@ -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>
              <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}
         {/foreach}
 
        {/if}
-       {if $totalTaxAmount}
+       {if isset($totalTaxAmount)}
         <tr>
          <td {$labelStyle}>
           {ts}Total Tax{/ts}
 
       {else}
 
-      {if $totalTaxAmount}
+      {if !empty($totalTaxAmount)}
          <tr>
            <td {$labelStyle}>
              {ts}Total Tax Amount{/ts}
          {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>
 
      {/if}
 
 
-     {if $receive_date}
+     {if !empty($receive_date)}
       <tr>
        <td {$labelStyle}>
         {ts}Date{/ts}
       </tr>
      {/if}
 
-     {if $is_monetary and $trxn_id}
+     {if !empty($is_monetary) and !empty($trxn_id)}
       <tr>
        <td {$labelStyle}>
         {ts}Transaction #{/ts}
       </tr>
      {/if}
 
-    {if $is_recur}
+    {if !empty($is_recur)}
       <tr>
         <td  colspan="2" {$labelStyle}>
           {ts}This is a recurring contribution.{/ts}
          </td>
         </tr>
       {/foreach}
-      {elseif $softCreditTypes and $softCredits}
+      {elseif !empty($softCreditTypes) and !empty($softCredits)}
       {foreach from=$softCreditTypes item=softCreditType key=n}
        <tr>
         <th {$headerStyle}>
        {/foreach}
      {/if}
 
-     {if $pcpBlock}
+     {if !empty($pcpBlock)}
       <tr>
        <th {$headerStyle}>
         {ts}Personal Campaign Page{/ts}
       {/if}
      {/if}
 
-     {if $onBehalfProfile}
+     {if !empty($onBehalfProfile)}
       <tr>
        <th {$headerStyle}>
         {$onBehalfProfile_grouptitle}
       {/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}
       </tr>
      {/if}
 
-     {if ! ($contributeMode eq 'notify' OR $contributeMode eq 'directIPN') and $is_monetary}
-      {if $is_pay_later && !$isBillingAddressRequiredForPayLater}
+     {if !empty($billingName)}
        <tr>
         <th {$headerStyle}>
-         {ts}Registered Email{/ts}
+         {ts}Billing Name and Address{/ts}
         </th>
        </tr>
        <tr>
         <td colspan="2" {$valueStyle}>
+         {$billingName}<br />
+         {$address|nl2br}<br />
          {$email}
         </td>
        </tr>
-      {elseif $amount GT 0}
+     {elseif !empty($email)}
        <tr>
         <th {$headerStyle}>
-         {ts}Billing Name and Address{/ts}
+         {ts}Registered Email{/ts}
         </th>
        </tr>
        <tr>
         <td colspan="2" {$valueStyle}>
-         {$billingName}<br />
-         {$address|nl2br}<br />
          {$email}
         </td>
        </tr>
-      {/if}
      {/if}
 
-     {if $contributeMode eq 'direct' AND !$is_pay_later AND $amount GT 0}
+     {if !empty($credit_card_type)}
       <tr>
        <th {$headerStyle}>
         {ts}Credit Card Information{/ts}
       </tr>
      {/if}
 
-     {if $selectPremium}
+     {if !empty($selectPremium)}
       <tr>
        <th {$headerStyle}>
         {ts}Premium Information{/ts}
         </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>
       {/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}
       {/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}