diff options
author | Igor Scheller <igor.scheller@igorshp.de> | 2018-10-17 01:30:10 +0200 |
---|---|---|
committer | msquare <msquare@notrademark.de> | 2018-10-31 13:43:23 +0100 |
commit | a2aaba9cab6b7bdf755a023ed2503cf8cf46925a (patch) | |
tree | 04275448599cc8ffaf908b3d7fcc984d822f6a17 /includes/view/Shifts_view.php | |
parent | d7aea575ff77cd37c326511e7ac5fe49067c63ad (diff) |
User: Bugfixes & code cleanup
Diffstat (limited to 'includes/view/Shifts_view.php')
-rw-r--r-- | includes/view/Shifts_view.php | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/includes/view/Shifts_view.php b/includes/view/Shifts_view.php index 2485ec67..4c329f1b 100644 --- a/includes/view/Shifts_view.php +++ b/includes/view/Shifts_view.php @@ -76,10 +76,8 @@ function Shift_editor_info_render($shift) */ function Shift_signup_button_render($shift, $angeltype, $user_angeltype = null) { - $user = auth()->user(); - if (empty($user_angeltype)) { - $user_angeltype = UserAngelType_by_User_and_AngelType($user->id, $angeltype); + $user_angeltype = UserAngelType_by_User_and_AngelType(auth()->user()->id, $angeltype); } if ($angeltype['shift_signup_state']->isSignupAllowed()) { @@ -105,7 +103,6 @@ function Shift_signup_button_render($shift, $angeltype, $user_angeltype = null) function Shift_view($shift, $shifttype, $room, $angeltypes_source, ShiftSignupState $shift_signup_state) { global $privileges; - $user = auth()->user(); $shift_admin = in_array('admin_shifts', $privileges); $user_shift_admin = in_array('user_shifts_admin', $privileges); @@ -143,7 +140,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->id), '<span class="icon-icon_angel"></span> ' . __('My shifts')); + $buttons[] = button(user_link(auth()->user()->id), '<span class="icon-icon_angel"></span> ' . __('My shifts')); $content[] = buttons($buttons); $content[] = Shift_view_header($shift, $room); |