Standardise some more event template tokens
authorEileen McNaughton <emcnaughton@wikimedia.org>
Sun, 3 Dec 2023 01:53:44 +0000 (14:53 +1300)
committerEileen McNaughton <emcnaughton@wikimedia.org>
Sun, 3 Dec 2023 01:53:44 +0000 (14:53 +1300)
CRM/Event/Form/Registration/Confirm.php
tests/templates/message_templates/event_online_receipt_text.tpl
xml/templates/message_templates/event_online_receipt_html.tpl

index daec9350a1c00ffad0841b3f865595bc5bb2d240..87827b09de69c1df2acd5acef9f02ca476cd09a5 100644 (file)
@@ -884,6 +884,7 @@ class CRM_Event_Form_Registration_Confirm extends CRM_Event_Form_Registration {
             $this->assign('lineItem', $lineItem);
           }
           $this->_values['params']['additionalParticipant'] = TRUE;
+          // Removed from tpl in 5.67
           $this->assign('isAdditionalParticipant', $this->_values['params']['additionalParticipant']);
         }
 
index 526ea892b597019ed9db77ad36314d94ec4e60fe..68db685a1cef4ad071c30a5ed95860640b721a9d 100644 (file)
@@ -20,9 +20,6 @@ is_pay_later:::{$is_pay_later}
 {if !empty($isAmountzero)}
 isAmountzero:::{$isAmountzero}
 {/if}
-{if !empty($isAdditionalParticipant)}
-isAdditionalParticipant:::{$isAdditionalParticipant}
-{/if}
 {if !empty($pay_later_receipt)}
 pay_later_receipt:::{$pay_later_receipt}
 {/if}
index 5cbff73e5024fdf3ad9c6b53df6e6f8f335960f5..f9cd1b0bc6769d24269bb639ef6cf396ae249ea0 100644 (file)
             {/if}
         {elseif !empty($isRequireApproval)}
           <p>{ts}Your registration has been submitted.{/ts}</p>
-            {if $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 !empty($is_pay_later) && empty($isAmountzero) && empty($isAdditionalParticipant)}
+          {if $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 {contribution.is_pay_later|boolean} && {contribution.balance_amount|boolean} && $isPrimary}
           <p>{if {event.pay_later_receipt|boolean}}{event.pay_later_receipt}{/if}</p>
         {/if}
     </td>
@@ -77,7 +77,7 @@
           </tr>
         {/if}
 
-        {if !empty($isShowLocation)}
+        {if {event.is_show_location|boolean}}
           <tr>
             <td colspan="2" {$valueStyle}>
               {event.location}
                 </tr>
               {/if}
 
-              {if !empty($receive_date)}
+              {if {contribution.receive_date|boolean}}
                 <tr>
                   <td {$labelStyle}>
                     {ts}Transaction Date{/ts}
                   </td>
                   <td {$valueStyle}>
-                    {$receive_date|crmDate}
+                    {contribution.receive_date}
                   </td>
                 </tr>
               {/if}
 
-              {if !empty($financialTypeName)}
+              {if {contribution.financial_type_id|boolean}}
                 <tr>
                   <td {$labelStyle}>
                     {ts}Financial Type{/ts}
                   </td>
                   <td {$valueStyle}>
-                    {$financialTypeName}
+                    {contribution.financial_type_id:label}
                   </td>
                 </tr>
               {/if}
 
-              {if !empty($trxn_id)}
+              {if {contribution.trxn_id|boolean}}
                 <tr>
                   <td {$labelStyle}>
                     {ts}Transaction #{/ts}
                   </td>
                   <td {$valueStyle}>
-                    {$trxn_id}
+                    {contribution.trxn_id|boolean}
                   </td>
                 </tr>
               {/if}
                 </tr>
               {/if}
 
-              {if !empty($checkNumber)}
+              {if {contribution.check_number|boolean}}
                 <tr>
                   <td {$labelStyle}>
                     {ts}Check Number{/ts}
                   </td>
                   <td {$valueStyle}>
-                    {$checkNumber}
+                    {contribution.check_number}
                   </td>
                 </tr>
               {/if}
         {/if}
 
       </table>
-      {if !empty($event.allow_selfcancelxfer)}
+      {if {event.allow_selfcancelxfer|boolean}}
         <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 !empty($totalAmount)}{ts}Cancellations are not refundable.{/ts}{/if}<br/>
+            {capture assign=selfservice_preposition}{if {event.selfcancelxfer_time} > 0}{ts}before{/ts}{else}{ts}after{/ts}{/if}{/capture}
+            {ts 1={event.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 {contribution.paid_amount|boolean}}{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>