From 1ab898fbcea20a06d321bb28afbf712f0a22372c Mon Sep 17 00:00:00 2001 From: Spitzer Daniel Date: Tue, 23 Apr 2024 20:30:08 +0200 Subject: [PATCH] =?UTF-8?q?Faserplanung/Zeiterfassung=20=20*=20Zeiterfassu?= =?UTF-8?q?ng=20=20*=20Faserplanung=20Koordinatenanzeige=20bei=20Rohrverze?= =?UTF-8?q?ichnis=20bearbeiten=20hinzugef=C3=BCgt=20=20*=20Migrations?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Layout/default/FiberPlanPipe/Form.php | 71 +++++++------------ Layout/default/TimerecordingEmployee/Form.php | 40 +++++++++-- .../default/TimerecordingEmployee/Index.php | 2 +- .../FiberPlanPipe/FiberPlanPipeModel.php | 2 +- .../TimerecordingEmployeeController.php | 20 +++++- .../TimerecordingEmployeeModel.php | 1 + ...rding_employee_add_field_bpahoursvalue.php | 31 ++++++++ 7 files changed, 109 insertions(+), 58 deletions(-) create mode 100644 db/migrations/20240423164320_timerecording_employee_add_field_bpahoursvalue.php diff --git a/Layout/default/FiberPlanPipe/Form.php b/Layout/default/FiberPlanPipe/Form.php index f967a46cc..8637dc496 100644 --- a/Layout/default/FiberPlanPipe/Form.php +++ b/Layout/default/FiberPlanPipe/Form.php @@ -230,9 +230,8 @@ if (isset($_GET['returnto']) && $_GET['returnto'] == "fiberplanpipe-detail") { -
- -
+
+

Legende:

-
-
+
+
+
+
-
-
+
+
+
+
@@ -422,41 +429,6 @@ if (isset($_GET['returnto']) && $_GET['returnto'] == "fiberplanpipe-detail") { addMarkers(); }); - - $("body").on("change", "#startpoint_type,#network_id", function () { - var options; - if ($.trim($("#network_id").val()) != "" && $.trim($("#startpoint_type").val())) { - - - $.getJSON(" 'getBuildingInfo']) ?>&network_id=" + $.trim($("#network_id").val()) + "&bdtype=" + $.trim($("#startpoint_type").val()), {}) - .done(function (data) { - $.each(data, function (k, val) { - options = options + ''; - }); - $('#starting-point-building').empty(); - $('#starting-point-building').append(''); - $(".select2").select2({placeholder: ""}); - }); - - } - }); - $("body").on("change", "#entpoint_type,#network_id2", function () { - var options; - if ($.trim($("#network_id2").val()) != "" && $.trim($("#entpoint_type").val())) { - - - $.getJSON(" 'getBuildingInfo']) ?>&network_id=" + $.trim($("#network_id2").val()) + "&bdtype=" + $.trim($("#entpoint_type").val()), {}) - .done(function (data) { - $.each(data, function (k, val) { - options = options + ''; - }); - $('#end-point-building').empty(); - $('#end-point-building').append(''); - $(".select2").select2({placeholder: ""}); - }); - - } - }); $("body").on("change", "#type", function () { if ($(this).val() < 3) { $('#dimesion-div').show(); @@ -500,7 +472,7 @@ if (isset($_GET['returnto']) && $_GET['returnto'] == "fiberplanpipe-detail") { removePolyline(); var oldlat; var oldlong; - var gpsconter=0; + var gpsconter = 0; $.each($('.endpoint_endpoint'), function (index, value) { if ($(this).find('option:selected').data('gpslat')) { var lat = $(this).find('option:selected').data('gpslat'); @@ -547,7 +519,15 @@ if (isset($_GET['returnto']) && $_GET['returnto'] == "fiberplanpipe-detail") { oldlat = $(this).find('option:selected').data('gpslat'); oldlong = $(this).find('option:selected').data('gpslong'); gpsconter++; + lat=String(lat); + lng=String(lng); + $(this).closest('.endpoint-maindiv').find('.endpoint_coordinates').html(``); } else { + $(this).closest('.endpoint-maindiv').find('.endpoint_coordinates').html(``); oldlat = ""; oldlong = ""; } @@ -596,9 +576,8 @@ if (isset($_GET['returnto']) && $_GET['returnto'] == "fiberplanpipe-detail") { ` + $('#endpoints').find('.endpoint_type').html() + ` -
- -
+
+
`); $('#' + randid + '_endpoint_network_id').val($('#endpoints').find('.endpoint_network_id').eq(endpointcounter - 2).val()); $('#' + randid + '_endpoint_type').val(''); diff --git a/Layout/default/TimerecordingEmployee/Form.php b/Layout/default/TimerecordingEmployee/Form.php index 509d4e408..bc48cb497 100644 --- a/Layout/default/TimerecordingEmployee/Form.php +++ b/Layout/default/TimerecordingEmployee/Form.php @@ -85,9 +85,15 @@ $daysSelect .= "";
@@ -97,7 +103,7 @@ $daysSelect .= "";
"/> + value="startdate) ? date('Y-m-d', $timerecordingemployees->startdate) : "" ?>"/>
@@ -106,7 +112,7 @@ $daysSelect .= "";
"/> + value="enddate) ? date('Y-m-d', $timerecordingemployees->enddate) : "" ?>"/>
@@ -114,10 +120,29 @@ $daysSelect .= "";
"/> + value="birthday) ? date('Y-m-d', $timerecordingemployees->birthday) : "" ?>"/>
- + superexpertEnabled()): ?> +
+ +
+ bpahours / 3600) ?>"/> +
+
+
+ +
+ bpahours_value) ?>"/> +
+
+
@@ -135,6 +160,7 @@ $daysSelect .= ""; value="plushours / 3600) ?>"/>
+
diff --git a/Layout/default/TimerecordingEmployee/Index.php b/Layout/default/TimerecordingEmployee/Index.php index 618fa546c..ad5b34698 100644 --- a/Layout/default/TimerecordingEmployee/Index.php +++ b/Layout/default/TimerecordingEmployee/Index.php @@ -120,7 +120,7 @@ $type[3] = "Lehrling"; data-order="id]['overtime_now'] ?>"> superexpertEnabled()): ?> id]['bpa_hours'] / 3600), floor($timerecordingemployees[$timerecordinguser->id]['bpa_hours'] / 60 % 60)) ?> + data-order="id]['bpahours'] ?>">id]['bpahours'] / 3600), floor($timerecordingemployees[$timerecordinguser->id]['bpahours'] / 60 % 60)) ?> id]['holidays_now']) ? $timerecordingemployees[$timerecordinguser->id]['holidays_now'] . ' Tage' : '' ?> diff --git a/application/FiberPlanPipe/FiberPlanPipeModel.php b/application/FiberPlanPipe/FiberPlanPipeModel.php index acedc102d..17c1e6846 100644 --- a/application/FiberPlanPipe/FiberPlanPipeModel.php +++ b/application/FiberPlanPipe/FiberPlanPipeModel.php @@ -364,7 +364,7 @@ INNER JOIN `Address` ON (`Address`.`id`=`Addresstype`.`address_id`) } } - $html .= '
'; + $html .= '
'; echo $html; $counter++; } diff --git a/application/TimerecordingEmployee/TimerecordingEmployeeController.php b/application/TimerecordingEmployee/TimerecordingEmployeeController.php index 52493034d..3eb110ba2 100644 --- a/application/TimerecordingEmployee/TimerecordingEmployeeController.php +++ b/application/TimerecordingEmployee/TimerecordingEmployeeController.php @@ -118,7 +118,23 @@ class TimerecordingEmployeeController extends mfBaseController $data['type'] = trim($r->type); $data['bmd_active'] = trim($r->bmd_active); $data['overtime'] = $overtime; -# + + + if ($r->bpahours) { + $bpahours = $r->bpahours; + $bpahours = str_replace(',', '.', $bpahours); + if (is_numeric($bpahours)) { + $bpahours = $bpahours * 3600; + $data['bpahours'] = $bpahours; + } + } + if ($r->bpahours_value) { + $bpahours_value = $r->bpahours_value; + $bpahours_value = str_replace(',', '.', $bpahours_value); + if (is_numeric($bpahours_value)) { + $data['bpahours_value'] = $bpahours_value; + } + } if (!$data['overtime']) { $data['overtime'] = 0; @@ -149,8 +165,6 @@ class TimerecordingEmployeeController extends mfBaseController } else { $timerecordingemployees = TimerecordingEmployeeModel::create($data); } -// var_dump($filestore); -// exit; $id = $timerecordingemployees->save(); if (!$id) { diff --git a/application/TimerecordingEmployee/TimerecordingEmployeeModel.php b/application/TimerecordingEmployee/TimerecordingEmployeeModel.php index b42acc1ce..5d17171c2 100644 --- a/application/TimerecordingEmployee/TimerecordingEmployeeModel.php +++ b/application/TimerecordingEmployee/TimerecordingEmployeeModel.php @@ -15,6 +15,7 @@ class TimerecordingEmployeeModel private $overtime_now; private $overtime_timestamp; private $bpahours; + private $bpahours_value; private $startdate; private $enddate; private $bmd_active; diff --git a/db/migrations/20240423164320_timerecording_employee_add_field_bpahoursvalue.php b/db/migrations/20240423164320_timerecording_employee_add_field_bpahoursvalue.php new file mode 100644 index 000000000..c55585dad --- /dev/null +++ b/db/migrations/20240423164320_timerecording_employee_add_field_bpahoursvalue.php @@ -0,0 +1,31 @@ +getEnvironment() == "thetool") { + $table = $this->table("TimerecordingEmployee", ["signed" => true]); + $table->addColumn("bpahours_value", "decimal", ["null" => false, "default" => 0.00, "after" => "bpahours", "precision" => 10, "scale" => 2]); + $table->update(); + } + + if ($this->getEnvironment() == "addressdb") { + + } + } + + public function down(): void + { + if ($this->getEnvironment() == "thetool") { + $this->table("TimerecordingEmployee")->removeColumn("bmd_active")->save(); + } + + if ($this->getEnvironment() == "addressdb") { + + } + } +}