diff options
-rw-r--r-- | model/Schedule.php | 24 | ||||
-rw-r--r-- | template/assemblies/schedule.phtml | 2 | ||||
-rw-r--r-- | view/multiview.php | 2 | ||||
-rw-r--r-- | view/streams-json-v1.php | 1 | ||||
-rw-r--r-- | view/streams-json-v2.php | 1 |
5 files changed, 22 insertions, 8 deletions
diff --git a/model/Schedule.php b/model/Schedule.php index 4c0a802..58442a4 100644 --- a/model/Schedule.php +++ b/model/Schedule.php @@ -34,6 +34,16 @@ class Schedule return floatval($this->getConference()->get('SCHEDULE.SCALE', 7)); } + public function isRoomMapped($scheduleRoom) { + $mapping = $this->getScheduleToRoomSlugMapping(); + return isset( $mapping[$scheduleRoom] ); + } + + public function getMappedRoom($scheduleRoom) { + $mapping = $this->getScheduleToRoomSlugMapping(); + return $this->getConference()->getRoomIfExists( $mapping[$scheduleRoom] ); + } + private function fetchSchedule() { $schedule = @file_get_contents($this->getScheduleCache()); @@ -54,7 +64,6 @@ class Schedule if(!$schedule) return []; - $mapping = $this->getScheduleToRoomSlugMapping(); $program = array(); // re-calculate day-ends @@ -115,8 +124,6 @@ class Schedule if($this->isRoomFiltered($name)) continue; - $room_known = isset($mapping[$name]); - $eventsSorted = []; foreach($room->event as $event) { @@ -150,7 +157,7 @@ class Schedule 'start' => $lastend, 'end' => $start, 'duration' => $pauseduration, - 'room_known' => $room_known, + 'room_known' => $this->isRoomMapped($name), ); } else if(!$lastend && $daystart < $start) @@ -164,7 +171,7 @@ class Schedule 'start' => $daystart, 'end' => $start, 'duration' => $start - $daystart, - 'room_known' => $room_known, + 'room_known' => $this->isRoomMapped($name), ); } @@ -182,7 +189,7 @@ class Schedule 'start' => $start, 'end' => $end, 'duration' => $duration, - 'room_known' => $room_known, + 'room_known' => $this->isRoomMapped($name), ); $lastend = $end; @@ -219,6 +226,7 @@ class Schedule } + $mapping = $this->getScheduleToRoomSlugMapping(); if($this->getConference()->has('SCHEDULE.ROOMFILTER')) { // sort by roomfilter @@ -277,6 +285,10 @@ class Schedule { if(isset($room['SCHEDULE_NAME'])) $mapping[ $room['SCHEDULE_NAME'] ] = $slug; + else if(isset($room['DISPLAY'])) + $mapping[ $room['DISPLAY'] ] = $slug; + else + $mapping[ $slug ] = $slug; } return $mapping; diff --git a/template/assemblies/schedule.phtml b/template/assemblies/schedule.phtml index ad58ce7..62eb077 100644 --- a/template/assemblies/schedule.phtml +++ b/template/assemblies/schedule.phtml @@ -3,6 +3,7 @@ <div class="now"><span>now</span></div> <? $rooms = $schedule->getSchedule() ?> <? foreach($rooms as $roomname => $events): ?> + <? $scheduleRoom = $schedule->getMappedRoom($roomname) ?> <div class="room <? if(isset($room) && $roomname == $room->getScheduleName()): ?>highlight<? endif ?>" style="width: <?=round($schedule->getDurationSum() / $schedule->getScale())?>px"> <? $fromstart = 0; ?> <? foreach($events as $event): ?> @@ -13,7 +14,6 @@ data-end="<?=intval($event['end'])?>" > <? $fromstart += $event['duration'] ?> - <? $scheduleRoom = $conference->getRoomIfExists($roomname) ?> <? if($scheduleRoom): ?> <a class="inner" diff --git a/view/multiview.php b/view/multiview.php index eebf81e..6825911 100644 --- a/view/multiview.php +++ b/view/multiview.php @@ -4,6 +4,6 @@ echo $tpl->render(array( 'page' => 'multiview', 'title' => 'Stream-Übersicht', - 'rooms' => Room::rooms(), + 'rooms' => $conference->getRooms(), 'selection' => @$_GET['selection'], )); diff --git a/view/streams-json-v1.php b/view/streams-json-v1.php index 19f7b0d..055f6bc 100644 --- a/view/streams-json-v1.php +++ b/view/streams-json-v1.php @@ -2,6 +2,7 @@ header('Content-Type: application/json'); +$struct = []; foreach (Conferences::getActiveConferences() as $conference) { $overview = $conference->getOverview(); diff --git a/view/streams-json-v2.php b/view/streams-json-v2.php index 1e4c89b..05d2af5 100644 --- a/view/streams-json-v2.php +++ b/view/streams-json-v2.php @@ -2,6 +2,7 @@ header('Content-Type: application/json'); +$struct = []; foreach (Conferences::getActiveConferences() as $conference) { $overview = $conference->getOverview(); |