From e2351d1f3de76561b68ef4148d7f2b0560a79a46 Mon Sep 17 00:00:00 2001 From: Frank Schubert Date: Tue, 15 Apr 2025 15:59:54 +0200 Subject: [PATCH] Added rimo_gn to ConstructionConsent --- Layout/default/ConstructionConsent/Form.php | 7 ++++ Layout/default/ConstructionConsent/Index.php | 9 +++-- Layout/default/ConstructionConsent/View.php | 3 ++ .../ConstructionConsent.php | 9 ++++- .../ConstructionConsentController.php | 1 + ...34656_construction_consent_add_rimo_gn.php | 33 +++++++++++++++++++ 6 files changed, 59 insertions(+), 3 deletions(-) create mode 100644 db/migrations/20250415134656_construction_consent_add_rimo_gn.php diff --git a/Layout/default/ConstructionConsent/Form.php b/Layout/default/ConstructionConsent/Form.php index 1a2ef0219..a679d7eb0 100644 --- a/Layout/default/ConstructionConsent/Form.php +++ b/Layout/default/ConstructionConsent/Form.php @@ -122,6 +122,13 @@ +
+ +
+ " /> +
+
+
diff --git a/Layout/default/ConstructionConsent/Index.php b/Layout/default/ConstructionConsent/Index.php index 28a769ae8..485c63287 100644 --- a/Layout/default/ConstructionConsent/Index.php +++ b/Layout/default/ConstructionConsent/Index.php @@ -134,16 +134,21 @@ $pagination_entity_name = "Zustimmungserklärungen"; " />
-
+
" />
-
+
" />
+
+ + " /> +
+
" /> diff --git a/Layout/default/ConstructionConsent/View.php b/Layout/default/ConstructionConsent/View.php index e74d1a6ef..0a703c5d4 100644 --- a/Layout/default/ConstructionConsent/View.php +++ b/Layout/default/ConstructionConsent/View.php @@ -184,6 +184,9 @@ $pagination_entity_name = "Adressen"; GSTNR gstnr?> + + Rimo GN + rimo_gn?> Plan/Skizze diff --git a/application/ConstructionConsent/ConstructionConsent.php b/application/ConstructionConsent/ConstructionConsent.php index ab7fa3e10..82fc10100 100644 --- a/application/ConstructionConsent/ConstructionConsent.php +++ b/application/ConstructionConsent/ConstructionConsent.php @@ -309,7 +309,7 @@ class ConstructionConsent extends mfBaseModel { $table_fields = [ "constructionconsentproject_id", "termination_id","adb_hausnummer_id", "adb_strasse_id", "object_type", "name", "ez", "kg", "gst", "gstnr", - "usage_length", "usage_pipe_on_plot", "usage_pipe_in_building", "usage_manhole", "usage_owner", + "rimo_gn", "usage_length", "usage_pipe_on_plot", "usage_pipe_in_building", "usage_manhole", "usage_owner", "status", "result", "result_text", "note", "create_by","edit_by","create","edit" ]; @@ -508,6 +508,13 @@ FROM ConstructionConsent } } + if(array_key_exists("rimo_gn", $filter)) { + $rimo_gn = FronkDB::singleton()->escape($filter["rimo_gn"]); + if($rimo_gn) { + $where .= " AND rimo_gn LIKE '%$rimo_gn%'"; + } + } + if(array_key_exists("address", $filter)) { $address = FronkDB::singleton()->escape($filter["address"]); if ($address) { diff --git a/application/ConstructionConsent/ConstructionConsentController.php b/application/ConstructionConsent/ConstructionConsentController.php index ec3f26f1b..ae1c7660e 100644 --- a/application/ConstructionConsent/ConstructionConsentController.php +++ b/application/ConstructionConsent/ConstructionConsentController.php @@ -252,6 +252,7 @@ class ConstructionConsentController extends mfBaseController { $data["kg"] = $r->kg; $data["gst"] = $r->gst; $data["gstnr"] = $r->gstnr; + $data["rimo_gn"] = $r->rimo_gn; $data["usage_length"] = $r->usage_length ?: null; $data["usage_pipe_on_plot"] = $r->usage_pipe_on_plot ? 1 : 0; $data["usage_pipe_in_building"] = $r->usage_pipe_in_building ? 1 : 0; diff --git a/db/migrations/20250415134656_construction_consent_add_rimo_gn.php b/db/migrations/20250415134656_construction_consent_add_rimo_gn.php new file mode 100644 index 000000000..584f222ae --- /dev/null +++ b/db/migrations/20250415134656_construction_consent_add_rimo_gn.php @@ -0,0 +1,33 @@ +getEnvironment() == "thetool") { + $table = $this->table('ConstructionConsent'); + $table->addColumn('rimo_gn', 'string', ['limit' => 64, 'null' => true, 'default' => null, "after" => "gstnr"]); + $table->update(); + } + + if($this->getEnvironment() == "addressdb") { + + } + } + + public function down(): void + { + if($this->getEnvironment() == "thetool") { + $table = $this->table('ConstructionConsent'); + $table->removeColumn('rimo_gn'); + $table->update(); + } + + if($this->getEnvironment() == "addressdb") { + + } + } +}