diff --git a/Admin/Install/Navigation.install.json b/Admin/Install/Navigation.install.json index 7da0567..18420db 100644 --- a/Admin/Install/Navigation.install.json +++ b/Admin/Install/Navigation.install.json @@ -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": [] } ] diff --git a/Admin/Routes/Web/Backend.php b/Admin/Routes/Web/Backend.php index f884c3d..da4056f 100644 --- a/Admin/Routes/Web/Backend.php +++ b/Admin/Routes/Web/Backend.php @@ -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, diff --git a/Controller/BackendController.php b/Controller/BackendController.php index 5c7c9e4..3c44e15 100644 --- a/Controller/BackendController.php +++ b/Controller/BackendController.php @@ -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; diff --git a/Models/ClockingStatus.php b/Models/ClockingStatus.php new file mode 100644 index 0000000..30525a4 --- /dev/null +++ b/Models/ClockingStatus.php @@ -0,0 +1,33 @@ +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(); + } +} diff --git a/Models/SessionElement.php b/Models/SessionElement.php new file mode 100644 index 0000000..598125b --- /dev/null +++ b/Models/SessionElement.php @@ -0,0 +1,59 @@ +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(); + } +} diff --git a/Models/SessionElementMapper.php b/Models/SessionElementMapper.php new file mode 100644 index 0000000..b3d9bbc --- /dev/null +++ b/Models/SessionElementMapper.php @@ -0,0 +1 @@ + [ - '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', ]]; diff --git a/Theme/Backend/dashboard.tpl.php b/Theme/Backend/dashboard.tpl.php new file mode 100644 index 0000000..b8e39d9 --- /dev/null +++ b/Theme/Backend/dashboard.tpl.php @@ -0,0 +1,79 @@ +getData('nav')->render(); ?> + +
| Used Vacation | + |
| Last Vacation | + |
| Next Vacation | + |