Skip to content

Commit

Permalink
Smarty notice fix on tell-a-friend
Browse files Browse the repository at this point in the history
  • Loading branch information
eileenmcnaughton committed Jan 16, 2025
1 parent 2ae11d3 commit 10c165b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
13 changes: 8 additions & 5 deletions CRM/Event/Form/Registration/ThankYou.php
Original file line number Diff line number Diff line change
Expand Up @@ -158,27 +158,30 @@ public function buildQuickForm() {
$params['entity_table'] = 'civicrm_event';

$data = [];
$friendURL = NULL;
$extensionText = [];

if (function_exists('tellafriend_civicrm_config')) {
// @todo - move this to tellafriend extension
CRM_Friend_BAO_Friend::retrieve($params, $data);
if (!empty($data['is_active'])) {
$friendText = $data['title'];
$this->assign('friendText', $friendText);
if ($this->_action & CRM_Core_Action::PREVIEW) {
$friendURL = CRM_Utils_System::url('civicrm/friend',
"eid={$this->_eventId}&reset=1&action=preview&pcomponent=event"
"eid={$this->getEventID()}&reset=1&action=preview&pcomponent=event"
);
}
else {
$friendURL = CRM_Utils_System::url('civicrm/friend',
"eid={$this->_eventId}&reset=1&pcomponent=event"
"eid={$this->getEventID()}&reset=1&pcomponent=event"
);
}
$extensionText[] = '"<div id="tell-a-friend" class="crm-section tell_friend_link-section">
<a href="' . $friendURL . '" title="{' . $friendText . '}" class="button"><span><i class="crm-i fa-chevron-right" aria-hidden="true"></i> ' . $friendText . '</span></a>
</div><br /><br />"';
}
}

$this->assign('friendURL', $friendURL);
$this->assign('extensionText', $extensionText);
$this->assign('iCal', CRM_Event_BAO_Event::getICalLinks($this->_eventId));
$this->assign('isShowICalIconsInline', TRUE);

Expand Down
8 changes: 3 additions & 5 deletions templates/CRM/Event/Form/Registration/ThankYou.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,9 @@
{/if}

{* Show link to Tell a Friend (CRM-2153) *}
{if $friendText}
<div id="tell-a-friend" class="crm-section tell_friend_link-section">
<a href="{$friendURL}" title="{$friendText|escape:'html'}" class="button"><span><i class="crm-i fa-chevron-right" aria-hidden="true"></i> {$friendText}</span></a>
</div><br /><br />
{/if}
{foreach from='extensionText' item='text'}
{$text}
{/foreach}

{* Add button for donor to create their own Personal Campaign page *}
{if $pcpLink}
Expand Down

0 comments on commit 10c165b

Please sign in to comment.