Skip to content

Commit

Permalink
Update a couple more tpl variables to tokens
Browse files Browse the repository at this point in the history
event.is_public is already converted in the event online template
- event.email_confirm_text is already tested as a token available
in the offline template. The token layer should take
care of the htmlise question
  • Loading branch information
eileenmcnaughton committed Aug 6, 2023
1 parent 46a4ecb commit 814904c
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 9 deletions.
5 changes: 3 additions & 2 deletions tests/phpunit/CRM/Event/Form/ParticipantTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,7 @@ public function testSubmitWithDeferredRecognition(): void {
* @throws \CRM_Core_Exception
*/
public function testSubmitPartialPayment(bool $isQuickConfig): void {
$mut = new CiviMailUtils($this, TRUE);
$mailUtil = new CiviMailUtils($this, TRUE);
$form = $this->getForm(['is_monetary' => 1]);
$this->callAPISuccess('PriceSet', 'create', ['is_quick_config' => $isQuickConfig, 'id' => $this->getPriceSetID('PaidEvent')]);
$paymentInstrumentID = CRM_Core_PseudoConstant::getKey('CRM_Contribute_BAO_Contribution', 'payment_instrument_id', 'Check');
Expand Down Expand Up @@ -582,7 +582,7 @@ public function testSubmitPartialPayment(bool $isQuickConfig): void {
'MAX_FILE_SIZE' => '33554432',
];
$form->submit($submitParams);
$this->assertPartialPaymentResult($isQuickConfig, $mut);
$this->assertPartialPaymentResult($isQuickConfig, $mailUtil);
}

/**
Expand Down Expand Up @@ -722,6 +722,7 @@ protected function assertPartialPaymentResult(bool $isQuickConfig, CiviMailUtils
'Event Information and Location',
'Annual CiviCRM meet',
'Registered Email',
'Just do it',
$isQuickConfig ? $this->formatMoneyInput(1550.55) . ' Family Deal - 1' : 'Fundraising Dinner - Family...',
$isAmountPaidOnForm ? 'Total Paid: $20.00' : 'Total Paid: ',
$isAmountPaidOnForm ? 'Balance: $1,530.55' : 'Balance: $1,550.55',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ location.phone.1.phone_type_display:::{$location.phone.1.phone_type_display}
location.phone.1.phone_ext:::{$location.phone.1.phone_ext}
location.email.1.email:::{$location.email.1.email}
{/if}
{if !empty($event.is_public)}
{if {event.is_public|boolean}}
event.is_public:::{$event.is_public}
{/if}
{if !empty($payer.name)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
<td>
{assign var="greeting" value="{contact.email_greeting_display}"}{if $greeting}<p>{$greeting},</p>{/if}

{if !empty($event.confirm_email_text) AND (empty($isOnWaitlist) AND empty($isRequireApproval))}
<p>{$event.confirm_email_text|htmlize}</p>
{if {event.confirm_email_text|boolean} AND (empty($isOnWaitlist) AND empty($isRequireApproval))}
<p>{event.confirm_email_text}</p>
{/if}

{if !empty($isOnWaitlist)}
Expand Down Expand Up @@ -133,7 +133,7 @@

{/if}

{if !empty($event.is_public)}
{if {event.is_public|boolean}}
<tr>
<td colspan="2" {$valueStyle}>
{capture assign=icalFeed}{crmURL p='civicrm/event/ical' q="reset=1&id=`$event.id`" h=0 a=1 fe=1}{/capture}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
{/if}


{if !empty($event.is_public)}
{if {event.is_public|boolean}}
{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}
{capture assign=gCalendar}{crmURL p='civicrm/event/ical' q="gCalendar=1&reset=1&id=`$event.id`" h=0 a=1 fe=1}{/capture}
Expand Down
4 changes: 2 additions & 2 deletions xml/templates/message_templates/event_online_receipt_html.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
<td>
{assign var="greeting" value="{contact.email_greeting_display}"}{if $greeting}<p>{$greeting},</p>{/if}

{if !empty($event.confirm_email_text) AND (empty($isOnWaitlist) AND empty($isRequireApproval))}
<p>{$event.confirm_email_text|htmlize}</p>
{if {event.confirm_email_text|boolean} AND (empty($isOnWaitlist) AND empty($isRequireApproval))}
<p>{event.confirm_email_text}</p>

{else}
<p>{ts}Thank you for your registration.{/ts}
Expand Down

0 comments on commit 814904c

Please sign in to comment.