Add USB checkout system and SSO profile page

New Features:
- USB Device checkout/check-in system with barcode scanning
  - displayusb.asp: List all USB devices with status
  - addusb.asp: Add new USB devices via barcode scan
  - checkout_usb.asp/savecheckout_usb.asp: Check out USB to SSO
  - checkin_usb.asp/savecheckin_usb.asp: Check in with wipe confirmation
  - usb_history.asp: Full checkout history with filters
  - api_usb.asp: JSON API for AJAX lookups
- displayprofile.asp: SSO profile page showing user info and USB history
- Date/time format changed to 12-hour (MM/DD/YYYY h:mm AM/PM)
- SSO links in USB history now link to profile page via search

Database:
- New machinetypeid 44 for USB devices
- New usb_checkouts table for tracking checkouts

Cleanup:
- Removed v2 folder (duplicate/old files)
- Removed old debug/test files
- Removed completed migration documentation

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
cproudlock
2025-12-07 11:16:14 -05:00
parent c7834d4b99
commit 65b622c361
1061 changed files with 19034 additions and 213120 deletions

View File

@@ -170,6 +170,20 @@
eventLimit: true,
events: [
<%
' Helper function to format datetime for FullCalendar (ISO 8601 format)
Function FormatDateISO(dt)
If IsNull(dt) Or dt = "" Then
FormatDateISO = ""
Else
FormatDateISO = Year(dt) & "-" & _
Right("0" & Month(dt), 2) & "-" & _
Right("0" & Day(dt), 2) & "T" & _
Right("0" & Hour(dt), 2) & ":" & _
Right("0" & Minute(dt), 2) & ":" & _
Right("0" & Second(dt), 2)
End If
End Function
' Fetch all ACTIVE notifications with type information and convert to FullCalendar events
Dim strSQL, rs, isFirst
strSQL = "SELECT n.notificationid, n.notification, n.starttime, n.endtime, n.isactive, n.ticketnumber, n.link, " & _
@@ -190,14 +204,18 @@ If Not rs.EOF Then
Dim notifTitle, notifStart, notifEnd, notifClass
' Properly escape JavaScript special characters
notifTitle = rs("notification") & ""
' Remove actual line breaks (replace with space)
notifTitle = Replace(notifTitle, vbCrLf, " ")
notifTitle = Replace(notifTitle, vbCr, " ")
notifTitle = Replace(notifTitle, vbLf, " ")
notifTitle = Replace(notifTitle, vbTab, " ")
' Escape backslashes first, then quotes
notifTitle = Replace(notifTitle, "\", "\\")
notifTitle = Replace(notifTitle, "'", "\'")
notifTitle = Replace(notifTitle, """", "\""")
notifTitle = Replace(notifTitle, vbCrLf, "\n")
notifTitle = Replace(notifTitle, vbCr, "\n")
notifTitle = Replace(notifTitle, vbLf, "\n")
notifTitle = Replace(notifTitle, vbTab, "\t")
notifStart = rs("starttime")
' Escape < and > to prevent </script> from breaking the JS block
notifTitle = Replace(notifTitle, "<", "\u003c")
notifTitle = Replace(notifTitle, ">", "\u003e")
notifStart = FormatDateISO(rs("starttime"))
' Handle NULL endtime - show ongoing notifications until end of current day
If IsNull(rs("endtime")) Or rs("endtime") = "" Then
@@ -207,9 +225,9 @@ If Not rs.EOF Then
todayDate = Date() ' Current date without time
notifEnd = Year(todayDate) & "-" & _
Right("0" & Month(todayDate), 2) & "-" & _
Right("0" & Day(todayDate), 2) & " 23:59:59"
Right("0" & Day(todayDate), 2) & "T23:59:59"
Else
notifEnd = rs("endtime")
notifEnd = FormatDateISO(rs("endtime"))
End If
' Determine event class based on notification type