summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authorIgor Scheller <igor.scheller@igorshp.de>2019-08-24 12:32:34 +0200
committerIgor Scheller <igor.scheller@igorshp.de>2019-08-24 12:32:34 +0200
commita51bfae6e58a736dacaba0b670cd2dfbd6e942be (patch)
tree2c241115d45fc60c325dd6e2ccaf1e5f07b1190e /includes
parent100602437f5efabbd91ab1762c30efdae2e84750 (diff)
User view: Fix shifts order if user has worklogs
Diffstat (limited to 'includes')
-rw-r--r--includes/view/User_view.php12
1 files changed, 4 insertions, 8 deletions
diff --git a/includes/view/User_view.php b/includes/view/User_view.php
index f44f47ca..bfe7e02c 100644
--- a/includes/view/User_view.php
+++ b/includes/view/User_view.php
@@ -471,7 +471,8 @@ function User_view_myshifts(
$myshifts_table = [];
$timeSum = 0;
foreach ($shifts as $shift) {
- $myshifts_table[$shift['start'] . $shift['SID']] = User_view_myshift($shift, $user_source, $its_me);
+ $key = $shift['start'] . '-shift-' . $shift['SID'];
+ $myshifts_table[$key] = User_view_myshift($shift, $user_source, $its_me);
if (!$shift['freeloaded']) {
$timeSum += ($shift['end'] - $shift['start']);
@@ -479,14 +480,9 @@ 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);
+ $key = $worklog['work_timestamp'] . '-worklog-' . $worklog['id'];
+ $myshifts_table[$key] = User_view_worklog($worklog, $admin_user_worklog_privilege);
$timeSum += $worklog['work_hours'] * 3600;
}
}