From 1db38f4b116bfcd1f029958f53bc96283e0f08f2 Mon Sep 17 00:00:00 2001 From: Frank Schubert Date: Tue, 21 Jan 2025 16:24:01 +0100 Subject: [PATCH 1/2] WIP 2025-01-20 ConstructionConsent History --- Layout/default/ConstructionConsent/View.php | 9 ++- ...nstruction_consent_history_and_contact.php | 55 +++++++++++++++++++ 2 files changed, 61 insertions(+), 3 deletions(-) create mode 100644 db/migrations/20250120145618_create_construction_consent_history_and_contact.php diff --git a/Layout/default/ConstructionConsent/View.php b/Layout/default/ConstructionConsent/View.php index 14ed59e56..90dcccd95 100644 --- a/Layout/default/ConstructionConsent/View.php +++ b/Layout/default/ConstructionConsent/View.php @@ -60,9 +60,12 @@ $pagination_entity_name = "Adressen"; adb_hausnummer->strasse->gemeinde->name?> - Anzahl Bestellungen - preorder_count?> - + Anzahl Wohneinheiten + adb_hausnummer->unit_count?> + + Anzahl Bestellungen + preorder_count?> + Straße diff --git a/db/migrations/20250120145618_create_construction_consent_history_and_contact.php b/db/migrations/20250120145618_create_construction_consent_history_and_contact.php new file mode 100644 index 000000000..65951e177 --- /dev/null +++ b/db/migrations/20250120145618_create_construction_consent_history_and_contact.php @@ -0,0 +1,55 @@ +getEnvironment() == "thetool") { + $cch = $this->table("ConstructionConsentHistory"); + $cch->addColumn("constructionconsent_id", "integer", ["null" => false]) + ->addColumn("key", "string", ["null" => false, "limit" => 100]) + ->addColumn("old_value", "text", ["null" => true]) + ->addColumn("new_value", "text", ["null" => true]) + ->addColumn("create_by", "integer", ["null" => false]) + ->addColumn("edit_by", "integer", ["null" => false]) + ->addColumn("create", "integer", ["null" => false]) + ->addColumn("edit", "integer", ["null" => false]); + $cch->create(); + + $ccc = $this->table("ConstructionConsentContact"); + $ccc->addColumn("constructionconsent_id", "integer", ["null" => false]) + ->addColumn("type", "enum", ["null" => false, "values" => ["contact", "property_manager", "electrician", "other"]]) + ->addColumn("name", "string", ["null" => true, "default" => null, "limit" => "255"]) + ->addColumn("street", "string", ["null" => true, "default" => null, "limit" => "64"]) + ->addColumn("zip", "string", ["null" => true, "default" => null, "limit" => "32"]) + ->addColumn("city", "string", ["null" => true, "default" => null, "limit" => "64"]) + ->addColumn("country", "string", ["null" => true, "default" => null, "limit" => "64"]) + ->addColumn("phone", "string", ["null" => true, "default" => null, "limit" => "64"]) + ->addColumn("fax", "string", ["null" => true, "default" => null, "limit" => "64"]) + ->addColumn("email", "string", ["null" => true, "default" => null, "limit" => "64"]) + ->addColumn("create_by", "integer", ["null" => false]) + ->addColumn("edit_by", "integer", ["null" => false]) + ->addColumn("create", "integer", ["null" => false]) + ->addColumn("edit", "integer", ["null" => false]); + $ccc->create(); + } + + if($this->getEnvironment() == "addressdb") { + + } + } + + public function down(): void + { + if($this->getEnvironment() == "thetool") { + + } + + if($this->getEnvironment() == "addressdb") { + + } + } +} From c0451c2621c76253502828079417694b0b1564f0 Mon Sep 17 00:00:00 2001 From: Frank Schubert Date: Tue, 21 Jan 2025 22:54:15 +0100 Subject: [PATCH 2/2] Added Journal/History/Contacts to ConstructionConsent --- Layout/default/ConstructionConsent/Form.php | 12 + Layout/default/ConstructionConsent/View.php | 206 +++++++++++- .../ConstructionConsent.php | 62 +++- .../ConstructionConsentController.php | 15 + .../ConstructionConsentContact.php | 180 ++++++++++ .../ConstructionConsentContactController.php | 98 ++++++ .../ConstructionConsentHistory.php | 317 ++++++++++++++++++ .../ConstructionConsentJournal.php | 25 +- .../ConstructionConsentJournalController.php | 58 ++++ .../ConstructionConsentOwner.php | 25 ++ .../ConstructionConsentOwnerController.php | 20 +- ...nstruction_consent_history_and_contact.php | 1 + ...ction_consent_change_status_and_result.php | 77 +++++ lang/de.php | 15 +- 14 files changed, 1084 insertions(+), 27 deletions(-) create mode 100644 application/ConstructionConsentContact/ConstructionConsentContact.php create mode 100644 application/ConstructionConsentContact/ConstructionConsentContactController.php create mode 100644 application/ConstructionConsentHistory/ConstructionConsentHistory.php create mode 100644 application/ConstructionConsentJournal/ConstructionConsentJournalController.php create mode 100644 db/migrations/20250121164455_construction_consent_change_status_and_result.php diff --git a/Layout/default/ConstructionConsent/Form.php b/Layout/default/ConstructionConsent/Form.php index b928d6c1a..80d2c0521 100644 --- a/Layout/default/ConstructionConsent/Form.php +++ b/Layout/default/ConstructionConsent/Form.php @@ -377,6 +377,18 @@ } + $("#kg").change(updateGstnr); + $("#gst").change(updateGstnr); + + function updateGstnr() { + let kg = $("#kg").val(); + let gst = $("#gst").val(); + + if(!kg || !gst) return; + + $("#gstnr").val(kg + gst); + } + \ No newline at end of file diff --git a/Layout/default/ConstructionConsent/View.php b/Layout/default/ConstructionConsent/View.php index 90dcccd95..b68115ca0 100644 --- a/Layout/default/ConstructionConsent/View.php +++ b/Layout/default/ConstructionConsent/View.php @@ -60,10 +60,10 @@ $pagination_entity_name = "Adressen"; adb_hausnummer->strasse->gemeinde->name?> - Anzahl Wohneinheiten + Wohneinheiten adb_hausnummer->unit_count?> - Anzahl Bestellungen + Bestellungen preorder_count?> @@ -159,6 +159,43 @@ $pagination_entity_name = "Adressen";
+
+
+

Ansprechpartner + Neuen Ansprechpartner hinzufügen +

+ + contacts) || !count($item->contacts)): ?> + Keine Ansprechpartner eingetragen + + + + + + + + + + + contacts as $type => $contacts): ?> + + + + + + + + + + + +
KontakttypNameTelefonFaxEmail
type, "consent")?>name?>phone?>fax?>email?> + + $contact->id])?>" onclick="if(!confirm('Ansprechpartner wirklich löschen?')) return false;" class="text-danger" title="Löschen"> +
+ +
+
@@ -196,12 +233,13 @@ $pagination_entity_name = "Adressen"; email?> - status, "consent")?> + status) ? __($owner->status, "consent") : ""?>
+
+ +
+
+ +
+
+

Journal

+ + +
+
+ + +
+
+ + + journal as $j): ?> + + + + + +
create)?> (creator?>) + text)?> +
+
+
+
+ +
+ +
+
+

History

+ +
+ + + + + + + + + history as $history): ?> + + + + + + + + +
ZeitpunktBenutzerFeldAlter WertNeuer Wert
create)?>creator->name?>getKey()?>getText("old")?>getText("new")?>
+
+
+
+
+
+ +
+