fixed saveaction

This commit is contained in:
Luca Haid
2025-05-07 10:02:36 +02:00
parent 0156d25a6c
commit 22ec1e3434

View File

@@ -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;