-
This commit is contained in:
@@ -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">×</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>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user