diff --git a/Admin/Routes/Web/Timerecording.php b/Admin/Routes/Web/Timerecording.php index ae44f6a..16ac398 100644 --- a/Admin/Routes/Web/Timerecording.php +++ b/Admin/Routes/Web/Timerecording.php @@ -6,7 +6,7 @@ use phpOMS\Account\PermissionType; use phpOMS\Router\RouteVerb; return [ - '^.*?$' => [ + '^/timerecording$' => [ [ 'dest' => '\Modules\HumanResourceTimeRecording\Controller\TimerecordingController:viewDashboard', 'verb' => RouteVerb::GET, diff --git a/Controller/TimerecordingController.php b/Controller/TimerecordingController.php index 42ca1e2..9b3ac0e 100644 --- a/Controller/TimerecordingController.php +++ b/Controller/TimerecordingController.php @@ -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; } } diff --git a/Theme/Backend/dashboard.tpl.php b/Theme/Backend/dashboard.tpl.php index 84b4214..6239a34 100644 --- a/Theme/Backend/dashboard.tpl.php +++ b/Theme/Backend/dashboard.tpl.php @@ -41,7 +41,9 @@ echo $this->getData('nav')->render(); ?> getStart()->format('Y-m-d'); ?> Status Here - getEmployee()->getProfile()->getAccount()->getName1(); ?>, getEmployee()->getProfile()->getAccount()->getName2(); ?> + + printHtml($session->getEmployee()->getProfile()->getAccount()->getName1()); ?>, + printHtml($session->getEmployee()->getProfile()->getAccount()->getName2()); ?> getStart()->format('H:i:s'); ?> getBreak() / 3600); ?>h getBreak() / 60) % 60); ?>m getEnd() !== null ? $session->getEnd()->format('H:i') : ''; ?> diff --git a/Theme/Timeterminal/Lang/en.lang.php b/Theme/Timeterminal/Lang/en.lang.php index e69de29..fb00b86 100644 --- a/Theme/Timeterminal/Lang/en.lang.php +++ b/Theme/Timeterminal/Lang/en.lang.php @@ -0,0 +1,41 @@ + [ + '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', +]]; diff --git a/Theme/Timeterminal/overview.tpl.php b/Theme/Timeterminal/overview.tpl.php index e69de29..29f81ab 100644 --- a/Theme/Timeterminal/overview.tpl.php +++ b/Theme/Timeterminal/overview.tpl.php @@ -0,0 +1,110 @@ +getData('sessions'); + +echo $this->getData('nav')->render(); ?> + +
+
+
+
+
+ +
+
+ +
+
+ +
+ +
+
+
+
+
+ +
+
+

Work

+
+ +
This month +
Last month +
This year +
+
+
+
+ +
+
+

Vaction

+
+ +
Used Vacation +
Last Vacation +
Next Vacation +
+
+
+
+
+ +
+
+
+ + + + + + + + +
getHtml('Recordings') ?>
getHtml('Date'); ?> + Status + getHtml('Start') ?> + getHtml('Break') ?> + getHtml('End') ?> + getHtml('Total') ?> +
+
getStart()->format('Y-m-d'); ?> - getHtml('D' . $session->getStart()->format('w')); ?> + Status Here + getStart()->format('H:i'); ?> + getBreak() / 3600); ?>h getBreak() / 60) % 60); ?>m + getEnd() !== null ? $session->getEnd()->format('H:i') : ''; ?> + getBusy() / 3600); ?>h getBusy() / 60) % 60); ?>m + +
+
+
+