Parse-Fehler im Gebäude-Formular behoben

closes #32
This commit is contained in:
bigserver
2026-04-09 08:36:47 +02:00
parent f8c55e4fea
commit 232eead696

View File

@@ -47,7 +47,7 @@ $selectedLocationId = $building['location_id'] ?? $prefillLocationId;
<div class="form-group"> <div class="form-group">
<label for="name">Name <span class="required">*</span></label> <label for="name">Name <span class="required">*</span></label>
<input type="text" id="name" name="name" required <input type="text" id="name" name="name" required
value="<?php echo htmlspecialchars($building['name'] ?? '); ?>" value="<?php echo htmlspecialchars($building['name'] ?? ''); ?>"
placeholder="z.B. Gebäude A, Verwaltungsgebäude"> placeholder="z.B. Gebäude A, Verwaltungsgebäude">
</div> </div>
@@ -57,7 +57,7 @@ $selectedLocationId = $building['location_id'] ?? $prefillLocationId;
<option value="">- Wählen -</option> <option value="">- Wählen -</option>
<?php foreach ($locations as $location): ?> <?php foreach ($locations as $location): ?>
<option value="<?php echo $location['id']; ?>" <option value="<?php echo $location['id']; ?>"
<?php echo ((int)$selectedLocationId === (int)$location['id']) ? 'selected' : '; ?>> <?php echo ((int)$selectedLocationId === (int)$location['id']) ? 'selected' : ''; ?>>
<?php echo htmlspecialchars($location['name']); ?> <?php echo htmlspecialchars($location['name']); ?>
</option> </option>
<?php endforeach; ?> <?php endforeach; ?>
@@ -67,7 +67,7 @@ $selectedLocationId = $building['location_id'] ?? $prefillLocationId;
<div class="form-group"> <div class="form-group">
<label for="comment">Beschreibung</label> <label for="comment">Beschreibung</label>
<textarea id="comment" name="comment" rows="3" <textarea id="comment" name="comment" rows="3"
placeholder="Adresse, Besonderheiten, etc."><?php echo htmlspecialchars($building['comment'] ?? '); ?></textarea> placeholder="Adresse, Besonderheiten, etc."><?php echo htmlspecialchars($building['comment'] ?? ''); ?></textarea>
</div> </div>
</fieldset> </fieldset>
@@ -172,7 +172,7 @@ $selectedLocationId = $building['location_id'] ?? $prefillLocationId;
<script> <script>
function confirmDelete(id) { function confirmDelete(id) {
if (confirm('Dieses Gebaeude wirklich loeschen? Alle Stockwerke werden geloescht.')) { if (confirm('Dieses Gebäude wirklich löschen? Alle Stockwerke werden gelöscht.')) {
fetch('?module=buildings&action=delete', { fetch('?module=buildings&action=delete', {
method: 'POST', method: 'POST',
headers: { 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8' }, headers: { 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8' },
@@ -184,13 +184,12 @@ function confirmDelete(id) {
window.location.href = '?module=buildings&action=list'; window.location.href = '?module=buildings&action=list';
return; return;
} }
alert((data && data.error) ? data.error : 'Loeschen fehlgeschlagen'); alert((data && data.error) ? data.error : 'Löschen fehlgeschlagen');
}) })
.catch(() => { .catch(() => {
alert('Loeschen fehlgeschlagen'); alert('Löschen fehlgeschlagen');
}); });
} }
} }
</script> </script>