diff options
Diffstat (limited to '')
-rw-r--r-- | model/Schedule.php | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/model/Schedule.php b/model/Schedule.php index 5c7858a..db93c4d 100644 --- a/model/Schedule.php +++ b/model/Schedule.php @@ -6,6 +6,15 @@ class Schedule extends ModelBase return $this->has('SCHEDULE'); } + private function isRoomFiltered($room) + { + if(!$this->has('SCHEDULE.ROOMFILTER')) + return false; + + $rooms = $this->get('SCHEDULE.ROOMFILTER'); + return !in_array($room, $rooms); + } + public function getSimulationOffset() { return $this->get('SCHEDULE.SIMULATE_OFFSET', 0); } @@ -53,6 +62,10 @@ class Schedule extends ModelBase foreach($day->room as $room) { + $name = (string)$room['name']; + if($this->isRoomFiltered($name)) + continue; + foreach($room->event as $event) { $start = strtotime((string)$event->date); @@ -82,6 +95,9 @@ class Schedule extends ModelBase $lastend = false; $name = (string)$room['name']; + if($this->isRoomFiltered($name)) + continue; + if(isset($mapping[$name])) $name = $mapping[$name]; |