From 288727f4657da77a9266465735c7f4c8342c089e Mon Sep 17 00:00:00 2001 From: Luca Haid Date: Tue, 20 May 2025 13:44:55 +0200 Subject: [PATCH] added faulty owner view --- .../ConstructionConsent/Consentform.pdf.php | 2 +- Layout/default/ConstructionConsent/Index.php | 15 ++ Layout/default/ConstructionConsent/View.php | 48 +++++ .../ConstructionConsentController.php | 36 ++++ .../ConstructionConsentOwner.php | 2 +- .../ConstructionConsentOwnerController.php | 5 +- .../ConstructionConsentProject.php | 175 +++++++++++++++ ...20132000_constr_cons_owner_add_company.php | 27 +++ .../ConstructionConsentFaultyEntries.js | 200 ++++++++++++++++++ 9 files changed, 506 insertions(+), 4 deletions(-) create mode 100644 db/migrations/20250520132000_constr_cons_owner_add_company.php create mode 100644 public/js/pages/ConstructionConsentFaultyEntries/ConstructionConsentFaultyEntries.js diff --git a/Layout/default/ConstructionConsent/Consentform.pdf.php b/Layout/default/ConstructionConsent/Consentform.pdf.php index 71d2a7361..8acd913a6 100644 --- a/Layout/default/ConstructionConsent/Consentform.pdf.php +++ b/Layout/default/ConstructionConsent/Consentform.pdf.php @@ -247,7 +247,7 @@ foreach ($owners as $owner):

title) ? $owner->title . "
" : "" ?> - firstname ?> lastname ?>
+ company ? $owner->company : $owner->firstname . ' ' . $owner->lastname ?>
street ?>
country): ?> zip ?> city ?> diff --git a/Layout/default/ConstructionConsent/Index.php b/Layout/default/ConstructionConsent/Index.php index 41c321810..44ee32ad5 100644 --- a/Layout/default/ConstructionConsent/Index.php +++ b/Layout/default/ConstructionConsent/Index.php @@ -2,6 +2,7 @@ $pagination_baseurl = $this->getUrl($Mod,"Index"); $pagination_baseurl_params = ["filter" => $filter]; $pagination_entity_name = "Zustimmungserklärungen"; + ?> @@ -184,6 +185,20 @@ $pagination_entity_name = "Zustimmungserklärungen"; + + +

+
+
ACHTUNG: Dieses Zustimmungserklärungsprojekt enthält fehlerhafte Besitzerdaten.
+

+ $filter["project_id"] ?? ""])?>" class="btn btn-danger mt-2">Hier klicken, um fehlerhafte Einträge zu sehen +

+
+
+ + 0) : ?> diff --git a/Layout/default/ConstructionConsent/View.php b/Layout/default/ConstructionConsent/View.php index 5700693de..fb643072a 100644 --- a/Layout/default/ConstructionConsent/View.php +++ b/Layout/default/ConstructionConsent/View.php @@ -343,7 +343,11 @@ $pagination_entity_name = "Adressen"; + company): ?> + company?>
+ title) ? $owner->title." " : ""?>firstname?> lastname?>
+ street?>
zip?> city?>
country?> @@ -514,6 +518,11 @@ $pagination_entity_name = "Adressen"; + +
+ + +
@@ -1168,10 +1177,49 @@ $pagination_entity_name = "Adressen"; } }); }); + + $(document).ready(function() { + $('#company').on('input', function() { + if ($(this).val().length > 0) { + $('#firstname').prop('required', false); + $('#lastname').prop('required', false); + } else { + $('#firstname').prop('required', true); + $('#lastname').prop('required', true); + } + }); + + $('#firstname, #lastname').on('input', function() { + if ($('#firstname').val().length > 0 && $('#lastname').val().length > 0) { + $('#company').prop('required', false); + } else { + $('#company').prop('required', true); + } + }); + + const urlParams = new URLSearchParams(window.location.search); + const highlightOwnerId = urlParams.get('highlight_owner_id'); + + if (highlightOwnerId) { + const targetRow = document.querySelector(`#owner-data-${highlightOwnerId}`); + if (targetRow) { + targetRow.scrollIntoView({ behavior: 'smooth', block: 'center' }); + targetRow.classList.add('highlight'); + setTimeout(() => { + targetRow.classList.remove('highlight'); + }, 1500); + } + } + + })