From 7d7ec119386f7d12a9636cba32ce8261e91f711a Mon Sep 17 00:00:00 2001 From: Jimmy Huang Date: Tue, 9 Jul 2024 14:55:35 +0800 Subject: [PATCH] refs #40301, fixes participant listing functions --- .../Page/ParticipantListing/NameStatusAndDate.php | 11 +++++++---- CRM/Event/Page/ParticipantListing/Simple.php | 5 +++-- templates/CRM/Event/Page/EventLinks.tpl | 2 +- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/CRM/Event/Page/ParticipantListing/NameStatusAndDate.php b/CRM/Event/Page/ParticipantListing/NameStatusAndDate.php index c31ad9563..7f71685f8 100644 --- a/CRM/Event/Page/ParticipantListing/NameStatusAndDate.php +++ b/CRM/Event/Page/ParticipantListing/NameStatusAndDate.php @@ -67,7 +67,8 @@ class CRM_Event_Page_ParticipantListing_NameStatusAndDate extends CRM_Core_Page function run() { $this->preProcess(); - + $countedStatus = CRM_Event_PseudoConstant::participantStatus(NULL, 'is_counted = 1'); + $countedStatusIds = implode(',', array_keys($countedStatus)); $fromClause = " FROM civicrm_contact INNER JOIN civicrm_participant ON civicrm_contact.id = civicrm_participant.contact_id @@ -75,7 +76,9 @@ function run() { "; $whereClause = " -WHERE civicrm_event.id = %1"; +WHERE civicrm_event.id = %1 +AND civicrm_participant.is_test = 0 +AND civicrm_participant.status_id IN ( $countedStatusIds )"; $params = array(1 => array($this->_id, 'Integer')); $this->pager($fromClause, $whereClause, $params); @@ -98,7 +101,7 @@ function run() { $rows = array(); $object = CRM_Core_DAO::executeQuery($query, $params); require_once 'CRM/Event/PseudoConstant.php'; - $statusLookup = CRM_Event_PseudoConstant::participantStatus(); + $statusLookup = CRM_Event_PseudoConstant::participantStatus(NULL, NULL, 'label'); while ($object->fetch()) { $row = array('id' => $object->contact_id, 'participantID' => $object->participant_id, @@ -107,7 +110,7 @@ function run() { 'status' => CRM_Utils_Array::value($object->status_id, $statusLookup ), - 'date' => $object->register_date, + 'date' => CRM_Utils_Date::customFormat($object->register_date), ); $rows[] = $row; } diff --git a/CRM/Event/Page/ParticipantListing/Simple.php b/CRM/Event/Page/ParticipantListing/Simple.php index fe24d6281..4f578e2cb 100644 --- a/CRM/Event/Page/ParticipantListing/Simple.php +++ b/CRM/Event/Page/ParticipantListing/Simple.php @@ -58,7 +58,8 @@ class CRM_Event_Page_ParticipantListing_Simple extends CRM_Core_Page { function run() { $this->preProcess(); - + $countedStatus = CRM_Event_PseudoConstant::participantStatus(NULL, 'is_counted = 1'); + $countedStatusIds = implode(',', array_keys($countedStatus)); $fromClause = " FROM civicrm_contact INNER JOIN civicrm_participant ON civicrm_contact.id = civicrm_participant.contact_id @@ -69,7 +70,7 @@ function run() { $whereClause = " WHERE civicrm_event.id = %1 AND civicrm_participant.is_test = 0 -AND civicrm_participant.status_id IN ( 1, 2 )"; +AND civicrm_participant.status_id IN ( $countedStatusIds )"; $params = array(1 => array($this->_id, 'Integer')); $this->pager($fromClause, $whereClause, $params); $orderBy = $this->orderBy(); diff --git a/templates/CRM/Event/Page/EventLinks.tpl b/templates/CRM/Event/Page/EventLinks.tpl index 0bfdd830d..8d7ab1c2c 100644 --- a/templates/CRM/Event/Page/EventLinks.tpl +++ b/templates/CRM/Event/Page/EventLinks.tpl @@ -43,7 +43,7 @@ {if $event.participant_listing_id}
- + {ts}Public Participant Listing{/ts}