Skip to content

Commit

Permalink
CRM-17283 Allow for searching on Registration Date in Participant Search
Browse files Browse the repository at this point in the history
  • Loading branch information
seamuslee001 committed Sep 28, 2015
1 parent 29cd1cd commit 5ae1e06
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
7 changes: 6 additions & 1 deletion CRM/Contact/BAO/Query.php
Original file line number Diff line number Diff line change
Expand Up @@ -1531,12 +1531,17 @@ public static function convertFormValues(&$formValues, $wildcard = 0, $useEquals
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';
Expand Down
4 changes: 4 additions & 0 deletions CRM/Event/BAO/Query.php
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,8 @@ public static function whereClauseSingle(&$values, &$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'
);
Expand Down Expand Up @@ -563,6 +565,8 @@ public static function buildSearchForm(&$form) {
$form->add('text', 'participant_fee_id', ts('Fee Level'), array('class' => 'big crm-ajax-select'));

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 => '<em>%1</em>')));

Expand Down
6 changes: 6 additions & 0 deletions templates/CRM/Event/Form/Search/Common.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@
<tr>
{include file="CRM/Core/DateRange.tpl" fieldName="event" from='_start_date_low' to='_end_date_high'}
</tr>
<tr>
<td><label>{ts}Registration Date{/ts}</label></td>
</tr>
<tr>
{include file="CRM/Core/DateRange.tpl" fieldName="participant" from='_register_date_low' to='_register_date_high'}
</tr>
<tr>
<td class="crm-event-form-block-participant_status"><label>{$form.participant_status_id.label}</label>
<br />
Expand Down

0 comments on commit 5ae1e06

Please sign in to comment.