Upload via GUI (335 Dateien)

This commit is contained in:
2026-10-24 20:14:41 +00:00
parent f189918dc4
commit 793fe6162e
12 changed files with 1920 additions and 1213 deletions
+28
View File
@@ -149,6 +149,25 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
}
}
// Ticket-Vorlagen: ?template=ID füllt das Formular vor
$ticketTemplates = [];
$activeTemplateId = 0;
try {
$ticketTemplates = ticket_templates_list($pdo);
if ($_SERVER['REQUEST_METHOD'] !== 'POST' && (int) ($_GET['template'] ?? 0) > 0) {
$tpl = ticket_template_get($pdo, (int) $_GET['template']);
if ($tpl) {
$activeTemplateId = (int) $tpl['id'];
$_POST['subject'] = (string) $tpl['subject'];
$_POST['message'] = nl2br(e((string) ($tpl['body'] ?? ''))); // der Editor erwartet HTML
if ($tpl['department_id']) $_POST['department_id'] = (string) $tpl['department_id'];
if ($tpl['help_topic_id']) $_POST['help_topic_id'] = (string) $tpl['help_topic_id'];
if ($tpl['priority_id']) $_POST['priority_id'] = (string) $tpl['priority_id'];
}
}
} catch (Throwable $e) {
$ticketTemplates = [];
}
$pageTitle = 'Ticket erstellen';
$activePage = 'tickets';
require __DIR__ . '/_header.php';
@@ -161,6 +180,15 @@ require __DIR__ . '/_header.php';
<a href="/staff/tickets.php" class="btn secondary">← Zur Ticket-Liste</a>
</div>
<p class="muted">Ticket im Namen eines Kunden anlegen – z.B. bei Telefonanrufen oder Vor-Ort-Anfragen.</p>
<?php if ($ticketTemplates): ?>
<div style="display:flex;gap:8px;flex-wrap:wrap;align-items:center;margin:0 0 14px">
<span class="muted" style="font-size:.82rem">Vorlage:</span>
<?php foreach ($ticketTemplates as $__tp): ?>
<a href="/staff/ticket_create.php?template=<?= (int) $__tp['id'] ?>" class="btn <?= $activeTemplateId === (int) $__tp['id'] ? '' : 'secondary' ?>" style="font-size:.82rem;padding:4px 12px"><?= e($__tp['name']) ?></a>
<?php endforeach; ?>
<?php if ($activeTemplateId): ?><a href="/staff/ticket_create.php" class="muted" style="font-size:.8rem">Ohne Vorlage</a><?php endif; ?>
</div>
<?php endif; ?>
<?php foreach ($errors as $err): ?>
<div class="flash error"><?= e($err) ?></div>