From c69d8b84d51ab771340cde4ec477c062b4a9be4f Mon Sep 17 00:00:00 2001 From: Daniel Spitzer Date: Fri, 14 Mar 2025 10:06:47 +0100 Subject: [PATCH] Zeiterfassung Fahrzeugverwaltung neue Features: * KM-Stand History * Journal * Neue Felder --- Layout/default/TimerecordingCar/Detail.php | 50 +++++++++++++++++-- .../TimerecordingCarController.php | 46 ++++++++++++++++- .../TimerecordingCarJournalModel.php | 6 ++- .../TimerecordingCarMileageHistoryModel.php | 3 +- ..._timerecording_car_journal_add_deleted.php | 31 ++++++++++++ ...cording_car_milage_history_add_deleted.php | 31 ++++++++++++ 6 files changed, 160 insertions(+), 7 deletions(-) create mode 100644 db/migrations/20250314072050_timerecording_car_journal_add_deleted.php create mode 100644 db/migrations/20250314072102_timerecording_car_milage_history_add_deleted.php diff --git a/Layout/default/TimerecordingCar/Detail.php b/Layout/default/TimerecordingCar/Detail.php index 85f6974e4..ed15194c4 100644 --- a/Layout/default/TimerecordingCar/Detail.php +++ b/Layout/default/TimerecordingCar/Detail.php @@ -39,6 +39,19 @@ if ($timerecordingcar->mileage_now && $timerecordingcar->mileage_timestamp) { color: #218200; opacity: 0.7; } + .del-journal + { + cursor: pointer; + position: absolute; + right: 5px; + top: 5px; + z-index: 2000; + } + .del-mileage-history + { + cursor: pointer; + z-index: 2000; + }
@@ -178,8 +191,8 @@ if ($timerecordingcar->mileage_now && $timerecordingcar->mileage_timestamp) { mileage ?> KM - (mileage_timestamp) ?> - ) + (mileage_timestamp) ?>) + mileage_now && $timerecordingcar->mileage_timestamp) {
-
+ +
timestamp) ?> @@ -392,6 +406,36 @@ if ($timerecordingcar->mileage_now && $timerecordingcar->mileage_timestamp) { } }); + $('body').on('click', '.del-journal', function () { + var id = $(this).data("id"); + var thisis = $(this); + if (!confirm("Journaleintrag wirklich löschen?")) { + return false; + } + $.ajax({ + url: "'deleteJournal']) ?>", + type: "POST", + data: {id: id}, + success: function (data) { + thisis.closest("div").remove(); + } + }); + }); + $('body').on('click', '.del-mileage-history', function () { + var id = $(this).data("id"); + var thisis = $(this); + if (!confirm("Kilometerstand wirklich löschen?")) { + return false; + } + $.ajax({ + url: "'deleteMilageHistory']) ?>", + type: "POST", + data: {id: id}, + success: function (data) { + thisis.closest("tr").remove(); + } + }); + }); });