diff --git a/Layout/default/ConstructionConsent/Index.php b/Layout/default/ConstructionConsent/Index.php
index d035b47aa..d49752bfd 100644
--- a/Layout/default/ConstructionConsent/Index.php
+++ b/Layout/default/ConstructionConsent/Index.php
@@ -93,11 +93,11 @@ $pagination_entity_name = "Zustimmungserklärungen";
Name |
Objekttyp |
Objektadresse |
- GST-Nr. |
- EZ |
- Besitzer |
- Besitzer Adresse |
- Besitzer Kontakt |
+
+
+
+
+
Anfragestatus |
Anfrageresultat |
|
@@ -118,26 +118,41 @@ $pagination_entity_name = "Zustimmungserklärungen";
=$item->adb_hausnummer->strasse->gemeinde->name?>
- =$item->gstnr?> |
- =$item->ez?> |
- =$item->owner_name?> |
-
- =$item->owner_street?>
- =$item->owner_zip?> =$item->owner_city?>
- |
-
- phone): ?>
- Tel: =$item->phone?>
-
- fax): ?>
- Fax: =$item->fax?>
-
- email): ?>
- Email: =$item->email?>
-
- |
+gstnr?>
+ez?>
+owner_name?>
+
+owner_street?>
+owner_zip?>owner_city?>
+
+
+phone): ?>
+phone?>
+
+fax): ?>
+fax?>
+
+email): ?>
+email?>
+
+
=($item->status) ? __($item->status,"consent") : ""?> |
- =($item->result) ? __($item->result,"consent") : ""?> |
+
+ owner_result_counts['denied']) && $item->owner_result_counts['denied'] > 0) {
+ $status_class = 'red'; // Red if at least one denied
+ } elseif ((isset($item->owner_result_counts['unresolvable']) && $item->owner_result_counts['unresolvable'] > 0) ||
+ (isset($item->owner_result_counts['moved']) && $item->owner_result_counts['moved'] > 0)) {
+ $status_class = 'yellow'; // Yellow if at least one unresolvable or moved
+ } elseif (isset($item->owner_result_counts['accepted']) &&
+ $item->owner_result_counts['accepted'] === count($item->owners)) {
+ $status_class = 'green'; // Green if all accepted
+ }
+ ?>
+
+ |
$item->id])?>">
result): ?>
@@ -163,5 +178,25 @@ $pagination_entity_name = "Zustimmungserklärungen";
-
+
diff --git a/Layout/default/ConstructionConsent/View.php b/Layout/default/ConstructionConsent/View.php
index d35b8fe92..d82f832c4 100644
--- a/Layout/default/ConstructionConsent/View.php
+++ b/Layout/default/ConstructionConsent/View.php
@@ -180,7 +180,7 @@ $pagination_entity_name = "Adressen";
|
| Plan/Skizze |
- file): ?>
+ file && $item->file->file): ?>
@@ -257,7 +257,7 @@ $pagination_entity_name = "Adressen";
Zusammenfassung Status (von =count($item->owners)?>)
owner_status_counts as $type => $count): ?>
-
+
| =__($type, "consent")?> |
=$count?> |
@@ -265,17 +265,33 @@ $pagination_entity_name = "Adressen";
- Zusammenfassung Ergebnis (von =count($item->owners)?>)
+ owner_result_counts['denied']) && $item->owner_result_counts['denied'] > 0) {
+ $status_class = 'red'; // Red if at least one denied
+ } elseif ((isset($item->owner_result_counts['unresolvable']) && $item->owner_result_counts['unresolvable'] > 0) ||
+ (isset($item->owner_result_counts['moved']) && $item->owner_result_counts['moved'] > 0)) {
+ $status_class = 'yellow'; // Yellow if at least one unresolvable or moved
+ } elseif (isset($item->owner_result_counts['accepted']) &&
+ $item->owner_result_counts['accepted'] === count($item->owners)) {
+ $status_class = 'green'; // Green if all accepted
+ }
+ ?>
+
+
+ Zusammenfassung Ergebnis (von =count($item->owners)?>)
owner_result_counts as $type => $count): ?>
-
-
+
+
| =__($type,"consent")?> |
=$count?> |
+
@@ -985,4 +1001,55 @@ $pagination_entity_name = "Adressen";
+
+
+
+
\ No newline at end of file
diff --git a/application/ConstructionConsent/ConstructionConsent.php b/application/ConstructionConsent/ConstructionConsent.php
index 57b44b386..d88c93475 100644
--- a/application/ConstructionConsent/ConstructionConsent.php
+++ b/application/ConstructionConsent/ConstructionConsent.php
@@ -210,6 +210,11 @@ class ConstructionConsent extends mfBaseModel {
$counts = [];
$owners = $this->getProperty("owners");
+
+ if (!isset($owners) || !is_array($owners)) {
+ return [];
+ }
+
foreach($owners as $owner) {
if(!array_key_exists($owner->result, $counts)) {
$counts[$owner->result] = 0;
|