Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix PHP8 warnings in Participant.tpl #26166

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CRM/Event/Form/Participant.php
Original file line number Diff line number Diff line change
@@ -1740,7 +1740,7 @@ public function buildEventFeeForm($form) {
}
$form->assign('onlinePendingContributionId', $form->get('onlinePendingContributionId'));

$form->assign('paid', $form->_isPaidEvent);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This removal causes a problem since now it never shows the fee selections!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We seem to be back to the fees not appearing again. I see this is moved up to the top, but $form->_isPaidEvent isn't set until after that.

$form->assign('paid', $form->_isPaidEvent ?? NULL);

$form->addElement('checkbox',
'send_receipt',
@@ -2266,6 +2266,7 @@ public function getFeeDetails($participantIds, $hasLineItems = FALSE) {
*/
protected function assignUrlPath() {
$this->assign('urlPath', 'civicrm/contact/view/participant');
$this->assign('urlPathVar', NULL);
if (!$this->_id && !$this->_contactId) {
$breadCrumbs = [
[
64 changes: 27 additions & 37 deletions templates/CRM/Event/Form/Participant.tpl
Original file line number Diff line number Diff line change
@@ -15,7 +15,7 @@
{* Main event form template *}
{else}
<div class="crm-block crm-form-block crm-participant-form-block">
{if $newCredit AND $action EQ 1 AND $participantMode EQ null}
{if $action EQ 1 AND ($context EQ 'participant' OR $context EQ 'standalone') AND $newCredit AND $participantMode EQ null}
<div class="action-link css_right crm-link-credit-card-mode">
{if $contactId}
{capture assign=ccModeLink}{crmURL p='civicrm/contact/view/participant' q="reset=1&action=add&cid=`$contactId`&context=`$context`&mode=live"}{/capture}
@@ -33,13 +33,6 @@
{/if}
<div id="eventFullMsg" class="messages status no-popup" style="display:none;"></div>


{if $action eq 1 AND $paid}
<div class="help">
{ts}If you are accepting offline payment from this participant, check <strong>Record Payment</strong>. You will be able to fill in the payment information, and optionally send a receipt.{/ts}
</div>
{/if}

{if $action eq 8} {* If action is Delete *}
<div class="crm-participant-form-block-delete messages status no-popup">
<div class="crm-content">
@@ -58,10 +51,12 @@
{else} {* If action is other than Delete *}
<div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="top"}</div>
<table class="form-layout-compressed">
<tr class="crm-participant-form-contact-id">
<td class="label">{$form.contact_id.label}</td>
<td>{$form.contact_id.html}</td>
</tr>
{if $context EQ 'standalone' OR $context EQ 'participant' OR $action EQ 2}
<tr class="crm-participant-form-contact-id">
<td class="label">{$form.contact_id.label}</td>
<td>{$form.contact_id.html}</td>
</tr>
{/if}
{if $action EQ 2}
{if $additionalParticipants} {* Display others registered by this participant *}
<tr class="crm-participant-form-block-additionalParticipants">
@@ -85,12 +80,7 @@
{/if}
<tr class="crm-participant-form-block-event_id">
<td class="label">{$form.event_id.label}</td>
<td class="view-value">
{$form.event_id.html}
{if $is_test}
{ts}(test){/ts}
{/if}
</td>
<td class="view-value">{$form.event_id.html}</td>
demeritcowboy marked this conversation as resolved.
Show resolved Hide resolved
</tr>

{* CRM-7362 --add campaign *}
@@ -148,7 +138,7 @@
</div>
{/if}

{if $accessContribution and $action eq 2 and $rows.0.contribution_id}
{if $action eq 2 and $accessContribution and $rows.0.contribution_id}
{include file="CRM/Contribute/Form/Selector.tpl" context="Search"}
{/if}

@@ -274,25 +264,25 @@

{/if}


<script type="text/javascript">
{literal}

sendNotification();
function sendNotification() {
var notificationStatusIds = {/literal}"{$notificationStatusIds}"{literal};
notificationStatusIds = notificationStatusIds.split(',');
if (cj.inArray(cj('.crm-participant-form-block-status_id select#status_id option:selected').val(), notificationStatusIds) > -1) {
cj("#notify").show();
cj("#is_notify").prop('checked', false);
{if $action NEQ 8}
<script type="text/javascript">
{literal}

sendNotification();
function sendNotification() {
var notificationStatusIds = {/literal}"{$notificationStatusIds}"{literal};
notificationStatusIds = notificationStatusIds.split(',');
if (cj.inArray(cj('.crm-participant-form-block-status_id select#status_id option:selected').val(), notificationStatusIds) > -1) {
cj("#notify").show();
}
else {
cj("#notify").hide();
cj("#is_notify").prop('checked', false);
demeritcowboy marked this conversation as resolved.
Show resolved Hide resolved
}
}
else {
cj("#notify").hide();
cj("#is_notify").prop('checked', false);
}
}

{/literal}
</script>
{/literal}
</script>
{/if}

{/if} {* end of main event block*}
2 changes: 1 addition & 1 deletion templates/CRM/Event/Page/Tab.tpl
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@
| and copyright information, see https://civicrm.org/licensing |
+--------------------------------------------------------------------+
*}
{if $action eq 1 or $action eq 2 or $action eq 8} {* add, update or view *}
{if $action eq 1 or $action eq 2 or $action eq 8} {* add, update or delete *}
{include file="CRM/Event/Form/Participant.tpl"}
{elseif $action eq 4}
{include file="CRM/Event/Form/ParticipantView.tpl"}