From a8ee791d64eaf3f4185b1053da9a4c5b5760c6da Mon Sep 17 00:00:00 2001 From: johnnyq Date: Mon, 6 Nov 2023 14:25:55 -0500 Subject: [PATCH] Allow to set quick notes under asset details --- ajax.php | 12 ++++++++++++ client_asset_details.php | 6 +++--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/ajax.php b/ajax.php index e8615dcf..991883f9 100644 --- a/ajax.php +++ b/ajax.php @@ -181,6 +181,18 @@ if (isset($_POST['contact_set_notes'])) { } +if (isset($_POST['asset_set_notes'])) { + $asset_id = intval($_POST['asset_id']); + $notes = sanitizeInput($_POST['notes']); + + // Update notes + mysqli_query($mysqli, "UPDATE assets SET asset_notes = '$notes' WHERE asset_id = $asset_id"); + + // Logging + mysqli_query($mysqli, "INSERT INTO logs SET log_type = 'Assets', log_action = 'Modify', log_description = '$session_name modified asset notes', log_ip = '$session_ip', log_user_agent = '$session_user_agent', log_user_id = $session_user_id"); + +} + /* * Collision Detection/Avoidance * Called upon loading a ticket, and every 2 mins thereafter diff --git a/client_asset_details.php b/client_asset_details.php index 04fe39e8..bef7c1e6 100644 --- a/client_asset_details.php +++ b/client_asset_details.php @@ -183,7 +183,7 @@ if (isset($_GET['asset_id'])) {
Notes
- +
@@ -495,8 +495,8 @@ if (isset($_GET['asset_id'])) { jQuery.post( "ajax.php", { - contact_set_notes: 'TRUE', - contact_id: contact_id, + asset_set_notes: 'TRUE', + asset_id: asset_id, notes: notes } )