3 +--------------------------------------------------------------------+
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2019 |
7 +--------------------------------------------------------------------+
8 | This file is a part of CiviCRM. |
10 | CiviCRM is free software; you can copy, modify, and distribute it |
11 | under the terms of the GNU Affero General Public License |
12 | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
14 | CiviCRM is distributed in the hope that it will be useful, but |
15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
17 | See the GNU Affero General Public License for more details. |
19 | You should have received a copy of the GNU Affero General Public |
20 | License and the CiviCRM Licensing Exception along |
21 | with this program; if not, contact CiviCRM LLC |
22 | at info[AT]civicrm[DOT]org. If you have questions about the |
23 | GNU Affero General Public License or the licensing of CiviCRM, |
24 | see the CiviCRM license FAQ at http://civicrm.org/licensing |
25 +--------------------------------------------------------------------+
31 * @copyright CiviCRM LLC (c) 2004-2019
35 class CRM_Event_BAO_Query
extends CRM_Core_BAO_Query
{
38 * Function get the import/export fields for contribution.
40 * @param bool $checkPermission
43 * Associative array of contribution fields
45 public static function &getFields($checkPermission = TRUE) {
47 $fields = array_merge($fields, CRM_Event_DAO_Event
::import());
48 $fields = array_merge($fields, self
::getParticipantFields());
49 $fields = array_merge($fields, CRM_Core_DAO_Discount
::export());
57 public static function &getParticipantFields() {
58 $fields = CRM_Event_BAO_Participant
::importableFields('Individual', TRUE, TRUE);
63 * Build select for CiviEvent.
67 public static function select(&$query) {
68 if (($query->_mode
& CRM_Contact_BAO_Query
::MODE_EVENT
) ||
69 CRM_Contact_BAO_Query
::componentPresent($query->_returnProperties
, 'participant_')
71 $query->_select
['participant_id'] = "civicrm_participant.id as participant_id";
72 $query->_element
['participant_id'] = 1;
73 $query->_tables
['civicrm_participant'] = $query->_whereTables
['civicrm_participant'] = 1;
76 if (!empty($query->_returnProperties
['participant_fee_level'])) {
77 $query->_select
['participant_fee_level'] = "civicrm_participant.fee_level as participant_fee_level";
78 $query->_element
['participant_fee_level'] = 1;
81 //add participant contact ID
82 if (!empty($query->_returnProperties
['participant_contact_id'])) {
83 $query->_select
['participant_contact_id'] = "civicrm_participant.contact_id as participant_contact_id";
84 $query->_element
['participant_contact_id'] = 1;
88 if (!empty($query->_returnProperties
['participant_fee_amount'])) {
89 $query->_select
['participant_fee_amount'] = "civicrm_participant.fee_amount as participant_fee_amount";
90 $query->_element
['participant_fee_amount'] = 1;
94 if (!empty($query->_returnProperties
['participant_fee_currency'])) {
95 $query->_select
['participant_fee_currency'] = "civicrm_participant.fee_currency as participant_fee_currency";
96 $query->_element
['participant_fee_currency'] = 1;
99 //add event title also if event id is select
100 if (!empty($query->_returnProperties
['event_id']) ||
!empty($query->_returnProperties
['event_title'])) {
101 $query->_select
['event_id'] = "civicrm_event.id as event_id";
102 $query->_select
['event_title'] = "civicrm_event.title as event_title";
103 $query->_element
['event_id'] = 1;
104 $query->_element
['event_title'] = 1;
105 $query->_tables
['civicrm_event'] = 1;
106 $query->_whereTables
['civicrm_event'] = 1;
109 //add start date / end date
110 if (!empty($query->_returnProperties
['event_start_date'])) {
111 $query->_select
['event_start_date'] = "civicrm_event.start_date as event_start_date";
112 $query->_element
['event_start_date'] = 1;
115 if (!empty($query->_returnProperties
['event_end_date'])) {
116 $query->_select
['event_end_date'] = "civicrm_event.end_date as event_end_date";
117 $query->_element
['event_end_date'] = 1;
121 if (!empty($query->_returnProperties
['event_type'])) {
122 $query->_select
['event_type'] = "event_type.label as event_type";
123 $query->_element
['event_type'] = 1;
124 $query->_tables
['event_type'] = 1;
125 $query->_whereTables
['event_type'] = 1;
128 if (!empty($query->_returnProperties
['event_type_id'])) {
129 $query->_select
['event_type_id'] = "event_type.id as event_type_id";
130 $query->_element
['event_type_id'] = 1;
131 $query->_tables
['event_type'] = 1;
132 $query->_whereTables
['event_type'] = 1;
136 if (!empty($query->_returnProperties
['participant_status_id'])) {
137 $query->_select
['participant_status_id'] = "civicrm_participant.status_id as participant_status_id";
138 $query->_element
['participant_status_id'] = 1;
139 $query->_tables
['civicrm_participant'] = 1;
140 $query->_whereTables
['civicrm_participant'] = 1;
143 // get particupant_status label
144 if (!empty($query->_returnProperties
['participant_status'])) {
145 $query->_select
['participant_status'] = "participant_status.label as participant_status";
146 $query->_element
['participant_status'] = 1;
147 $query->_tables
['participant_status'] = 1;
148 $query->_whereTables
['civicrm_participant'] = 1;
151 //add participant_role_id
152 if (!empty($query->_returnProperties
['participant_role_id'])) {
153 $query->_select
['participant_role_id'] = "civicrm_participant.role_id as participant_role_id";
154 $query->_element
['participant_role_id'] = 1;
155 $query->_tables
['civicrm_participant'] = 1;
156 $query->_whereTables
['civicrm_participant'] = 1;
157 $query->_pseudoConstantsSelect
['participant_role_id'] = array(
158 'pseudoField' => 'participant_role_id',
159 'idCol' => 'participant_role_id',
163 //add participant_role
164 if (!empty($query->_returnProperties
['participant_role'])) {
165 $query->_select
['participant_role'] = "civicrm_participant.role_id as participant_role";
166 $query->_element
['participant_role'] = 1;
167 $query->_tables
['participant_role'] = 1;
168 $query->_whereTables
['civicrm_participant'] = 1;
169 $query->_pseudoConstantsSelect
['participant_role'] = array(
170 'pseudoField' => 'participant_role',
171 'idCol' => 'participant_role',
176 if (!empty($query->_returnProperties
['participant_register_date'])) {
177 $query->_select
['participant_register_date'] = "civicrm_participant.register_date as participant_register_date";
178 $query->_element
['participant_register_date'] = 1;
182 if (!empty($query->_returnProperties
['participant_source'])) {
183 $query->_select
['participant_source'] = "civicrm_participant.source as participant_source";
184 $query->_element
['participant_source'] = 1;
185 $query->_tables
['civicrm_participant'] = $query->_whereTables
['civicrm_participant'] = 1;
189 if (!empty($query->_returnProperties
['participant_note'])) {
190 $query->_select
['participant_note'] = "civicrm_note.note as participant_note";
191 $query->_element
['participant_note'] = 1;
192 $query->_tables
['participant_note'] = 1;
193 $query->_whereTables
['civicrm_note'] = 1;
196 if (!empty($query->_returnProperties
['participant_is_pay_later'])) {
197 $query->_select
['participant_is_pay_later'] = "civicrm_participant.is_pay_later as participant_is_pay_later";
198 $query->_element
['participant_is_pay_later'] = 1;
201 if (!empty($query->_returnProperties
['participant_is_test'])) {
202 $query->_select
['participant_is_test'] = "civicrm_participant.is_test as participant_is_test";
203 $query->_element
['participant_is_test'] = 1;
206 if (!empty($query->_returnProperties
['participant_registered_by_id'])) {
207 $query->_select
['participant_registered_by_id'] = "civicrm_participant.registered_by_id as participant_registered_by_id";
208 $query->_element
['participant_registered_by_id'] = 1;
212 if (!empty($query->_returnProperties
['participant_discount_name'])) {
213 $query->_select
['participant_discount_name'] = "discount_name.title as participant_discount_name";
214 $query->_element
['participant_discount_name'] = 1;
215 $query->_tables
['civicrm_discount'] = 1;
216 $query->_tables
['participant_discount_name'] = 1;
217 $query->_whereTables
['civicrm_discount'] = 1;
218 $query->_whereTables
['participant_discount_name'] = 1;
221 //carry campaign id to selectors.
222 if (!empty($query->_returnProperties
['participant_campaign_id'])) {
223 $query->_select
['participant_campaign_id'] = 'civicrm_participant.campaign_id as participant_campaign_id';
224 $query->_element
['participant_campaign_id'] = 1;
233 public static function where(&$query) {
235 foreach (array_keys($query->_params
) as $id) {
236 if (empty($query->_params
[$id][0])) {
239 if (substr($query->_params
[$id][0], 0, 6) == 'event_' ||
240 substr($query->_params
[$id][0], 0, 12) == 'participant_'
242 if ($query->_mode
== CRM_Contact_BAO_QUERY
::MODE_CONTACTS
) {
243 $query->_useDistinct
= TRUE;
245 $grouping = $query->_params
[$id][3];
246 self
::whereClauseSingle($query->_params
[$id], $query);
255 public static function whereClauseSingle(&$values, &$query) {
256 $checkPermission = empty($query->_skipPermission
);
257 list($name, $op, $value, $grouping, $wildcard) = $values;
258 $fields = array_merge(CRM_Event_BAO_Event
::fields(), CRM_Event_BAO_Participant
::exportableFields());
261 case 'event_start_date_low':
262 case 'event_start_date_high':
263 $query->dateQueryBuilder($values,
264 'civicrm_event', 'event_start_date', 'start_date', 'Start Date'
268 case 'event_end_date_low':
269 case 'event_end_date_high':
270 $query->dateQueryBuilder($values,
271 'civicrm_event', 'event_end_date', 'end_date', 'End Date'
275 case 'event_include_repeating_events':
277 * Include Repeating Events
279 //Get parent of this event
281 if ($query->_where
[$grouping]) {
282 foreach ($query->_where
[$grouping] as $key => $val) {
283 if (strstr($val, 'civicrm_event.id =')) {
285 $extractEventId = explode(" ", $val);
286 $value = $extractEventId[2];
287 $where = $query->_where
[$grouping][$key];
289 elseif (strstr($val, 'civicrm_event.id IN')) {
290 //extract the first event id if multiple events are selected
291 preg_match('/civicrm_event.id IN \(\"(\d+)/', $val, $matches);
292 $value = $matches[1];
293 $where = $query->_where
[$grouping][$key];
297 $extractEventId = explode(" ", $exEventId);
298 $value = $extractEventId[2];
300 elseif (!empty($matches[1])) {
301 $value = $matches[1];
303 $where = $query->_where
[$grouping][$key];
305 $thisEventHasParent = CRM_Core_BAO_RecurringEntity
::getParentFor($value, 'civicrm_event');
306 if ($thisEventHasParent) {
307 $getAllConnections = CRM_Core_BAO_RecurringEntity
::getEntitiesForParent($thisEventHasParent, 'civicrm_event');
308 $allEventIds = array();
309 foreach ($getAllConnections as $key => $val) {
310 $allEventIds[] = $val['id'];
312 if (!empty($allEventIds)) {
314 $value = "(" . implode(",", $allEventIds) . ")";
317 $query->_where
[$grouping][] = "{$where} OR civicrm_event.id $op {$value}";
318 $query->_qill
[$grouping][] = ts('Include Repeating Events');
319 $query->_tables
['civicrm_event'] = $query->_whereTables
['civicrm_event'] = 1;
322 case 'participant_is_test':
323 $key = array_search('civicrm_participant.is_test = 0', $query->_where
[$grouping]);
325 unset($query->_where
[$grouping][$key]);
327 case 'participant_test':
328 // We dont want to include all tests for sql OR CRM-7827
329 if (!$value ||
$query->getOperator() != 'OR') {
330 $query->_where
[$grouping][] = CRM_Contact_BAO_Query
::buildClause("civicrm_participant.is_test",
336 $isTest = $value ?
'a Test' : 'not a Test';
337 $query->_qill
[$grouping][] = ts("Participant is %1", array(1 => $isTest));
338 $query->_tables
['civicrm_participant'] = $query->_whereTables
['civicrm_participant'] = 1;
342 case 'participant_fee_id':
343 foreach ($value as $k => &$val) {
344 $val = CRM_Core_DAO
::getFieldValue('CRM_Price_DAO_PriceFieldValue', $val, 'label');
345 $val = CRM_Core_DAO
::escapeString(trim($val));
347 $feeLabel = implode('|', $value);
348 $query->_where
[$grouping][] = "civicrm_participant.fee_level REGEXP '{$feeLabel}'";
349 $query->_qill
[$grouping][] = ts("Fee level") . " IN " . implode(', ', $value);
350 $query->_tables
['civicrm_participant'] = $query->_whereTables
['civicrm_participant'] = 1;
353 case 'participant_fee_amount_high':
354 case 'participant_fee_amount_low':
355 $query->numberRangeBuilder($values,
356 'civicrm_participant', 'participant_fee_amount', 'fee_amount', 'Fee Amount'
360 case 'participant_status_id':
361 if ($value && is_array($value) && strpos($op, 'IN') === FALSE) {
364 case 'participant_status':
365 case 'participant_source':
366 case 'participant_id':
367 case 'participant_contact_id':
368 case 'participant_is_pay_later':
369 case 'participant_fee_amount':
370 case 'participant_fee_level':
371 case 'participant_campaign_id':
372 case 'participant_registered_by_id':
375 if (in_array($name, array(
376 'participant_status_id',
377 'participant_source',
379 'participant_contact_id',
380 'participant_fee_amount',
381 'participant_fee_level',
382 'participant_is_pay_later',
383 'participant_campaign_id',
384 'participant_registered_by_id',
387 $name = str_replace('participant_', '', $name);
388 if ($name == 'is_pay_later') {
392 elseif ($name == 'participant_status') {
396 $dataType = !empty($fields[$qillName]['type']) ? CRM_Utils_Type
::typeToString($fields[$qillName]['type']) : 'String';
397 $tableName = empty($tableName) ?
'civicrm_participant' : $tableName;
398 if (is_array($value) && in_array(key($value), CRM_Core_DAO
::acceptedSQLOperators(), TRUE)) {
400 $value = $value[$op];
402 $query->_where
[$grouping][] = CRM_Contact_BAO_Query
::buildClause("$tableName.$name", $op, $value, $dataType);
404 list($op, $value) = CRM_Contact_BAO_Query
::buildQillForFieldValue('CRM_Event_DAO_Participant', $name, $value, $op);
405 $query->_qill
[$grouping][] = ts('%1 %2 %3', array(1 => $fields[$qillName]['title'], 2 => $op, 3 => $value));
406 $query->_tables
['civicrm_participant'] = $query->_whereTables
['civicrm_participant'] = 1;
409 case 'participant_role':
410 case 'participant_role_id':
414 $dataType = !empty($fields[$qillName]['type']) ? CRM_Utils_Type
::typeToString($fields[$qillName]['type']) : 'String';
415 $tableName = empty($tableName) ?
'civicrm_participant' : $tableName;
416 if (is_array($value) && in_array(key($value), CRM_Core_DAO
::acceptedSQLOperators(), TRUE)) {
418 $value = $value[$op];
420 if (!strstr($op, 'NULL') && !strstr($op, 'EMPTY') && !strstr($op, 'LIKE')) {
421 $regexOp = (strstr($op, '!') ||
strstr($op, 'NOT')) ?
'NOT REGEXP' : 'REGEXP';
422 $regexp = "([[:cntrl:]]|^)" . implode('([[:cntrl:]]|$)|([[:cntrl:]]|^)', (array) $value) . "([[:cntrl:]]|$)";
423 $query->_where
[$grouping][] = CRM_Contact_BAO_Query
::buildClause("civicrm_participant.$name", $regexOp, $regexp, 'String');
426 $query->_where
[$grouping][] = CRM_Contact_BAO_Query
::buildClause("$tableName.$name", $op, $value, $dataType);
429 list($op, $value) = CRM_Contact_BAO_Query
::buildQillForFieldValue('CRM_Event_DAO_Participant', $name, $value, $op);
430 $query->_qill
[$grouping][] = ts('%1 %2 %3', array(1 => $fields[$qillName]['title'], 2 => $op, 3 => $value));
431 $query->_tables
['civicrm_participant'] = $query->_whereTables
['civicrm_participant'] = 1;
434 case 'participant_register_date':
435 case 'participant_register_date_high':
436 case 'participant_register_date_low':
437 $query->dateQueryBuilder($values,
438 'civicrm_participant', 'participant_register_date', 'register_date', 'Register Date'
443 case 'participant_event_id':
444 $name = str_replace('participant_', '', $name);
445 case 'event_is_public':
446 case 'event_type_id':
449 if (in_array($name, array(
456 $name = str_replace('event_', '', $name);
458 $dataType = !empty($fields[$qillName]['type']) ? CRM_Utils_Type
::typeToString($fields[$qillName]['type']) : 'String';
460 $query->_where
[$grouping][] = CRM_Contact_BAO_Query
::buildClause("civicrm_event.$name", $op, $value, $dataType);
461 $query->_tables
['civicrm_event'] = $query->_whereTables
['civicrm_event'] = 1;
462 if (!array_key_exists($qillName, $fields)) {
465 list($op, $value) = CRM_Contact_BAO_Query
::buildQillForFieldValue('CRM_Event_DAO_Event', $name, $value, $op, array('check_permission' => $checkPermission));
466 $query->_qill
[$grouping][] = ts('%1 %2 %3', array(1 => $fields[$qillName]['title'], 2 => $op, 3 => $value));
472 * @param string $name
476 * @return null|string
478 public static function from($name, $mode, $side) {
481 case 'civicrm_participant':
482 $from = " LEFT JOIN civicrm_participant ON civicrm_participant.contact_id = contact_a.id ";
485 case 'civicrm_event':
487 $from = " LEFT JOIN civicrm_event ON civicrm_participant.event_id = civicrm_event.id ";
491 $from = " $side JOIN civicrm_option_group option_group_event_type ON (option_group_event_type.name = 'event_type')";
492 $from .= " $side JOIN civicrm_option_value event_type ON (civicrm_event.event_type_id = event_type.value AND option_group_event_type.id = event_type.option_group_id ) ";
495 case 'participant_note':
496 $from .= " $side JOIN civicrm_note ON ( civicrm_note.entity_table = 'civicrm_participant' AND
497 civicrm_participant.id = civicrm_note.entity_id )";
500 case 'participant_status':
501 $from .= " $side JOIN civicrm_participant_status_type participant_status ON (civicrm_participant.status_id = participant_status.id) ";
504 case 'participant_role':
505 $from = " $side JOIN civicrm_option_group option_group_participant_role ON (option_group_participant_role.name = 'participant_role')";
506 $from .= " $side JOIN civicrm_option_value participant_role ON ((civicrm_participant.role_id = participant_role.value OR SUBSTRING_INDEX(role_id,'\ 1', 1) = participant_role.value)
507 AND option_group_participant_role.id = participant_role.option_group_id ) ";
510 case 'participant_discount_name':
511 $from = " $side JOIN civicrm_discount discount ON ( civicrm_participant.discount_id = discount.id )";
512 $from .= " $side JOIN civicrm_option_group discount_name ON ( discount_name.id = discount.price_set_id ) ";
520 * @param bool $includeCustomFields
524 public static function defaultReturnProperties(
526 $includeCustomFields = TRUE
529 if ($mode & CRM_Contact_BAO_Query
::MODE_EVENT
) {
532 'contact_sub_type' => 1,
537 'event_start_date' => 1,
538 'event_end_date' => 1,
540 'participant_id' => 1,
541 'participant_status' => 1,
542 'participant_status_id' => 1,
543 'participant_role' => 1,
544 'participant_role_id' => 1,
545 'participant_note' => 1,
546 'participant_register_date' => 1,
547 'participant_source' => 1,
548 'participant_fee_level' => 1,
549 'participant_is_test' => 1,
550 'participant_is_pay_later' => 1,
551 'participant_fee_amount' => 1,
552 'participant_discount_name' => 1,
553 'participant_fee_currency' => 1,
554 'participant_registered_by_id' => 1,
555 'participant_campaign_id' => 1,
558 if ($includeCustomFields) {
559 // also get all the custom participant properties
560 $fields = CRM_Core_BAO_CustomField
::getFieldsForImport('Participant');
561 if (!empty($fields)) {
562 foreach ($fields as $name => $dontCare) {
563 $properties[$name] = 1;
573 * @param CRM_Core_Form $form
575 public static function buildSearchForm(&$form) {
576 $dataURLEventFee = CRM_Utils_System
::url('civicrm/ajax/eventFee',
581 $form->assign('dataURLEventFee', $dataURLEventFee);
583 $form->addEntityRef('event_id', ts('Event Name'), array(
585 'placeholder' => ts('- any -'),
587 'select' => array('minimumInputLength' => 0),
590 $form->addEntityRef('event_type_id', ts('Event Type'), array(
591 'entity' => 'option_value',
592 'placeholder' => ts('- any -'),
593 'select' => array('minimumInputLength' => 0),
595 'params' => array('option_group_id' => 'event_type'),
599 $obj = new CRM_Report_Form_Event_ParticipantListing();
600 $form->add('select', 'participant_fee_id',
602 $obj->getPriceLevels(),
603 FALSE, array('class' => 'crm-select2', 'multiple' => 'multiple', 'placeholder' => ts('- any -'))
606 CRM_Core_Form_Date
::buildDateRange($form, 'event', 1, '_start_date_low', '_end_date_high', ts('From'), FALSE);
608 CRM_Core_Form_Date
::buildDateRange($form, 'participant', 1, '_register_date_low', '_register_date_high', ts('From'), FALSE);
610 $form->addElement('hidden', 'event_date_range_error');
611 $form->addElement('hidden', 'participant_date_range_error');
612 $form->addFormRule(array('CRM_Event_BAO_Query', 'formRule'), $form);
614 $form->addElement('checkbox', "event_include_repeating_events", NULL, ts('Include participants from all events in the %1 series', array(1 => '<em>%1</em>')));
616 $form->addSelect('participant_status_id',
618 'entity' => 'participant',
619 'label' => ts('Participant Status'),
620 'multiple' => 'multiple',
621 'option_url' => NULL,
622 'placeholder' => ts('- any -'),
626 $form->addSelect('participant_role_id',
628 'entity' => 'participant',
629 'label' => ts('Participant Role'),
630 'multiple' => 'multiple',
631 'option_url' => NULL,
632 'placeholder' => ts('- any -'),
636 $form->addYesNo('participant_test', ts('Participant is a Test?'), TRUE);
637 $form->addYesNo('participant_is_pay_later', ts('Participant is Pay Later?'), TRUE);
638 $form->addElement('text', 'participant_fee_amount_low', ts('From'), array('size' => 8, 'maxlength' => 8));
639 $form->addElement('text', 'participant_fee_amount_high', ts('To'), array('size' => 8, 'maxlength' => 8));
641 $form->addRule('participant_fee_amount_low', ts('Please enter a valid money value.'), 'money');
642 $form->addRule('participant_fee_amount_high', ts('Please enter a valid money value.'), 'money');
644 self
::addCustomFormFields($form, array('Participant', 'Event'));
646 CRM_Campaign_BAO_Campaign
::addCampaignInComponentSearch($form, 'participant_campaign_id');
648 $form->assign('validCiviEvent', TRUE);
649 $form->setDefaults(array('participant_test' => 0));
655 public static function tableNames(&$tables) {
656 //add participant table
657 if (!empty($tables['civicrm_event'])) {
658 $tables = array_merge(array('civicrm_participant' => 1), $tables);
663 * Check if the values in the date range are in correct chronological order.
665 * @todo Get this to work with CRM_Utils_Rule::validDateRange
667 * @param array $fields
668 * @param array $files
669 * @param CRM_Core_Form $form
673 public static function formRule($fields, $files, $form) {
676 if ((empty($fields['event_start_date_low']) ||
empty($fields['event_end_date_high'])) && (empty($fields['participant_register_date_low']) ||
empty($fields['participant_register_date_high']))) {
679 $lowDate = strtotime($fields['event_start_date_low']);
680 $highDate = strtotime($fields['event_end_date_high']);
682 if ($lowDate > $highDate) {
683 $errors['event_date_range_error'] = ts('Please check that your Event Date Range is in correct chronological order.');
686 $lowDate1 = strtotime($fields['participant_register_date_low']);
687 $highDate1 = strtotime($fields['participant_register_date_high']);
689 if ($lowDate1 > $highDate1) {
690 $errors['participant_date_range_error'] = ts('Please check that your Registration Date Range is in correct chronological order.');
692 return empty($errors) ?
TRUE : $errors;