Undo in Admin after archiving tags and categories (one or several), canned responses, ticket, project, document, vendor, license and contract templates, roles, payment methods with any default they were, SLAs, custom links, portal announcements and agent banners, and after archiving a tax or switching off a ticket status when nothing was moved; payment methods archive without asking first and the SLA archive message names the SLA

This commit is contained in:
johnnyq
2026-11-20 16:53:11 -05:00
parent 651a4d1306
commit 8d9d15d6f7
20 changed files with 133 additions and 8 deletions

View File

@@ -72,11 +72,15 @@ if (isset($_GET['archive_document_template']) || isset($_GET['restore_document_t
$document_template_id = intval($row['document_template_id']);
// Archived, it isn't offered for new documents; the ones made from it stay
$undo = $archive ? undoArchivedBefore('document_templates', 'document_template_id', [$document_template_id]) : null;
mysqli_query($mysqli, "UPDATE document_templates SET document_template_archived_at = " . ($archive ? 'NOW()' : 'NULL') . " WHERE document_template_id = $document_template_id");
logAudit("Document Template", $archive ? "Archive" : "Restore", "$session_name " . ($archive ? 'archived' : 'restored') . " document template " . escapeSql($row['document_template_name']), 0, $document_template_id);
flashAlert("Document template <strong>" . escapeHtml($row['document_template_name']) . "</strong> " . ($archive ? 'archived' : 'restored'), $archive ? 'error' : 'success');
if ($undo) {
undoOfferArchived($undo, '', $row['document_template_name']);
}
redirect();