From 60ad343b22ab3cff886e8a8c0f57d40bbff8dcfc Mon Sep 17 00:00:00 2001 From: msquare Date: Sun, 13 Jan 2019 16:04:01 +0100 Subject: fixes #178: Show not only next but also last shift in free angels view --- includes/view/User_view.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'includes/view/User_view.php') diff --git a/includes/view/User_view.php b/includes/view/User_view.php index c2bf4a06..4768f4ac 100644 --- a/includes/view/User_view.php +++ b/includes/view/User_view.php @@ -320,6 +320,23 @@ function User_shift_state_render($user) . ''; } +function User_last_shift_render($user) +{ + if (!$user->state->arrived) { + return ''; + } + + $last_shifts = ShiftEntries_finished_by_user($user->id); + if (empty($last_shifts)) { + return ''; + } + + $lastShift = array_shift($last_shifts); + return '' + . __('Shift ended %c') + . ''; +} + /** * @param array $needed_angel_type * @return string -- cgit v1.2.3-54-g00ecf