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:
parent
1ade7624e2
commit
7e462d84a1
20 changed files with 969 additions and 91 deletions
|
|
@ -8,6 +8,7 @@
|
|||
/** @var array $values */
|
||||
/** @var array $errors */
|
||||
/** @var string $period */
|
||||
/** @var int $employeeFilter */
|
||||
/** @var string $date */
|
||||
/** @var string $from */
|
||||
/** @var string $to */
|
||||
|
|
@ -16,17 +17,20 @@
|
|||
/** @var string $today */
|
||||
$fieldError = static fn (string $key): string => (string) ($errors[$key] ?? '');
|
||||
$canEdit = $isAdmin || $ownEmployeeId > 0;
|
||||
$returnTo = '/absences?period=' . rawurlencode($period) . '&date=' . rawurlencode($date);
|
||||
$periodUrl = static fn (string $key, string $d): string => '/absences?period=' . rawurlencode($key) . '&date=' . rawurlencode($d);
|
||||
$employeeQuery = $employeeFilter > 0 ? '&employee=' . $employeeFilter : '';
|
||||
$returnTo = '/absences?period=' . rawurlencode($period) . '&date=' . rawurlencode($date) . $employeeQuery;
|
||||
$periodUrl = static fn (string $key, string $d): string => '/absences?period=' . rawurlencode($key) . '&date=' . rawurlencode($d) . $employeeQuery;
|
||||
$editing = (int) ($values['id'] ?? 0) > 0;
|
||||
$totalCount = 0;
|
||||
foreach ($byEmployee as $group) {
|
||||
$totalCount += count($group['rows']);
|
||||
}
|
||||
$periodLabels = ['weeks' => '4 Wochen', 'month' => 'Monat', 'next_month' => 'Nächster Monat', 'all' => 'Alle'];
|
||||
$rangeLabel = $period === 'all' ? 'alle Einträge' : fmt_date_range($from, $to);
|
||||
?>
|
||||
<div class="page-head page-head--compact">
|
||||
<div>
|
||||
<p class="eyebrow">Team · <?= $totalCount ?> Abwesenheit<?= $totalCount === 1 ? '' : 'en' ?> im Zeitraum</p>
|
||||
<p class="eyebrow">Team · <?= $totalCount ?> Abwesenheit<?= $totalCount === 1 ? '' : 'en' ?> <?= $period === 'all' ? 'insgesamt' : 'im Zeitraum' ?></p>
|
||||
<h1>Wer ist wann nicht da</h1>
|
||||
<p class="page-head__lede">Urlaub, Krankheit und Sonstiges – für alle sichtbar. Buchungen sind für abwesende Mitarbeiter inklusive Vorlauf gesperrt.</p>
|
||||
</div>
|
||||
|
|
@ -40,16 +44,41 @@ foreach ($byEmployee as $group) {
|
|||
<div class="cal-toolbar">
|
||||
<div class="cal-toolbar__left">
|
||||
<div class="segmented" role="group" aria-label="Zeitraum">
|
||||
<a href="<?= e(url($periodUrl('weeks', $date))) ?>"<?= $period === 'weeks' ? ' class="is-active" aria-current="page"' : '' ?>>4 Wochen</a>
|
||||
<a href="<?= e(url($periodUrl('month', $date))) ?>"<?= $period === 'month' ? ' class="is-active" aria-current="page"' : '' ?>>Monat</a>
|
||||
<?php foreach ($periodLabels as $key => $label): ?>
|
||||
<a href="<?= e(url($periodUrl($key, $date))) ?>"<?= $period === $key ? ' class="is-active" aria-current="page"' : '' ?>><?= e($label) ?></a>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<div class="cal-nav">
|
||||
<a class="icon-btn" href="<?= e(url($periodUrl($period, $prevDate))) ?>" aria-label="Vorheriger Zeitraum"><svg class="ico" aria-hidden="true"><use href="#i-left"/></svg></a>
|
||||
<a class="btn small" href="<?= e(url($periodUrl($period, $today))) ?>">Heute</a>
|
||||
<a class="icon-btn" href="<?= e(url($periodUrl($period, $nextDate))) ?>" aria-label="Nächster Zeitraum"><svg class="ico" aria-hidden="true"><use href="#i-right"/></svg></a>
|
||||
</div>
|
||||
<p class="muted small"><?= e(fmt_date_range($from, $to)) ?></p>
|
||||
<?php if ($period !== 'all' && $period !== 'next_month'): ?>
|
||||
<div class="cal-nav">
|
||||
<a class="icon-btn" href="<?= e(url($periodUrl($period, $prevDate))) ?>" aria-label="Vorheriger Zeitraum"><svg class="ico" aria-hidden="true"><use href="#i-left"/></svg></a>
|
||||
<a class="btn small" href="<?= e(url($periodUrl($period, $today))) ?>">Heute</a>
|
||||
<a class="icon-btn" href="<?= e(url($periodUrl($period, $nextDate))) ?>" aria-label="Nächster Zeitraum"><svg class="ico" aria-hidden="true"><use href="#i-right"/></svg></a>
|
||||
</div>
|
||||
<?php elseif ($period === 'next_month'): ?>
|
||||
<div class="cal-nav">
|
||||
<a class="icon-btn" href="<?= e(url($periodUrl($period, $prevDate))) ?>" aria-label="Vorheriger Monat"><svg class="ico" aria-hidden="true"><use href="#i-left"/></svg></a>
|
||||
<a class="btn small" href="<?= e(url($periodUrl($period, $today))) ?>">Heute</a>
|
||||
<a class="icon-btn" href="<?= e(url($periodUrl($period, $nextDate))) ?>" aria-label="Übernächster Monat"><svg class="ico" aria-hidden="true"><use href="#i-right"/></svg></a>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<p class="muted small"><?= e($rangeLabel) ?></p>
|
||||
</div>
|
||||
<form class="cal-filters" method="get" action="<?= e(url('/absences')) ?>">
|
||||
<input type="hidden" name="period" value="<?= e($period) ?>">
|
||||
<input type="hidden" name="date" value="<?= e($date) ?>">
|
||||
<label class="inline-field">
|
||||
<span>Mitarbeiter</span>
|
||||
<select name="employee" data-autosubmit>
|
||||
<option value="0">Alle Mitarbeiter</option>
|
||||
<?php foreach ($employees as $employee): ?>
|
||||
<option value="<?= (int) $employee['id'] ?>"<?= $employeeFilter === (int) $employee['id'] ? ' selected' : '' ?>>
|
||||
<?= e($employee['name']) ?><?= (int) $employee['active'] === 1 ? '' : ' (inaktiv)' ?>
|
||||
</option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</label>
|
||||
<noscript><button class="btn small" type="submit">Anzeigen</button></noscript>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<?php if ($canEdit): ?>
|
||||
|
|
@ -60,7 +89,7 @@ foreach ($byEmployee as $group) {
|
|||
? 'Als Admin können Sie Abwesenheiten für alle Mitarbeiter pflegen.'
|
||||
: 'Sie können Ihre eigenen Abwesenheiten eintragen und löschen.' ?></p>
|
||||
</div>
|
||||
<form method="post" action="<?= e(url('/absences')) ?>" class="form-grid">
|
||||
<form method="post" action="<?= e(url('/absences')) ?>" class="form-grid" data-date-pair>
|
||||
<?= csrf_field() ?>
|
||||
<input type="hidden" name="id" value="<?= (int) ($values['id'] ?? 0) ?>">
|
||||
<?php if ($isAdmin): ?>
|
||||
|
|
@ -109,11 +138,13 @@ foreach ($byEmployee as $group) {
|
|||
|
||||
<section class="card">
|
||||
<div class="card__head">
|
||||
<h2>Abwesenheiten <?= e(fmt_date_range($from, $to)) ?></h2>
|
||||
<h2>Abwesenheiten <?= e($rangeLabel) ?></h2>
|
||||
<p>Erinnerungen laufen <?= (int) BOOKING_LEAD_DAYS ?> Tage vor Mietbeginn an – deshalb ist der Mitarbeiter schon vor dem Mietbeginn gesperrt.</p>
|
||||
</div>
|
||||
<?php if ($totalCount === 0): ?>
|
||||
<p class="muted">Im gewählten Zeitraum ist niemand als abwesend eingetragen.</p>
|
||||
<p class="muted"><?= $employeeFilter > 0
|
||||
? 'Für den gewählten Mitarbeiter ist im Zeitraum nichts eingetragen.'
|
||||
: ($period === 'all' ? 'Es sind noch keine Abwesenheiten eingetragen.' : 'Im gewählten Zeitraum ist niemand als abwesend eingetragen.') ?></p>
|
||||
<?php else: ?>
|
||||
<ul class="absence-list">
|
||||
<?php foreach ($byEmployee as $group): ?>
|
||||
|
|
@ -136,7 +167,7 @@ foreach ($byEmployee as $group) {
|
|||
<?php endif; ?>
|
||||
<?php if ($isAdmin || (int) $row['employee_id'] === $ownEmployeeId): ?>
|
||||
<span class="absence-entry__actions">
|
||||
<a class="btn small" href="<?= e(url('/absences?period=' . rawurlencode($period) . '&date=' . rawurlencode((string) $row['start_date']) . '&edit=' . (int) $row['id'])) ?>">Bearbeiten</a>
|
||||
<a class="btn small" href="<?= e(url('/absences?period=' . rawurlencode($period) . '&date=' . rawurlencode((string) $row['start_date']) . $employeeQuery . '&edit=' . (int) $row['id'])) ?>">Bearbeiten</a>
|
||||
<form method="post" action="<?= e(url('/absences/' . (int) $row['id'] . '/delete')) ?>" data-confirm="Abwesenheit löschen?">
|
||||
<?= csrf_field() ?>
|
||||
<input type="hidden" name="return_to" value="<?= e($returnTo) ?>">
|
||||
|
|
|
|||
|
|
@ -4,6 +4,9 @@
|
|||
/** @var array $doneMap */
|
||||
/** @var string $copyText */
|
||||
/** @var bool $canDelete */
|
||||
/** @var bool $canEdit */
|
||||
/** @var bool $canCancel */
|
||||
/** @var bool $canEditBilling */
|
||||
/** @var bool $deleteBlocked */
|
||||
/** @var bool $isAdmin */
|
||||
$cancelled = $booking['status'] === 'cancelled';
|
||||
|
|
@ -29,21 +32,25 @@ $returnTo = '/bookings/' . (int) $booking['id'];
|
|||
</h1>
|
||||
</div>
|
||||
<div class="page-head__actions">
|
||||
<a class="btn" href="<?= e(url($returnTo . '/edit')) ?>"><svg class="ico" aria-hidden="true"><use href="#i-edit"/></svg> Bearbeiten</a>
|
||||
<?php if (!empty($canEdit)): ?>
|
||||
<a class="btn" href="<?= e(url($returnTo . '/edit')) ?>"><svg class="ico" aria-hidden="true"><use href="#i-edit"/></svg> Bearbeiten</a>
|
||||
<?php endif; ?>
|
||||
<?php if ($isAdmin): ?>
|
||||
<a class="btn" href="<?= e(url('/bookings/new')) ?>"><svg class="ico" aria-hidden="true"><use href="#i-plus"/></svg> Neue Buchung</a>
|
||||
<?php endif; ?>
|
||||
<?php if (!$cancelled): ?>
|
||||
<form method="post" action="<?= e(url($returnTo . '/cancel')) ?>" data-confirm="Buchung von <?= e($booking['customer_name']) ?> wirklich stornieren?">
|
||||
<?= csrf_field() ?>
|
||||
<input type="hidden" name="return_to" value="<?= e($returnTo) ?>">
|
||||
<button class="btn danger" type="submit"><svg class="ico" aria-hidden="true"><use href="#i-close"/></svg> Stornieren</button>
|
||||
</form>
|
||||
<?php else: ?>
|
||||
<form method="post" action="<?= e(url($returnTo . '/restore')) ?>" data-confirm="Buchung wieder aktivieren?">
|
||||
<?= csrf_field() ?>
|
||||
<button class="btn" type="submit"><svg class="ico" aria-hidden="true"><use href="#i-return"/></svg> Wiederherstellen</button>
|
||||
</form>
|
||||
<?php if (!empty($canCancel)): ?>
|
||||
<?php if (!$cancelled): ?>
|
||||
<form method="post" action="<?= e(url($returnTo . '/cancel')) ?>" data-confirm="Buchung von <?= e($booking['customer_name']) ?> wirklich stornieren?">
|
||||
<?= csrf_field() ?>
|
||||
<input type="hidden" name="return_to" value="<?= e($returnTo) ?>">
|
||||
<button class="btn danger" type="submit"><svg class="ico" aria-hidden="true"><use href="#i-close"/></svg> Stornieren</button>
|
||||
</form>
|
||||
<?php else: ?>
|
||||
<form method="post" action="<?= e(url($returnTo . '/restore')) ?>" data-confirm="Buchung wieder aktivieren?">
|
||||
<?= csrf_field() ?>
|
||||
<button class="btn" type="submit"><svg class="ico" aria-hidden="true"><use href="#i-return"/></svg> Wiederherstellen</button>
|
||||
</form>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -84,6 +91,16 @@ $returnTo = '/bookings/' . (int) $booking['id'];
|
|||
<p class="copy-hint"><svg class="ico" aria-hidden="true"><use href="#i-check"/></svg> Zeilenumbrüche und Formatierung bleiben beim Kopieren erhalten.</p>
|
||||
</section>
|
||||
|
||||
<?php if (trim((string) ($booking['note'] ?? '')) !== ''): ?>
|
||||
<section class="card">
|
||||
<div class="card__head">
|
||||
<h2>Bemerkung</h2>
|
||||
<p>Interne Notiz – nicht Teil des kopierten Kundentexts.</p>
|
||||
</div>
|
||||
<p class="note-text"><?= nl2br(e((string) $booking['note'])) ?></p>
|
||||
</section>
|
||||
<?php endif; ?>
|
||||
|
||||
<section class="card">
|
||||
<div class="card__head">
|
||||
<h2>Automatische Erinnerungen</h2>
|
||||
|
|
@ -174,7 +191,9 @@ $returnTo = '/bookings/' . (int) $booking['id'];
|
|||
<section class="card">
|
||||
<h2>Aktionen</h2>
|
||||
<div class="stack-actions">
|
||||
<a class="btn btn--block" href="<?= e(url($returnTo . '/edit')) ?>"><svg class="ico" aria-hidden="true"><use href="#i-edit"/></svg> Buchung bearbeiten</a>
|
||||
<?php if (!empty($canEdit)): ?>
|
||||
<a class="btn btn--block" href="<?= e(url($returnTo . '/edit')) ?>"><svg class="ico" aria-hidden="true"><use href="#i-edit"/></svg> Buchung bearbeiten</a>
|
||||
<?php endif; ?>
|
||||
<?php if ($isAdmin): ?>
|
||||
<a class="btn btn--block" href="<?= e(url('/bookings/new?trailer=' . (int) $booking['trailer_id'] . '&start=' . $booking['end_date'])) ?>"><svg class="ico" aria-hidden="true"><use href="#i-plus"/></svg> Anschlussbuchung anlegen</a>
|
||||
<?php endif; ?>
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
/** @var array $employees */
|
||||
/** @var array $user */
|
||||
/** @var bool $isEdit */
|
||||
/** @var bool $canEditBilling */
|
||||
$fieldError = static fn (string $key): string => (string) ($errors[$key] ?? '');
|
||||
$cancelled = $isEdit && ($booking['status'] ?? '') === 'cancelled';
|
||||
$selectedTrailer = null;
|
||||
|
|
@ -185,10 +186,17 @@ $backUrl = $isEdit ? '/bookings/' . (int) $booking['id'] : '/calendar';
|
|||
<?php if ($fieldError('email')): ?><em class="field-error"><?= e($fieldError('email')) ?></em><?php endif; ?>
|
||||
</label>
|
||||
|
||||
<label class="field field--wide<?= $fieldError('note') !== '' ? ' has-error' : '' ?>">
|
||||
<span>Bemerkung <small class="optional">(optional)</small></span>
|
||||
<textarea name="note" rows="3" maxlength="500" placeholder="z. B. Schlüsselübergabe hinten, Kunde ruft vorher an"><?= e((string) ($values['note'] ?? '')) ?></textarea>
|
||||
<?php if ($fieldError('note')): ?><em class="field-error"><?= e($fieldError('note')) ?></em><?php endif; ?>
|
||||
<em class="muted small">Für alle Mitarbeiter sichtbar und bearbeitbar. Erscheint nicht im kopierten Kundentext.</em>
|
||||
</label>
|
||||
|
||||
<label class="field<?= $fieldError('rent') !== '' ? ' has-error' : '' ?>" data-paste-field="rent">
|
||||
<span>Miete</span>
|
||||
<span class="money-input">
|
||||
<input type="text" name="rent" value="<?= e($values['rent']) ?>" inputmode="decimal" placeholder="0,00" data-money="rent">
|
||||
<input type="text" name="rent" value="<?= e($values['rent']) ?>" inputmode="decimal" placeholder="0,00" data-money="rent"<?= empty($canEditBilling) ? ' readonly' : '' ?>>
|
||||
<span>€</span>
|
||||
</span>
|
||||
<?php if ($fieldError('rent')): ?><em class="field-error"><?= e($fieldError('rent')) ?></em><?php endif; ?>
|
||||
|
|
@ -197,7 +205,7 @@ $backUrl = $isEdit ? '/bookings/' . (int) $booking['id'] : '/calendar';
|
|||
<label class="field<?= $fieldError('delivery') !== '' ? ' has-error' : '' ?>" data-paste-field="delivery">
|
||||
<span>Lieferkosten</span>
|
||||
<span class="money-input">
|
||||
<input type="text" name="delivery" value="<?= e($values['delivery']) ?>" inputmode="decimal" placeholder="0,00" data-money="delivery">
|
||||
<input type="text" name="delivery" value="<?= e($values['delivery']) ?>" inputmode="decimal" placeholder="0,00" data-money="delivery"<?= empty($canEditBilling) ? ' readonly' : '' ?>>
|
||||
<span>€</span>
|
||||
</span>
|
||||
<?php if ($fieldError('delivery')): ?><em class="field-error"><?= e($fieldError('delivery')) ?></em><?php endif; ?>
|
||||
|
|
@ -212,7 +220,7 @@ $backUrl = $isEdit ? '/bookings/' . (int) $booking['id'] : '/calendar';
|
|||
<label class="field<?= $fieldError('deposit') !== '' ? ' has-error' : '' ?>" data-paste-field="deposit">
|
||||
<span>Anzahlung</span>
|
||||
<span class="money-input">
|
||||
<input type="text" name="deposit" value="<?= e($values['deposit']) ?>" inputmode="decimal" placeholder="0,00" data-money="deposit">
|
||||
<input type="text" name="deposit" value="<?= e($values['deposit']) ?>" inputmode="decimal" placeholder="0,00" data-money="deposit"<?= empty($canEditBilling) ? ' readonly' : '' ?>>
|
||||
<span>€</span>
|
||||
</span>
|
||||
<?php if ($fieldError('deposit')): ?><em class="field-error"><?= e($fieldError('deposit')) ?></em><?php endif; ?>
|
||||
|
|
@ -221,10 +229,10 @@ $backUrl = $isEdit ? '/bookings/' . (int) $booking['id'] : '/calendar';
|
|||
<div class="field<?= $fieldError('invoice_no') !== '' ? ' has-error' : '' ?>" data-paste-field="invoice_no">
|
||||
<span>Rechnung</span>
|
||||
<div class="field-with-aside">
|
||||
<input type="text" name="invoice_no" value="<?= e($values['invoice_no']) ?>" maxlength="40" placeholder="z. B. RE2026054" data-invoice-no>
|
||||
<input type="text" name="invoice_no" value="<?= e($values['invoice_no']) ?>" maxlength="40" placeholder="z. B. RE2026054" data-invoice-no<?= empty($canEditBilling) ? ' readonly' : '' ?>>
|
||||
<span class="segmented-radio segmented-radio--compact">
|
||||
<label><input type="radio" name="invoice" value="0"<?= (int) $values['invoice'] === 0 ? ' checked' : '' ?>><span>NEIN</span></label>
|
||||
<label><input type="radio" name="invoice" value="1"<?= (int) $values['invoice'] === 1 ? ' checked' : '' ?>><span>JA</span></label>
|
||||
<label><input type="radio" name="invoice" value="0"<?= (int) $values['invoice'] === 0 ? ' checked' : '' ?><?= empty($canEditBilling) ? ' disabled' : '' ?>><span>NEIN</span></label>
|
||||
<label><input type="radio" name="invoice" value="1"<?= (int) $values['invoice'] === 1 ? ' checked' : '' ?><?= empty($canEditBilling) ? ' disabled' : '' ?>><span>JA</span></label>
|
||||
</span>
|
||||
</div>
|
||||
<?php if ($fieldError('invoice_no')): ?><em class="field-error"><?= e($fieldError('invoice_no')) ?></em><?php endif; ?>
|
||||
|
|
@ -243,6 +251,9 @@ $backUrl = $isEdit ? '/bookings/' . (int) $booking['id'] : '/calendar';
|
|||
<p class="muted small">
|
||||
Es gilt: Gesamt = Miete + Lieferkosten, „Noch zu zahlen" = Gesamt − Anzahlung.
|
||||
Kunden bitte auf die <a href="<?= e(url('/datenschutz')) ?>">Datenschutzhinweise</a> hinweisen.
|
||||
<?php if (empty($canEditBilling)): ?>
|
||||
<br>Miete, Lieferkosten, Anzahlung und Rechnungsdaten pflegt die Verwaltung.
|
||||
<?php endif; ?>
|
||||
</p>
|
||||
</section>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -3,7 +3,8 @@
|
|||
/** @var array $reminders */
|
||||
/** @var array $doneMap */
|
||||
/** @var string $copyText */
|
||||
/** @var bool $canDelete */
|
||||
/** @var bool $canCancel */
|
||||
/** @var bool $isAdmin */
|
||||
$cancelled = $booking['status'] === 'cancelled';
|
||||
$lines = explode("\n", $copyText);
|
||||
$due = due_cents((int) $booking['total_cents'], (int) $booking['deposit_cents']);
|
||||
|
|
@ -67,6 +68,12 @@ foreach ($reminders as $reminder) {
|
|||
<div><dt>Anzahlung</dt><dd><?= e(fmt_money((int) $booking['deposit_cents'])) ?></dd></div>
|
||||
<div class="is-strong"><dt>Noch zu zahlen</dt><dd><?= e(fmt_money($due)) ?></dd></div>
|
||||
</dl>
|
||||
<?php if (trim((string) ($booking['note'] ?? '')) !== ''): ?>
|
||||
<div class="next-reminder next-reminder--note">
|
||||
<span>Bemerkung</span>
|
||||
<p class="note-text"><?= nl2br(e((string) $booking['note'])) ?></p>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php if ($openReminder): ?>
|
||||
<div class="next-reminder<?= $openReminder['due_date'] < today_iso() ? ' is-overdue' : '' ?>">
|
||||
<span>Nächste Erinnerung</span>
|
||||
|
|
@ -83,16 +90,18 @@ foreach ($reminders as $reminder) {
|
|||
<?php if (!empty($isAdmin)): ?>
|
||||
<a class="btn" href="<?= e(url('/bookings/new')) ?>"><svg class="ico" aria-hidden="true"><use href="#i-plus"/></svg> Neue Buchung</a>
|
||||
<?php endif; ?>
|
||||
<?php if (!$cancelled): ?>
|
||||
<form method="post" action="<?= e(url($bookingUrl . '/cancel')) ?>" data-confirm="Buchung von <?= e($booking['customer_name']) ?> wirklich stornieren?">
|
||||
<?= csrf_field() ?>
|
||||
<input type="hidden" name="return_to" value="<?= e($bookingUrl) ?>">
|
||||
<button class="btn danger-ghost" type="submit">Stornieren</button>
|
||||
</form>
|
||||
<?php else: ?>
|
||||
<form method="post" action="<?= e(url($bookingUrl . '/restore')) ?>" data-confirm="Buchung wieder aktivieren?">
|
||||
<?= csrf_field() ?>
|
||||
<button class="btn" type="submit">Wiederherstellen</button>
|
||||
</form>
|
||||
<?php if (!empty($canCancel)): ?>
|
||||
<?php if (!$cancelled): ?>
|
||||
<form method="post" action="<?= e(url($bookingUrl . '/cancel')) ?>" data-confirm="Buchung von <?= e($booking['customer_name']) ?> wirklich stornieren?">
|
||||
<?= csrf_field() ?>
|
||||
<input type="hidden" name="return_to" value="<?= e($bookingUrl) ?>">
|
||||
<button class="btn danger-ghost" type="submit">Stornieren</button>
|
||||
</form>
|
||||
<?php else: ?>
|
||||
<form method="post" action="<?= e(url($bookingUrl . '/restore')) ?>" data-confirm="Buchung wieder aktivieren?">
|
||||
<?= csrf_field() ?>
|
||||
<button class="btn" type="submit">Wiederherstellen</button>
|
||||
</form>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -100,8 +100,16 @@ $minWidth = match ($view) {
|
|||
<?php if ($view !== 'day'): ?>
|
||||
<p class="cal-scroll-hint"><svg class="ico" aria-hidden="true"><use href="#i-left"/></svg> Seitlich scrollen, um alle Tage zu sehen <svg class="ico" aria-hidden="true"><use href="#i-right"/></svg></p>
|
||||
<?php endif; ?>
|
||||
<?php if ($canCreate): ?>
|
||||
<p class="cal-scroll-hint cal-scroll-hint--range">Tipp: erst das Startdatum, dann das Enddatum antippen – der Zeitraum wird direkt als Buchung vorgefüllt.</p>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="cal-shell" data-calendar-view="<?= e($view) ?>" data-calendar-date="<?= e($date) ?>" data-calendar-focus="<?= e($focusFrom) ?>">
|
||||
<div class="cal-shell" data-calendar-view="<?= e($view) ?>" data-calendar-date="<?= e($date) ?>" data-calendar-focus="<?= e($focusFrom) ?>"
|
||||
<?= $canCreate ? 'data-new-booking-url="' . e(url('/bookings/new')) . '"' : '' ?>>
|
||||
<div class="cal-range-hint" data-range-hint hidden>
|
||||
<span data-range-hint-text></span>
|
||||
<button class="link-button" type="button" data-range-cancel>Auswahl aufheben</button>
|
||||
</div>
|
||||
<div class="cal-scroll">
|
||||
<div class="cal" style="--cols: <?= $cols ?>;<?= $minWidth > 0 ? ' min-width: ' . $minWidth . 'px;' : '' ?>">
|
||||
<div class="cal-corner">
|
||||
|
|
@ -110,9 +118,13 @@ $minWidth = match ($view) {
|
|||
</div>
|
||||
<div class="cal-head">
|
||||
<?php foreach ($days as $day): ?>
|
||||
<div class="cal-head__day<?= $day['is_today'] ? ' is-today' : '' ?><?= $day['is_weekend'] ? ' is-weekend' : '' ?><?= $day['is_week_start'] ? ' is-week-start' : '' ?>">
|
||||
<?php $dayHoliday = $day['holiday'] ?? null; ?>
|
||||
<div class="cal-head__day<?= $day['is_today'] ? ' is-today' : '' ?><?= $day['is_weekend'] ? ' is-weekend' : '' ?><?= $dayHoliday !== null ? ' is-holiday' : '' ?><?= $day['is_week_start'] ? ' is-week-start' : '' ?>"<?= $dayHoliday !== null ? ' title="' . e($dayHoliday) . '"' : '' ?>>
|
||||
<span class="cal-head__weekday"><?= e($day['weekday']) ?></span>
|
||||
<span class="cal-head__num"><?= (int) $day['day'] ?></span>
|
||||
<?php if ($dayHoliday !== null): // Feiertag (NRW) benennen, damit er nicht nur per Farbe erkennbar ist. ?>
|
||||
<span class="cal-head__holiday"><?= e($dayHoliday) ?></span>
|
||||
<?php endif; ?>
|
||||
<?php // Monat in jeder Tagesüberschrift, damit er auch in der Handy-Ansicht
|
||||
// ohne das große Monats-Label erkennbar bleibt. ?>
|
||||
<span class="cal-head__month<?= $day['is_first_of_month'] ? ' is-month-start' : '' ?>"><?= e($view === 'day' ? fmt_month($day['iso']) : fmt_month_short($day['iso'])) ?></span>
|
||||
|
|
@ -141,16 +153,25 @@ $minWidth = match ($view) {
|
|||
<div class="cal-track" style="--row-h: <?= (int) $row['height'] ?>px; --lanes: <?= (int) $row['lanes'] ?>" data-trailer-id="<?= (int) $trailer['id'] ?>" data-trailer-label="<?= e($trailer['label']) ?>">
|
||||
<div class="cal-cells">
|
||||
<?php foreach ($days as $day): ?>
|
||||
<?php
|
||||
$cellHoliday = $day['holiday'] ?? null;
|
||||
$cellClass = 'cal-cell'
|
||||
. ($day['is_today'] ? ' is-today' : '')
|
||||
. ($day['is_weekend'] ? ' is-weekend' : '')
|
||||
. ($cellHoliday !== null ? ' is-holiday' : '')
|
||||
. ($day['is_week_start'] ? ' is-week-start' : '');
|
||||
?>
|
||||
<?php if ($canCreate): ?>
|
||||
<a class="cal-cell<?= $day['is_today'] ? ' is-today' : '' ?><?= $day['is_weekend'] ? ' is-weekend' : '' ?><?= $day['is_week_start'] ? ' is-week-start' : '' ?>"
|
||||
<a class="<?= $cellClass ?>"
|
||||
href="<?= e(url('/bookings/new?trailer=' . (int) $trailer['id'] . '&start=' . $day['iso'] . '&end=' . $day['iso'])) ?>"
|
||||
data-cell="1"
|
||||
data-date="<?= e($day['iso']) ?>"
|
||||
aria-label="Neue Buchung <?= e($trailer['label']) ?> am <?= e(fmt_date($day['iso'])) ?>"></a>
|
||||
<?= $cellHoliday !== null ? 'data-holiday="' . e((string) $cellHoliday) . '" ' : '' ?>aria-label="Neue Buchung <?= e($trailer['label']) ?> am <?= e(fmt_date($day['iso'])) ?><?= $cellHoliday !== null ? ', ' . e((string) $cellHoliday) : '' ?>"></a>
|
||||
<?php else: ?>
|
||||
<span class="cal-cell<?= $day['is_today'] ? ' is-today' : '' ?><?= $day['is_weekend'] ? ' is-weekend' : '' ?><?= $day['is_week_start'] ? ' is-week-start' : '' ?>"
|
||||
<span class="<?= $cellClass ?>"
|
||||
data-cell="1"
|
||||
data-date="<?= e($day['iso']) ?>"></span>
|
||||
data-date="<?= e($day['iso']) ?>"
|
||||
<?= $cellHoliday !== null ? 'data-holiday="' . e((string) $cellHoliday) . '"' : '' ?>></span>
|
||||
<?php endif; ?>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
|
|
@ -159,14 +180,25 @@ $minWidth = match ($view) {
|
|||
$booking = $bar['booking'];
|
||||
$geo = $bar['geo'];
|
||||
$cancelled = $booking['status'] === 'cancelled';
|
||||
$showMeta = $view === 'day' || $geo['span'] >= 2;
|
||||
// Zweiter Mitarbeiter (abweichende Rücknahme) auch bei kurzen
|
||||
// Buchungen zeigen – die Zeile/Spalte wird dafür höher.
|
||||
$separateReturn = booking_has_separate_return($booking);
|
||||
$showMeta = $view === 'day' || $geo['span'] >= 2 || $separateReturn;
|
||||
$compactReturn = $separateReturn && $view !== 'day' && $geo['span'] < 2;
|
||||
$label = in_array($view, ['month', 'weeks'], true) ? truncate((string) $booking['customer_name'], 18) : (string) $booking['customer_name'];
|
||||
$barClass = 'cal-bar'
|
||||
. ($cancelled ? ' is-cancelled' : '')
|
||||
. (!empty($bar['absent']) && $booking['status'] !== 'cancelled' ? ' is-absent-conflict' : '')
|
||||
. ($geo['cut_start'] ? ' is-cut-start' : '')
|
||||
. ($geo['cut_end'] ? ' is-cut-end' : '')
|
||||
. ($geo['span'] <= 1 ? ' is-tiny' : '')
|
||||
. ($showMeta ? ' has-meta' : '');
|
||||
$aria = $booking['customer_name'] . ', ' . $booking['trailer_label'] . ', '
|
||||
. fmt_date_with_time($booking['start_date'], $booking['start_time'] ?? null) . ' bis '
|
||||
. fmt_date_with_time($booking['end_date'], $booking['end_time'] ?? null)
|
||||
. ', ' . booking_employee_summary($booking) . ($cancelled ? ', storniert' : '');
|
||||
?>
|
||||
<a class="cal-bar<?= $cancelled ? ' is-cancelled' : '' ?><?= !empty($bar['absent']) && $booking['status'] !== 'cancelled' ? ' is-absent-conflict' : '' ?><?= $geo['cut_start'] ? ' is-cut-start' : '' ?><?= $geo['cut_end'] ? ' is-cut-end' : '' ?><?= $geo['span'] <= 1 ? ' is-tiny' : '' ?>"
|
||||
<a class="<?= $barClass ?>"
|
||||
href="<?= e(url('/bookings/' . (int) $booking['id'])) ?>"
|
||||
draggable="false"
|
||||
data-panel="<?= (int) $booking['id'] ?>"
|
||||
|
|
@ -182,6 +214,9 @@ $minWidth = match ($view) {
|
|||
<?php if ($showMeta): ?>
|
||||
<span class="cal-bar__meta"><?= e($view === 'day' ? fmt_date_with_time($booking['start_date'], $booking['start_time'] ?? null) . ' – ' . fmt_date_with_time($booking['end_date'], $booking['end_time'] ?? null) : booking_employee_summary($booking)) ?><?= $view === 'day' ? ' · ' . e(booking_employee_summary($booking)) : '' ?></span>
|
||||
<?php endif; ?>
|
||||
<?php if ($compactReturn): // Kurze Buchung: Rücknahme-Mitarbeiter kompakt in eigener Zeile. ?>
|
||||
<span class="cal-bar__meta cal-bar__meta--return"><?= e(truncate('Rücknahme: ' . booking_return_employee_name($booking), 16)) ?></span>
|
||||
<?php endif; ?>
|
||||
<?php if ($view === 'day'): ?>
|
||||
<span class="cal-bar__meta cal-bar__meta--soft"><?= e(booking_kind_label((string) $booking['kind'])) ?> · <?= e(fmt_money((int) $booking['total_cents'])) ?></span>
|
||||
<?php endif; ?>
|
||||
|
|
|
|||
|
|
@ -129,7 +129,12 @@ $isEmployeeView = $employeeScope > 0;
|
|||
<?php endforeach; ?>
|
||||
</ul>
|
||||
<?php else: ?>
|
||||
<p class="trailer-card__free">Frei – neue Buchung möglich.</p>
|
||||
<?php $freeUntil = (string) ($row['free_until'] ?? ''); ?>
|
||||
<?php if (valid_date($freeUntil)): ?>
|
||||
<p class="trailer-card__free">Frei bis <strong><?= e(fmt_date($freeUntil)) ?></strong> – neue Buchung möglich.</p>
|
||||
<?php else: ?>
|
||||
<p class="trailer-card__free">Frei – neue Buchung möglich.</p>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
</article>
|
||||
<?php endforeach; ?>
|
||||
|
|
|
|||
|
|
@ -90,16 +90,16 @@ $navActive = static function (string $area) use ($path): string {
|
|||
<a href="<?= e(url('/')) ?>"<?= $navActive('dashboard') ?>>
|
||||
<svg class="ico" aria-hidden="true"><use href="#i-grid"/></svg><span><span class="nav-long">Übersicht</span><span class="nav-short">Start</span></span>
|
||||
</a>
|
||||
<a href="<?= e(url('/reminders')) ?>"<?= $navActive('reminders') ?>>
|
||||
<svg class="ico" aria-hidden="true"><use href="#i-bell"/></svg><span><span class="nav-long">Erinnerungen</span><span class="nav-short">Aufgaben</span></span>
|
||||
<?php if ($badge > 0): ?><span class="nav-badge" aria-label="<?= $badge ?> offene Erinnerungen"><?= $badge > 99 ? '99+' : $badge ?></span><?php endif; ?>
|
||||
</a>
|
||||
<a href="<?= e(url('/calendar')) ?>"<?= $navActive('calendar') ?>>
|
||||
<svg class="ico" aria-hidden="true"><use href="#i-calendar"/></svg><span><span class="nav-long">Kalender</span><span class="nav-short">Kalender</span></span>
|
||||
</a>
|
||||
<a href="<?= e(url('/absences')) ?>"<?= $navActive('absences') ?>>
|
||||
<svg class="ico" aria-hidden="true"><use href="#i-clock"/></svg><span><span class="nav-long">Abwesenheiten</span><span class="nav-short">Team</span></span>
|
||||
</a>
|
||||
<a href="<?= e(url('/reminders')) ?>"<?= $navActive('reminders') ?>>
|
||||
<svg class="ico" aria-hidden="true"><use href="#i-bell"/></svg><span><span class="nav-long">Erinnerungen</span><span class="nav-short">Aufgaben</span></span>
|
||||
<?php if ($badge > 0): ?><span class="nav-badge" aria-label="<?= $badge ?> offene Erinnerungen"><?= $badge > 99 ? '99+' : $badge ?></span><?php endif; ?>
|
||||
</a>
|
||||
<?php if ($isAdmin): ?>
|
||||
<a href="<?= e(url('/admin/users')) ?>"<?= $navActive('admin') ?>>
|
||||
<svg class="ico" aria-hidden="true"><use href="#i-users"/></svg><span><span class="nav-long">Verwaltung</span><span class="nav-short">Admin</span></span>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue