draft time recording

This commit is contained in:
Dennis Eichhorn 2019-08-10 23:15:25 +02:00
parent b2bb34e498
commit 4d837684dc
20 changed files with 359 additions and 52 deletions

View File

@ -5,7 +5,7 @@
"type": 2,
"subtype": 1,
"name": "TimeRecording",
"uri": "{/prefix}hr/timerecording/dashboard?{?}",
"uri": "{/prefix}humanresource/timerecording/dashboard?{?}",
"target": "self",
"icon": null,
"order": 70,
@ -15,11 +15,11 @@
"children": [
{
"id": 1006302001,
"pid": "/hr/timerecording",
"pid": "/humanresource/timerecording",
"type": 3,
"subtype": 1,
"name": "List",
"uri": "{/prefix}hr/timerecording/dashboard?{?}",
"uri": "{/prefix}humanresource/timerecording/dashboard?{?}",
"target": "self",
"icon": null,
"order": 1,
@ -29,5 +29,20 @@
"children": []
}
]
},
{
"id": 1006303001,
"pid": "/",
"type": 2,
"subtype": 1,
"name": "TimeRecording",
"uri": "{/prefix}humanresource/timerecording/dashboard?{?}",
"target": "self",
"icon": null,
"order": 1,
"from": "HumanResourceTimeRecording",
"permission": { "permission": 2, "type": null, "element": null },
"parent": 1003401001,
"children": []
}
]

View File

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

View File

@ -20,7 +20,7 @@ use phpOMS\Message\ResponseAbstract;
use phpOMS\Views\View;
/**
* Database controller class.
* TimeRecording controller class.
*
* @package Modules\HumanResourceTimeRecording
* @license OMS License 1.0
@ -40,48 +40,10 @@ final class BackendController extends Controller
* @since 1.0.0
* @codeCoverageIgnore
*/
public function viewDatabaseList(RequestAbstract $request, ResponseAbstract $response, $data = null) : RenderableInterface
public function viewDashboard(RequestAbstract $request, ResponseAbstract $response, $data = null) : RenderableInterface
{
$view = new View($this->app, $request, $response);
$view->setTemplate('/Modules/Database/Theme/Backend/database-list');
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1006301001, $request, $response));
return $view;
}
/**
* @param RequestAbstract $request Request
* @param ResponseAbstract $response Response
* @param mixed $data Generic data
*
* @return RenderableInterface
*
* @since 1.0.0
* @codeCoverageIgnore
*/
public function viewDatabaseCreate(RequestAbstract $request, ResponseAbstract $response, $data = null) : RenderableInterface
{
$view = new View($this->app, $request, $response);
$view->setTemplate('/Modules/Database/Theme/Backend/database-generator');
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1006301001, $request, $response));
return $view;
}
/**
* @param RequestAbstract $request Request
* @param ResponseAbstract $response Response
* @param mixed $data Generic data
*
* @return RenderableInterface
*
* @since 1.0.0
* @codeCoverageIgnore
*/
public function viewDatabaseResult(RequestAbstract $request, ResponseAbstract $response, $data = null) : RenderableInterface
{
$view = new View($this->app, $request, $response);
$view->setTemplate('/Modules/Database/Theme/Backend/database-query-result');
$view->setTemplate('/Modules/HumanResourceTimeRecording/Theme/Backend/dashboard');
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1006301001, $request, $response));
return $view;

33
Models/ClockingStatus.php Normal file
View File

@ -0,0 +1,33 @@
<?php
/**
* Orange Management
*
* PHP Version 7.2
*
* @package Modules\HumanResourceTimeRecording
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link https://orange-management.org
*/
declare(strict_types=1);
namespace Modules\HumanResourceTimeRecording\Models;
use phpOMS\Stdlib\Base\Enum;
/**
* ClockingStatus enum.
*
* @package Modules\HumanResourceTimeRecording
* @license OMS License 1.0
* @link https://orange-management.org
* @since 1.0.0
*/
abstract class ClockingStatus extends Enum
{
public const START = 1;
public const PAUSE = 2;
public const ON_THE_MOVE = 3;
public const END = 4;
}

34
Models/ClockingType.php Normal file
View File

@ -0,0 +1,34 @@
<?php
/**
* Orange Management
*
* PHP Version 7.2
*
* @package Modules\HumanResourceTimeRecording
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link https://orange-management.org
*/
declare(strict_types=1);
namespace Modules\HumanResourceTimeRecording\Models;
use phpOMS\Stdlib\Base\Enum;
/**
* ClockingType enum.
*
* @package Modules\HumanResourceTimeRecording
* @license OMS License 1.0
* @link https://orange-management.org
* @since 1.0.0
*/
abstract class ClockingType extends Enum
{
public const OFFICE = 1;
public const HOME = 2;
public const REMOTE = 3;
public const VACATION = 4;
public const SICK = 5;
}

27
Models/NullSession.php Normal file
View File

@ -0,0 +1,27 @@
<?php
/**
* Orange Management
*
* PHP Version 7.2
*
* @package Modules\HumanResourceTimeRecording
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link https://orange-management.org
*/
declare(strict_types=1);
namespace Modules\HumanResourceTimeRecording\Models;
/**
* Null model
*
* @package Modules\HumanResourceTimeRecording
* @license OMS License 1.0
* @link https://orange-management.org
* @since 1.0.0
*/
class NullSession extends Session
{
}

View File

@ -0,0 +1,27 @@
<?php
/**
* Orange Management
*
* PHP Version 7.2
*
* @package Modules\HumanResourceTimeRecording
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link https://orange-management.org
*/
declare(strict_types=1);
namespace Modules\HumanResourceTimeRecording\Models;
/**
* Null model
*
* @package Modules\HumanResourceTimeRecording
* @license OMS License 1.0
* @link https://orange-management.org
* @since 1.0.0
*/
class NullSessionElement extends SessionElement
{
}

59
Models/Session.php Normal file
View File

@ -0,0 +1,59 @@
<?php
/**
* Orange Management
*
* PHP Version 7.2
*
* @package Modules\HumanResourceTimeRecording
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link https://orange-management.org
*/
declare(strict_types=1);
namespace Modules\HumanResourceTimeRecording\Models;
/**
* Null model
*
* @package Modules\HumanResourceTimeRecording
* @license OMS License 1.0
* @link https://orange-management.org
* @since 1.0.0
*/
class Session implements ArrayableInterface, \JsonSerializable
{
private $id = 0;
public function getId() : int
{
return $this->id;
}
/**
* {@inheritdoc}
*/
public function toArray() : array
{
return [
'id' => $this->id,
];
}
/**
* {@inheritdoc}
*/
public function __toString()
{
return (string) \json_encode($this->toArray());
}
/**
* {@inheritdoc}
*/
public function jsonSerialize()
{
eturn $this->toArray();
}
}

59
Models/SessionElement.php Normal file
View File

@ -0,0 +1,59 @@
<?php
/**
* Orange Management
*
* PHP Version 7.2
*
* @package Modules\HumanResourceTimeRecording
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link https://orange-management.org
*/
declare(strict_types=1);
namespace Modules\HumanResourceTimeRecording\Models;
/**
* Null model
*
* @package Modules\HumanResourceTimeRecording
* @license OMS License 1.0
* @link https://orange-management.org
* @since 1.0.0
*/
class SessionElement implements ArrayableInterface, \JsonSerializable
{
private $id = 0;
public function getId() : int
{
return $this->id;
}
/**
* {@inheritdoc}
*/
public function toArray() : array
{
return [
'id' => $this->id,
];
}
/**
* {@inheritdoc}
*/
public function __toString()
{
return (string) \json_encode($this->toArray());
}
/**
* {@inheritdoc}
*/
public function jsonSerialize()
{
eturn $this->toArray();
}
}

View File

@ -0,0 +1 @@
<?php

1
Models/SessionMapper.php Normal file
View File

@ -0,0 +1 @@
<?php

View File

@ -10,9 +10,18 @@
* @version 1.0.0
* @link https://orange-management.org
*/
return ['Database' => [
'Created' => 'Created',
'Creator' => 'Creator',
'Database' => 'Database',
'Query' => 'Query',
return ['HumanResourceTimeRecording' => [
'End' => 'End',
'Start' => 'Start',
'Status' => 'Status',
'Type' => 'Type',
'CT0' => 'Office',
'CT1' => 'Remote',
'CT2' => 'Home',
'CT3' => 'Vacation',
'CT4' => 'Sick',
'CS0' => 'Start',
'CS1' => 'Pause',
'CS2' => 'On the move',
'CS3' => 'End',
]];

View File

@ -0,0 +1,79 @@
<?php declare(strict_types=1);
/**
* Orange Management
*
* PHP Version 7.2
*
* @package TBD
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link https://orange-management.org
*/
use \Modules\HumanResourceTimeRecording\Models\ClockingType;
use \Modules\HumanResourceTimeRecording\Models\ClockingStatus;
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') ?>
</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::ON_THE_MOVE; ?>"><?= $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>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 class="col-md-4 col-xs-12">
<section class="box wf-100">
<div class="inner">
</div>
</section>
</div>
</div>
on response successfull reload!!! or!
on response successfull change ui/change ui and on response not successfull undo changed ui both result in the same
list for month show total of total
list contains segments for week show total of total
every week contains every day show total of total
if you click on a day you get detailed information of that day
show additional section with vacation days

View File

View File

View File

View File

@ -20,12 +20,13 @@
"Admin": "1.0.0"
},
"providing": {
"Navigation": "*"
"Navigation": "*",
"MyPrivate": "*"
},
"load": [
{
"pid": [
"/database"
"/humanresource/timerecording"
],
"type": 4,
"for": "Content",