Ticket pictures review fixes: Redact takes a picture selected on its own as well as text, a picture that can't be saved stays in the text instead of being lost and the Ticket Pictures job logs a warning and carries on past a ticket that fails, new tickets for several clients keep their pictures as files straight away, and deleting a client deletes its tickets with their attachments, pictures, tasks and history instead of leaving them behind; 26.12.3 changelog entries

This commit is contained in:
johnnyq
2026-11-29 12:49:22 -05:00
parent e8c38c739e
commit 08f4c74253
5 changed files with 54 additions and 21 deletions

View File

@@ -444,14 +444,12 @@ if (isset($_GET['delete_client'])) {
// Delete Software
mysqli_query($mysqli, "DELETE FROM software WHERE software_client_id = $client_id");
// Delete tickets and related data
// Delete tickets and everything that is only theirs - attachments and the pictures in their text, files and all,
// tasks, watchers and history too (functions/ticket.php)
$sql = mysqli_query($mysqli, "SELECT ticket_id FROM tickets WHERE ticket_client_id = $client_id");
while($row = mysqli_fetch_assoc($sql)) {
$ticket_id = $row['ticket_id'];
mysqli_query($mysqli, "DELETE FROM ticket_replies WHERE ticket_reply_ticket_id = $ticket_id");
mysqli_query($mysqli, "DELETE FROM ticket_views WHERE view_ticket_id = $ticket_id");
ticketDeleteForGood(intval($row['ticket_id']));
}
mysqli_query($mysqli, "DELETE FROM tickets WHERE ticket_client_id = $client_id");
mysqli_query($mysqli, "DELETE FROM trips WHERE trip_client_id = $client_id");
// Their calls and phones go, and their phone system domains are no longer linked (functions/phone.php)
if (phoneTablesReady()) {
@@ -690,6 +688,8 @@ if (isset($_POST['bulk_add_client_ticket'])) {
if ($template) {
ticketTemplateFinish($ticket_id, $ticket_template_id, true, true, $fill_in_answers);
}
// Pictures pasted into it kept as its files (functions/ticket_pictures.php)
ticketPicturesSaveTicket($ticket_id);
logAudit("Ticket", "Create", "$session_name created ticket $ticket_prefix$ticket_number - $subject", $client_id, $ticket_id);
triggerCustomAction('ticket_create', $ticket_id);