From 1288638914387a856d8a5fbaeac9a85c098785be Mon Sep 17 00:00:00 2001 From: Mathieu Lu Date: Wed, 6 Sep 2023 11:25:09 -0400 Subject: [PATCH] Event Dashboard: show events that have not ended yet --- CRM/Event/BAO/Event.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/CRM/Event/BAO/Event.php b/CRM/Event/BAO/Event.php index 96e746a736..41956084cf 100644 --- a/CRM/Event/BAO/Event.php +++ b/CRM/Event/BAO/Event.php @@ -364,7 +364,7 @@ SELECT count(id) as total_events FROM civicrm_event WHERE civicrm_event.is_active = 1 AND civicrm_event.is_template = 0 AND - civicrm_event.start_date >= DATE_SUB( NOW(), INTERVAL 7 day ) + (civicrm_event.start_date >= DATE_SUB(NOW(), INTERVAL 7 day) OR (civicrm_event.end_date IS NOT NULL AND civicrm_event.end_date >= NOW())) $validEventIDs"; $dao = CRM_Core_DAO::executeQuery($query); @@ -373,9 +373,7 @@ WHERE civicrm_event.is_active = 1 AND $eventSummary['total_events'] = $dao->total_events; } - if (empty($eventSummary) || - $dao->total_events == 0 - ) { + if (empty($eventSummary['total_events'])) { return $eventSummary; } @@ -426,7 +424,7 @@ LEFT JOIN civicrm_pcp_block ON ( civicrm_pcp_block.entity_id = civicrm_event.id LEFT JOIN civicrm_recurring_entity ON ( civicrm_event.id = civicrm_recurring_entity.entity_id AND civicrm_recurring_entity.entity_table = 'civicrm_event' ) WHERE civicrm_event.is_active = 1 AND civicrm_event.is_template = 0 AND - civicrm_event.start_date >= DATE_SUB( NOW(), INTERVAL 7 day ) + (civicrm_event.start_date >= DATE_SUB(NOW(), INTERVAL 7 day) OR (civicrm_event.end_date IS NOT NULL AND civicrm_event.end_date >= NOW())) $validEventIDs ORDER BY civicrm_event.start_date ASC $event_summary_limit -- 2.25.1