Added Changes in ConstructionConsent

This commit is contained in:
Luca Haid
2025-01-30 14:54:34 +01:00
parent e2d0f65a81
commit b85c93ad83
3 changed files with 137 additions and 30 deletions
+72 -5
View File
@@ -180,7 +180,7 @@ $pagination_entity_name = "Adressen";
</tr><tr>
<th>Plan/Skizze</th>
<td>
<?php if($item->file): ?>
<?php if($item->file && $item->file->file): ?>
<!--img src="<?=self::getUrl("File", "Download", ["id" => $item->file->file_id])?>" style="max-width: 480px;"/-->
<img src="<?=$item->file->file->asDataUrl()?>" style="max-width: 480px;" />
<?php endif; ?>
@@ -257,7 +257,7 @@ $pagination_entity_name = "Adressen";
<h5>Zusammenfassung Status (von <?=count($item->owners)?>)</h5>
<table class="table table-sm">
<?php foreach($item->owner_status_counts as $type => $count): ?>
<tr>
<tr class="ConstructionConsentOwnerResult-<?=$type?>">
<th><?=__($type, "consent")?></th>
<td><?=$count?></td>
</tr>
@@ -265,17 +265,33 @@ $pagination_entity_name = "Adressen";
</table>
</div>
<div class="col-3">
<h5>Zusammenfassung Ergebnis (von <?=count($item->owners)?>)</h5>
<?php
// Determine the status based on the counts
$status_class = 'blue'; // Default to blue (all open)
if (isset($item->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
}
?>
<!-- Circle for status -->
<h5><div class="status-circle <?=$status_class?>"></div>Zusammenfassung Ergebnis (von <?=count($item->owners)?>)</h5>
<table class="table table-sm">
<?php foreach($item->owner_result_counts as $type => $count): ?>
<?php if(!$type) continue; ?>
<tr>
<?php if(!$type) continue; ?>
<tr class="ConstructionConsentOwnerResult-<?=$type?>">
<th><?=__($type,"consent")?></th>
<td><?=$count?></td>
</tr>
<?php endforeach; ?>
</table>
</div>
</div>
<table class="table table-sm table-striped table-hover">
<tr>
@@ -985,4 +1001,55 @@ $pagination_entity_name = "Adressen";
</script>
<style>
/* Styles for the status circle */
.status-circle {
width: 14px;
height: 14px;
border-radius: 50%;
display: inline-block;
}
.status-circle.red {
background-color: #d9534f; /* Red */
}
.status-circle.yellow {
background-color: #f0ad4e; /* Yellow */
}
.status-circle.green {
background-color: #5cb85c; /* Green */
}
.status-circle.blue {
background-color: #337ab7; /* Blue */
}
.ConstructionConsentOwnerResult-denied {
/*red background color here for this tr*/
background-color: #d9534f
}
.ConstructionConsentOwnerResult-open {
/*grey background color here for this tr*/
background-color: #bababa
}
.ConstructionConsentOwnerResult-accepted {
/*green background color here for this tr*/
background-color: #5cb85c
}
.ConstructionConsentOwnerResult-unresolvable {
/*orange background color here for this tr*/
background-color: #f0ad4e
}
.ConstructionConsentOwnerResult-moved {
/*orange background color here for this tr*/
background-color: #f0ad4e
}
</style>
<?php include(realpath(dirname(__FILE__)."/../../$mfLayoutPackage")."/footer.php"); ?>