diff options
author | msquare <msquare@notrademark.de> | 2017-09-11 17:52:55 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-09-11 17:52:55 +0200 |
commit | 359160613027a480620e22deef19ff883eaaeb21 (patch) | |
tree | 310600aaa23404f0cd7d3e198bacdbc93645da32 /includes/pages/user_shifts.php | |
parent | 581b81f1b25dc6b6f0a3b34810c293738fd40217 (diff) | |
parent | 0a20883aa862779b48fd2a297456c2db04cffb95 (diff) |
Merge pull request #344 from MyIgel/master
Prepared routing, added symfony http Closes #336 and closes #337
Diffstat (limited to 'includes/pages/user_shifts.php')
-rw-r--r-- | includes/pages/user_shifts.php | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/includes/pages/user_shifts.php b/includes/pages/user_shifts.php index 813cb9b3..2bd7688f 100644 --- a/includes/pages/user_shifts.php +++ b/includes/pages/user_shifts.php @@ -167,20 +167,23 @@ function view_user_shifts() { global $user, $privileges, $ical_shifts; + $session = session(); $ical_shifts = []; $days = load_days(); $rooms = load_rooms(); $types = load_types(); - if (!isset($_SESSION['ShiftsFilter'])) { + if (!$session->has('ShiftsFilter')) { $room_ids = [ $rooms[0]['id'] ]; $type_ids = array_map('get_ids_from_array', $types); - $_SESSION['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); } - update_ShiftsFilter($_SESSION['ShiftsFilter'], in_array('user_shifts_admin', $privileges), $days); - $shiftsFilter = $_SESSION['ShiftsFilter']; + + $shiftsFilter = $session->get('ShiftsFilter'); + update_ShiftsFilter($shiftsFilter, in_array('user_shifts_admin', $privileges), $days); $shiftCalendarRenderer = shiftCalendarRendererByShiftFilter($shiftsFilter); @@ -203,6 +206,11 @@ function view_user_shifts() $end_day = date('Y-m-d', $shiftsFilter->getEndTime()); $end_time = date('H:i', $shiftsFilter->getEndTime()); + $assignNotice = ''; + if (config('signup_requires_arrival') && !$user['Gekommen']) { + $assignNotice = info(render_user_arrived_hint(), true); + } + return page([ div('col-md-12', [ msg(), @@ -223,15 +231,16 @@ function view_user_shifts() 'task_notice' => '<sup>1</sup>' . _('The tasks shown here are influenced by the angeltypes you joined already!') - . ' <a href="' . page_link_to('angeltypes') . '&action=about' . '">' + . ' <a href="' . page_link_to('angeltypes', ['action' => 'about']) . '">' . _('Description of the jobs.') . '</a>', + 'assign_notice' => $assignNotice, 'shifts_table' => msg() . $shiftCalendarRenderer->render(), 'ical_text' => '<h2>' . _('iCal export') . '</h2><p>' . sprintf( _('Export of shown shifts. <a href="%s">iCal format</a> or <a href="%s">JSON format</a> available (please keep secret, otherwise <a href="%s">reset the api key</a>).'), - page_link_to_absolute('ical') . '&key=' . $user['api_key'], - page_link_to_absolute('shifts_json_export') . '&key=' . $user['api_key'], - page_link_to('user_myshifts') . '&reset' + page_link_to('ical', ['key' => $user['api_key']]), + page_link_to('shifts_json_export', ['key' => $user['api_key']]), + page_link_to('user_myshifts', ['reset' => 1]) ) . '</p>', 'filter' => _('Filter') ]) |