Undo: the message after archiving, a move or a bulk change has Undo, which puts it back as it was unless it changed since, and archiving no longer asks first except for clients; covers archiving every kind on Archived with contact roles, document links and a client's recurring invoices, file, document, folder and rack moves, and the bulk changes that set a field on tickets, assets, contacts, clients, projects, invoices, products and IP addresses

This commit is contained in:
johnnyq
2026-11-19 23:15:07 -05:00
parent c105d8f5e5
commit 6a5bc6cf55
52 changed files with 589 additions and 48 deletions

View File

@@ -336,11 +336,13 @@ if (isset($_GET['archive_software'])) {
// Seats stay put - an archived license drops off every device and user
// anyway, and comes back with them if it is restored
$undo = undoArchiveBefore('software', $software_id); // for Undo on the message
mysqli_query($mysqli, "UPDATE software SET software_archived_at = NOW() WHERE software_id = $software_id");
logAudit("Software", "Archive", "$session_name archived license " . escapeSql($row['software_name']), $client_id, $software_id);
flashAlert("License <strong>{$row['software_name']}</strong> archived", 'error');
undoOfferArchive($undo);
redirect();
@@ -395,6 +397,7 @@ if (isset($_POST['bulk_archive_software'])) {
enforceUserPermission('module_support', 2);
$undo = undoArchiveBefore('software', $_POST['software_ids'] ?? []); // for Undo on the message
$rows = softwareBulkRows($_POST['software_ids'] ?? []);
foreach ($rows as $software_id => $row) {
$client_id = intval($row['software_client_id']);
@@ -403,6 +406,7 @@ if (isset($_POST['bulk_archive_software'])) {
}
flashAlert("Archived <strong>" . count($rows) . "</strong> license" . (count($rows) === 1 ? '' : 's'), 'error');
undoOfferArchive($undo);
redirect();