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;