diff options
author | Igor Scheller <igor.scheller@igorshp.de> | 2019-06-04 20:51:26 +0200 |
---|---|---|
committer | msquare <msquare@notrademark.de> | 2019-06-04 21:23:34 +0200 |
commit | ead56a89fef63745d0e9d3a0b44ef198792c2784 (patch) | |
tree | f7831e1de0281a553c5f5df8fa0a4e1d156a8f27 /includes/view/ShiftEntry_view.php | |
parent | b6eda8dbfc9880239bdc622a0b6988ad0a8ab722 (diff) |
Only show the shift "Comment" field for own entries
Diffstat (limited to 'includes/view/ShiftEntry_view.php')
-rw-r--r-- | includes/view/ShiftEntry_view.php | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/includes/view/ShiftEntry_view.php b/includes/view/ShiftEntry_view.php index 26e9896d..689aa25a 100644 --- a/includes/view/ShiftEntry_view.php +++ b/includes/view/ShiftEntry_view.php @@ -154,7 +154,7 @@ function ShiftEntry_create_title() /** * Display form for adding/editing a shift entry. * - * @param string $angel + * @param User $angel * @param string $date * @param string $location * @param string $title @@ -187,15 +187,22 @@ function ShiftEntry_edit_view( ) ]; } + + if ($angel->id == auth()->user()->id) { + $comment = form_textarea('comment', __('Comment (for your eyes only):'), $comment); + } else { + $comment = ''; + } + return page_with_title(__('Edit shift entry'), [ msg(), form([ - form_info(__('Angel:'), $angel), + form_info(__('Angel:'), User_Nick_render($angel)), form_info(__('Date, Duration:'), $date), form_info(__('Location:'), $location), form_info(__('Title:'), $title), form_info(__('Type:'), $type), - form_textarea('comment', __('Comment (for your eyes only):'), $comment), + $comment, join('', $freeload_form), form_submit('submit', __('Save')) ]) |