From: Eileen McNaughton Date: Sat, 16 Sep 2023 02:57:42 +0000 (+1200) Subject: Whitespace clean up on event online receipt X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=0c1d533c77e520cc45fd08f06f3a2f6ce13204c7;p=civicrm-core.git Whitespace clean up on event online receipt --- diff --git a/tests/phpunit/CRM/Event/Form/Registration/ConfirmTest.php b/tests/phpunit/CRM/Event/Form/Registration/ConfirmTest.php index e316d30d2b..88ee9eebee 100644 --- a/tests/phpunit/CRM/Event/Form/Registration/ConfirmTest.php +++ b/tests/phpunit/CRM/Event/Form/Registration/ConfirmTest.php @@ -134,7 +134,7 @@ class CRM_Event_Form_Registration_ConfirmTest extends CiviUnitTestCase { 'Expires: January ' . (date('Y') + 1), 'Visa', '************1111', - 'This is a confirmation that your registration has been received and your status has been updated to Registered', + 'This is a confirmation that your registration has been received and your status has been updated to Registered', ]); $mut->clearMessages(); } @@ -336,11 +336,11 @@ class CRM_Event_Form_Registration_ConfirmTest extends CiviUnitTestCase { public function testMailMultipleParticipant(): void { $this->createScenarioMultipleParticipantPendingWithTax(); $mailSent = $this->sentMail; - $amountsPaid = [300, 100, 200]; + // amounts paid = [300, 100, 200]; // The first participant, as the primary participant, (only) will have the full total in the email $this->assertStringContainsString('$600', $mailSent[0]['body']); - $this->assertStringNotContainsString(600, $mailSent[1]['body']); - $this->assertStringNotContainsString(600, $mailSent[2]['body']); + $this->assertStringNotContainsString('$600', $mailSent[1]['body']); + $this->assertStringNotContainsString('$600', $mailSent[2]['body']); // The $100 paid by the second participant will be in the emails to the primary but and second participant $this->assertStringContainsString('$100', $mailSent[0]['body']); diff --git a/xml/templates/message_templates/event_online_receipt_html.tpl b/xml/templates/message_templates/event_online_receipt_html.tpl index 0033ae800c..3bda72c979 100644 --- a/xml/templates/message_templates/event_online_receipt_html.tpl +++ b/xml/templates/message_templates/event_online_receipt_html.tpl @@ -1,8 +1,8 @@ - - + + @@ -13,461 +13,464 @@ {capture assign=tdStyle}style="width: 100px;"{/capture} {capture assign=participantTotal}style="margin: 0.5em 0 0.5em;padding: 0.5em;background-color: #999999;font-weight: bold;color: #FAFAFA;border-radius: 2px;"{/capture} - - +
- - + {if !empty($isOnWaitlist)} +

{ts}You have been added to the WAIT LIST for this event.{/ts}

+ {if $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} + {elseif !empty($isRequireApproval)} +

{ts}Your registration has been submitted.{/ts}

+ {if $isPrimary} +

{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} + {elseif !empty($is_pay_later) && empty($isAmountzero) && empty($isAdditionalParticipant)} +

{if {event.pay_later_receipt|boolean}}{event.pay_later_receipt}{/if}

+ {/if} + - - - - {/if}
- {assign var="greeting" value="{contact.email_greeting_display}"}{if $greeting}

{$greeting},

{/if} - - {if {event.confirm_email_text|boolean} 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}{/if}

- - {/if} - -

- {if !empty($isOnWaitlist)} -

{ts}You have been added to the WAIT LIST for this event.{/ts}

- {if $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} - {elseif !empty($isRequireApproval)} -

{ts}Your registration has been submitted.{/ts}

- {if $isPrimary} -

{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} - {elseif !empty($is_pay_later) && empty($isAmountzero) && empty($isAdditionalParticipant)} -

{if {event.pay_later_receipt|boolean}}{event.pay_later_receipt}{/if}

- {/if} +
+ {assign var="greeting" value="{contact.email_greeting_display}"}{if $greeting}

{$greeting},

{/if} + {if {event.confirm_email_text|boolean} 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 towaitlisted.{/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 $conference_sessions} - - - - - - - {/if} - - {if !empty($event.participant_role) and $event.participant_role neq 'Attendee' and !empty($defaultRole)} - - - - - {/if} - - {if !empty($isShowLocation)} - - - - {/if} - - {if !empty($location.phone.1.phone) || !empty($location.email.1.email)} - - - - {foreach from=$location.phone item=phone} - {if $phone.phone} + - + - {/if} - {/if} - - {/if} {* End of conditional section for Paid events *} - - -{if !empty($customPre)} -{foreach from=$customPre item=customPr key=i} - - {foreach from=$customPr item=customValue key=customName} - - - - - {/foreach} -{/foreach} -{/if} - -{if !empty($customPost)} -{foreach from=$customPost item=customPos key=j} - - {foreach from=$customPos item=customValue key=customName} - - - - - {/foreach} -{/foreach} -{/if} - -{if !empty($customProfile)} -{foreach from=$customProfile.profile item=eachParticipant key=participantID} - - {foreach from=$eachParticipant item=eachProfile key=pid} - - {foreach from=$eachProfile item=val key=field} - {foreach from=$val item=v key=f} - - - {/foreach} - - {/foreach} -{/foreach} -{/foreach} -{/if} - -
- {ts}Event Information and Location{/ts} -
- {event.title}
- {event.start_date|crmDate:"%A"} {event.start_date|crmDate}{if {event.end_date|boolean}}-{if '{event.end_date|crmDate:"%Y%m%d"}' === '{event.start_date|crmDate:"%Y%m%d"}'}{event.end_date|crmDate:"Time"}{else}{event.end_date|crmDate:"%A"} {event.end_date|crmDate}{/if}{/if} -
- {ts}Your schedule:{/ts} -
- {assign var='group_by_day' value='NA'} - {foreach from=$conference_sessions item=session} - {if $session.start_date|crmDate:"%Y/%m/%d" != $group_by_day|crmDate:"%Y/%m/%d"} - {assign var='group_by_day' value=$session.start_date} - {$group_by_day|crmDate:"%m/%d/%Y"}
- {/if} - {$session.start_date|crmDate:0:1}{if $session.end_date}-{$session.end_date|crmDate:0:1}{/if} {$session.title}
- {if $session.location}    {$session.location}
{/if} - {/foreach} -
- {ts}Participant Role{/ts} - - {$event.participant_role} -
- {$location.address.1.display|nl2br} -
- {ts}Event Contacts:{/ts} -
+ - - + - {/if} - {/foreach} - {foreach from=$location.email item=eventEmail} - {if $eventEmail.email} - - + - {/if} - {/foreach} - {/if} - - {if {event.is_public|boolean}} - - - - - - - {/if} - {if $event.is_share} - - - - {/if} - {if !empty($payer.name)} - - - - - - - {/if} - {if {event.is_monetary|boolean} and empty($isRequireApproval)} - - - - - - {if $isShowLineItems} - {foreach from=$participants key=index item=currentParticipant} - {if $isPrimary || {participant.id} === $currentParticipant.id} - {if $isPrimary && $lineItems|@count GT 1} {* Header for multi participant registration cases. *} - - - - {/if} - - - - {/if} - {/foreach} + {if $conference_sessions} + + + + + + {/if} - {if $isShowTax && {contribution.tax_amount|boolean}} + + {if !empty($event.participant_role) and $event.participant_role neq 'Attendee' and !empty($defaultRole)} - + + {/if} - {if !$isPrimary} - {* Use the participant specific tax rate breakdown *} - {assign var=taxRateBreakdown value=$participant.tax_rate_breakdown} + {if !empty($isShowLocation)} + + + + {/if} + + {if !empty($location.phone.1.phone) || !empty($location.email.1.email)} + + + + {foreach from=$location.phone item=phone} + {if $phone.phone} + + + + {/if} - {foreach from=$taxRateBreakdown item=taxDetail key=taxRate} + {/foreach} + {foreach from=$location.email item=eventEmail} + {if $eventEmail.email} - - + + - {/foreach} + {/if} + {/foreach} {/if} - {if !empty($amounts) && empty($lineItem)} - {foreach from=$amounts item=amnt key=level} - - - - {/foreach} - {/if} - - {if $isShowTax && {contribution.tax_amount|boolean}} - - - - - {/if} - {if $isPrimary} - - - - - {if !empty($pricesetFieldsCount) } - - - - {/if} + {if {event.is_public|boolean}} + + + + + + + {/if} - {if $register_date} - - - - - {/if} + {if $event.is_share} + + + + {/if} + {if !empty($payer.name)} + + + + + + + {/if} + {if {event.is_monetary|boolean} and empty($isRequireApproval)} + + + + {if $isShowLineItems} + {foreach from=$participants key=index item=currentParticipant} + {if $isPrimary || {participant.id} === $currentParticipant.id} + {if $isPrimary && $lineItems|@count GT 1} {* Header for multi participant registration cases. *} + + + + {/if} + + + + {/if} + {/foreach} + {/if} + {if $isShowTax && {contribution.tax_amount|boolean}} + + + + + {if !$isPrimary} + {* Use the participant specific tax rate breakdown *} + {assign var=taxRateBreakdown value=$participant.tax_rate_breakdown} + {/if} + {foreach from=$taxRateBreakdown item=taxDetail key=taxRate} + + + + + {/foreach} + {/if} - {if !empty($receive_date)} - - - - - {/if} + {if !empty($amounts) && empty($lineItem)} + {foreach from=$amounts item=amnt key=level} + + + + {/foreach} + {/if} - {if !empty($financialTypeName)} - - - - - {/if} + {if $isShowTax && {contribution.tax_amount|boolean}} + + + + + {/if} + {if $isPrimary} + + + + + {if !empty($pricesetFieldsCount) } + + + + + {/if} + + {if $register_date} + + + + + {/if} + + {if !empty($receive_date)} + + + + + {/if} + + {if !empty($financialTypeName)} + + + + + {/if} + + {if !empty($trxn_id)} + + + + + {/if} + + {if !empty($paidBy)} + + + + + {/if} + + {if !empty($checkNumber)} + + + + + {/if} + + {if !empty($billingName)} + + + + + + + {/if} + + {if !empty($credit_card_type)} + + + + + + + {/if} + {/if} - {if !empty($trxn_id)} - - - - - {/if} + {/if} {* End of conditional section for Paid events *} - {if !empty($paidBy)} - - - - - {/if} + {if !empty($customPre)} + {foreach from=$customPre item=customPr key=i} + + + + {foreach from=$customPr item=customValue key=customName} + + + + + {/foreach} + {/foreach} + {/if} - {if !empty($checkNumber)} - - - - - {/if} + {if !empty($customPost)} + {foreach from=$customPost item=customPos key=j} + + + + {foreach from=$customPos item=customValue key=customName} + + + + + {/foreach} + {/foreach} + {/if} - {if !empty($billingName)} - - - - - - - {/if} + {if !empty($customProfile)} + {foreach from=$customProfile.profile item=eachParticipant key=participantID} + + + + {foreach from=$eachParticipant item=eachProfile key=pid} + + + + {foreach from=$eachProfile item=val key=field} + + {foreach from=$val item=v key=f} + + + {/foreach} + + {/foreach} + {/foreach} + {/foreach} + {/if} - {if !empty($credit_card_type)} - - - +
- {if $phone.phone_type} - {$phone.phone_type_display} - {else} - {ts}Phone{/ts} - {/if} - - {$phone.phone} {if $phone.phone_ext} {ts}ext.{/ts} {$phone.phone_ext}{/if} - + {ts}Event Information and Location{/ts} +
- {ts}Email{/ts} - - {$eventEmail.email} - + {event.title}
+ {event.start_date|crmDate:"%A"} {event.start_date|crmDate}{if {event.end_date|boolean}}-{if '{event.end_date|crmDate:"%Y%m%d"}' === '{event.start_date|crmDate:"%Y%m%d"}'}{event.end_date|crmDate:"Time"}{else}{event.end_date|crmDate:"%A"} {event.end_date|crmDate}{/if}{/if} +
- {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} -
- {capture assign=gCalendar}{crmURL p='civicrm/event/ical' q="gCalendar=1&reset=1&id={event.id}" h=0 a=1 fe=1}{/capture} - {ts}Add event to Google Calendar{/ts} -
- {capture assign=eventUrl}{crmURL p='civicrm/event/info' q="id={event.id}&reset=1" a=true fe=1 h=1}{/capture} - {include file="CRM/common/SocialNetwork.tpl" emailMode=true url=$eventUrl pageURL=$eventUrl title='{event.title}'} -
- {ts}You were registered by:{/ts} -
- {$payer.name} -
- {event.fee_label} -
- {ts 1=$currentParticipant.index}Participant %1{/ts} {$currentParticipant.contact.display_name} -
- - - - - - {if $isShowTax && {contribution.tax_amount|boolean}} - - - - {/if} - - {if !empty($pricesetFieldsCount)}{/if} - - {foreach from=$currentParticipant.line_items item=line} - - - - - {if $line.tax_rate || $line.tax_amount != ""} - - - {else} - - - {/if} - - {if !empty($pricesetFieldsCount)} {/if} - - {/foreach} - {if $isShowTax} - - - - - - - {/if} -
{ts}Item{/ts}{ts}Qty{/ts}{ts}Each{/ts}{ts}Subtotal{/ts}{ts}Tax Rate{/ts}{ts}Tax Amount{/ts}{ts}Total{/ts}{ts}Total Participants{/ts}
{$line.title}{$line.qty}{$line.unit_price|crmMoney:$currency}{$line.tax_rate|string_format:"%.2f"}%{$line.tax_amount|crmMoney:$currency} - {$line.line_total+$line.tax_amount|crmMoney:$currency} - {$line.participant_count}
{ts}Participant Total{/ts}{$currentParticipant.totals.total_amount_exclusive|crmMoney}{$currentParticipant.totals.tax_amount|crmMoney}{$currentParticipant.totals.total_amount_inclusive|crmMoney}
-
+ {ts}Your schedule:{/ts} +
+ {assign var='group_by_day' value='NA'} + {foreach from=$conference_sessions item=session} + {if $session.start_date|crmDate:"%Y/%m/%d" != $group_by_day|crmDate:"%Y/%m/%d"} + {assign var='group_by_day' value=$session.start_date} + {$group_by_day|crmDate:"%m/%d/%Y"}
+ {/if} + {$session.start_date|crmDate:0:1}{if $session.end_date}-{$session.end_date|crmDate:0:1}{/if} {$session.title} +
+ {if $session.location}    {$session.location}
{/if} + {/foreach} +
- {ts}Amount Before Tax:{/ts} + {ts}Participant Role{/ts} - {if $isPrimary}{contribution.tax_exclusive_amount}{else}{$participant.totals.total_amount_exclusive|crmMoney}{/if} + {$event.participant_role}
+ {$location.address.1.display|nl2br} +
+ {ts}Event Contacts:{/ts} +
+ {if $phone.phone_type} + {$phone.phone_type_display} + {else} + {ts}Phone{/ts} + {/if} + + {$phone.phone} {if $phone.phone_ext} {ts}ext.{/ts} {$phone.phone_ext}{/if} +
{if $taxRate == 0}{ts}No{/ts} {$taxTerm}{else}{$taxTerm} {$taxDetail.percentage}%{/if}{$taxDetail.amount|crmMoney:'{contribution.currency}'}{ts}Email{/ts}{$eventEmail.email}
- {$amnt.amount|crmMoney:$currency} {$amnt.label} -
- {ts}Total Tax Amount{/ts} - - {if $isPrimary}{contribution.tax_amount}{else}{$participant.totals.tax_amount|crmMoney}{/if} -
- {ts}Total Amount{/ts} - - {contribution.total_amount} {if !empty($hookDiscount.message)}({$hookDiscount.message}){/if} -
- {ts}Total Participants{/ts} - {assign var="count" value= 0} - {foreach from=$lineItem item=pcount} - {assign var="lineItemCount" value=0} - {if $pcount neq 'skip'} - {foreach from=$pcount item=p_count} - {assign var="lineItemCount" value=$lineItemCount+$p_count.participant_count} - {/foreach} - {if $lineItemCount < 1 } - {assign var="lineItemCount" value=1} - {/if} - {assign var="count" value=$count+$lineItemCount} - {/if} - {/foreach} - {$count} -
+ {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} +
+ {capture assign=gCalendar}{crmURL p='civicrm/event/ical' q="gCalendar=1&reset=1&id={event.id}" h=0 a=1 fe=1}{/capture} + {ts}Add event to Google Calendar{/ts} +
- {ts}Registration Date{/ts} - - {$register_date|crmDate} -
+ {capture assign=eventUrl}{crmURL p='civicrm/event/info' q="id={event.id}&reset=1" a=true fe=1 h=1}{/capture} + {include file="CRM/common/SocialNetwork.tpl" emailMode=true url=$eventUrl pageURL=$eventUrl title='{event.title}'} +
+ {ts}You were registered by:{/ts} +
+ {$payer.name} +
+ {event.fee_label} +
+ {ts 1=$currentParticipant.index}Participant %1{/ts} {$currentParticipant.contact.display_name} +
+ + + + + + {if $isShowTax && {contribution.tax_amount|boolean}} + + + + {/if} + + {if !empty($pricesetFieldsCount)} + + {/if} + + {foreach from=$currentParticipant.line_items item=line} + + + + + {if $line.tax_rate || $line.tax_amount != ""} + + + {else} + + + {/if} + + {if !empty($pricesetFieldsCount)} + + {/if} + + {/foreach} + {if $isShowTax} + + + + + + + {/if} +
{ts}Item{/ts}{ts}Qty{/ts}{ts}Each{/ts}{ts}Subtotal{/ts}{ts}Tax Rate{/ts}{ts}Tax Amount{/ts}{ts}Total{/ts}{ts}Total Participants{/ts}
{$line.title}{$line.qty}{$line.unit_price|crmMoney:$currency}{$line.tax_rate|string_format:"%.2f"}%{$line.tax_amount|crmMoney:$currency} + {$line.line_total+$line.tax_amount|crmMoney:$currency} + {$line.participant_count}
{ts}Participant Total{/ts}{$currentParticipant.totals.total_amount_exclusive|crmMoney}{$currentParticipant.totals.tax_amount|crmMoney}{$currentParticipant.totals.total_amount_inclusive|crmMoney}
+
+ {ts}Amount Before Tax:{/ts} + + {if $isPrimary}{contribution.tax_exclusive_amount}{else}{$participant.totals.total_amount_exclusive|crmMoney}{/if} +
{if $taxRate == 0}{ts}No{/ts} {$taxTerm}{else}{$taxTerm} {$taxDetail.percentage}%{/if}{$taxDetail.amount|crmMoney:'{contribution.currency}'}
- {ts}Transaction Date{/ts} - - {$receive_date|crmDate} -
+ {$amnt.amount|crmMoney:$currency} {$amnt.label} +
- {ts}Financial Type{/ts} - - {$financialTypeName} -
+ {ts}Total Tax Amount{/ts} + + {if $isPrimary}{contribution.tax_amount}{else}{$participant.totals.tax_amount|crmMoney}{/if} +
+ {ts}Total Amount{/ts} + + {contribution.total_amount} {if !empty($hookDiscount.message)}({$hookDiscount.message}){/if} +
+ {ts}Total Participants{/ts} + {assign var="count" value= 0} + {foreach from=$lineItem item=pcount} + {assign var="lineItemCount" value=0} + {if $pcount neq 'skip'} + {foreach from=$pcount item=p_count} + {assign var="lineItemCount" value=$lineItemCount+$p_count.participant_count} + {/foreach} + {if $lineItemCount < 1 } + {assign var="lineItemCount" value=1} + {/if} + {assign var="count" value=$count+$lineItemCount} + {/if} + {/foreach} + {$count} +
+ {ts}Registration Date{/ts} + + {$register_date|crmDate} +
+ {ts}Transaction Date{/ts} + + {$receive_date|crmDate} +
+ {ts}Financial Type{/ts} + + {$financialTypeName} +
+ {ts}Transaction #{/ts} + + {$trxn_id} +
+ {ts}Paid By{/ts} + + {$paidBy} +
+ {ts}Check Number{/ts} + + {$checkNumber} +
+ {ts}Billing Name and Address{/ts} +
+ {$billingName}
+ {$address|nl2br} +
+ {ts}Credit Card Information{/ts} +
+ {$credit_card_type}
+ {$credit_card_number}
+ {ts}Expires{/ts}: {$credit_card_exp_date|truncate:7:''|crmDate} +
- {ts}Transaction #{/ts} - - {$trxn_id} -
- {ts}Paid By{/ts} - - {$paidBy} -
{$customPre_grouptitle.$i}
{$customName}{$customValue}
- {ts}Check Number{/ts} - - {$checkNumber} -
{$customPost_grouptitle.$j}
{$customName}{$customValue}
- {ts}Billing Name and Address{/ts} -
- {$billingName}
- {$address|nl2br} -
{ts 1=$participantID+2}Participant %1{/ts}
{$customProfile.title.$pid}
{$field}{$v}
- {ts}Credit Card Information{/ts} -
+ {if !empty($event.allow_selfcancelxfer) }
- {$credit_card_type}
- {$credit_card_number}
- {ts}Expires{/ts}: {$credit_card_exp_date|truncate:7:''|crmDate} -
+ {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}Click here to transfer or cancel your registration.{/ts} +
{$customPre_grouptitle.$i}
{$customName}{$customValue}
{$customPost_grouptitle.$j}
{$customName}{$customValue}
{ts 1=$participantID+2}Participant %1{/ts}
{$customProfile.title.$pid}
{$field}{$v}
- {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}Click here to transfer or cancel your registration.{/ts} -