Skip to content

Commit

Permalink
refs #40301, fixes participant listing functions
Browse files Browse the repository at this point in the history
  • Loading branch information
jimyhuang committed Jul 9, 2024
1 parent 8853f3d commit 7d7ec11
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
11 changes: 7 additions & 4 deletions CRM/Event/Page/ParticipantListing/NameStatusAndDate.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,18 @@ 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
INNER JOIN civicrm_event ON civicrm_participant.event_id = civicrm_event.id
";

$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);
Expand All @@ -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,
Expand All @@ -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;
}
Expand Down
5 changes: 3 additions & 2 deletions CRM/Event/Page/ParticipantListing/Simple.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion templates/CRM/Event/Page/EventLinks.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
</div>
{if $event.participant_listing_id}
<div class="flex-general">
<a class="crm-participant-listing" href="{$participantListingURL}" target="_blank">
<a class="crm-participant-listing" href="{crmURL p='civicrm/event/participant' q="reset=1&id=`$id`"}" target="_blank">
<i class="zmdi zmdi-assignment-account"></i>
{ts}Public Participant Listing{/ts}
</a>
Expand Down

0 comments on commit 7d7ec11

Please sign in to comment.