summaryrefslogtreecommitdiff
path: root/includes/view/Shifts_view.php
diff options
context:
space:
mode:
Diffstat (limited to 'includes/view/Shifts_view.php')
-rw-r--r--includes/view/Shifts_view.php9
1 files changed, 5 insertions, 4 deletions
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']), '<span class="icon-icon_angel"></span> ' . __('My shifts'));
+ $buttons[] = button(user_link($user->id), '<span class="icon-icon_angel"></span> ' . __('My shifts'));
$content[] = buttons($buttons);
$content[] = Shift_view_header($shift, $room);