From 893259c22b0774cf1cb2d844c921a1308fa5a182 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Tue, 31 Dec 2019 19:54:45 +0100 Subject: [PATCH] add todos from github --- Controller/BackendController.php | 14 +++----------- Models/SessionMapper.php | 5 +++-- Theme/Backend/private-dashboard.tpl.php | 1 - 3 files changed, 6 insertions(+), 14 deletions(-) diff --git a/Controller/BackendController.php b/Controller/BackendController.php index 02fd366..0196f8e 100644 --- a/Controller/BackendController.php +++ b/Controller/BackendController.php @@ -14,6 +14,7 @@ declare(strict_types=1); namespace Modules\HumanResourceTimeRecording\Controller; +use Modules\Dashboard\Models\DashboardElementInterface; use Modules\HumanResourceTimeRecording\Models\SessionMapper; use phpOMS\Contract\RenderableInterface; @@ -32,19 +33,10 @@ use phpOMS\Views\PaginationView; * @link https://orange-management.org * @since 1.0.0 */ -final class BackendController extends Controller +final class BackendController extends Controller implements DashboardElementInterface { /** - * Routing end-point for application behaviour. - * - * @param RequestAbstract $request Request - * @param ResponseAbstract $response Response - * @param mixed $data Generic data - * - * @return RenderableInterface - * - * @since 1.0.0 - * @codeCoverageIgnore + * {@inheritdoc} */ public function viewDashboard(RequestAbstract $request, ResponseAbstract $response, $data = null) : RenderableInterface { diff --git a/Models/SessionMapper.php b/Models/SessionMapper.php index 9a8c33e..ee7a744 100644 --- a/Models/SessionMapper.php +++ b/Models/SessionMapper.php @@ -102,8 +102,9 @@ final class SessionMapper extends DataMapperAbstract * * @return Session[] * - * @todo: consider selecting only active employees - * @todo: consider using a datetime to limit the results to look for + * @todo Orange-Management/Modules#189 + * Currently the last work session of all employees is returned. This should be optionally reduced to only return active employees. + * Alternatively it might make sense to limit the last session by an oldest date. * * @since 1.0.0 */ diff --git a/Theme/Backend/private-dashboard.tpl.php b/Theme/Backend/private-dashboard.tpl.php index f4f2df3..fe669a2 100644 --- a/Theme/Backend/private-dashboard.tpl.php +++ b/Theme/Backend/private-dashboard.tpl.php @@ -26,7 +26,6 @@ $lastOpenSession = $this->getData('lastSession'); $type = $lastOpenSession !== null ? $lastOpenSession->getType() : ClockingType::OFFICE; $status = $lastOpenSession !== null ? $lastOpenSession->getStatus() : ClockingStatus::END; -// @todo: users may have a different definition of week start! /** @var \phpOMS\Stdlib\Base\SmartDateTime $startWeek */ $startWeek = new SmartDateTime('now'); $startWeek = $startWeek->getStartOfWeek();