Add inline machine type creation and employee search results

- Add "+ New" button for machine types when adding models on network device pages
  (firewall, switch, server, access point, camera)
- Machine type dropdown now grouped by category (Equipment, Network, PC)
- Add firewall device type to savenetworkdevice.asp
- Remove employee autocomplete dropdown from global search bar
- Add employee search results to search.asp results page
- Update data_cache.asp with null-safe CLng handling

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
cproudlock
2026-01-22 16:18:10 -05:00
parent 6d1cbc01c6
commit 12a35ed7e0
12 changed files with 1248 additions and 36 deletions

View File

@@ -152,7 +152,10 @@ Function GetPrinterListCached()
' Fetch from database
Dim sql, rs_temp, resultArray(), count, i
sql = "SELECT printers.printerid AS printer, printers.*, vendors.*, models.*, machines.* " & _
sql = "SELECT printers.printerid AS printer, models.image, printers.installpath, " & _
"printers.printercsfname, printers.ipaddress, printers.serialnumber AS printerserial, " & _
"machines.islocationonly, vendors.vendor, models.modelnumber, models.documentationpath, " & _
"machines.machinenumber, machines.machineid " & _
"FROM printers, vendors, models, machines " & _
"WHERE printers.modelid=models.modelnumberid " & _
"AND models.vendorid=vendors.vendorid " & _
@@ -191,7 +194,7 @@ Function GetPrinterListCached()
resultArray(i, 7) = rs_temp("documentationpath")
resultArray(i, 8) = rs_temp("printercsfname")
resultArray(i, 9) = rs_temp("ipaddress")
resultArray(i, 10) = rs_temp("serialnumber")
resultArray(i, 10) = rs_temp("printerserial")
' Convert islocationonly bit to 1/0 integer (bit fields come as binary)
On Error Resume Next
@@ -225,7 +228,7 @@ End Function
' Render dropdown options from cached vendor data
Function RenderVendorOptions(selectedID)
Dim vendors, output, i
Dim vendors, output, i, safeSelectedID
vendors = GetPrinterVendorsCached()
output = ""
@@ -236,8 +239,14 @@ Function RenderVendorOptions(selectedID)
End If
On Error Goto 0
' Safely handle null/empty selectedID
safeSelectedID = 0
If Not IsNull(selectedID) And selectedID <> "" And IsNumeric(selectedID) Then
safeSelectedID = CLng(selectedID)
End If
For i = 0 To UBound(vendors)
If CLng(vendors(i, 0)) = CLng(selectedID) Then
If CLng(vendors(i, 0)) = safeSelectedID Then
output = output & "<option value='" & vendors(i, 0) & "' selected>" & vendors(i, 1) & "</option>"
Else
output = output & "<option value='" & vendors(i, 0) & "'>" & vendors(i, 1) & "</option>"
@@ -249,7 +258,7 @@ End Function
' Render dropdown options from cached model data
Function RenderModelOptions(selectedID)
Dim models, output, i
Dim models, output, i, safeSelectedID
models = GetPrinterModelsCached()
output = ""
@@ -260,8 +269,14 @@ Function RenderModelOptions(selectedID)
End If
On Error Goto 0
' Safely handle null/empty selectedID
safeSelectedID = 0
If Not IsNull(selectedID) And selectedID <> "" And IsNumeric(selectedID) Then
safeSelectedID = CLng(selectedID)
End If
For i = 0 To UBound(models)
If CLng(models(i, 0)) = CLng(selectedID) Then
If CLng(models(i, 0)) = safeSelectedID Then
output = output & "<option value='" & models(i, 0) & "' selected>" & models(i, 1) & "</option>"
Else
output = output & "<option value='" & models(i, 0) & "'>" & models(i, 1) & "</option>"
@@ -331,7 +346,7 @@ End Function
' Render dropdown options from cached support team data
Function RenderSupportTeamOptions(selectedID)
Dim teams, output, i
Dim teams, output, i, safeSelectedID
teams = GetSupportTeamsCached()
output = ""
@@ -342,8 +357,14 @@ Function RenderSupportTeamOptions(selectedID)
End If
On Error Goto 0
' Safely handle null/empty selectedID
safeSelectedID = 0
If Not IsNull(selectedID) And selectedID <> "" And IsNumeric(selectedID) Then
safeSelectedID = CLng(selectedID)
End If
For i = 0 To UBound(teams)
If CLng(teams(i, 0)) = CLng(selectedID) Then
If CLng(teams(i, 0)) = safeSelectedID Then
output = output & "<option value='" & teams(i, 0) & "' selected>" & Server.HTMLEncode(teams(i, 1)) & "</option>"
Else
output = output & "<option value='" & teams(i, 0) & "'>" & Server.HTMLEncode(teams(i, 1)) & "</option>"

View File

@@ -9,7 +9,6 @@ function setCookie(value)
}
</script>
<header class="topbar-nav">
<nav class="navbar navbar-expand fixed-top">
<ul class="navbar-nav mr-auto align-items-center">