mirror of
https://github.com/Karaka-Management/oms-HumanResourceTimeRecording.git
synced 2026-02-13 19:28:41 +00:00
add todos from github
This commit is contained in:
parent
f5497970f3
commit
893259c22b
|
|
@ -14,6 +14,7 @@ declare(strict_types=1);
|
||||||
|
|
||||||
namespace Modules\HumanResourceTimeRecording\Controller;
|
namespace Modules\HumanResourceTimeRecording\Controller;
|
||||||
|
|
||||||
|
use Modules\Dashboard\Models\DashboardElementInterface;
|
||||||
use Modules\HumanResourceTimeRecording\Models\SessionMapper;
|
use Modules\HumanResourceTimeRecording\Models\SessionMapper;
|
||||||
|
|
||||||
use phpOMS\Contract\RenderableInterface;
|
use phpOMS\Contract\RenderableInterface;
|
||||||
|
|
@ -32,19 +33,10 @@ use phpOMS\Views\PaginationView;
|
||||||
* @link https://orange-management.org
|
* @link https://orange-management.org
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
final class BackendController extends Controller
|
final class BackendController extends Controller implements DashboardElementInterface
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Routing end-point for application behaviour.
|
* {@inheritdoc}
|
||||||
*
|
|
||||||
* @param RequestAbstract $request Request
|
|
||||||
* @param ResponseAbstract $response Response
|
|
||||||
* @param mixed $data Generic data
|
|
||||||
*
|
|
||||||
* @return RenderableInterface
|
|
||||||
*
|
|
||||||
* @since 1.0.0
|
|
||||||
* @codeCoverageIgnore
|
|
||||||
*/
|
*/
|
||||||
public function viewDashboard(RequestAbstract $request, ResponseAbstract $response, $data = null) : RenderableInterface
|
public function viewDashboard(RequestAbstract $request, ResponseAbstract $response, $data = null) : RenderableInterface
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -102,8 +102,9 @@ final class SessionMapper extends DataMapperAbstract
|
||||||
*
|
*
|
||||||
* @return Session[]
|
* @return Session[]
|
||||||
*
|
*
|
||||||
* @todo: consider selecting only active employees
|
* @todo Orange-Management/Modules#189
|
||||||
* @todo: consider using a datetime to limit the results to look for
|
* 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
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,6 @@ $lastOpenSession = $this->getData('lastSession');
|
||||||
$type = $lastOpenSession !== null ? $lastOpenSession->getType() : ClockingType::OFFICE;
|
$type = $lastOpenSession !== null ? $lastOpenSession->getType() : ClockingType::OFFICE;
|
||||||
$status = $lastOpenSession !== null ? $lastOpenSession->getStatus() : ClockingStatus::END;
|
$status = $lastOpenSession !== null ? $lastOpenSession->getStatus() : ClockingStatus::END;
|
||||||
|
|
||||||
// @todo: users may have a different definition of week start!
|
|
||||||
/** @var \phpOMS\Stdlib\Base\SmartDateTime $startWeek */
|
/** @var \phpOMS\Stdlib\Base\SmartDateTime $startWeek */
|
||||||
$startWeek = new SmartDateTime('now');
|
$startWeek = new SmartDateTime('now');
|
||||||
$startWeek = $startWeek->getStartOfWeek();
|
$startWeek = $startWeek->getStartOfWeek();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user