diff options
author | msquare <msquare@notrademark.de> | 2016-10-05 22:28:39 +0200 |
---|---|---|
committer | msquare <msquare@notrademark.de> | 2016-10-05 22:28:39 +0200 |
commit | 6d97aa2d273464e3cb6703a0527793c52583d4cd (patch) | |
tree | e2c6780b096161d374627119a91397ab160da4f6 /includes/controller/rooms_controller.php | |
parent | 6fff6a6c1a5a4ae6c6977c3aeb4ac532ba09a395 (diff) |
continue working on shifts calendar renderer
Diffstat (limited to 'includes/controller/rooms_controller.php')
-rw-r--r-- | includes/controller/rooms_controller.php | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/includes/controller/rooms_controller.php b/includes/controller/rooms_controller.php index da5bdba1..4573409a 100644 --- a/includes/controller/rooms_controller.php +++ b/includes/controller/rooms_controller.php @@ -1,6 +1,7 @@ <?php use Engelsystem\ShiftsFilterRenderer; use Engelsystem\ShiftsFilter; +use Engelsystem\ShiftCalendarRenderer; /** * Room controllers for managing everything room related. @@ -26,18 +27,27 @@ function room_controller() { } } - $shiftsFilter = new ShiftsFilter(false, [ + $shiftsFilter = new ShiftsFilter(true, [ $room['RID'] - ], []); - $shiftsFilter->setStartTime(time()); - $shiftsFilter->setEndTime(time() + 24 * 60 * 60); + ], AngelType_ids()); + $selected_day = date("Y-m-d"); + if (! empty($days)) { + $selected_day = $days[0]; + } + if (isset($_REQUEST['shifts_filter_day'])) { + $selected_day = $_REQUEST['shifts_filter_day']; + } + $shiftsFilter->setStartTime(parse_date("Y-m-d H:i", $selected_day . ' 00:00')); + $shiftsFilter->setEndTime(parse_date("Y-m-d H:i", $selected_day . ' 23:59')); $shiftsFilterRenderer = new ShiftsFilterRenderer($shiftsFilter); - $shiftsFilterRenderer->enableDaySelection($days, EventConfig()); + $shiftsFilterRenderer->enableDaySelection($days); + + $shifts = Shifts_by_ShiftsFilter($shiftsFilter, $user); return [ $room['Name'], - Room_view($room, $shiftsFilterRenderer) + Room_view($room, $shiftsFilterRenderer, new ShiftCalendarRenderer($shifts, $shiftsFilter)) ]; } |