From e520211a3eaa3385369b0013a4384926562f92b1 Mon Sep 17 00:00:00 2001 From: Seamus Lee Date: Sat, 26 Sep 2015 00:29:33 +0000 Subject: [PATCH] CRM-17283 Allow for searching on partcipant registration date --- CRM/Contact/BAO/Query.php | 7 ++++++- CRM/Event/BAO/Query.php | 4 ++++ templates/CRM/Event/Form/Search/Common.tpl | 6 ++++++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/CRM/Contact/BAO/Query.php b/CRM/Contact/BAO/Query.php index 54873b5b87..e488eeaceb 100644 --- a/CRM/Contact/BAO/Query.php +++ b/CRM/Contact/BAO/Query.php @@ -1516,12 +1516,17 @@ class CRM_Contact_BAO_Query { elseif (preg_match('/_date_relative$/', $id) || $id == 'event_relative' || $id == 'case_from_relative' || - $id == 'case_to_relative' + $id == 'case_to_relative' || + $id == 'participant_relative' ) { if ($id == 'event_relative') { $fromRange = 'event_start_date_low'; $toRange = 'event_end_date_high'; } + elseif ($id == 'participant_relative') { + $fromRange = 'participant_register_date_low'; + $toRange = 'participant_register_date_high'; + } elseif ($id == 'case_from_relative') { $fromRange = 'case_from_start_date_low'; $toRange = 'case_from_start_date_high'; diff --git a/CRM/Event/BAO/Query.php b/CRM/Event/BAO/Query.php index 2af7f411d3..05328b5c33 100644 --- a/CRM/Event/BAO/Query.php +++ b/CRM/Event/BAO/Query.php @@ -408,6 +408,8 @@ class CRM_Event_BAO_Query { return; case 'participant_register_date': + case 'participant_register_date_high': + case 'participant_register_date_low': $query->dateQueryBuilder($values, 'civicrm_participant', 'participant_register_date', 'register_date', 'Register Date' ); @@ -580,6 +582,8 @@ class CRM_Event_BAO_Query { CRM_Core_Form_Date::buildDateRange($form, 'event', 1, '_start_date_low', '_end_date_high', ts('From'), FALSE); + CRM_Core_Form_Date::buildDateRange($form, 'participant', 1, '_register_date_low', '_register_date_high', ts('From'), FALSE); + $form->addElement('checkbox', "event_include_repeating_events", NULL, ts('Include participants from all events in the %1 series', array(1 => '%1'))); $form->addSelect('participant_status_id', diff --git a/templates/CRM/Event/Form/Search/Common.tpl b/templates/CRM/Event/Form/Search/Common.tpl index 6eb6e826c2..bab2fd45d6 100644 --- a/templates/CRM/Event/Form/Search/Common.tpl +++ b/templates/CRM/Event/Form/Search/Common.tpl @@ -38,6 +38,12 @@ {include file="CRM/Core/DateRange.tpl" fieldName="event" from='_start_date_low' to='_end_date_high'} + + + + +{include file="CRM/Core/DateRange.tpl" fieldName="participant" from='_register_date_low' to='_register_date_high'} +
-- 2.25.1