summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authorClemens <clemens@mach.sh>2018-12-21 21:18:14 +0100
committerIgor Scheller <igor.scheller@igorshp.de>2018-12-21 21:18:14 +0100
commit482721eb1ba0ee21a3f75a8465fcf53ae08a1603 (patch)
tree0010933f60855d32f904c72e0724b4c23ca43d6d /includes
parent9a2f2465116387880282df505e3d3230516604dd (diff)
user view: Show multiple worklog entries per day
closes #531 (Multiple worklogs on same day not displayed in users shift list (but counted in sum))
Diffstat (limited to 'includes')
-rw-r--r--includes/view/User_view.php6
1 files changed, 6 insertions, 0 deletions
diff --git a/includes/view/User_view.php b/includes/view/User_view.php
index 275a31ca..c2bf4a06 100644
--- a/includes/view/User_view.php
+++ b/includes/view/User_view.php
@@ -442,7 +442,13 @@ function User_view_myshifts(
}
if ($its_me || $admin_user_worklog_privilege) {
+ $day_counter = 1;
foreach ($user_worklogs as $worklog) {
+ // Check if more than one worklog per day
+ if (isset($myshifts_table[$worklog['work_timestamp']])) {
+ $worklog['work_timestamp'] += $day_counter++;
+ }
+
$myshifts_table[$worklog['work_timestamp']] = User_view_worklog($worklog, $admin_user_worklog_privilege);
$timeSum += $worklog['work_hours'] * 3600;
}