From a7dc640385460f908e1f17ed914338f616c51c41 Mon Sep 17 00:00:00 2001 From: msquare Date: Tue, 26 Dec 2017 12:17:51 +0100 Subject: [PATCH] add my shifts button to shift view --- includes/view/Shifts_view.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/includes/view/Shifts_view.php b/includes/view/Shifts_view.php index 7fc56d1d..44c879d2 100644 --- a/includes/view/Shifts_view.php +++ b/includes/view/Shifts_view.php @@ -103,7 +103,7 @@ function Shift_signup_button_render($shift, $angeltype, $user_angeltype = null) */ function Shift_view($shift, $shifttype, $room, $angeltypes_source, ShiftSignupState $shift_signup_state) { - global $privileges; + global $user, $privileges; $shift_admin = in_array('admin_shifts', $privileges); $user_shift_admin = in_array('user_shifts_admin', $privileges); @@ -132,12 +132,16 @@ function Shift_view($shift, $shifttype, $room, $angeltypes_source, ShiftSignupSt $shift_signup_state->getState() == ShiftSignupState::SIGNED_UP ? info(_('You are signed up for this shift.'), true) : '', - ($shift_admin || $admin_shifttypes || $admin_rooms) ? buttons([ + buttons( + ($shift_admin || $admin_shifttypes || $admin_rooms) ? [ $shift_admin ? button(shift_edit_link($shift), glyph('pencil') . _('edit')) : '', $shift_admin ? button(shift_delete_link($shift), glyph('trash') . _('delete')) : '', $admin_shifttypes ? button(shifttype_link($shifttype), $shifttype['name']) : '', - $admin_rooms ? button(room_link($room), glyph('map-marker') . $room['Name']) : '' - ]) : '', + $admin_rooms ? button(room_link($room), glyph('map-marker') . $room['Name']) : '', + button(user_link($user), ' ' . _('My shifts')) + ] : [ + button(user_link($user), ' ' . _('My shifts')) + ]), Shift_view_header($shift, $room), div('row', [ div('col-sm-6', [