From 0898732ee7689a725a039fa43e844b0f3968ed08 Mon Sep 17 00:00:00 2001 From: johnnyq Date: Mon, 28 Aug 2023 16:21:09 -0400 Subject: [PATCH] Added more archiving capabilities across the board also dont show delete if folder is not empty, still need to add show archived data --- client_asset_edit_modal.php | 40 +++++++++++++++++++++++++------- client_assets.php | 16 +++++++++++-- client_certificate_add_modal.php | 2 +- client_certificates.php | 9 ++++++- client_documents.php | 10 +++++--- client_domains.php | 16 ++++++++++--- client_files.php | 11 +++------ client_invoices.php | 2 +- client_location_edit_modal.php | 10 ++++++-- client_networks.php | 5 ++++ client_software.php | 2 ++ client_software_add_modal.php | 4 ++-- client_software_edit_modal.php | 20 ++++++++++++---- client_tickets.php | 9 ++++++- client_vendors.php | 5 ++++ invoice.php | 4 ++-- post/certificate.php | 24 +++++++++++++++++++ post/document.php | 24 +++++++++++++++++++ post/file.php | 24 +++++++++++++++++++ post/network.php | 24 +++++++++++++++++++ post/product.php | 23 ++++++++++++++++++ post/vendor.php | 1 + products.php | 7 +++++- quote.php | 4 ++-- recurring_invoice.php | 4 ++-- scheduled_ticket_add_modal.php | 4 ++-- ticket_add_modal.php | 2 +- ticket_edit_modal.php | 4 ++-- trip_add_modal.php | 2 +- trip_copy_modal.php | 2 +- trip_edit_modal.php | 10 ++++++-- trips.php | 1 + 32 files changed, 273 insertions(+), 52 deletions(-) diff --git a/client_asset_edit_modal.php b/client_asset_edit_modal.php index bd42286b..16c267a3 100644 --- a/client_asset_edit_modal.php +++ b/client_asset_edit_modal.php @@ -131,12 +131,18 @@ '$asset_created_at' OR location_archived_at IS NULL) AND location_client_id = $client_id ORDER BY location_archived_at ASC, location_name ASC"); while ($row = mysqli_fetch_array($sql_locations)) { $location_id_select = intval($row['location_id']); $location_name_select = nullable_htmlentities($row['location_name']); + $location_archived_at = nullable_htmlentities($row['location_archived_at']); + if (empty($location_archived_at)) { + $location_archived_display = ""; + } else { + $location_archived_display = "Archived - "; + } ?> - + @@ -153,13 +159,19 @@ '$asset_created_at' OR contact_archived_at IS NULL) AND contact_client_id = $client_id ORDER BY contact_name ASC"); + $sql_contacts = mysqli_query($mysqli, "SELECT * FROM contacts WHERE (contact_archived_at > '$asset_created_at' OR contact_archived_at IS NULL) AND contact_client_id = $client_id ORDER BY contact_archived_at ASC, contact_name ASC"); while ($row = mysqli_fetch_array($sql_contacts)) { $contact_id_select = intval($row['contact_id']); $contact_name_select = nullable_htmlentities($row['contact_name']); + $contact_archived_at = nullable_htmlentities($row['contact_archived_at']); + if (empty($contact_archived_at)) { + $contact_archived_display = ""; + } else { + $contact_archived_display = "Archived - "; + } ?> @@ -191,14 +203,20 @@ '$asset_created_at' OR network_archived_at IS NULL) AND network_client_id = $client_id ORDER BY network_name ASC"); + $sql_networks = mysqli_query($mysqli, "SELECT * FROM networks WHERE (network_archived_at > '$asset_created_at' OR network_archived_at IS NULL) AND network_client_id = $client_id ORDER BY network_archived_at ASC, network_name ASC"); while ($row = mysqli_fetch_array($sql_networks)) { $network_id_select = intval($row['network_id']); $network_name_select = nullable_htmlentities($row['network_name']); $network_select = nullable_htmlentities($row['network']); + $network_archived_at = nullable_htmlentities($row['network_archived_at']); + if (empty($network_archived_at)) { + $network_archived_display = ""; + } else { + $network_archived_display = "Archived - "; + } ?> - + @@ -239,12 +257,18 @@ '$asset_created_at' OR vendor_archived_at IS NULL) AND vendor_client_id = $client_id ORDER BY vendor_name ASC"); + $sql_vendors = mysqli_query($mysqli, "SELECT * FROM vendors WHERE (vendor_archived_at > '$asset_created_at' OR vendor_archived_at IS NULL) AND vendor_client_id = $client_id ORDER BY vendor_archived_at ASC, vendor_name ASC"); while ($row = mysqli_fetch_array($sql_vendors)) { $vendor_id_select = intval($row['vendor_id']); $vendor_name_select = nullable_htmlentities($row['vendor_name']); + $vendor_archived_at = nullable_htmlentities($row['vendor_archived_at']); + if (empty($vendor_archived_at)) { + $vendor_archived_display = ""; + } else { + $vendor_archived_display = "Archived - "; + } ?> - + diff --git a/client_assets.php b/client_assets.php index dcdec50c..ec69ac82 100644 --- a/client_assets.php +++ b/client_assets.php @@ -214,11 +214,23 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()")); if (empty($contact_name)) { $contact_name = "-"; } + $contact_archived_at = nullable_htmlentities($row['contact_archived_at']); + if (empty($contact_archived_at)) { + $contact_archived_display = ""; + } else { + $contact_archived_display = "Archived - "; + } $location_name = nullable_htmlentities($row['location_name']); if (empty($location_name)) { $location_name = "-"; } + $location_archived_at = nullable_htmlentities($row['location_archived_at']); + if (empty($location_archived_at)) { + $location_archived_display = ""; + } else { + $location_archived_display = "Archived - "; + } $login_id = intval($row['login_id']); $login_username = nullable_htmlentities(decryptLoginEntry($row['login_username'])); @@ -303,9 +315,9 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()")); - + - +