From 22ec1e3434429ba56e0cf0e4306f74170b8d763e Mon Sep 17 00:00:00 2001 From: Luca Haid Date: Wed, 7 May 2025 10:02:36 +0200 Subject: [PATCH] fixed saveaction --- .../ConstructionConsentController.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/application/ConstructionConsent/ConstructionConsentController.php b/application/ConstructionConsent/ConstructionConsentController.php index 8ceaed952..5a4b3a0b9 100644 --- a/application/ConstructionConsent/ConstructionConsentController.php +++ b/application/ConstructionConsent/ConstructionConsentController.php @@ -254,6 +254,18 @@ class ConstructionConsentController extends mfBaseController { $this->layout()->setFlash("Sie haben keine Berechtigung für dieses Projekt", "error"); $this->redirect("ConstructionConsent"); } +// if mode is add and object type is building check if adb_hausnummer_id is set and if object type is street check if adb_strasse_id is set + + if($r->object_type == "building" && !$r->adb_hausnummer_id) { + $this->layout()->setFlash("Kein Gebäude ausgewählt", "error"); + return $this->addAction(); + } + + if($r->object_type == "street" && !$r->adb_strasse_id) { + $this->layout()->setFlash("Keine Straße ausgewählt", "error"); + return $this->addAction(); + } + $data = []; $data["constructionconsentproject_id"] = $r->constructionconsentproject_id;