Skip to content
Snippets Groups Projects
Commit 0ae0bb0e authored by lobo's avatar lobo
Browse files

CRM-13355 - add support to retrieve non-public events

----------------------------------------
* CRM-13355: CiviDiscount Codes Should Be Available on Non-Public Events
  http://issues.civicrm.org/jira/browse/CRM-13355
parent 80e108ba
No related branches found
No related tags found
No related merge requests found
......@@ -112,7 +112,7 @@ class CRM_Event_BAO_Event extends CRM_Event_DAO_Event {
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']);
}
......@@ -501,7 +501,7 @@ LIMIT 0, 10
$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)) {
......@@ -665,16 +665,28 @@ WHERE civicrm_address.geo_code_1 IS NOT NULL
/**
* 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) {
......@@ -689,7 +701,8 @@ WHERE civicrm_address.geo_code_1 IS NOT NULL
$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
......@@ -744,8 +757,8 @@ LEFT JOIN civicrm_option_value ON (
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)) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment