oms-HumanResourceTimeRecording/Theme/Backend/dashboard.tpl.php
Dennis Eichhorn bf9a78b535
Some checks failed
Image optimization / general_image_workflow (push) Has been cancelled
CI / general_module_workflow_php (push) Has been cancelled
CI / general_module_workflow_js (push) Has been cancelled
many bug fixes
2025-03-11 03:09:21 +00:00

67 lines
2.9 KiB
PHP
Executable File

<?php
/**
* Jingga
*
* PHP Version 8.2
*
* @package HumanResourceTimeRecording
* @copyright Dennis Eichhorn
* @license OMS License 2.2
* @version 1.0.0
* @link https://jingga.app
*/
declare(strict_types=1);
use Modules\HumanResourceTimeRecording\Models\ClockingType;
use phpOMS\Uri\UriFactory;
$date = new \DateTime('now');
echo $this->data['nav']->render(); ?>
<div class="row">
<div class="col-xs-12">
<section class="portlet">
<div class="portlet-head"><?= $this->getHtml('Status'); ?><i class="g-icon download btn end-xs">download</i></div>
<div class="slider">
<table id="employeeList" class="default sticky">
<thead>
<tr>
<td><?= $this->getHtml('Date'); ?>
<td><?= $this->getHtml('Type'); ?>
<td class="wf-100"><?= $this->getHtml('Employee'); ?>
<td><?= $this->getHtml('Start'); ?>
<td><?= $this->getHtml('Break'); ?>
<td><?= $this->getHtml('End'); ?>
<td><?= $this->getHtml('Total'); ?>
<tbody>
<?php foreach ($this->data['employees'] as $employee) :
$session = $this->data['sessions'][$employee->id] ?? null;
// @todo Implement clocking view per employee for HR (also to edit clocking)
$employeeUrl = UriFactory::build('{/base}/humanresource/staff/view?id=' . $employee->id);
?>
<tr>
<td><?= $session?->start->format('Y-m-d H:i:s') ?? $date->format('Y-m-d H:i:s'); ?>
<td><?php if ($session === NULL) : ?>
<span class="tag hl-1">-----</span>
<?php else : ?>
<span class="tag">
<?= $this->printHtml($this->data['session_types'][$session?->type->id]?->getL11n() ?? ''); ?>
</span>
<?php endif; ?>
<td><a class="content" href="<?= $employeeUrl; ?>">
<?= $this->printHtml($employee->profile->account->name1); ?>,
<?= $this->printHtml($employee->profile->account->name2); ?>
</a>
<td><?= $session?->start->format('H:i:s'); ?>
<td><?= $session !== null ? ((int) ($session->getBreak() / 3600)) . 'h' : ''; ?> <?= $session !== null ? ((int) ($session->getBreak() / 60) % 60) . 'm' : ''; ?>
<td><?= $session?->end?->format('H:i') ?? ''; ?>
<td><?= $session !== null ? ((int) ($session->busy / 3600)) . 'h' : ''; ?> <?= $session !== null ? ((int) ($session->busy / 60) % 60) . 'm' : ''; ?>
<?php endforeach; ?>
</table>
</div>
</section>
</div>
</div>