Skip to content

Commit

Permalink
BUGFIX: DataLists not storing in new variables.
Browse files Browse the repository at this point in the history
  • Loading branch information
unclecheese committed Sep 11, 2012
1 parent 52050fb commit 6b8c56a
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions code/Calendar.php
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ public function getDateToEventRelation() {
public function getEventList($start, $end, $filter = null, $limit = null, $announcement_filter = null) {

foreach($this->getAllCalendars() as $calendar) {

$eventList = new ArrayList();
if($events = $calendar->getStandardEvents($start, $end, $filter)) {
$eventList->merge($events);
Expand All @@ -187,7 +188,7 @@ public function getEventList($start, $end, $filter = null, $limit = null, $annou
(EndDate BETWEEN '$start' AND '$end')
");
if($filter) {
$announcements->where($announcement_filter);
$announcements = $announcements->where($announcement_filter);
}

if($announcements) {
Expand Down Expand Up @@ -233,14 +234,14 @@ protected function getStandardEvents($start, $end, $filter = null) {
$relation = $this->getDateToEventRelation();
$event_class = $this->getEventClass();
$list = DataList::create($datetime_class);
$list->where("Recursion != 1");
$list->where("
$list = $list->where("Recursion != 1");
$list = $list->where("
(StartDate <= '$start' AND EndDate >= '$end') OR
(StartDate BETWEEN '$start' AND '$end') OR
(EndDate BETWEEN '$start' AND '$end')
");
$list->filter(array($relation => $ids));
$list->innerJoin($event_class, "$relation = \"{$event_class}\".ID");
$list = $list->filter(array($relation => $ids));
$list = $list->innerJoin($event_class, "$relation = \"{$event_class}\".ID");
return $list;
}

Expand All @@ -257,7 +258,7 @@ protected function getRecurringEvents($filter = null) {
->filter("ParentID", $this->ID)
->innerJoin($datetime_class, "\"{$datetime_class}\".{$relation} = \"SiteTree\".ID");
if($filter) {
$events->where($filter);
$events = $events->where($filter);
}
return $events;
}
Expand Down

0 comments on commit 6b8c56a

Please sign in to comment.