Rebuild Admin > Ticket Statuses: list on the standard pattern with In use and Switched off tabs, search, sortable headers, ticket counts linking to the tickets, SLA clock and client-reply columns and drag ordering for the pickers and board; one New/Edit window with badge preview, colour swatches and a description shown on hover across the app; per-status choice of whether a client reply by email or portal moves the ticket back to Open or leaves it; switch off and delete move a status's tickets to a chosen status with ticket history and SLA sync, and clear canned responses that set it; built-in statuses keep their names, stay on and have fixed SLA and reply behaviour enforced server-side; badges use readable text colour; the tickets filter keeps a switched-off status; database 3.4.0 adds ticket_status_description and ticket_status_client_reply; new functions/ticket_status.php

This commit is contained in:
johnnyq
2026-10-24 15:14:10 -04:00
parent fb9534b0a2
commit be374e9c2b
26 changed files with 1194 additions and 268 deletions

View File

@@ -183,11 +183,13 @@ if (isset($_POST['add_ticket_comment'])) {
$original_row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT ticket_status FROM tickets WHERE ticket_id = $ticket_id LIMIT 1"));
$original_ticket_status = intval($original_row['ticket_status'] ?? 0);
mysqli_query($mysqli, "UPDATE tickets SET ticket_status = 2 WHERE ticket_id = $ticket_id AND ticket_client_id = $session_client_id LIMIT 1");
// Back to Open - unless it is in a status of your own set to stay put when the client replies (Scheduled, say)
$new_ticket_status = ticketStatusAfterClientReply($original_ticket_status);
mysqli_query($mysqli, "UPDATE tickets SET ticket_status = $new_ticket_status WHERE ticket_id = $ticket_id AND ticket_client_id = $session_client_id LIMIT 1");
syncTicketSlaClock($ticket_id);
// Only record the reopen when the ticket was not already open
if ($original_ticket_status !== 2) {
if ($original_ticket_status !== $new_ticket_status) {
logTicketHistory($ticket_id, "$session_contact_name replied from the client portal, reopening the ticket");
}