Kundenmail 26.11.: Feiertage NRW, Abwesenheitsfilter, Von/Bis-Automatik, Navigation, zweiter Mitarbeiter im Kalender, Bearbeitungsrechte, Bemerkungsfeld, Frei-bis

- Feiertage NRW im Kalender markiert (eigene Osterformel, keine Extra-Extension)
- Abwesenheiten: Zeitraeume 'Naechster Monat'/'Alle' plus Mitarbeiterfilter
- 'Bis' folgt 'Von' per data-date-pair; Kalender waehlt Zeitraum mit zwei Klicks
- Hauptnavigation: Uebersicht - Erinnerungen - Kalender - Abwesenheiten - Verwaltung
- Kalender zeigt abweichenden Ruecknahme-Mitarbeiter auch bei kurzen Buchungen
- Buchungen bearbeiten/verschieben fuer alle Mitarbeiter; Anlegen, Storno, Loeschen
  und Betraege/Rechnungsdaten bleiben beim Admin (serverseitig erzwungen)
- Bemerkungsfeld je Buchung (Migration 008_booking_note.sql, nicht im Kundentext)
- Uebersicht: 'Frei bis <Datum>' bei freien Anhaengern
This commit is contained in:
torsten 2026-11-29 12:24:59 +01:00
parent 1ade7624e2
commit 7e462d84a1
20 changed files with 969 additions and 91 deletions

View file

@ -473,8 +473,20 @@ a .ico, button .ico { pointer-events: none; }
color: var(--muted); font-size: .76rem;
}
.cal-scroll-hint .ico { width: 14px; height: 14px; }
.cal-scroll-hint--range { color: var(--brand-800); }
.cal-shell { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); overflow: hidden; }
/* Zeitraum-Auswahl mit zwei Klicks: gewählter Starttag und Hinweisleiste. */
.cal-range-hint {
display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
padding: 8px 12px; background: var(--ice-100); border-bottom: 1px solid var(--line);
font-size: .82rem; font-weight: 600; color: var(--brand-800);
}
.cal-range-hint[hidden] { display: none; }
.cal-cell.is-range-start { background: rgba(25, 106, 188, .22); box-shadow: inset 0 0 0 2px var(--brand); }
/* Eine Zeile mehr im Balken (abweichende Rücknahme) braucht Platz. */
.cal-bar.has-meta { padding-top: 2px; padding-bottom: 2px; }
.cal-scroll { overflow-x: auto; overflow-y: hidden; }
.cal { --lane: 150px; display: grid; grid-template-columns: var(--lane) minmax(0, 1fr); }
.cal-corner {
@ -509,6 +521,14 @@ a .ico, button .ico { pointer-events: none; }
/* Wochenwechsel in der 4-Wochen-Ansicht sichtbar machen. */
.cal-head__day.is-week-start { border-left: 2px solid var(--line); }
.cal-head__week { font-family: var(--font-display); font-size: .56rem; font-weight: 800; letter-spacing: .04em; color: var(--brand-700); margin-top: 1px; white-space: nowrap; }
/* Feiertage (NRW): eigener Farbton, weil Feiertage wie Wochenenden berechnet werden. */
.cal-head__day.is-holiday { background: #fff1f0; }
.cal-head__day.is-holiday .cal-head__num, .cal-head__day.is-holiday .cal-head__weekday { color: #b3261e; }
.cal-head__holiday {
font-family: var(--font-display); font-size: .54rem; font-weight: 700; letter-spacing: .01em;
color: #b3261e; margin-top: 1px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cal-head__day.is-today .cal-head__holiday { color: #8c1d18; }
.cal-label {
position: sticky; left: 0; z-index: 5; background: #fff;
@ -532,6 +552,8 @@ a .ico, button .ico { pointer-events: none; }
.cal-cell:hover { background: #f2f8ff; }
.cal-cell.is-weekend { background: #fbfdff; }
.cal-cell.is-weekend:hover { background: #f1f8ff; }
.cal-cell.is-holiday { background: #fff5f4; }
.cal-cell.is-holiday:hover { background: #ffe9e7; }
.cal-cell.is-today { background: rgba(230, 241, 252, .5); }
.cal-cell.is-today:hover { background: rgba(211, 230, 249, .7); }
.cal-cell.is-week-start { border-left: 2px solid var(--line); }
@ -590,6 +612,7 @@ a .ico, button .ico { pointer-events: none; }
.cal-bar__name { font-size: .76rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.2; }
.cal-bar__meta { font-size: .63rem; font-weight: 500; opacity: .88; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.25; }
.cal-bar__meta--soft { opacity: .72; }
.cal-bar__meta--return { font-weight: 700; opacity: .95; }
.cal-bar__flag { font-size: .58rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; opacity: .9; }
.cal-foot { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 12px 4px 0; color: var(--muted); font-size: .76rem; }
.cal-foot p { display: flex; align-items: center; gap: 7px; max-width: 90ch; }
@ -680,6 +703,9 @@ a .ico, button .ico { pointer-events: none; }
.copy-list--compact dd { font-size: .84rem; }
.copy-hint { display: flex; align-items: center; gap: 6px; margin-top: 12px; color: var(--muted); font-size: .76rem; }
.copy-hint .ico { width: 14px; height: 14px; color: var(--green); }
/* Internes Bemerkungsfeld zur Buchung. */
.note-text { white-space: normal; line-height: 1.5; font-size: .88rem; color: var(--ink); overflow-wrap: anywhere; }
.next-reminder--note { background: #fffaf0; border-color: #f2dfb4; }
.reminder-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.reminder-row {

View file

@ -523,8 +523,12 @@
if (!/^\d{4}-\d{2}-\d{2}$/.test(value || '')) return;
// Der Datepicker von "Bis" startet damit im Monat des Folgetags.
end.min = value;
// "Von" vorgeben heißt: eintägige Anfrage – "Bis" folgt automatisch.
end.value = nextDay(value);
// "Von" vorgeben heißt: eintägige Anfrage – "Bis" folgt automatisch,
// solange es leer ist oder vor dem neuen Start liegt. Eine bereits
// bewusst gewählte längere Spanne bleibt erhalten.
if (!end.value || end.value < value) {
end.value = nextDay(value);
}
};
// Beim Laden nur die Untergrenze setzen, damit eine vorhandene
// serverseitige Auswahl (GET-Parameter) erhalten bleibt.
@ -548,6 +552,69 @@
scroller.scrollLeft = Math.max(0, cell.offsetLeft - 8);
});
/* ------------------------------------- Kalender: Zeitraum per zwei Klicks */
// Erster Klick auf ein Tagesfeld setzt „Von“, der zweite Klick im selben
// Anhänger „Bis“ und öffnet das Buchungsformular mit genau diesem Zeitraum.
// Nur für Nutzer, die Buchungen anlegen dürfen (Zellen sind dann Links).
document.querySelectorAll('.cal-shell[data-new-booking-url]').forEach((shell) => {
const hint = shell.querySelector('[data-range-hint]');
const hintText = shell.querySelector('[data-range-hint-text]');
const cancel = shell.querySelector('[data-range-cancel]');
const newBookingUrl = shell.dataset.newBookingUrl;
if (!newBookingUrl) return;
const fmt = (iso) => {
if (!/^\d{4}-\d{2}-\d{2}$/.test(String(iso || ''))) return '–';
const [y, m, d] = iso.split('-');
return `${d}.${m}.${y}`;
};
let anchor = null; // { trailerId, date, cell, label }
const clear = () => {
anchor?.cell?.classList.remove('is-range-start');
anchor = null;
if (hint) hint.hidden = true;
};
shell.addEventListener('click', (event) => {
const cell = event.target.closest('a.cal-cell');
if (!cell || !shell.contains(cell)) return;
// Klick nach einem Ziehen nicht als Datumsauswahl werten.
if (document.body.dataset.calendarDragged === '1') return;
event.preventDefault();
const track = cell.closest('.cal-track');
const trailerId = track?.dataset.trailerId || '';
const label = track?.dataset.trailerLabel || '';
const date = cell.dataset.date;
if (!date) return;
if (!anchor || anchor.trailerId !== trailerId) {
clear();
anchor = { trailerId, date, cell, label };
cell.classList.add('is-range-start');
if (hint && hintText) {
hintText.textContent = `${label}: Von ${fmt(date)} – jetzt das Enddatum im selben Anhänger wählen.`;
hint.hidden = false;
}
return;
}
const from = anchor.date <= date ? anchor.date : date;
const to = anchor.date <= date ? date : anchor.date;
const params = new URLSearchParams({ trailer: trailerId, start: from, end: to });
window.location.href = `${newBookingUrl}?${params.toString()}`;
});
cancel?.addEventListener('click', (event) => {
event.preventDefault();
clear();
});
document.addEventListener('keydown', (event) => {
if (event.key === 'Escape' && anchor) clear();
});
});
/* -------------------------------------------------------- Kalender: Ziehen */
const calendar = document.querySelector('.cal-shell');
if (calendar && window.matchMedia('(pointer: fine)').matches) {
@ -650,6 +717,9 @@
}
suppressClick = true;
window.setTimeout(() => { suppressClick = false; }, 120);
// Ziehen soll nie als Klick für die Zeitraum-Auswahl gelten.
document.body.dataset.calendarDragged = '1';
window.setTimeout(() => { delete document.body.dataset.calendarDragged; }, 400);
const dx = event.clientX - active.startX;
const shift = Math.round(dx / active.dayWidth);