+ case 'event_include_repeating_events':
+ /**
+ * Include Repeating Events
+ */
+ //Get parent of this event
+ $exEventId = '';
+ if ($query->_where[$grouping]) {
+ foreach($query->_where[$grouping] as $key => $val) {
+ if (strstr($val, 'civicrm_event.id =')) {
+ $exEventId = $val;
+ $extractEventId = explode(" ", $val);
+ $value = $extractEventId[2];
+ unset($query->_where[$grouping][$key]);
+ }
+ }
+ $extractEventId = explode(" ", $exEventId);
+ $value = $extractEventId[2];
+ unset($query->_where[$grouping][$key]);
+ }
+ $thisEventHasParent = CRM_Core_BAO_RecurringEntity::getParentFor($value, 'civicrm_event');
+ if ($thisEventHasParent) {
+ $getAllConnections = CRM_Core_BAO_RecurringEntity::getEntitiesForParent($thisEventHasParent, 'civicrm_event');
+ $allEventIds = array();
+ foreach($getAllConnections as $key => $val) {
+ $allEventIds[] = $val['id'];
+ }
+ if (!empty($allEventIds)) {
+ $op = "IN";
+ $value = "(".implode(",", $allEventIds).")";
+ }
+ }
+ $query->_where[$grouping][] = "civicrm_event.id $op {$value}";
+ $query->_qill[$grouping][] = ts('Include Repeating Events (If Any) ') . " = TRUE";
+ $query->_tables['civicrm_event'] = $query->_whereTables['civicrm_event'] = 1;
+ return;
+