2014-12-22 17:55:20 +01:00
|
|
|
<?php
|
2017-08-30 00:07:01 +02:00
|
|
|
|
2016-10-05 22:28:39 +02:00
|
|
|
use Engelsystem\ShiftCalendarRenderer;
|
2017-01-02 15:43:36 +01:00
|
|
|
use Engelsystem\ShiftsFilterRenderer;
|
2016-10-05 18:56:50 +02:00
|
|
|
|
2017-01-03 03:22:48 +01:00
|
|
|
/**
|
|
|
|
* @param array $room
|
|
|
|
* @param ShiftsFilterRenderer $shiftsFilterRenderer
|
|
|
|
* @param ShiftCalendarRenderer $shiftCalendarRenderer
|
|
|
|
* @return string
|
|
|
|
*/
|
2017-01-02 03:57:23 +01:00
|
|
|
function Room_view($room, ShiftsFilterRenderer $shiftsFilterRenderer, ShiftCalendarRenderer $shiftCalendarRenderer)
|
|
|
|
{
|
|
|
|
return page_with_title(glyph('map-marker') . $room['Name'], [
|
2017-01-02 15:43:36 +01:00
|
|
|
$shiftsFilterRenderer->render(room_link($room)),
|
|
|
|
$shiftCalendarRenderer->render()
|
|
|
|
]);
|
2016-10-05 18:56:50 +02:00
|
|
|
}
|
2014-12-22 17:55:20 +01:00
|
|
|
|
2017-01-03 03:22:48 +01:00
|
|
|
/**
|
|
|
|
* @param array $room
|
|
|
|
* @return string
|
|
|
|
*/
|
2017-01-02 03:57:23 +01:00
|
|
|
function Room_name_render($room)
|
|
|
|
{
|
|
|
|
global $privileges;
|
|
|
|
if (in_array('view_rooms', $privileges)) {
|
|
|
|
return '<a href="' . room_link($room) . '">' . glyph('map-marker') . $room['Name'] . '</a>';
|
|
|
|
}
|
|
|
|
return glyph('map-marker') . $room['Name'];
|
2014-12-22 17:55:20 +01:00
|
|
|
}
|