Fix event_offline template phones & emails
authorEileen McNaughton <emcnaughton@wikimedia.org>
Mon, 22 May 2023 03:34:02 +0000 (15:34 +1200)
committerEileen McNaughton <emcnaughton@wikimedia.org>
Mon, 22 May 2023 03:50:36 +0000 (15:50 +1200)
xml/templates/message_templates/event_offline_receipt_html.tpl
xml/templates/message_templates/event_offline_receipt_text.tpl

index 5237c950fa373a3d888f3fde7889cca7b6f1682e..4be7ffd9b8dd7d75e0097b95119601c7c10b12a9 100644 (file)
       </tr>
      {/if}
 
-     {if !empty($location.phone.1.phone) || !empty($location.email.1.email)}
+     {if {event.loc_block_id.phone_id.phone|boolean} || {event.loc_block_id.email_id.email|boolean}}
       <tr>
        <td colspan="2" {$labelStyle}>
         {ts}Event Contacts:{/ts}
        </td>
       </tr>
-      {foreach from=$location.phone item=phone}
-       {if $phone.phone}
+
+       {if {event.loc_block_id.phone_id.phone|boolean}}
         <tr>
          <td {$labelStyle}>
-          {if $phone.phone_type}
-           {$phone.phone_type_display}
+          {if {event.loc_block_id.phone_id.phone_type_id|boolean}}
+            {event.loc_block_id.phone_id.phone_type_id:label}
           {else}
            {ts}Phone{/ts}
           {/if}
          </td>
          <td {$valueStyle}>
-          {$phone.phone} {if $phone.phone_ext}&nbsp;{ts}ext.{/ts} {$phone.phone_ext}{/if}
+          {event.loc_block_id.phone_id.phone} {if {event.loc_block_id.phone_id.phone_ext|boolean}}&nbsp;{ts}ext.{/ts} {event.loc_block_id.phone_id.phone_ext}{/if}
          </td>
         </tr>
        {/if}
-      {/foreach}
-      {foreach from=$location.email item=eventEmail}
-       {if $eventEmail.email}
+         {if {event.loc_block_id.phone_2_id.phone|boolean}}
+           <tr>
+             <td {$labelStyle}>
+                 {if {event.loc_block_id.phone_2_id.phone_type_id|boolean}}
+                     {event.loc_block_id.phone_2_id.phone_type_id:label}
+                 {else}
+                     {ts}Phone{/ts}
+                 {/if}
+             </td>
+             <td {$valueStyle}>
+                 {event.loc_block_id.phone_2_id.phone} {if {event.loc_block_id.phone_2_id.phone_ext|boolean}}&nbsp;{ts}ext.{/ts} {event.loc_block_id.phone_2_id.phone_ext}{/if}
+             </td>
+           </tr>
+         {/if}
+
+
+       {if {event.loc_block_id.email_id.email|boolean}}
         <tr>
          <td {$labelStyle}>
           {ts}Email{/ts}
          </td>
          <td {$valueStyle}>
-          {$eventEmail.email}
+             {event.loc_block_id.email_id.email}
          </td>
         </tr>
        {/if}
-      {/foreach}
+
+       {if {event.loc_block_id.email_2_id.email|boolean}}
+         <tr>
+           <td {$labelStyle}>
+               {ts}Email{/ts}
+           </td>
+           <td {$valueStyle}>
+               {event.loc_block_id.email_2_id.email}
+           </td>
+         </tr>
+       {/if}
+
      {/if}
 
      {if !empty($event.is_public)}
index 95c1f1d5396b531873ca4ff14881068b37c62883..9dbe1d41abcef8abc22386d397ad460951ce26d9 100644 (file)
 {$location.address.1.display|strip_tags:false}
 {/if}{*End of isShowLocation condition*}
 
-{if !empty($location.phone.1.phone) || !empty($location.email.1.email)}
-
+{if {event.loc_block_id.phone_id.phone|boolean} || {event.loc_block_id.email_id.email|boolean}}
 {ts}Event Contacts:{/ts}
-{foreach from=$location.phone item=phone}
-{if $phone.phone}
 
-{if $phone.phone_type}{$phone.phone_type_display}{else}{ts}Phone{/ts}{/if}: {$phone.phone}{/if} {if $phone.phone_ext} {ts}ext.{/ts} {$phone.phone_ext}{/if}
-{/foreach}
-{foreach from=$location.email item=eventEmail}
-{if $eventEmail.email}
+{if {event.loc_block_id.phone_id.phone|boolean}}
+{if {event.loc_block_id.phone_id.phone_type_id|boolean}}{event.loc_block_id.phone_id.phone_type_id:label}{else}{ts}Phone{/ts}{/if} {event.loc_block_id.phone_id.phone} {if {event.loc_block_id.phone_id.phone_ext|boolean}} {ts}ext.{/ts} {event.loc_block_id.phone_id.phone_ext}{/if}
+{/if}
 
-{ts}Email{/ts}: {$eventEmail.email}{/if}{/foreach}
+{if {event.loc_block_id.phone_2_id.phone|boolean}}
+{if {event.loc_block_id.phone_2_id.phone_type_id|boolean}}{event.loc_block_id.phone_2_id.phone_type_id:label}{else}{ts}Phone{/ts}{/if} {event.loc_block_id.phone_2_id.phone} {if {event.loc_block_id.phone_2_id.phone_ext|boolean}} {ts}ext.{/ts} {event.loc_block_id.phone_2_id.phone_ext}{/if}
 {/if}
 
+{if {event.loc_block_id.email_id.email|boolean}}
+{ts}Email {/ts}{event.loc_block_id.email_id.email}
+{/if}
+{if {event.loc_block_id.email_2_id.email|boolean}}
+{ts}Email {/ts}{event.loc_block_id.email_2_id.email}{/if}
+{/if}
+
+
 {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 entry for this event.{/ts} {$icalFeed}