Upload via GUI (335 Dateien)

This commit is contained in:
2026-10-24 20:14:46 +00:00
parent c270c0b6cf
commit b2a0a2d0b8
10 changed files with 688 additions and 3 deletions
+30
View File
@@ -252,6 +252,25 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
}
}
// Ticket-Vorlagen: ?template=ID füllt das Formular vor (nur Vorlagen, die für Kunden sichtbar sind)
$ticketTemplates = [];
$activeTemplateId = 0;
try {
$ticketTemplates = ticket_templates_list(get_db(), true);
if ($_SERVER['REQUEST_METHOD'] !== 'POST' && (int) ($_GET['template'] ?? 0) > 0) {
$tpl = ticket_template_get(get_db(), (int) $_GET['template'], true);
if ($tpl) {
$activeTemplateId = (int) $tpl['id'];
$_POST['subject'] = (string) $tpl['subject'];
$_POST['message'] = (string) ($tpl['body'] ?? '');
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 = []; // Datenbank noch nicht aktualisiert: Formular funktioniert wie bisher
}
$pageTitle = 'Neues Ticket';
$activePage = 'new';
require __DIR__ . '/includes/header_customer.php';
@@ -266,6 +285,17 @@ require __DIR__ . '/includes/header_customer.php';
<a href="/dashboard.php" class="btn secondary" style="white-space:nowrap">Meine Tickets</a>
</div>
<?php if ($ticketTemplates): ?>
<div class="ticket-templates" style="margin:0 0 18px">
<div class="muted" style="font-size:.82rem;margin-bottom:6px">Womit können wir helfen? Eine Vorlage füllt das Formular für Sie vor:</div>
<div style="display:flex;gap:8px;flex-wrap:wrap">
<?php foreach ($ticketTemplates as $__tp): ?>
<a href="/ticket_new.php?template=<?= (int) $__tp['id'] ?>" class="btn <?= $activeTemplateId === (int) $__tp['id'] ? '' : 'secondary' ?>" style="font-size:.85rem" <?= $__tp['description'] ? 'title="' . e((string) $__tp['description']) . '"' : '' ?>><?= e($__tp['name']) ?></a>
<?php endforeach; ?>
<?php if ($activeTemplateId): ?><a href="/ticket_new.php" class="muted" style="align-self:center;font-size:.82rem">Ohne Vorlage</a><?php endif; ?>
</div>
</div>
<?php endif; ?>
<?php foreach ($errors as $err): ?>
<div class="flash error"><?= e($err) ?></div>
<?php endforeach; ?>