continue hr implementation

This commit is contained in:
Dennis Eichhorn 2019-10-16 17:35:36 +02:00
parent 4579fae4b2
commit d0ec492329
5 changed files with 159 additions and 2 deletions

View File

@ -6,7 +6,7 @@ use phpOMS\Account\PermissionType;
use phpOMS\Router\RouteVerb;
return [
'^.*?$' => [
'^/timerecording$' => [
[
'dest' => '\Modules\HumanResourceTimeRecording\Controller\TimerecordingController:viewDashboard',
'verb' => RouteVerb::GET,

View File

@ -18,6 +18,7 @@ use phpOMS\Contract\RenderableInterface;
use phpOMS\Message\RequestAbstract;
use phpOMS\Message\ResponseAbstract;
use phpOMS\Views\View;
use Modules\HumanResourceTimeRecording\Models\SessionMapper;
/**
* TimeRecording controller class.
@ -48,6 +49,9 @@ final class TimerecordingController extends Controller
$view->setTemplate('/Modules/HumanResourceTimeRecording/Theme/Timeterminal/overview');
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1006301001, $request, $response));
$list = SessionMapper::getNewest(50);
$view->addData('sessions', $list);
return $view;
}
}

View File

@ -41,7 +41,9 @@ echo $this->getData('nav')->render(); ?>
<tr>
<td><?= $session->getStart()->format('Y-m-d'); ?>
<td><span class="tag">Status Here</span>
<td><?= $session->getEmployee()->getProfile()->getAccount()->getName1(); ?>, <?= $session->getEmployee()->getProfile()->getAccount()->getName2(); ?>
<td>
<?= $this->printHtml($session->getEmployee()->getProfile()->getAccount()->getName1()); ?>,
<?= $this->printHtml($session->getEmployee()->getProfile()->getAccount()->getName2()); ?>
<td><?= $session->getStart()->format('H:i:s'); ?>
<td><?= (int) ($session->getBreak() / 3600); ?>h <?= ((int) ($session->getBreak() / 60) % 60); ?>m
<td><?= $session->getEnd() !== null ? $session->getEnd()->format('H:i') : ''; ?>

View File

@ -0,0 +1,41 @@
<?php
/**
* Orange Management
*
* PHP Version 7.4
*
* @package Modules\HumanResourceTimeRecording
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link https://orange-management.org
*/
declare(strict_types=1);
return ['HumanResourceTimeRecording' => [
'Break' => 'Break',
'CS0' => 'Start',
'CS1' => 'Pause',
'CS2' => 'Continue',
'CS3' => 'End',
'CT0' => 'Office',
'CT1' => 'Remote',
'CT2' => 'Home',
'CT3' => 'Vacation',
'CT4' => 'Sick',
'CT5' => 'On the move',
'D0' => 'Sunday',
'D1' => 'Monday',
'D2' => 'Tuesday',
'D3' => 'Wednesday',
'D4' => 'Thursday',
'D5' => 'Friday',
'D6' => 'Saturday',
'Date' => 'Date',
'End' => 'End',
'Recordings' => 'Recordings',
'Start' => 'Start',
'Status' => 'Status',
'Total' => 'Total',
'Type' => 'Type',
]];

View File

@ -0,0 +1,110 @@
<?php
/**
* Orange Management
*
* PHP Version 7.4
*
* @package HumanResourceTimeRecording
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link https://orange-management.org
*/
declare(strict_types=1);
use \Modules\HumanResourceTimeRecording\Models\ClockingType;
use \Modules\HumanResourceTimeRecording\Models\ClockingStatus;
$sessions = $this->getData('sessions');
echo $this->getData('nav')->render(); ?>
<div class="row">
<div class="col-md-4 col-xs-12">
<section class="box wf-100">
<div class="inner">
<form id="clocking" method="PUT" action="<?= \phpOMS\Uri\UriFactory::build('{/api}task/element?{?}&csrf={$CSRF}'); ?>">
<table class="layout wf-100" style="table-layout: fixed">
<tr><td><label for="iType"><?= $this->getHtml('Type') ?></label>
<tr><td>
<select id="iType" name="Type">
<option value="<?= ClockingType::OFFICE; ?>"><?= $this->getHtml('CT0') ?>
<option value="<?= ClockingType::REMOTE; ?>"><?= $this->getHtml('CT1') ?>
<option value="<?= ClockingType::HOME; ?>"><?= $this->getHtml('CT2') ?>
<option value="<?= ClockingType::VACATION; ?>"><?= $this->getHtml('CT3') ?>
<option value="<?= ClockingType::SICK; ?>"><?= $this->getHtml('CT4') ?>
<option value="<?= ClockingType::ON_THE_MOVE; ?>"><?= $this->getHtml('CT5') ?>
</select>
<tr><td><label for="iStatus"><?= $this->getHtml('Status') ?></label>
<tr><td>
<select id="iStatus" name="Status">
<option value="<?= ClockingStatus::START; ?>"><?= $this->getHtml('CS0') ?>
<option value="<?= ClockingStatus::PAUSE; ?>"><?= $this->getHtml('CS1') ?>
<option value="<?= ClockingStatus::CONTINUE; ?>"><?= $this->getHtml('CS2') ?>
<option value="<?= ClockingStatus::END; ?>"><?= $this->getHtml('CS3') ?>
</select>
<tr><td>
<input type="submit" id="iclockingButton" name="clockingButton" value="<?= $this->getHtml('Submit', '0', '0'); ?>">
</table>
</form>
</div>
</section>
</div>
<div class="col-md-4 col-xs-12">
<section class="box wf-100">
<header><h1>Work</h1></header>
<div class="inner">
<table>
<tr><td>This month<td>
<tr><td>Last month<td>
<tr><td>This year<td>
</table>
</div>
</section>
</div>
<div class="col-md-4 col-xs-12">
<section class="box wf-100">
<header><h1>Vaction</h1></header>
<div class="inner">
<table>
<tr><td>Used Vacation<td>
<tr><td>Last Vacation<td>
<tr><td>Next Vacation<td>
</table>
</div>
</section>
</div>
</div>
<div class="row">
<div class="col-xs-12">
<div class="box wf-100">
<table id="accountList" class="default">
<caption><?= $this->getHtml('Recordings') ?><i class="fa fa-download floatRight download btn"></i></caption>
<thead>
<tr>
<td><?= $this->getHtml('Date'); ?>
<td>Status
<td><?= $this->getHtml('Start') ?>
<td><?= $this->getHtml('Break') ?>
<td><?= $this->getHtml('End') ?>
<td><?= $this->getHtml('Total') ?>
<tfoot>
<tr><td colspan="5">
<tbody>
<?php foreach ($sessions as $session) : ?>
<tr>
<td><?= $session->getStart()->format('Y-m-d'); ?> - <?= $this->getHtml('D' . $session->getStart()->format('w')); ?>
<td><span class="tag">Status Here</span>
<td><?= $session->getStart()->format('H:i'); ?>
<td><?= (int) ($session->getBreak() / 3600); ?>h <?= ((int) ($session->getBreak() / 60) % 60); ?>m
<td><?= $session->getEnd() !== null ? $session->getEnd()->format('H:i') : ''; ?>
<td><?= (int) ($session->getBusy() / 3600); ?>h <?= ((int) ($session->getBusy() / 60) % 60); ?>m
<?php endforeach; ?>
</table>
</div>
</div>
</div>