diff options
-rw-r--r-- | includes/controller/shifts_controller.php | 2 | ||||
-rw-r--r-- | includes/pages/user_shifts.php | 7 | ||||
-rw-r--r-- | includes/view/Shifts_view.php | 20 |
3 files changed, 17 insertions, 12 deletions
diff --git a/includes/controller/shifts_controller.php b/includes/controller/shifts_controller.php index 041f21e2..126678a7 100644 --- a/includes/controller/shifts_controller.php +++ b/includes/controller/shifts_controller.php @@ -45,7 +45,7 @@ function shift_controller() { return [ $shift['name'], - Shift_view($shift, $shifttype, $room, in_array('admin_shifts', $privileges), $angeltypes, in_array('user_shifts_admin', $privileges)) + Shift_view($shift, $shifttype, $room, in_array('admin_shifts', $privileges), $angeltypes, in_array('user_shifts_admin', $privileges), in_array('admin_rooms', $privileges), in_array('shifttypes', $privileges)) ]; } diff --git a/includes/pages/user_shifts.php b/includes/pages/user_shifts.php index 70a674fb..9ec79438 100644 --- a/includes/pages/user_shifts.php +++ b/includes/pages/user_shifts.php @@ -676,11 +676,14 @@ function view_user_shifts() { $info[] = date("Y-m-d", $shift['start']); $info[] = date("H:i", $shift['start']) . ' - ' . date("H:i", $shift['end']); if (count($_SESSION['user_shifts']['rooms']) > 1) - $info[] = $shift['room_name']; + $info[] = Room_name_render([ + 'Name' => $shift['room_name'], + 'RID' => $shift['RID'] + ]); $shift_row = array( 'info' => join('<br />', $info), - 'entries' => $shift['name'] + 'entries' => '<a href="' . shift_link($shift) . '">' . $shift['name'] . '</a>' . ($shift['title'] ? '<br />' . $shift['title'] : '') ); if (in_array('admin_shifts', $privileges)) diff --git a/includes/view/Shifts_view.php b/includes/view/Shifts_view.php index 91a553ec..594cb33c 100644 --- a/includes/view/Shifts_view.php +++ b/includes/view/Shifts_view.php @@ -1,6 +1,6 @@ <?php -function Shift_view($shift, $shifttype, $room, $shift_admin, $angeltypes_source, $user_shift_admin) { +function Shift_view($shift, $shifttype, $room, $shift_admin, $angeltypes_source, $user_shift_admin, $admin_rooms, $admin_shifttypes) { $parsedown = new Parsedown(); $angeltypes = []; @@ -42,9 +42,11 @@ function Shift_view($shift, $shifttype, $room, $shift_admin, $angeltypes_source, return page_with_title($shift['name'] . ' <small class="moment-countdown" data-timestamp="' . $shift['start'] . '">%c</small>', [ msg(), - $shift_admin ? buttons([ - button(shift_edit_link($shift), glyph('pencil') . _('edit')), - button(shift_delete_link($shift), glyph('trash') . _('delete')) + ($shift_admin || $admin_shifttypes || $admin_rooms) ? buttons([ + $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']) : '' ]) : '', div('row', [ div('col-sm-3 col-xs-6', [ @@ -54,22 +56,22 @@ function Shift_view($shift, $shifttype, $room, $shift_admin, $angeltypes_source, div('col-sm-3 col-xs-6', [ '<h4>' . _('Start') . '</h4>', '<p class="lead">', - date('y-m-d', $shift['start']), + glyph('calendar') . date('y-m-d', $shift['start']), '<br />', - date('H:i', $shift['start']), + glyph('time') . date('H:i', $shift['start']), '</p>' ]), div('col-sm-3 col-xs-6', [ '<h4>' . _('End') . '</h4>', '<p class="lead">', - date('y-m-d', $shift['end']), + glyph('calendar') . date('y-m-d', $shift['end']), '<br />', - date('H:i', $shift['end']), + glyph('time') . date('H:i', $shift['end']), '</p>' ]), div('col-sm-3 col-xs-6', [ '<h4>' . _('Location') . '</h4>', - '<p class="lead">' . $room['Name'] . '</p>' + '<p class="lead">' . glyph('map-marker') . $room['Name'] . '</p>' ]) ]), div('row', [ |