From 89e62c95a7ffd71a8e860f59378ecd13d6cbb196 Mon Sep 17 00:00:00 2001 From: Igor Scheller Date: Tue, 9 Oct 2018 21:47:31 +0200 Subject: Changed more functions :tada: --- includes/view/Shifts_view.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'includes/view/Shifts_view.php') diff --git a/includes/view/Shifts_view.php b/includes/view/Shifts_view.php index 92447efd..bd13a390 100644 --- a/includes/view/Shifts_view.php +++ b/includes/view/Shifts_view.php @@ -75,10 +75,10 @@ function Shift_editor_info_render($shift) */ function Shift_signup_button_render($shift, $angeltype, $user_angeltype = null) { - global $user; + $user = auth()->user(); if (empty($user_angeltype)) { - $user_angeltype = UserAngelType_by_User_and_AngelType($user, $angeltype); + $user_angeltype = UserAngelType_by_User_and_AngelType($user->id, $angeltype); } if ($angeltype['shift_signup_state']->isSignupAllowed()) { @@ -103,7 +103,8 @@ function Shift_signup_button_render($shift, $angeltype, $user_angeltype = null) */ function Shift_view($shift, $shifttype, $room, $angeltypes_source, ShiftSignupState $shift_signup_state) { - global $user, $privileges; + global $privileges; + $user = auth()->user(); $shift_admin = in_array('admin_shifts', $privileges); $user_shift_admin = in_array('user_shifts_admin', $privileges); @@ -141,7 +142,7 @@ function Shift_view($shift, $shifttype, $room, $angeltypes_source, ShiftSignupSt $admin_rooms ? button(room_link($room), glyph('map-marker') . $room['Name']) : '', ]; } - $buttons[] = button(user_link($user['UID']), ' ' . __('My shifts')); + $buttons[] = button(user_link($user->id), ' ' . __('My shifts')); $content[] = buttons($buttons); $content[] = Shift_view_header($shift, $room); -- cgit v1.2.3-54-g00ecf