Buchungen anlegen nur für Administratoren

This commit is contained in:
torsten 2026-11-19 10:48:32 +01:00
parent c8ec53ebdd
commit 6a2a9ea342
8 changed files with 67 additions and 32 deletions

View file

@ -7,6 +7,8 @@
/** @var int $openReminderCount */
/** @var int $handoverCount */
/** @var int $employeeScope */
/** @var array $user */
$canCreate = ($user['role'] ?? '') === 'admin';
$rentedTrailers = 0;
$rentedChests = 0;
$freeTrailers = 0;
@ -44,9 +46,11 @@ $isEmployeeView = $employeeScope > 0;
<a class="btn" href="<?= e(url('/availability')) ?>">
<svg class="ico" aria-hidden="true"><use href="#i-search"/></svg> Verfügbarkeit
</a>
<a class="btn primary" href="<?= e(url('/bookings/new')) ?>">
<svg class="ico" aria-hidden="true"><use href="#i-plus"/></svg> Neue Buchung
</a>
<?php if ($canCreate): ?>
<a class="btn primary" href="<?= e(url('/bookings/new')) ?>">
<svg class="ico" aria-hidden="true"><use href="#i-plus"/></svg> Neue Buchung
</a>
<?php endif; ?>
</div>
</div>
@ -140,7 +144,9 @@ $isEmployeeView = $employeeScope > 0;
<svg class="ico" aria-hidden="true"><use href="#i-calendar"/></svg>
<h3>Keine Übergaben in den nächsten zwei Wochen</h3>
<p>Neue Buchungen erscheinen hier automatisch mit Übergabe- und Rücknahmetermin.</p>
<a class="btn primary" href="<?= e(url('/bookings/new')) ?>">Buchung anlegen</a>
<?php if ($canCreate): ?>
<a class="btn primary" href="<?= e(url('/bookings/new')) ?>">Buchung anlegen</a>
<?php endif; ?>
</div>
<?php else: ?>
<ul class="event-list">
@ -217,11 +223,13 @@ $isEmployeeView = $employeeScope > 0;
<section class="panel panel--quick">
<h2>Kurz zugreifen</h2>
<a class="quick-link" href="<?= e(url('/bookings/new')) ?>">
<span class="quick-link__icon"><svg class="ico" aria-hidden="true"><use href="#i-plus"/></svg></span>
<span><strong>Neue Buchung</strong><small>Zeitraum und Kunde erfassen</small></span>
<svg class="ico chev" aria-hidden="true"><use href="#i-right"/></svg>
</a>
<?php if ($canCreate): ?>
<a class="quick-link" href="<?= e(url('/bookings/new')) ?>">
<span class="quick-link__icon"><svg class="ico" aria-hidden="true"><use href="#i-plus"/></svg></span>
<span><strong>Neue Buchung</strong><small>Zeitraum und Kunde erfassen</small></span>
<svg class="ico chev" aria-hidden="true"><use href="#i-right"/></svg>
</a>
<?php endif; ?>
<a class="quick-link" href="<?= e(url('/search')) ?>">
<span class="quick-link__icon"><svg class="ico" aria-hidden="true"><use href="#i-search"/></svg></span>
<span><strong>Kunde suchen</strong><small>Buchung nach Name finden</small></span>