From 6d23cca51b8ef40fd115a494f6b4f22378dd94b6 Mon Sep 17 00:00:00 2001 From: wrongecho Date: Sat, 14 Dec 2024 13:37:40 +0000 Subject: [PATCH] Assets: Suggest operating systems when adding an asset --- client_asset_add_modal.php | 4 ++-- client_assets.php | 27 +++++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/client_asset_add_modal.php b/client_asset_add_modal.php index e931a91dd..83032aa71 100644 --- a/client_asset_add_modal.php +++ b/client_asset_add_modal.php @@ -12,7 +12,7 @@ - diff --git a/client_assets.php b/client_assets.php index 2c38aada2..ad713306d 100644 --- a/client_assets.php +++ b/client_assets.php @@ -91,6 +91,16 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()")); + +// OS typeahead suggestions +$os_sql = mysqli_query($mysqli, "SELECT DISTINCT asset_os AS label FROM assets WHERE asset_archived_at IS NULL"); +if (mysqli_num_rows($os_sql) > 0) { + while ($row = mysqli_fetch_array($os_sql)) { + $os_arr[] = $row; + } + $json_os = json_encode($os_arr); +} + ?>
@@ -619,3 +629,20 @@ class="btn btn- + + + + +