Merge branch 'ConstructionConsent/add-netzgebiet-id' into 'master'

fixed saveaction

See merge request fronk/thetool!1301
This commit is contained in:
Luca Haid
2025-05-07 08:02:52 +00:00

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;