Upload via GUI (275 Dateien)
This commit is contained in:
@@ -17,6 +17,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
'name' => $_POST['name'] ?? '', 'email' => $_POST['email'] ?? '', 'is_default' => !empty($_POST['is_default']),
|
||||
'is_active' => ($_POST['status'] ?? 'active') === 'active', 'manager_id' => $_POST['manager_id'] ?? null,
|
||||
'sla_plan_id' => $_POST['sla_plan_id'] ?? null, 'notes' => $_POST['notes'] ?? '', 'signature' => $_POST['signature'] ?? '',
|
||||
'auto_assign_mode' => $_POST['auto_assign_mode'] ?? 'none', 'auto_assign_staff_id' => $_POST['auto_assign_staff_id'] ?? null,
|
||||
]);
|
||||
audit_log($staff['id'], ($action === 'create' ? 'Abteilung erstellt: ' : 'Abteilung aktualisiert: ') . trim($_POST['name'] ?? ''));
|
||||
flash('success', $action === 'create' ? 'Abteilung erstellt.' : 'Änderungen gespeichert.');
|
||||
@@ -84,6 +85,8 @@ require __DIR__ . '/_header.php';
|
||||
$curStatus = $_POST ? ($_POST['status'] ?? 'active') : (($editDept['is_active'] ?? 1) ? 'active' : 'inactive');
|
||||
$curEmail = strtolower((string) $v('email', 'email'));
|
||||
$curManager = (string) $v('manager_id', 'manager_id');
|
||||
$curAutoMode = (string) $v('auto_assign_mode', 'auto_assign_mode', 'none');
|
||||
$curAutoStaff = (string) $v('auto_assign_staff_id', 'auto_assign_staff_id');
|
||||
$isDefaultChecked = $_POST ? !empty($_POST['is_default']) : !empty($editDept['is_default']);
|
||||
$members = [];
|
||||
if ($editDept) {
|
||||
@@ -128,6 +131,21 @@ require __DIR__ . '/_header.php';
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
|
||||
<label for="auto_assign_mode">Neue Tickets automatisch zuweisen</label>
|
||||
<select id="auto_assign_mode" name="auto_assign_mode">
|
||||
<?php foreach (department_auto_assign_modes() as $__mk => $__ml): ?>
|
||||
<option value="<?= e($__mk) ?>" <?= $curAutoMode === $__mk ? 'selected' : '' ?>><?= e($__ml) ?></option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
<label for="auto_assign_staff_id" style="margin-top:8px">Mitarbeiter (nur bei „Immer an einen bestimmten Mitarbeiter“)</label>
|
||||
<select id="auto_assign_staff_id" name="auto_assign_staff_id">
|
||||
<option value="">— Niemand —</option>
|
||||
<?php foreach ($staffList as $s): ?>
|
||||
<option value="<?= $s['id'] ?>" <?= $curAutoStaff === (string) $s['id'] ? 'selected' : '' ?>><?= e($s['name']) ?></option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
<p class="muted" style="font-size:.78rem;margin-top:4px">Gilt für Tickets aus Formular, E-Mail, API (z. B. Minecraft-Plugin) und Live-Chat. Eine Ticket-Regel mit „Mitarbeiter zuweisen“ hat Vorrang. Ist der Mitarbeiter im Urlaub, geht das Ticket an seine Vertretung. „Reihum“ überspringt Mitarbeiter im Urlaub, offline oder außerhalb ihrer Schicht.</p>
|
||||
|
||||
<label for="sla_plan_id">SLA-Plan</label>
|
||||
<select id="sla_plan_id" name="sla_plan_id">
|
||||
<option value="">— Zeiten der Priorität verwenden —</option>
|
||||
|
||||
@@ -67,7 +67,7 @@ function lc_verify_csrf(): void
|
||||
if (!$token || !hash_equals($_SESSION['csrf_token'] ?? '', $token)) {
|
||||
lc_json(['error' => 'Ihre Sitzung ist abgelaufen. Bitte laden Sie die Seite neu.', 'csrfExpired' => true]);
|
||||
}
|
||||
$_SESSION['csrf_token'] = bin2hex(random_bytes(32));
|
||||
// Token gilt für die ganze Sitzung (keine Erneuerung pro Benutzung, sonst scheitern parallel geöffnete Tabs)
|
||||
}
|
||||
|
||||
[$deptFilterSql, $deptFilterParams] = dept_filter_sql($myDeptIds, 't.department_id');
|
||||
|
||||
@@ -9,8 +9,9 @@ require_once __DIR__ . '/../includes/bootstrap.php';
|
||||
|
||||
header('Content-Type: application/json');
|
||||
|
||||
// Nur POST erlauben
|
||||
if ($_SERVER['REQUEST_METHOD'] !== 'POST') {
|
||||
// Nur POST erlauben (Ausnahme: GET ?check=1 fragt nur die Restzeit ab, ohne die Sitzung zu verlängern)
|
||||
$checkOnly = ($_GET['check'] ?? '') === '1' && $_SERVER['REQUEST_METHOD'] === 'GET';
|
||||
if ($_SERVER['REQUEST_METHOD'] !== 'POST' && !$checkOnly) {
|
||||
http_response_code(405);
|
||||
echo json_encode(['error' => 'Method not allowed']);
|
||||
exit;
|
||||
@@ -34,6 +35,12 @@ if ($last && $elapsed > ($timeout * 60)) {
|
||||
exit;
|
||||
}
|
||||
|
||||
// Nur Restzeit abfragen (andere Tabs und Hintergrund-Abfragen verlängern nichts)
|
||||
if ($checkOnly) {
|
||||
echo json_encode(['ok' => true, 'remaining' => max(0, (int) ($timeout * 60 - $elapsed))]);
|
||||
exit;
|
||||
}
|
||||
|
||||
// Aktivität erneuern (dieser Ping kommt nur bei echten Klicks, Tipps und Mausbewegungen)
|
||||
$_SESSION['staff_last_activity'] = time();
|
||||
staff_touch_activity(get_db(), (int) $_SESSION['staff_id']);
|
||||
|
||||
@@ -38,6 +38,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
set_setting('kb_enabled', $kbEnabled);
|
||||
set_setting('ticket_ratings_enabled', !empty($_POST['ticket_ratings_enabled']) ? '1' : '0');
|
||||
set_setting('auto_time_tracking_enabled', !empty($_POST['auto_time_tracking_enabled']) ? '1' : '0');
|
||||
set_setting('auto_assign_on_open', !empty($_POST['auto_assign_on_open']) ? '1' : '0');
|
||||
set_setting('live_chat_enabled', !empty($_POST['live_chat_enabled']) ? '1' : '0');
|
||||
$liveChatDept = $_POST['live_chat_department_id'] ?? '';
|
||||
set_setting('live_chat_department_id', ($liveChatDept !== '' && in_array((int)$liveChatDept, array_column($departments, 'id'))) ? (string)(int)$liveChatDept : '');
|
||||
@@ -532,6 +533,10 @@ require __DIR__ . '/_header.php';
|
||||
<input type="checkbox" name="auto_time_tracking_enabled" value="1" style="width:auto" <?= get_setting('auto_time_tracking_enabled','1')==='1'?'checked':'' ?>>
|
||||
Automatische Zeiterfassung (misst automatisch, wie lange ein Mitarbeiter ein Ticket geöffnet hat)
|
||||
</label>
|
||||
<label style="display:flex;align-items:center;gap:8px;margin-top:10px;font-weight:400;cursor:pointer">
|
||||
<input type="checkbox" name="auto_assign_on_open" value="1" style="width:auto" <?= get_setting('auto_assign_on_open','1')==='1'?'checked':'' ?>>
|
||||
Beim Öffnen automatisch zuweisen (ein noch nicht zugewiesenes Ticket geht an den Mitarbeiter, der es öffnet)
|
||||
</label>
|
||||
<?php $autoCloseEnabled = get_setting('auto_close_enabled','0')==='1'; ?>
|
||||
<label style="display:flex;align-items:center;gap:8px;margin-top:10px;font-weight:400;cursor:pointer">
|
||||
<input type="checkbox" name="auto_close_enabled" value="1" style="width:auto" id="auto_close_enabled" onchange="document.getElementById('auto-close-days-row').style.display=this.checked?'block':'none'" <?= $autoCloseEnabled?'checked':'' ?>>
|
||||
|
||||
Reference in New Issue
Block a user