diff --git a/Admin/Install/Navigation.install.json b/Admin/Install/Navigation.install.json index de0284e..cfeb663 100644 --- a/Admin/Install/Navigation.install.json +++ b/Admin/Install/Navigation.install.json @@ -56,7 +56,7 @@ "icon": null, "order": 1, "from": "HumanResourceTimeRecording", - "permission": { "permission": 2, "type": null, "element": null }, + "permission": { "permission": 2, "type": 2, "element": null }, "parent": 1003401001, "children": [] } diff --git a/Controller/BackendController.php b/Controller/BackendController.php index 807f202..02fd366 100644 --- a/Controller/BackendController.php +++ b/Controller/BackendController.php @@ -80,6 +80,7 @@ final class BackendController extends Controller $lastOpenSession = SessionMapper::getMostPlausibleOpenSessionForEmployee($employee); $start = new SmartDateTime('now'); + $start = $start->getEndOfDay(); $limit = $start->getEndOfMonth(); $limit->smartModify(0, -2, 0); diff --git a/Models/SessionMapper.php b/Models/SessionMapper.php index 63983d7..9a8c33e 100644 --- a/Models/SessionMapper.php +++ b/Models/SessionMapper.php @@ -181,7 +181,7 @@ final class SessionMapper extends DataMapperAbstract $query = new Builder(self::$db); $query = self::getQuery($query) ->where(self::$table . '.hr_timerecording_session_employee', '=', $employee) - ->andWhere(self::$table . '.' . self::$createdAt, '<=', $start->format('Y-m-d')) + ->andWhere(self::$table . '.' . self::$createdAt, '<=', $start->format('Y-m-d H:i:s')) ->orderBy(self::$table . '.' . self::$createdAt, 'DESC') ->offset($offset) ->limit($limit); diff --git a/Theme/Backend/private-dashboard.tpl.php b/Theme/Backend/private-dashboard.tpl.php index c3fd024..4ddea96 100644 --- a/Theme/Backend/private-dashboard.tpl.php +++ b/Theme/Backend/private-dashboard.tpl.php @@ -80,7 +80,13 @@ show additional section with vacation days - + @@ -148,7 +154,7 @@ show additional section with vacation days getBreak() / 3600); ?>h getBreak() / 60) % 60); ?>m getEnd() !== null ? $session->getEnd()->format('H:i') : ''; ?> getBusy() / 3600); ?>h getBusy() / 60) % 60); ?>m - getStart()->getTimestamp() < $startWeek->getTimestamp() || $count === $sessionCount) : ?> + getBusy(); if ($session->getStart()->getTimestamp() < $startWeek->getTimestamp() || $count === $sessionCount) : ?> format('Y/m/d'); ?> - format('Y/m/d'); ?> h m @@ -157,9 +163,8 @@ show additional section with vacation days $startWeek = $startWeek->createModify(0, 0, -7); $busy['week'] = 0; endif; - $busy['week'] += $session->getBusy(); ?> - getStart()->getTimestamp() < $startMonth->getTimestamp() || $count === $sessionCount) : ?> + getBusy(); if ($session->getStart()->getTimestamp() < $startMonth->getTimestamp() || $count === $sessionCount) : ?> format('Y/m/d'); ?> - format('Y/m/d'); ?> h m @@ -168,7 +173,6 @@ show additional section with vacation days $startMonth = $startMonth->createModify(0, -1, 0); $busy['month'] = 0; endif; - $busy['month'] += $session->getBusy(); ?>