Upload via GUI (335 Dateien)
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
</main>
|
||||
</div>
|
||||
<script src="/assets/js/richtext.js?v=<?= @filemtime(__DIR__ . '/../assets/js/richtext.js') ?: time() ?>"></script>
|
||||
<script src="/assets/js/live-tickets.js?v=<?= @filemtime(__DIR__ . '/../assets/js/live-tickets.js') ?: time() ?>"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -36,8 +36,11 @@ if ('serviceWorker' in navigator) {
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<script>try { if (localStorage.getItem('deskhub_sidebar') === 'closed') document.documentElement.classList.add('sidebar-closed'); } catch (e) {}</script>
|
||||
<button type="button" id="sidebar-open" class="sidebar-toggle sidebar-toggle-open" aria-label="Seitenleiste einblenden" title="Seitenleiste einblenden" onclick="document.getElementById('sidebar-toggle').click()">☰</button>
|
||||
<div class="app-shell">
|
||||
<aside class="sidebar">
|
||||
<aside class="sidebar" id="sidebar">
|
||||
<button type="button" id="sidebar-toggle" class="sidebar-toggle sidebar-toggle-close" aria-label="Seitenleiste einklappen" title="Seitenleiste einklappen">«</button>
|
||||
<div class="brand">
|
||||
<?php $logo = get_setting('logo_path'); ?>
|
||||
<?php if ($logo): ?>
|
||||
@@ -102,12 +105,17 @@ if ('serviceWorker' in navigator) {
|
||||
<?php if ($staff['role'] === 'admin'): ?><a href="/staff/custom_lists.php" class="<?= $activePage==='custom_lists'?'active':'' ?>">Benutzerdefinierte Listen</a><?php endif; ?>
|
||||
<?php if ($staff['role'] === 'admin'): ?><a href="/staff/canned_responses.php" class="<?= $activePage==='canned'?'active':'' ?>">Vorlagen</a><?php endif; ?>
|
||||
<?php if ($staff['role'] === 'admin'): ?><a href="/staff/site_pages.php" class="<?= $activePage==='site_pages'?'active':'' ?>">Seiten</a><?php endif; ?>
|
||||
<?php if ($staff['role'] === 'admin'): ?><a href="/staff/languages.php" class="<?= $activePage==='languages'?'active':'' ?>">Sprachen</a><?php endif; ?>
|
||||
<?php if ($staff['role'] === 'admin'): ?><a href="/staff/ticket_templates.php" class="<?= $activePage==='ticket_templates'?'active':'' ?>">Ticket-Vorlagen</a><a href="/staff/status_page.php" class="<?= $activePage==='status_page'?'active':'' ?>">Statusseite</a><?php endif; ?>
|
||||
<?php if (has_permission($staff, 'manage_email_addresses')): ?><a href="/staff/email_addresses.php" class="<?= $activePage==='email_addresses'?'active':'' ?>">E-Mail-Adressen</a><?php endif; ?>
|
||||
<?php if (has_permission($staff, 'manage_email_templates')): ?><a href="/staff/email_templates.php" class="<?= $activePage==='email_templates'?'active':'' ?>">E-Mail-Vorlagen</a><?php endif; ?>
|
||||
<?php if (has_permission($staff, 'manage_kb')): ?><a href="/staff/kb_manage.php" class="<?= $activePage==='kb'?'active':'' ?>">Wissensdatenbank</a><?php endif; ?>
|
||||
<?php if (has_permission($staff, 'manage_assistant')): ?><a href="/staff/assistant.php" class="<?= $activePage==='assistant'?'active':'' ?>">Digitaler Assistent</a><?php endif; ?>
|
||||
|
||||
<?php if ($staff['role'] === 'admin'): ?><a href="/staff/plugins.php" class="<?= $activePage==='plugins'?'active':'' ?>">Plugins</a><?php endif; ?>
|
||||
<?php foreach (plugin_admin_menu_items($staff) as $__pm): ?>
|
||||
<a href="<?= e($__pm['url']) ?>" class="<?= ($activePage ?? '') === 'plugin_' . $__pm['plugin'] ? 'active' : '' ?>"><?= e($__pm['label']) ?></a>
|
||||
<?php endforeach; ?>
|
||||
<span class="nav-group-label">Kunden</span>
|
||||
<?php if ($staff['role'] === 'admin'): ?><a href="/staff/customers.php" class="<?= $activePage==='customers'?'active':'' ?>">Kundenverzeichnis</a><?php endif; ?>
|
||||
<?php if (has_permission($staff, 'manage_organizations')): ?><a href="/staff/organizations.php" class="<?= $activePage==='organizations'?'active':'' ?>">Organisationen</a><?php endif; ?>
|
||||
@@ -173,6 +181,7 @@ if ('serviceWorker' in navigator) {
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="lang-row" style="margin-bottom:10px"><?= i18n_switcher_html('dark') ?></div>
|
||||
<div style="display:flex; gap:14px; align-items:center">
|
||||
|
||||
<?php
|
||||
@@ -354,12 +363,14 @@ window.sessionTimerTimeout = <?= (int)$_jsTimeout ?>;
|
||||
};
|
||||
})();
|
||||
</script>
|
||||
<script src="/assets/js/sidebar.js?v=<?= @filemtime(__DIR__ . "/../assets/js/sidebar.js") ?: time() ?>"></script>
|
||||
<main class="main">
|
||||
<!-- Session-Timer: kompakte Pille oben rechts -->
|
||||
<div id="session-timer-bar" style="position:fixed;top:12px;right:16px;z-index:9999;display:flex;align-items:center;gap:6px;background:rgba(15,23,42,.75);backdrop-filter:blur(6px);border:1px solid rgba(255,255,255,.1);border-radius:20px;padding:4px 12px 4px 8px;pointer-events:none;opacity:0;transition:opacity .3s">
|
||||
<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="#94a3b8" stroke-width="2.5"><circle cx="12" cy="12" r="10"/><polyline points="12 6 12 12 16 14"/></svg>
|
||||
<span id="session-timer" style="font-size:.72rem;font-weight:700;color:#cbd5e1;font-variant-numeric:tabular-nums;letter-spacing:.02em"></span>
|
||||
</div>
|
||||
<?= plugin_filter('staff.page.top', '', ['staff' => $staff ?? null, 'activePage' => $activePage ?? '']) /* Hinweise von Plugins oben auf jeder Seite (fertiges HTML aus vertrauenswürdigem Plugin-Code) */ ?>
|
||||
<?php foreach (get_flashes() as $f): ?>
|
||||
<div class="flash <?= e($f['type']) ?>"><?= e($f['message']) ?></div>
|
||||
<?php endforeach; ?>
|
||||
|
||||
@@ -42,6 +42,7 @@ $pageTitle = 'Passwort zurücksetzen';
|
||||
<?= site_icon_links() ?>
|
||||
</head>
|
||||
<body>
|
||||
<?= i18n_switcher_html('floating') ?>
|
||||
<div class="auth-wrap">
|
||||
<div class="auth-card">
|
||||
<?php require __DIR__ . '/../includes/brand_block.php'; ?>
|
||||
|
||||
+1241
-1212
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,110 @@
|
||||
<?php
|
||||
require_once __DIR__ . '/../includes/bootstrap.php';
|
||||
$admin = require_admin();
|
||||
$pdo = get_db();
|
||||
$errors = [];
|
||||
|
||||
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
verify_csrf();
|
||||
$action = $_POST['action'] ?? '';
|
||||
if ($action === 'settings') {
|
||||
set_setting('status_page_enabled', !empty($_POST['enabled']) ? '1' : '0');
|
||||
$title = trim(mb_substr((string) ($_POST['title'] ?? ''), 0, 80));
|
||||
set_setting('status_page_title', $title !== '' ? $title : 'Systemstatus');
|
||||
audit_log($admin['id'], 'Statusseite: Einstellungen geändert');
|
||||
flash('success', 'Einstellungen gespeichert.');
|
||||
} elseif ($action === 'component_save') {
|
||||
$id = (int) ($_POST['id'] ?? 0) ?: null;
|
||||
$r = status_save_component($pdo, $id, (string) ($_POST['name'] ?? ''), (string) ($_POST['description'] ?? ''), (int) ($_POST['sort_order'] ?? 0));
|
||||
if ($r === null) $errors[] = 'Bitte einen Namen angeben.'; else flash('success', 'Dienst gespeichert.');
|
||||
} elseif ($action === 'component_state') {
|
||||
status_set_component($pdo, (int) ($_POST['id'] ?? 0), (string) ($_POST['status'] ?? ''));
|
||||
flash('success', 'Zustand geändert.');
|
||||
} elseif ($action === 'component_delete') {
|
||||
status_delete_component($pdo, (int) ($_POST['id'] ?? 0));
|
||||
flash('success', 'Dienst entfernt.');
|
||||
} elseif ($action === 'incident_create') {
|
||||
$cid = (int) ($_POST['component_id'] ?? 0) ?: null;
|
||||
$r = status_create_incident($pdo, (string) ($_POST['title'] ?? ''), (string) ($_POST['body'] ?? ''), (string) ($_POST['status'] ?? 'investigating'), $cid, ($_POST['component_state'] ?? '') !== '' ? (string) $_POST['component_state'] : null, (int) $admin['id']);
|
||||
if (!$r['ok']) $errors[] = $r['error']; else { audit_log($admin['id'], 'Statusseite: Meldung veröffentlicht'); flash('success', 'Meldung veröffentlicht.'); }
|
||||
} elseif ($action === 'incident_update') {
|
||||
$r = status_update_incident($pdo, (int) ($_POST['id'] ?? 0), (string) ($_POST['status'] ?? ''), (string) ($_POST['body'] ?? ''), (int) $admin['id'], true);
|
||||
if (!$r['ok']) $errors[] = $r['error']; else flash('success', 'Update veröffentlicht.');
|
||||
} elseif ($action === 'incident_delete') {
|
||||
status_delete_incident($pdo, (int) ($_POST['id'] ?? 0));
|
||||
flash('success', 'Meldung gelöscht.');
|
||||
}
|
||||
if (!$errors) redirect('/staff/status_page.php');
|
||||
}
|
||||
|
||||
$components = status_components($pdo);
|
||||
$incidents = status_incidents($pdo, 60);
|
||||
$states = status_component_states();
|
||||
$incStates = status_incident_states();
|
||||
$pageTitle = 'Statusseite';
|
||||
$activePage = 'status_page';
|
||||
require __DIR__ . '/_header.php';
|
||||
?>
|
||||
<h1>Statusseite</h1>
|
||||
<?php foreach ($errors as $err): ?><div class="flash error"><?= e($err) ?></div><?php endforeach; ?>
|
||||
<p class="muted" style="max-width:820px">Eine öffentliche Seite, auf der Ihre Kunden sehen, ob alles läuft, und über Störungen und Wartungen informiert werden.
|
||||
<?php if (status_page_enabled()): ?>Adresse: <a href="/status.php" target="_blank"><?= e(base_url()) ?>/status.php</a><?php endif; ?></p>
|
||||
|
||||
<form method="post" class="card" style="max-width:820px;margin-bottom:16px">
|
||||
<?= csrf_field() ?><input type="hidden" name="action" value="settings">
|
||||
<h3>Einstellungen</h3>
|
||||
<label style="display:flex;align-items:center;gap:8px;font-weight:400"><input type="checkbox" name="enabled" value="1" style="width:auto" <?= status_page_enabled() ? 'checked' : '' ?>> Statusseite für Kunden anzeigen (Link „Status“ im Kundenbereich)</label>
|
||||
<label for="title" style="margin-top:8px">Überschrift</label>
|
||||
<input type="text" id="title" name="title" maxlength="80" value="<?= e((string) get_setting('status_page_title', 'Systemstatus')) ?>" style="max-width:340px">
|
||||
<div class="btn-row"><button type="submit" class="btn">Speichern</button></div>
|
||||
</form>
|
||||
|
||||
<div class="card" style="max-width:820px;margin-bottom:16px">
|
||||
<h3>Dienste</h3>
|
||||
<?php if (!$components): ?><p class="muted">Noch keine Dienste. Legen Sie unten zum Beispiel „Webseite“, „E-Mail“ oder „Telefon“ an.</p><?php endif; ?>
|
||||
<?php foreach ($components as $c): $st = $states[$c['status']] ?? $states['operational']; ?>
|
||||
<div style="display:flex;gap:10px;flex-wrap:wrap;align-items:center;padding:8px 0;border-top:1px solid var(--border,#e3e9ee)">
|
||||
<div style="flex:1;min-width:180px"><strong><?= e($c['name']) ?></strong><?php if ($c['description']): ?><div class="muted" style="font-size:.8rem"><?= e($c['description']) ?></div><?php endif; ?></div>
|
||||
<form method="post" style="display:flex;gap:6px;align-items:center"><?= csrf_field() ?><input type="hidden" name="action" value="component_state"><input type="hidden" name="id" value="<?= (int) $c['id'] ?>">
|
||||
<select name="status" onchange="this.form.submit()" style="color:<?= e($st[1]) ?>;font-weight:600"><?php foreach ($states as $k => $s): ?><option value="<?= e($k) ?>" <?= $c['status'] === $k ? 'selected' : '' ?>><?= e($s[0]) ?></option><?php endforeach; ?></select></form>
|
||||
<form method="post" onsubmit="return confirm('Dienst entfernen?')"><?= csrf_field() ?><input type="hidden" name="action" value="component_delete"><input type="hidden" name="id" value="<?= (int) $c['id'] ?>"><button class="btn secondary" type="submit" style="padding:2px 10px;font-size:.78rem">Entfernen</button></form>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
<form method="post" style="display:flex;gap:8px;flex-wrap:wrap;margin-top:12px;border-top:1px solid var(--border,#e3e9ee);padding-top:12px"><?= csrf_field() ?><input type="hidden" name="action" value="component_save">
|
||||
<input type="text" name="name" placeholder="Neuer Dienst, z. B. Webseite" maxlength="120" required style="flex:1;min-width:180px">
|
||||
<input type="text" name="description" placeholder="Beschreibung (optional)" maxlength="255" style="flex:1;min-width:180px">
|
||||
<input type="number" name="sort_order" value="<?= count($components) * 10 + 10 ?>" title="Reihenfolge" style="width:80px">
|
||||
<button class="btn" type="submit">Hinzufügen</button></form>
|
||||
</div>
|
||||
|
||||
<form method="post" class="card" style="max-width:820px;margin-bottom:16px"><?= csrf_field() ?><input type="hidden" name="action" value="incident_create">
|
||||
<h3>Neue Meldung (Störung oder Wartung)</h3>
|
||||
<label for="inc_title">Titel</label><input type="text" id="inc_title" name="title" maxlength="200" required placeholder="z. B. E-Mail-Versand verzögert">
|
||||
<label for="inc_body" style="margin-top:8px">Beschreibung</label><textarea id="inc_body" name="body" rows="3" maxlength="4000"></textarea>
|
||||
<div style="display:flex;gap:12px;flex-wrap:wrap;margin-top:8px">
|
||||
<div><label>Stufe</label><select name="status"><?php foreach ($incStates as $k => $l): ?><option value="<?= e($k) ?>"><?= e($l) ?></option><?php endforeach; ?></select></div>
|
||||
<div><label>Betrifft</label><select name="component_id"><option value="">– kein bestimmter Dienst –</option><?php foreach ($components as $c): ?><option value="<?= (int) $c['id'] ?>"><?= e($c['name']) ?></option><?php endforeach; ?></select></div>
|
||||
<div><label>Dienst setzen auf</label><select name="component_state"><option value="">– nicht ändern –</option><?php foreach ($states as $k => $s): ?><option value="<?= e($k) ?>"><?= e($s[0]) ?></option><?php endforeach; ?></select></div>
|
||||
</div>
|
||||
<div class="btn-row"><button type="submit" class="btn">Veröffentlichen</button></div>
|
||||
</form>
|
||||
|
||||
<div class="card" style="max-width:820px">
|
||||
<h3>Meldungen</h3>
|
||||
<?php if (!$incidents): ?><p class="muted">Keine Meldungen in den letzten 60 Tagen.</p><?php endif; ?>
|
||||
<?php foreach ($incidents as $i): ?>
|
||||
<div style="padding:10px 0;border-top:1px solid var(--border,#e3e9ee)">
|
||||
<strong><?= e($i['title']) ?></strong>
|
||||
<span class="muted" style="font-size:.8rem">· <?= e(format_dt((string) $i['created_at'])) ?><?= $i['component_name'] ? ' · ' . e($i['component_name']) : '' ?> · <?= e($incStates[$i['status']] ?? $i['status']) ?></span>
|
||||
<?php foreach ($i['updates'] as $u): ?><div style="font-size:.86rem;margin-top:3px"><span class="muted"><?= e($incStates[$u['status']] ?? $u['status']) ?>:</span> <?= nl2br(e((string) $u['body'])) ?></div><?php endforeach; ?>
|
||||
<?php if ($i['status'] !== 'resolved'): ?>
|
||||
<form method="post" style="display:flex;gap:6px;flex-wrap:wrap;margin-top:6px"><?= csrf_field() ?><input type="hidden" name="action" value="incident_update"><input type="hidden" name="id" value="<?= (int) $i['id'] ?>">
|
||||
<select name="status"><?php foreach ($incStates as $k => $l): ?><option value="<?= e($k) ?>" <?= $k === $i['status'] ? 'selected' : '' ?>><?= e($l) ?></option><?php endforeach; ?></select>
|
||||
<input type="text" name="body" placeholder="Update für die Kunden" maxlength="4000" style="flex:1;min-width:200px">
|
||||
<button class="btn secondary" type="submit">Update senden</button></form>
|
||||
<?php endif; ?>
|
||||
<form method="post" onsubmit="return confirm('Meldung löschen?')" style="margin-top:4px"><?= csrf_field() ?><input type="hidden" name="action" value="incident_delete"><input type="hidden" name="id" value="<?= (int) $i['id'] ?>"><button class="btn secondary" type="submit" style="padding:2px 10px;font-size:.76rem">Löschen</button></form>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<?php require __DIR__ . '/_footer.php'; ?>
|
||||
@@ -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>
|
||||
|
||||
@@ -0,0 +1,84 @@
|
||||
<?php
|
||||
require_once __DIR__ . '/../includes/bootstrap.php';
|
||||
$admin = require_admin();
|
||||
$pdo = get_db();
|
||||
$errors = [];
|
||||
|
||||
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
verify_csrf();
|
||||
$action = $_POST['action'] ?? '';
|
||||
if ($action === 'save') {
|
||||
$id = (int) ($_POST['id'] ?? 0) ?: null;
|
||||
$r = ticket_template_save($pdo, $id, $_POST);
|
||||
if (!$r['ok']) {
|
||||
$errors[] = $r['error'];
|
||||
} else {
|
||||
audit_log($admin['id'], 'Ticket-Vorlage gespeichert: ' . trim((string) ($_POST['name'] ?? '')));
|
||||
flash('success', 'Vorlage gespeichert.');
|
||||
redirect('/staff/ticket_templates.php');
|
||||
}
|
||||
} elseif ($action === 'delete') {
|
||||
ticket_template_delete($pdo, (int) ($_POST['id'] ?? 0));
|
||||
audit_log($admin['id'], 'Ticket-Vorlage gelöscht');
|
||||
flash('success', 'Vorlage gelöscht.');
|
||||
redirect('/staff/ticket_templates.php');
|
||||
}
|
||||
}
|
||||
|
||||
$departments = $pdo->query('SELECT id, name FROM departments ORDER BY name')->fetchAll();
|
||||
$priorities = $pdo->query('SELECT id, name FROM priorities ORDER BY id')->fetchAll();
|
||||
$helpTopics = help_topic_options($pdo);
|
||||
$templates = ticket_templates_list($pdo, false, true);
|
||||
$editing = null;
|
||||
if (!empty($_GET['edit'])) {
|
||||
foreach ($templates as $t) if ((int) $t['id'] === (int) $_GET['edit']) $editing = $t;
|
||||
}
|
||||
// Bei einem Fehler die eingegebenen Werte behalten
|
||||
$v = $errors ? $_POST : ($editing ?: ['is_public' => 1, 'is_active' => 1, 'sort_order' => count($templates) * 10 + 10]);
|
||||
$pageTitle = 'Ticket-Vorlagen';
|
||||
$activePage = 'ticket_templates';
|
||||
require __DIR__ . '/_header.php';
|
||||
?>
|
||||
<h1>Ticket-Vorlagen</h1>
|
||||
<?php foreach ($errors as $err): ?><div class="flash error"><?= e($err) ?></div><?php endforeach; ?>
|
||||
<p class="muted" style="max-width:820px">Vorbelegte Formulare für häufige Anliegen, zum Beispiel „Neuer Mitarbeiter“ oder „Passwort zurücksetzen“. Kunden wählen sie auf der Seite „Neues Ticket“ (wenn sie für Kunden sichtbar sind), Mitarbeiter beim Anlegen eines Tickets im Web, im Windows-Programm und in der App.</p>
|
||||
|
||||
<form method="post" class="card" style="max-width:820px;margin-bottom:16px"><?= csrf_field() ?>
|
||||
<input type="hidden" name="action" value="save"><input type="hidden" name="id" value="<?= (int) ($editing['id'] ?? $_POST['id'] ?? 0) ?>">
|
||||
<h3><?= $editing || !empty($_POST['id']) ? 'Vorlage bearbeiten' : 'Neue Vorlage' ?></h3>
|
||||
<div class="field-row">
|
||||
<div><label for="name">Name der Vorlage</label><input type="text" id="name" name="name" maxlength="120" required value="<?= e((string) ($v['name'] ?? '')) ?>" placeholder="z. B. Neuer Mitarbeiter"></div>
|
||||
<div><label for="description">Kurzbeschreibung (optional)</label><input type="text" id="description" name="description" maxlength="255" value="<?= e((string) ($v['description'] ?? '')) ?>"></div>
|
||||
</div>
|
||||
<label for="subject" style="margin-top:8px">Betreff</label>
|
||||
<input type="text" id="subject" name="subject" maxlength="200" value="<?= e((string) ($v['subject'] ?? '')) ?>" placeholder="Vorgabe für den Betreff">
|
||||
<label for="body" style="margin-top:8px">Text</label>
|
||||
<textarea id="body" name="body" rows="7" maxlength="10000" placeholder="Zum Beispiel eine Liste mit den Angaben, die Sie brauchen: Name, Startdatum, benötigte Geräte …"><?= e((string) ($v['body'] ?? '')) ?></textarea>
|
||||
<div class="field-row" style="margin-top:8px">
|
||||
<div><label for="department_id">Abteilung</label><select id="department_id" name="department_id"><option value="">– nicht vorgeben –</option><?php foreach ($departments as $d): ?><option value="<?= (int) $d['id'] ?>" <?= (int) ($v['department_id'] ?? 0) === (int) $d['id'] ? 'selected' : '' ?>><?= e($d['name']) ?></option><?php endforeach; ?></select></div>
|
||||
<div><label for="help_topic_id">Hilfethema</label><select id="help_topic_id" name="help_topic_id"><option value="">– nicht vorgeben –</option><?php foreach ($helpTopics as $h): ?><option value="<?= (int) $h['id'] ?>" <?= (int) ($v['help_topic_id'] ?? 0) === (int) $h['id'] ? 'selected' : '' ?>><?= e($h['path']) ?></option><?php endforeach; ?></select></div>
|
||||
<div><label for="priority_id">Priorität</label><select id="priority_id" name="priority_id"><option value="">– nicht vorgeben –</option><?php foreach ($priorities as $p): ?><option value="<?= (int) $p['id'] ?>" <?= (int) ($v['priority_id'] ?? 0) === (int) $p['id'] ? 'selected' : '' ?>><?= e($p['name']) ?></option><?php endforeach; ?></select></div>
|
||||
</div>
|
||||
<div style="display:flex;gap:18px;flex-wrap:wrap;margin-top:10px;align-items:center">
|
||||
<label style="font-weight:400"><input type="checkbox" name="is_public" value="1" style="width:auto" <?= !empty($v['is_public']) ? 'checked' : '' ?>> Für Kunden sichtbar (auf „Neues Ticket“)</label>
|
||||
<label style="font-weight:400"><input type="checkbox" name="is_active" value="1" style="width:auto" <?= !isset($v['is_active']) || !empty($v['is_active']) ? 'checked' : '' ?>> Aktiv</label>
|
||||
<label style="font-weight:400">Reihenfolge <input type="number" name="sort_order" value="<?= (int) ($v['sort_order'] ?? 0) ?>" style="width:80px"></label>
|
||||
</div>
|
||||
<div class="btn-row"><button type="submit" class="btn">Speichern</button><?php if ($editing): ?> <a class="btn secondary" href="/staff/ticket_templates.php">Abbrechen</a><?php endif; ?></div>
|
||||
</form>
|
||||
|
||||
<div class="card" style="max-width:820px">
|
||||
<h3>Vorhandene Vorlagen</h3>
|
||||
<?php if (!$templates): ?><p class="muted">Noch keine Vorlagen.</p><?php endif; ?>
|
||||
<?php foreach ($templates as $t): ?>
|
||||
<div style="display:flex;gap:10px;flex-wrap:wrap;align-items:center;padding:10px 0;border-top:1px solid var(--border,#e3e9ee)">
|
||||
<div style="flex:1;min-width:200px"><strong><?= e($t['name']) ?></strong>
|
||||
<?= $t['is_public'] ? '<span class="muted" style="font-size:.76rem"> · für Kunden</span>' : '<span class="muted" style="font-size:.76rem"> · nur Mitarbeiter</span>' ?>
|
||||
<?= $t['is_active'] ? '' : '<span style="color:#b45309;font-size:.76rem"> · inaktiv</span>' ?>
|
||||
<?php if ($t['description']): ?><div class="muted" style="font-size:.82rem"><?= e($t['description']) ?></div><?php endif; ?></div>
|
||||
<a class="btn secondary" href="/staff/ticket_templates.php?edit=<?= (int) $t['id'] ?>" style="padding:3px 12px;font-size:.8rem">Bearbeiten</a>
|
||||
<form method="post" onsubmit="return confirm('Vorlage löschen?')"><?= csrf_field() ?><input type="hidden" name="action" value="delete"><input type="hidden" name="id" value="<?= (int) $t['id'] ?>"><button class="btn secondary" type="submit" style="padding:3px 12px;font-size:.8rem">Löschen</button></form>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<?php require __DIR__ . '/_footer.php'; ?>
|
||||
@@ -1268,6 +1268,21 @@ $sourceLabel = $sourceLabels[$ticket['source']] ?? $ticket['source'];
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<?php $csatRow = null; try { $csatRow = csat_for_ticket($pdo, (int) $ticket['id']); } catch (Throwable $e) {} ?>
|
||||
<?php if ($csatRow): ?>
|
||||
<!-- Zufriedenheit des Kunden -->
|
||||
<div class="card" style="padding:14px 20px">
|
||||
<span style="font-size:.71rem; font-weight:700; text-transform:uppercase; letter-spacing:.06em; color:var(--muted)">Kundenzufriedenheit</span>
|
||||
<?php if ($csatRow['rating'] !== null): ?>
|
||||
<div style="font-size:1.25rem;color:#f5b301;margin-top:4px"><?= e(csat_stars((int) $csatRow['rating'])) ?> <span style="font-size:.85rem;color:var(--muted)"><?= (int) $csatRow['rating'] ?> von 5</span></div>
|
||||
<?php if (!empty($csatRow['comment'])): ?><div style="font-size:.85rem;margin-top:4px">„<?= e((string) $csatRow['comment']) ?>“</div><?php endif; ?>
|
||||
<div class="muted" style="font-size:.76rem;margin-top:4px">Bewertet am <?= e(format_dt((string) $csatRow['answered_at'])) ?></div>
|
||||
<?php else: ?>
|
||||
<div class="muted" style="font-size:.84rem;margin-top:4px">Abfrage am <?= e(format_dt((string) $csatRow['sent_at'])) ?> gesendet, noch keine Antwort.</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<!-- Wiedervorlage und Beobachter -->
|
||||
<div class="card" style="padding:16px 20px">
|
||||
<span style="font-size:.71rem; font-weight:700; text-transform:uppercase; letter-spacing:.06em; color:var(--muted)">Wiedervorlage</span>
|
||||
|
||||
Reference in New Issue
Block a user