else {
CRM_Utils_Hook::post('create', 'Event', $event->id, $event);
}
- if ($financialTypeId && CRM_Utils_Array::value('financial_type_id', $params)
+ if ($financialTypeId && CRM_Utils_Array::value('financial_type_id', $params)
&& $financialTypeId != $params['financial_type_id']) {
CRM_Price_BAO_FieldValue::updateFinancialType($params['id'], 'civicrm_event', $params['financial_type_id']);
}
$eventSummary['events'][$dao->id]['is_subevent'] = $dao->slot_label_id;
$eventSummary['events'][$dao->id]['is_pcp_enabled'] = $dao->is_pcp_enabled;
$eventSummary['events'][$dao->id]['reminder'] = CRM_Core_BAO_ActionSchedule::isConfigured($dao->id, $mappingID);
-
+
$statusTypes = CRM_Event_PseudoConstant::participantStatus();
foreach ($statusValues as $statusId => $statusValue) {
if (!array_key_exists($statusId, $statusTypes)) {
/**
* function to get the complete information for one or more events
*
- * @param date $start get events with start date >= this date
- * @param integer $type get events on the a specific event type (by event_type_id)
- * @param integer $eventId return a single event - by event id
- * @param date $end also get events with end date >= this date
+ * @param date $start get events with start date >= this date
+ * @param integer $type get events on the a specific event type (by event_type_id)
+ * @param integer $eventId return a single event - by event id
+ * @param date $end also get events with end date >= this date
+ * @param boolean $onlyPublic include public events only, default TRUE
*
* @return array $all array of all the events that are searched
* @static
* @access public
*/
- static function &getCompleteInfo($start = NULL, $type = NULL, $eventId = NULL, $end = NULL) {
+ static function &getCompleteInfo(
+ $start = NULL,
+ $type = NULL,
+ $eventId = NULL,
+ $end = NULL,
+ $onlyPublic = TRUE
+ ) {
+ $publicCondition = NULL;
+ if ($onlyPublic) {
+ $publicCondition = " AND civicrm_event.is_public = 1";
+ }
+
$dateCondition = '';
// if start and end date are NOT passed, return all events with start_date OR end_date >= today CRM-5133
if ($start) {
$dateCondition .= " AND ( civicrm_event.end_date <= '{$endDate}' ) ";
}
- // CRM-9421 and CRM-8620 Default mode for ical/rss feeds. No start or end filter passed. Need to exclude old events with only start date
+ // CRM-9421 and CRM-8620 Default mode for ical/rss feeds. No start or end filter passed.
+ // Need to exclude old events with only start date
// and not exclude events in progress (start <= today and end >= today). DGG
if (empty($start) && empty($end)) {
// get events with end date >= today, not sure of this logic
civicrm_event.event_type_id = civicrm_option_value.value AND
civicrm_option_value.option_group_id = %1 )
WHERE civicrm_event.is_active = 1
- AND civicrm_event.is_public = 1
AND (is_template = 0 OR is_template IS NULL)
+ {$publicCondition}
{$dateCondition}";
if (isset($typeCondition)) {