Anhänger anlegen, aktivieren und löschen

This commit is contained in:
OpenCode 2026-11-13 01:19:05 +01:00
parent b50267e4f0
commit 5ecbd29d21
15 changed files with 265 additions and 55 deletions

View file

@ -338,12 +338,17 @@ function page_calendar(array $user): void
$to = add_days($from, 6);
}
$trailers = trailers_all();
$bookings = booking_list($from, $to, $showCancelled, $employeeId);
$byTrailer = [];
foreach ($bookings as $booking) {
$byTrailer[(int) $booking['trailer_id']][] = $booking;
}
// Aktive Anhänger immer zeigen; inaktive nur, wenn im Zeitraum noch
// historische Buchungen sichtbar sind.
$trailers = array_values(array_filter(
trailers_all(false),
static fn (array $t): bool => (int) $t['active'] === 1 || !empty($byTrailer[(int) $t['id']])
));
$days = [];
$cursor = $from;