}
/**
- * build select for CiviEvent
+ * Build select for CiviEvent
*
* @param $query
*
}
}
+
/**
* @param $query
*/
$query->_tables['civicrm_event'] = $query->_whereTables['civicrm_event'] = 1;
return;
+ 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;
+
case 'event_type_id':
$eventTypes = CRM_Core_OptionGroup::values("event_type");
return;
case 'participant_id':
- $query->_where[$grouping][] = CRM_Contact_BAO_Query::buildClause("civicrm_participant.id",
- $op,
- $value,
- "Integer"
- );
+ $query->_where[$grouping][] = CRM_Contact_BAO_Query::buildClause("civicrm_participant.id", $op, $value, "Integer");
$query->_tables['civicrm_participant'] = $query->_whereTables['civicrm_participant'] = 1;
return;
}
/**
- * @param $name
+ * @param string $name
* @param $mode
* @param $side
*
}
/**
- * getter for the qill object
+ * Getter for the qill object
*
* @return string
* @access public
$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);
+ $eventIncludeRepeatingEvents = &$form->addElement('checkbox', "event_include_repeating_events", NULL, ts(' Include Repeating Events (If Any) ? '));
$status = CRM_Event_PseudoConstant::participantStatus(NULL, NULL, 'label');
foreach ($status as $id => $Name) {
/**
* @param $row
- * @param $id
+ * @param int $id
*/
static function searchAction(&$row, $id) {}