From ead56a89fef63745d0e9d3a0b44ef198792c2784 Mon Sep 17 00:00:00 2001 From: Igor Scheller Date: Tue, 4 Jun 2019 20:51:26 +0200 Subject: Only show the shift "Comment" field for own entries --- includes/pages/user_myshifts.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'includes/pages') diff --git a/includes/pages/user_myshifts.php b/includes/pages/user_myshifts.php index 9ab86f2a..f962225e 100644 --- a/includes/pages/user_myshifts.php +++ b/includes/pages/user_myshifts.php @@ -87,8 +87,11 @@ function user_myshifts() } } - $comment = strip_request_item_nl('comment'); + $comment = $shift['Comment']; $user_source = User::find($shift['UID']); + if (auth()->user()->id == $user_source->id) { + $comment = strip_request_item_nl('comment'); + } if ($valid) { ShiftEntry_update([ @@ -111,7 +114,7 @@ function user_myshifts() } return ShiftEntry_edit_view( - User_Nick_render($shifts_user), + $shifts_user, date('Y-m-d H:i', $shift['start']) . ', ' . shift_length($shift), $shift['Name'], $shift['name'], -- cgit v1.2.3-54-g00ecf