Merge branch 'ConstructionConsent/add-new' into 'master'

-

See merge request fronk/thetool!1291
This commit is contained in:
Luca Haid
2025-05-06 09:29:15 +00:00
6 changed files with 91 additions and 15 deletions

View File

@@ -457,10 +457,15 @@ foreach ($owners as $owner):
<div class="borderpoint">
<h3>Übersichtsplan / Planskizze</h3>
<?php if ($owner->consent->file && $owner->consent->file->file_id && $owner->consent->file->file->fileExists()): ?>
<?php if (
$owner->consent->file &&
$owner->consent->file->file_id &&
$owner->consent->file->file !== null && // Explicitly check if $owner->consent->file->file is not null
$owner->consent->file->file->fileExists()
): ?>
<img src="<?= $owner->consent->file->file->asDataUrl() ?>" style="max-width: 640px; max-height: 640px; border: 1px solid #000"/>
<?php endif; ?>
</div>
<div class="signature-line mt-4">

View File

@@ -170,7 +170,9 @@ $pagination_entity_name = "Zustimmungserklärungen";
<?php endif; ?>
</div>
<div class="col text-right">
<a class="btn btn-success" href="<?=self::getUrl("ConstructionConsent", "downloadMultiple", ["filter" => $filter])?>"><i class="fas fa-download"></i> Zustimmungserklärungen herunterladen</a>
<a class="btn btn-success text-white" style="cursor: pointer" data-toggle="modal" data-target="#downloadModal">
<i class="fas fa-download"></i> Zustimmungserklärungen herunterladen
</a>
</div>
</div>
</form>
@@ -397,8 +399,11 @@ $pagination_entity_name = "Zustimmungserklärungen";
} elseif (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)) {
} 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) ||
(isset($item->owner_result_counts['open']) && $item->owner_result_counts['open'] > 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)) {
@@ -431,6 +436,30 @@ $pagination_entity_name = "Zustimmungserklärungen";
</div>
</div>
<div class="modal fade" id="downloadModal" tabindex="-1" role="dialog" aria-labelledby="downloadModalLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="downloadModalLabel">Zustimmungserklärungen herunterladen</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<div class="custom-control custom-checkbox">
<input type="checkbox" class="custom-control-input" id="markAsSentCheckbox">
<label class="custom-control-label text-danger" for="markAsSentCheckbox">Zustimmungserklärungen auf verschickt setzen?</label>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Abbrechen</button>
<button type="button" class="btn btn-success" id="confirmDownload">Herunterladen</button>
</div>
</div>
</div>
</div>
<style>
/* Styles for the status circle */
.status-circle {
@@ -505,6 +534,17 @@ $pagination_entity_name = "Zustimmungserklärungen";
window.notify('error', 'Fehler beim Verarbeiten oder Importieren der CSV-Daten.');
}
});
const downloadURLWithoutMarkAsSent = '<?=self::getUrl("ConstructionConsent", "downloadMultiple", ["filter" => $filter])?>';
const downloadURLWithMarkAsSent = '<?=self::getUrl("ConstructionConsent", "downloadMultiple", ["filter" => $filter, "markAsSent" => 1])?>';
document.getElementById('confirmDownload').addEventListener('click', () => {
const markAsSent = document.getElementById('markAsSentCheckbox').checked;
const downloadURL = markAsSent ? downloadURLWithMarkAsSent : downloadURLWithoutMarkAsSent;
window.open(downloadURL, '_blank');
$('#downloadModal').modal('hide');
});
});
</script>

View File

@@ -286,8 +286,11 @@ $pagination_entity_name = "Adressen";
$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)) {
} 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) ||
(isset($item->owner_result_counts['open']) && $item->owner_result_counts['open'] > 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)) {
@@ -930,8 +933,15 @@ $pagination_entity_name = "Adressen";
.addClass("text-success")
.data("status-id", update.status);
// find result-id-text and result-it-resulttext and set it to "Offen" / open if data-result-id has nothing
if($("#result-" + update.id + "-text").data("result-id") == "") {
$("#result-" + update.id + "-text").data("result-id", "open").addClass("text-success");
$("#result-" + update.id + "-resulttext").text("Offen");
}
setTimeout(() => {
$("#status-" + update.id + "-text").removeClass("text-success")
$("#result-" + update.id + "-text").removeClass("text-success")
}, 1500);
toggleStatusControl(oid);
@@ -1180,7 +1190,7 @@ $pagination_entity_name = "Adressen";
.ConstructionConsentOwnerResult-open {
/*grey background color here for this tr*/
background-color: #eaeaea
background-color: #ffe58e
}
.ConstructionConsentOwnerResult-accepted {