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

@@ -224,12 +224,16 @@ if (isset($_GET['archive_software_template']) || isset($_GET['restore_software_t
$software_template_id = intval($row['software_template_id']);
// Archived, it isn't offered for new licenses; the ones made from it stay
$undo = $archive ? undoArchivedBefore('software_templates', 'software_template_id', [$software_template_id]) : null;
mysqli_query($mysqli, "UPDATE software_templates SET software_template_archived_at = " . ($archive ? 'NOW()' : 'NULL') . ", software_template_updated_at = software_template_updated_at
WHERE software_template_id = $software_template_id");
logAudit("Software Template", $archive ? "Archive" : "Restore", "$session_name " . ($archive ? 'archived' : 'restored') . " license template " . escapeSql($row['software_template_name']), 0, $software_template_id);
flashAlert("License template <strong>" . escapeHtml($row['software_template_name']) . "</strong> " . ($archive ? 'archived' : 'restored'), $archive ? 'error' : 'success');
if ($undo) {
undoOfferArchived($undo, '', $row['software_template_name']);
}
redirect();