summaryrefslogtreecommitdiff
path: root/includes/view
diff options
context:
space:
mode:
authormsquare <msquare@notrademark.de>2017-12-26 12:17:51 +0100
committermsquare <msquare@notrademark.de>2017-12-26 12:17:51 +0100
commita7dc640385460f908e1f17ed914338f616c51c41 (patch)
tree6ef1c9553facd2674c52aaa6646d8eb6ef9bc523 /includes/view
parent010199328498888872cf3c023e163c02872fff8f (diff)
add my shifts button to shift view
Diffstat (limited to 'includes/view')
-rw-r--r--includes/view/Shifts_view.php12
1 files 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), '<span class="icon-icon_angel"></span> ' . _('My shifts'))
+ ] : [
+ button(user_link($user), '<span class="icon-icon_angel"></span> ' . _('My shifts'))
+ ]),
Shift_view_header($shift, $room),
div('row', [
div('col-sm-6', [