From a7682935295504e6be9bb494052530a1f032ae63 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Sun, 7 Jun 2020 22:23:20 +0200 Subject: [PATCH] fix null model bug and impl. ger language --- Models/NullSession.php | 12 +++++++ Models/Session.php | 2 +- Models/SessionMapper.php | 9 +++-- Theme/Backend/Lang/Navigation.de.lang.php | 21 ++++++++++++ Theme/Backend/Lang/de.lang.php | 42 +++++++++++++++++++++++ Theme/Backend/private-dashboard.tpl.php | 26 +++++++------- 6 files changed, 94 insertions(+), 18 deletions(-) create mode 100644 Theme/Backend/Lang/Navigation.de.lang.php create mode 100644 Theme/Backend/Lang/de.lang.php diff --git a/Models/NullSession.php b/Models/NullSession.php index 74709aa..c571216 100644 --- a/Models/NullSession.php +++ b/Models/NullSession.php @@ -24,4 +24,16 @@ namespace Modules\HumanResourceTimeRecording\Models; */ final class NullSession extends Session { + /** + * Constructor + * + * @param int $id Model id + * + * @since 1.0.0 + */ + public function __construct(int $id = 0) + { + $this->id = $id; + parent::__construct(); + } } diff --git a/Models/Session.php b/Models/Session.php index 1325303..9773119 100644 --- a/Models/Session.php +++ b/Models/Session.php @@ -32,7 +32,7 @@ class Session implements ArrayableInterface, \JsonSerializable * @var int * @since 1.0.0 */ - private int $id = 0; + protected int $id = 0; /** * Session start diff --git a/Models/SessionMapper.php b/Models/SessionMapper.php index 03a2137..7ccefbf 100644 --- a/Models/SessionMapper.php +++ b/Models/SessionMapper.php @@ -191,11 +191,14 @@ final class SessionMapper extends DataMapperAbstract $sth->execute(); $results = $sth->fetchAll(\PDO::FETCH_ASSOC); - $obj = self::populateIterable($results === false ? [] : $results); + $objs = self::populateIterable($results === false ? [] : $results); + + foreach ($objs as $obj) { + self::fillRelations($obj, RelationType::ALL, 6); + } - self::fillRelations($obj, RelationType::ALL, 6); self::clear(); - return $obj; + return $objs; } } diff --git a/Theme/Backend/Lang/Navigation.de.lang.php b/Theme/Backend/Lang/Navigation.de.lang.php new file mode 100644 index 0000000..b8c30b8 --- /dev/null +++ b/Theme/Backend/Lang/Navigation.de.lang.php @@ -0,0 +1,21 @@ + [ + 'Create' => 'Erstellen', + 'List' => 'Liste', + 'Stats' => 'Statsitiken', + 'TimeRecording' => 'Zeiterfassung', + 'Today' => 'Heute', +]]; diff --git a/Theme/Backend/Lang/de.lang.php b/Theme/Backend/Lang/de.lang.php new file mode 100644 index 0000000..dd5016c --- /dev/null +++ b/Theme/Backend/Lang/de.lang.php @@ -0,0 +1,42 @@ + [ + 'Break' => 'Pause', + 'CS1' => 'Start', + 'CS2' => 'Pause', + 'CS3' => 'Weiter', + 'CS4' => 'Ende', + 'CT1' => 'Büro', + 'CT2' => 'Zuhause', + 'CT3' => 'Remote', + 'CT4' => 'Urlaub', + 'CT5' => 'Krank', + 'CT6' => 'Unterwegs', + 'D0' => 'Sonntag', + 'D1' => 'Montag', + 'D2' => 'Dienstag', + 'D3' => 'Mittwoch', + 'D4' => 'Donnerstag', + 'D5' => 'Freitag', + 'D6' => 'Samstag', + 'Date' => 'Datum', + 'End' => 'Ende', + 'Recordings' => 'Aufzeichnungen', + 'Start' => 'Start', + 'Status' => 'Status', + 'Time' => 'Zeit', + 'Total' => 'Gesamt', + 'Type' => 'Typ', +]]; diff --git a/Theme/Backend/private-dashboard.tpl.php b/Theme/Backend/private-dashboard.tpl.php index f716488..2f0ec6b 100644 --- a/Theme/Backend/private-dashboard.tpl.php +++ b/Theme/Backend/private-dashboard.tpl.php @@ -44,8 +44,8 @@ $busy = [ echo $this->getData('nav')->render(); ?>
-
-
+
+
@@ -82,9 +82,9 @@ echo $this->getData('nav')->render(); ?>
-
-

Work

-
+
+
Work
+
This month
Last month @@ -95,9 +95,9 @@ echo $this->getData('nav')->render(); ?>
-
-

Vaction

-
+
+
Vacation
+
Used Vacation
Last Vacation @@ -110,9 +110,9 @@ echo $this->getData('nav')->render(); ?>
-
- - +
+
getHtml('Recordings') ?>
+
getHtml('Recordings') ?>
- getData('nav')->render(); ?> ?>
getHtml('Date'); ?> @@ -122,8 +122,6 @@ echo $this->getData('nav')->render(); ?> getHtml('Break'); ?> getHtml('End'); ?> getHtml('Total'); ?> -
-
+
\ No newline at end of file