From 73bb587197ee3c3f556113475220ec7ea571e4cb Mon Sep 17 00:00:00 2001 From: M_Viper Date: Fri, 23 Oct 2026 11:14:31 +0000 Subject: [PATCH] Upload via GUI (275 Dateien) --- DeskHub-Webseite/api/staff/v1/departments.php | 6 ++++++ DeskHub-Webseite/api/staff/v1/ticket.php | 2 ++ 2 files changed, 8 insertions(+) diff --git a/DeskHub-Webseite/api/staff/v1/departments.php b/DeskHub-Webseite/api/staff/v1/departments.php index 02905dd8..3be46658 100644 --- a/DeskHub-Webseite/api/staff/v1/departments.php +++ b/DeskHub-Webseite/api/staff/v1/departments.php @@ -41,6 +41,8 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { 'slaPlanId' => !empty($d['sla_plan_id']) ? (int) $d['sla_plan_id'] : null, 'managerId' => !empty($d['manager_id']) ? (int) $d['manager_id'] : null, 'managerName' => $d['manager_name'] ?? null, + 'autoAssignMode' => (string) ($d['auto_assign_mode'] ?? 'none'), + 'autoAssignStaffId' => !empty($d['auto_assign_staff_id']) ? (int) $d['auto_assign_staff_id'] : null, 'notes' => $d['notes'] ?? null, 'members' => array_values($membersByDept[(int) $d['id']] ?? []), 'createdAt' => $d['created_at'] ?? null, @@ -62,6 +64,10 @@ try { // Fehlende Schlüssel (ältere App-Version) lassen Status und SLA-Plan unverändert if (array_key_exists('isActive', $body)) $in['is_active'] = !empty($body['isActive']); if (array_key_exists('slaPlanId', $body)) $in['sla_plan_id'] = $body['slaPlanId']; + if (array_key_exists('autoAssignMode', $body)) { + $in['auto_assign_mode'] = $body['autoAssignMode']; + $in['auto_assign_staff_id'] = $body['autoAssignStaffId'] ?? null; + } $newId = department_save($pdo, $id, $in); audit_log($staff['id'], ($id === 0 ? 'Abteilung erstellt: ' : 'Abteilung aktualisiert: ') . trim((string) ($body['name'] ?? '')) . ' (Mobile App)'); api_json(['id' => $newId]); diff --git a/DeskHub-Webseite/api/staff/v1/ticket.php b/DeskHub-Webseite/api/staff/v1/ticket.php index 943ecd8a..bcd6dd75 100644 --- a/DeskHub-Webseite/api/staff/v1/ticket.php +++ b/DeskHub-Webseite/api/staff/v1/ticket.php @@ -27,6 +27,7 @@ if ($ticket['source'] !== 'chat') { $ticketLockedBy = $lockedByName; } else { ticket_acquire_lock((int) $ticket['id'], (int) $staff['id'], $pdo); + ticket_assign_on_open($pdo, $ticket, $staff); // unzugewiesenes Ticket wird dem öffnenden Mitarbeiter zugewiesen } } @@ -83,6 +84,7 @@ if ($ticket['source'] === 'chat' && $ticket['status'] !== 'closed') { $lockedByOtherName = live_chat_locked_by_other($ticket, (int) $staff['id'], $pdo); if (!$lockedByOtherName) { live_chat_acquire_lock((int) $ticket['id'], (int) $staff['id'], $pdo); + ticket_assign_on_open($pdo, $ticket, $staff); } }