summaryrefslogtreecommitdiff
path: root/includes/view/User_view.php
diff options
context:
space:
mode:
authormsquare <msquare@notrademark.de>2019-01-13 16:04:01 +0100
committermsquare <msquare@notrademark.de>2019-01-13 16:04:44 +0100
commit60ad343b22ab3cff886e8a8c0f57d40bbff8dcfc (patch)
treef2929345e47b421267c1653a7bff76449556eefd /includes/view/User_view.php
parent3a01c838af10c20c906d733d7915e3fc523a6d87 (diff)
fixes #178: Show not only next but also last shift in free angels view
Diffstat (limited to 'includes/view/User_view.php')
-rw-r--r--includes/view/User_view.php17
1 files changed, 17 insertions, 0 deletions
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)
. '</span>';
}
+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 '<span class="moment-countdown" data-timestamp="' . $lastShift['end'] . '">'
+ . __('Shift ended %c')
+ . '</span>';
+}
+
/**
* @param array $needed_angel_type
* @return string