|
|
@ -177,18 +177,19 @@ function view_user_shifts()
|
|
|
|
$rooms = load_rooms();
|
|
|
|
$rooms = load_rooms();
|
|
|
|
$types = load_types();
|
|
|
|
$types = load_types();
|
|
|
|
|
|
|
|
|
|
|
|
if (!$session->has('ShiftsFilter')) {
|
|
|
|
if (!$session->has('shifts-filter')) {
|
|
|
|
$room_ids = [
|
|
|
|
$room_ids = [
|
|
|
|
$rooms[0]['id']
|
|
|
|
$rooms[0]['id']
|
|
|
|
];
|
|
|
|
];
|
|
|
|
$type_ids = array_map('get_ids_from_array', $types);
|
|
|
|
$type_ids = array_map('get_ids_from_array', $types);
|
|
|
|
$shiftsFilter = new ShiftsFilter(in_array('user_shifts_admin', $privileges), $room_ids, $type_ids);
|
|
|
|
$shiftsFilter = new ShiftsFilter(in_array('user_shifts_admin', $privileges), $room_ids, $type_ids);
|
|
|
|
$session->set('ShiftsFilter', $shiftsFilter);
|
|
|
|
$session->set('shifts-filter', $shiftsFilter->sessionExport());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/** @var ShiftsFilter $shiftsFilter */
|
|
|
|
$shiftsFilter = new ShiftsFilter();
|
|
|
|
$shiftsFilter = $session->get('ShiftsFilter');
|
|
|
|
$shiftsFilter->sessionImport($session->get('shifts-filter'));
|
|
|
|
update_ShiftsFilter($shiftsFilter, in_array('user_shifts_admin', $privileges), $days);
|
|
|
|
update_ShiftsFilter($shiftsFilter, in_array('user_shifts_admin', $privileges), $days);
|
|
|
|
|
|
|
|
$session->set('shifts-filter', $shiftsFilter->sessionExport());
|
|
|
|
|
|
|
|
|
|
|
|
$shiftCalendarRenderer = shiftCalendarRendererByShiftFilter($shiftsFilter);
|
|
|
|
$shiftCalendarRenderer = shiftCalendarRendererByShiftFilter($shiftsFilter);
|
|
|
|
|
|
|
|
|
|
|
|