From 11baca9413c8ce944976d966b06ee968a8d56e34 Mon Sep 17 00:00:00 2001 From: Luca Haid Date: Tue, 20 May 2025 10:51:45 +0200 Subject: [PATCH] ConstructionConsent - adding journal entry on create owner or import owner create --- .../ConstructionConsent/ConstructionConsentController.php | 6 ++++++ .../ConstructionConsentOwnerController.php | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/application/ConstructionConsent/ConstructionConsentController.php b/application/ConstructionConsent/ConstructionConsentController.php index 48effd9dd..27b71709c 100644 --- a/application/ConstructionConsent/ConstructionConsentController.php +++ b/application/ConstructionConsent/ConstructionConsentController.php @@ -1137,6 +1137,12 @@ class ConstructionConsentController extends mfBaseController { $ownerRecord->save(); + $journal = ConstructionConsentJournal::create([ + "constructionconsent_id" => $consentRecord->id, + "text" => "Import: Eigentümer $firstname $lastname wurde hinzugefügt" + ]); + $journal->save(); + $counts[$isNew ? "created" : "updated"]++; } diff --git a/application/ConstructionConsentOwner/ConstructionConsentOwnerController.php b/application/ConstructionConsentOwner/ConstructionConsentOwnerController.php index f594ad2c7..97769c89a 100644 --- a/application/ConstructionConsentOwner/ConstructionConsentOwnerController.php +++ b/application/ConstructionConsentOwner/ConstructionConsentOwnerController.php @@ -121,6 +121,12 @@ class ConstructionConsentOwnerController extends mfBaseController if(!$item->save()) { $this->layout()->setFlash("Beim Speichern ist ein Fehler aufgetreten. Bitte versuchen Sie es erneut.", "error"); } else { + $journal = ConstructionConsentJournal::create([ + "constructionconsent_id" => $cc->id, + "text" => "Eigentümer " . $item->firstname . " " . $item->lastname . " wurde hinzugefügt" + ]); + $journal->save(); + $this->layout()->setFlash("Besitzer wurde erfolgreich gespeichert.", "success"); }