From 2f4e29750922d2c535a6da27a5c95188243623d0 Mon Sep 17 00:00:00 2001 From: Spitzer Daniel Date: Mon, 12 Feb 2024 11:39:57 +0100 Subject: [PATCH] Zeiterfassung update --- Layout/default/Timerecording/Index.php | 4 +- Layout/default/TimerecordingEmployee/Form.php | 10 +++++ .../default/TimerecordingEmployee/Index.php | 13 +++++-- Layout/default/TimerecordingReport/Index.php | 38 +++++++++---------- .../TimerecordingEmployeeController.php | 2 +- .../TimerecordingEmployeeModel.php | 1 + ..._timerecording_employee_add_field_type.php | 31 +++++++++++++++ 7 files changed, 74 insertions(+), 25 deletions(-) create mode 100644 db/migrations/20240212095840_timerecording_employee_add_field_type.php diff --git a/Layout/default/Timerecording/Index.php b/Layout/default/Timerecording/Index.php index 6c9501679..3612b80b1 100644 --- a/Layout/default/Timerecording/Index.php +++ b/Layout/default/Timerecording/Index.php @@ -179,9 +179,9 @@ $years[time() - 31536000] = date('Y', time() - 31536000); -
+
-
+
+
+ +
+ +
+
diff --git a/Layout/default/TimerecordingEmployee/Index.php b/Layout/default/TimerecordingEmployee/Index.php index 5147a6688..6d2bbbe8a 100644 --- a/Layout/default/TimerecordingEmployee/Index.php +++ b/Layout/default/TimerecordingEmployee/Index.php @@ -1,4 +1,8 @@ - + @@ -34,6 +38,7 @@ Mitarbeiter + Vertragsart Start Zeitaufzeichnung Sollzeiten Sollstunden @@ -47,6 +52,7 @@ + @@ -63,12 +69,13 @@ name ?> - id]['startdate']) ? date("d.m.Y",$timerecordingemployees[$timerecordinguser->id]['startdate']) : "-" ?> + id]['type']] ?> + id]['startdate']) ? date("d.m.Y", $timerecordingemployees[$timerecordinguser->id]['startdate']) : "-" ?> id]['datetimetext'] : "" ?> id]['auto_workinghours'] == '1') ? 'Ja' : 'Nein' ?> - $timerecordingemployees[$timerecordinguser->id]['id'],"userid" => $timerecordinguser->id]) ?>"> $timerecordingemployees[$timerecordinguser->id]['id'], "userid" => $timerecordinguser->id]) ?>"> diff --git a/Layout/default/TimerecordingReport/Index.php b/Layout/default/TimerecordingReport/Index.php index 97331bc28..0b6f31610 100644 --- a/Layout/default/TimerecordingReport/Index.php +++ b/Layout/default/TimerecordingReport/Index.php @@ -271,25 +271,25 @@ $years[time() - 31536000] = date('Y', time() - 31536000);
-
-
-
-
- -
-
-
-
- -
-
-
-
+ + + + + + + + + + + + + + + + + + +
diff --git a/application/TimerecordingEmployee/TimerecordingEmployeeController.php b/application/TimerecordingEmployee/TimerecordingEmployeeController.php index 1fd0453d5..0986a1114 100644 --- a/application/TimerecordingEmployee/TimerecordingEmployeeController.php +++ b/application/TimerecordingEmployee/TimerecordingEmployeeController.php @@ -106,9 +106,9 @@ class TimerecordingEmployeeController extends mfBaseController $data['user_id'] = trim($r->user_id); $data['auto_workinghours'] = trim($r->auto_workinghours); $data['holidays'] = trim($r->holidays); - $data['businesstrip'] = trim($r->businesstrip); $data['plushours'] = $plushours; $data['startdate'] = strtotime($r->startdate); + $data['type'] = trim($r->type); if (!$data['user_id']) { diff --git a/application/TimerecordingEmployee/TimerecordingEmployeeModel.php b/application/TimerecordingEmployee/TimerecordingEmployeeModel.php index 14363409e..913b19bb1 100644 --- a/application/TimerecordingEmployee/TimerecordingEmployeeModel.php +++ b/application/TimerecordingEmployee/TimerecordingEmployeeModel.php @@ -3,6 +3,7 @@ class TimerecordingEmployeeModel { private $user_id; + private $type; private $auto_workinghours; private $holidays; private $plushours; diff --git a/db/migrations/20240212095840_timerecording_employee_add_field_type.php b/db/migrations/20240212095840_timerecording_employee_add_field_type.php new file mode 100644 index 000000000..bc3038581 --- /dev/null +++ b/db/migrations/20240212095840_timerecording_employee_add_field_type.php @@ -0,0 +1,31 @@ +getEnvironment() == "thetool") { + $table = $this->table("TimerecordingEmployee", ["signed" => true]); + $table->addColumn("type", "integer", ["null" => false, "default" => '1', "after" => "user_id", "comment" => "1:Angestellter/2:Arbeiter/3:Lehrling"]); + $table->update(); + } + + if($this->getEnvironment() == "addressdb") { + + } + } + + public function down(): void + { + if($this->getEnvironment() == "thetool") { + $this->table("TimerecordingEmployee")->removeColumn("type")->save(); + } + + if($this->getEnvironment() == "addressdb") { + + } + } +}