From 3d7e378b67807fe50bf893eed9de040dfdc7add3 Mon Sep 17 00:00:00 2001 From: Philip Häusler Date: Thu, 13 Aug 2015 22:57:40 +0200 Subject: change default end date on creating shifts --- includes/pages/admin_shifts.php | 2 +- includes/view/User_view.php | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/includes/pages/admin_shifts.php b/includes/pages/admin_shifts.php index 5ff46fc9..df8a7e04 100644 --- a/includes/pages/admin_shifts.php +++ b/includes/pages/admin_shifts.php @@ -10,7 +10,7 @@ function admin_shifts() { $rid = 0; $start = DateTime::createFromFormat("Y-m-d H:i", date("Y-m-d") . " 00:00")->getTimestamp(); - $end = $start + 24 * 60 * 60; + $end = $start; $mode = 'single'; $angelmode = 'manually'; $length = ''; diff --git a/includes/view/User_view.php b/includes/view/User_view.php index a3665690..eb46b55c 100644 --- a/includes/view/User_view.php +++ b/includes/view/User_view.php @@ -159,15 +159,15 @@ function User_view($user_source, $admin_user_privilege, $freeloader, $user_angel $myshift['actions'] = table_buttons($myshift['actions']); if ($shift['freeloaded']) - $timesum += - 2 * ($shift['end'] - $shift['start']); + $timesum += (- 2 * ($shift['end'] - $shift['start'])); else - $timesum += $shift['end'] - $shift['start']; + $timesum += ($shift['end'] - $shift['start']); $myshifts_table[] = $myshift; } if (count($myshifts_table) > 0) $myshifts_table[] = array( 'date' => '' . _("Sum:") . '', - 'time' => "" . round($timesum / (60 * 60), 1) . " h", + 'time' => "" . round($timesum / 3600, 1) . " h", 'room' => "", 'shift_info' => "", 'comment' => "", -- cgit v1.2.3-54-g00ecf