Fix some Ticket History gaps

This commit is contained in:
johnnyq
2026-08-01 14:33:37 -04:00
parent cdb4a43b89
commit 75028ba09a
11 changed files with 163 additions and 10 deletions

View File

@@ -168,6 +168,7 @@ if (isset($_GET['reopen_ticket'], $_GET['url_key'])) {
if (mysqli_num_rows($sql) == 1) {
// Update the ticket
mysqli_query($mysqli, "UPDATE tickets SET ticket_status = 2, ticket_resolved_at = NULL WHERE ticket_id = $ticket_id AND ticket_url_key = '$url_key'");
logTicketHistory($ticket_id, "The client reopened the ticket from the guest link");
// Add reply
mysqli_query($mysqli, "INSERT INTO ticket_replies SET ticket_reply = 'Ticket reopened by client (guest URL).', ticket_reply_type = 'Internal', ticket_reply_by = 0, ticket_reply_ticket_id = $ticket_id");
@@ -196,6 +197,7 @@ if (isset($_GET['close_ticket'], $_GET['url_key'])) {
// Update the ticket
mysqli_query($mysqli, "UPDATE tickets SET ticket_status = 5, ticket_closed_at = NOW() WHERE ticket_id = $ticket_id AND ticket_url_key = '$url_key'");
logTicketHistory($ticket_id, "The client closed the ticket from the guest link");
// Add reply
mysqli_query($mysqli, "INSERT INTO ticket_replies SET ticket_reply = 'Ticket closed by client (guest URL).', ticket_reply_type = 'Internal', ticket_reply_by = 0, ticket_reply_ticket_id = $ticket_id");