feat(settings): eigene Unterschrift hinterlegen, Datum im Unterschriftenfeld
- Neue Seite Verwaltung → Einstellungen (/admin/settings): Unterschrift mit Maus/Finger zeichnen, Vorschau, Speichern und Entfernen; Bild über die geschützte Route /admin/settings/signature - owner_signature_*() in app/documents.php speichert die Unterschrift als JPEG unter storage/signature/ (0600) und liefert Pfad/Zeitpunkt - Auftragsbestätigung: Unterschrift des Vermieters im rechten Feld, links vorbelegt „Ort, Datum“ (z. B. „Neuss, 30.11.2026“); beide Felder wandern zusammen auf Seite 2, wenn kein Platz bleibt - Zahlungs- und Schlusstext zu einem Absatz zusammengefasst, damit die Bestätigung mit Anzahlung und Unterschrift einseitig bleibt - CSS .signature-preview, Anleitung, README und ROADMAP (Feature 26)
This commit is contained in:
parent
a45a159f9e
commit
e4be5831e1
6 changed files with 226 additions and 17 deletions
|
|
@ -6,6 +6,7 @@ $items = [
|
|||
'/admin/trailers' => ['label' => 'Anhänger', 'icon' => 'i-truck'],
|
||||
'/admin/mailings' => ['label' => 'Rundmail', 'icon' => 'i-mail'],
|
||||
'/admin/accounts' => ['label' => 'Konten', 'icon' => 'i-bank'],
|
||||
'/admin/settings' => ['label' => 'Einstellungen', 'icon' => 'i-settings'],
|
||||
'/admin/backups' => ['label' => 'Sicherungen', 'icon' => 'i-database'],
|
||||
];
|
||||
?>
|
||||
|
|
|
|||
81
views/admin_settings.php
Normal file
81
views/admin_settings.php
Normal file
|
|
@ -0,0 +1,81 @@
|
|||
<?php
|
||||
/** @var string|null $signatureTime */
|
||||
/** @var bool $hasSignature */
|
||||
/** @var array<string, string> $errors */
|
||||
/** @var array<string, mixed> $legal */
|
||||
/** @var int $depositDueDays */
|
||||
$error = static fn (string $key): string => (string) ($errors[$key] ?? '');
|
||||
$place = trim((string) ($legal['city'] ?? ''));
|
||||
$owner = trim((string) ($legal['owner'] ?? '')) !== '' ? (string) $legal['owner'] : (string) ($legal['business_name'] ?? '');
|
||||
?>
|
||||
<div class="page-head page-head--compact">
|
||||
<div>
|
||||
<p class="eyebrow">Verwaltung</p>
|
||||
<h1>Einstellungen</h1>
|
||||
<p class="page-head__lede">Unterschrift des Vermieters für die Auftragsbestätigung. Sie wird einmal
|
||||
hinterlegt und in jede neu erzeugte Auftragsbestätigung eingesetzt – zusammen mit Ort und Datum.</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php require __DIR__ . '/_admin_nav.php'; ?>
|
||||
|
||||
<?php if ($error('general') !== ''): ?>
|
||||
<div class="alert alert--error" role="alert">
|
||||
<svg class="ico" aria-hidden="true"><use href="#i-alert"/></svg>
|
||||
<div><strong>Das hat nicht geklappt.</strong><p><?= e($error('general')) ?></p></div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<section class="panel">
|
||||
<div class="panel__head">
|
||||
<div>
|
||||
<h2>Unterschrift des Vermieters</h2>
|
||||
<p><?= $hasSignature
|
||||
? 'Hinterlegt' . ($signatureTime !== null ? ' seit ' . e(fmt_datetime($signatureTime)) : '') . '. Neue Auftragsbestätigungen enthalten sie im Feld „Unterschrift Vermieter“.'
|
||||
: 'Noch keine Unterschrift hinterlegt – die Auftragsbestätigung bleibt im Unterschriftenfeld leer.' ?></p>
|
||||
</div>
|
||||
<?php if ($hasSignature): ?>
|
||||
<div class="panel__actions">
|
||||
<form method="post" action="<?= e(url('/admin/settings')) ?>" data-confirm="Hinterlegte Unterschrift entfernen?">
|
||||
<?= csrf_field() ?>
|
||||
<input type="hidden" name="action" value="delete_signature">
|
||||
<button class="btn small danger-ghost" type="submit">
|
||||
<svg class="ico" aria-hidden="true"><use href="#i-trash"/></svg> Unterschrift entfernen
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<div class="form-grid">
|
||||
<div class="field">
|
||||
<span>Aktuell hinterlegt</span>
|
||||
<?php if ($hasSignature): ?>
|
||||
<img class="signature-preview" src="<?= e(url('/admin/settings/signature')) ?>" alt="Hinterlegte Unterschrift von <?= e($owner) ?>">
|
||||
<?php else: ?>
|
||||
<p class="muted small">– keine –</p>
|
||||
<?php endif; ?>
|
||||
<em class="muted small">Ort und Datum setzt die Auftragsbestätigung automatisch:
|
||||
<strong><?= e(trim($place . ', ' . fmt_date(today_iso()), ', ')) ?></strong>.</em>
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<span>Neue Unterschrift zeichnen</span>
|
||||
<form method="post" action="<?= e(url('/admin/settings')) ?>" data-signature-form>
|
||||
<?= csrf_field() ?>
|
||||
<input type="hidden" name="action" value="save_signature">
|
||||
<input type="hidden" name="signature" value="" data-signature-input>
|
||||
<div class="sign-pad" data-signature-pad>
|
||||
<canvas width="900" height="300" data-signature-canvas aria-label="Unterschriftfläche"></canvas>
|
||||
<p class="sign-pad__hint">Hier mit Maus oder Finger unterschreiben</p>
|
||||
</div>
|
||||
<div class="sign-actions">
|
||||
<button type="button" class="btn" data-signature-clear>Leeren</button>
|
||||
<button type="submit" class="btn primary" data-signature-submit disabled>Unterschrift speichern</button>
|
||||
</div>
|
||||
</form>
|
||||
<em class="muted small">Gilt ab sofort für alle <strong>neu</strong> erzeugten Auftragsbestätigungen;
|
||||
bereits erzeugte PDFs bleiben unverändert.</em>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
|
@ -74,6 +74,7 @@ $navActive = static function (string $area) use ($path): string {
|
|||
<symbol id="i-snow" viewBox="0 0 24 24"><path d="M12 2v20M4.5 6.8l15 10.4M19.5 6.8 4.5 17.2M12 6.4 9.6 4M12 6.4 14.4 4M12 17.6 9.6 20M12 17.6l2.4 2.4"/></symbol>
|
||||
<symbol id="i-sun" viewBox="0 0 24 24"><circle cx="12" cy="12" r="4"/><path d="M12 2v3M12 19v3M2 12h3M19 12h3M4.9 4.9 7 7M17 17l2.1 2.1M19.1 4.9 17 7M7 17l-2.1 2.1"/></symbol>
|
||||
<symbol id="i-download" viewBox="0 0 24 24"><path d="M12 3v12M7 10l5 5 5-5"/><path d="M5 20h14"/></symbol>
|
||||
<symbol id="i-settings" viewBox="0 0 24 24"><circle cx="12" cy="12" r="3.2"/><path d="M19.4 14.5a1.6 1.6 0 0 0 .3 1.8l.1.1a2 2 0 1 1-2.8 2.8l-.1-.1a1.6 1.6 0 0 0-1.8-.3 1.6 1.6 0 0 0-1 1.5V21a2 2 0 1 1-4 0v-.2a1.6 1.6 0 0 0-1-1.5 1.6 1.6 0 0 0-1.8.3l-.1.1a2 2 0 1 1-2.8-2.8l.1-.1a1.6 1.6 0 0 0 .3-1.8 1.6 1.6 0 0 0-1.5-1H3a2 2 0 1 1 0-4h.2a1.6 1.6 0 0 0 1.5-1 1.6 1.6 0 0 0-.3-1.8l-.1-.1a2 2 0 1 1 2.8-2.8l.1.1a1.6 1.6 0 0 0 1.8.3H9a1.6 1.6 0 0 0 1-1.5V3a2 2 0 1 1 4 0v.2a1.6 1.6 0 0 0 1 1.5 1.6 1.6 0 0 0 1.8-.3l.1-.1a2 2 0 1 1 2.8 2.8l-.1.1a1.6 1.6 0 0 0-.3 1.8V9a1.6 1.6 0 0 0 1.5 1H21a2 2 0 1 1 0 4h-.2a1.6 1.6 0 0 0-1.4 1z"/></symbol>
|
||||
<symbol id="i-bank" viewBox="0 0 24 24"><path d="M3 9.5 12 4l9 5.5"/><path d="M5 10v9M9.5 10v9M14.5 10v9M19 10v9"/><path d="M3 21h18"/></symbol>
|
||||
<symbol id="i-database" viewBox="0 0 24 24"><ellipse cx="12" cy="5.5" rx="8" ry="3"/><path d="M4 5.5v13c0 1.7 3.6 3 8 3s8-1.3 8-3v-13"/><path d="M4 12c0 1.7 3.6 3 8 3s8-1.3 8-3"/></symbol>
|
||||
</defs>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue