Skip to content

Commit

Permalink
BUGFIX: Nested calendars only adding Announcements
Browse files Browse the repository at this point in the history
  • Loading branch information
unclecheese committed Aug 11, 2012
1 parent 6daafa4 commit 3b6bb9f
Showing 1 changed file with 13 additions and 14 deletions.
27 changes: 13 additions & 14 deletions code/Calendar.php
Original file line number Diff line number Diff line change
Expand Up @@ -163,13 +163,11 @@ public function getDateToEventRelation() {


public function getEventList($start, $end, $filter = null, $limit = null) {
$eventList = new ArrayList();
if($events = $this->getStandardEvents($start, $end, $filter)) {
$eventList->merge($events);
}


foreach($this->getAllCalendars() as $calendar) {
foreach($this->getAllCalendars() as $calendar) {
$eventList = new ArrayList();
if($events = $calendar->getStandardEvents($start, $end, $filter)) {
$eventList->merge($events);
}
$announcements = DataList::create($this->getAnnouncementClass())
->filter('CalendarID', $calendar->ID)
->where("
Expand All @@ -178,7 +176,6 @@ public function getEventList($start, $end, $filter = null, $limit = null) {
(EndDate BETWEEN '$start' AND '$end')
");
if($filter) {
var_dump($filter);
$announcements->filter($filter);
}

Expand All @@ -188,17 +185,19 @@ public function getEventList($start, $end, $filter = null, $limit = null) {
}

}
}


if($recurring = $this->getRecurringEvents($filter)) {
$eventList = $this->addRecurringEvents($start, $end, $recurring, $eventList);
if($recurring = $calendar->getRecurringEvents($filter)) {
$eventList = $calendar->addRecurringEvents($start, $end, $recurring, $eventList);
}

}

$eventList->sort("StartDate","ASC");

// if($this->Feeds()) {
// $event_list = $this->importFromFeeds($event_list);
// }
$eventList->sort("StartDate","ASC");

return $eventList;
}

Expand Down Expand Up @@ -418,7 +417,7 @@ class Calendar_Controller extends Page_Controller {
public function init() {
parent::init();
RSSFeed::linkToFeed($this->Link() . "rss", $this->RSSTitle ? $this->RSSTitle : $this->Title);
Requirements::css('event_calendar/css/calendar.css');
Requirements::themedCSS('calendar.css');
Requirements::javascript(THIRDPARTY_DIR.'/jquery/jquery.js');
Requirements::javascript('event_calendar/javascript/calendar.js');
}
Expand Down

0 comments on commit 3b6bb9f

Please sign in to comment.