Add Archive and Delete buttons to document details along with button titles to state what the button does, also added a from var to fix redirect behavior if deleting from document details go back to documents listing

This commit is contained in:
johnnyq
2025-10-24 14:46:09 -04:00
parent 559506fc90
commit 04bae8dc37
3 changed files with 402 additions and 369 deletions

View File

@@ -633,7 +633,15 @@ if (isset($_GET['delete_document'])) {
flash_alert("Document <strong>$document_name</strong> deleted and all versions", 'error');
redirect();
// Determine redirect behavior
// If there's a "from" parameter, we can use it to decide where to go
if (isset($_GET['from']) && $_GET['from'] === 'document_details') {
// User deleted from document_details.php
redirect("documents.php?client_id=$client_id");
} else {
// Default behavior — redirect back to previous page
redirect();
}
}