Skip to content
Snippets Groups Projects
Commit affcd169 authored by jaapjansma's avatar jaapjansma
Browse files

Fixed issue with event participant count field (do not count deleted contacts).

parent 88f2e2d8
No related branches found
No related tags found
No related merge requests found
# Version 1.52 (not yet released)
* Fixed issue with event participant count field (do not count deleted contacts).
# Version 1.51
......
......@@ -75,7 +75,7 @@ class EventParticipantsCountFieldOutputHandler extends AbstractSimpleFieldOutput
SELECT count(*) as `total`
FROM `civicrm_contact` `c`
INNER JOIN `civicrm_participant` `p` ON `p`.`contact_id` = `c`.`id`
WHERE `p`.`event_id` = %1";
WHERE `p`.`event_id` = %1 AND `c`.`is_deleted` = '0'";
$participantsSqlParams[1] = array($event_id, 'Integer');
if (count($this->role_ids)) {
$participantsSql .= " AND `p`.`role_id` IN (".implode(', ', $this->role_ids).")";
......@@ -96,12 +96,12 @@ class EventParticipantsCountFieldOutputHandler extends AbstractSimpleFieldOutput
'event' => $event_id,
];
if (count($this->role_ids) == 1) {
$urlQueryParams['role'] = implode(', ', $this->role_ids);
$urlQueryParams['role'] = implode(',', $this->role_ids);
} elseif (count($this->role_ids) > 1) {
$urlQueryParams['role'] = 'true';
$urlQueryParams['participant_role_id'] = implode(',', $this->role_ids);
}
if (count($this->status_ids)) {
$urlQueryParams['participant_status_id'] = implode(', ', $this->status_ids);
$urlQueryParams['participant_status_id'] = implode(',', $this->status_ids);
}
$url = \CRM_Utils_System::url('civicrm/event/search', $urlQueryParams);
$output->setHtmlOutput('<a href="' . $url .'">'.$total.'</a>');
......
......@@ -19,4 +19,9 @@
<div class="content">{$form.show_as_link.html}</div>
<div class="clear"></div>
</div>
<div class="crm-section">
<div class="label"></div>
<div class="content"><p class="description">{ts 1=https://lab.civicrm.org/partners/civicoop/snj/snjfixparticipantsearch}When you have selected show link to manage participant you also might need to install <a href="%1">SNJ Fix for Participant Search Extension</a>{/ts}</p></div>
<div class="clear"></div>
</div>
{/crmScope}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment