Fix network device description/machinenotes display and edit

- Fix ADO cursor issue where reading rs("description") twice caused
  empty values (IsNull check consumed the field value)
- Change all device pages to read description field once using
  `description = rs("description") & ""` pattern
- Add deviceDescription variable in displaydevice.asp
- Fix machinetypeid mapping: IDF=17, Camera=18 (was swapped)
- Add model dropdown fix to include currently assigned model
- Add server application tracking feature
- Various other improvements and fixes

Files affected:
- displaydevice.asp, displaylocationdevice.asp
- deviceaccesspoint.asp, deviceserver.asp, deviceswitch.asp
- devicecamera.asp, deviceidf.asp
- savenetworkdevice.asp, networkdevices.asp

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
cproudlock
2025-12-17 13:47:56 -05:00
parent a5b4013949
commit a4096ace94
25 changed files with 1744 additions and 355 deletions

View File

@@ -1,33 +1,28 @@
<%
' Calculate fiscal week (GE fiscal year starts first Monday of January)
Dim fwToday, fwYearStart, fwFirstMonday, fwDayOfWeek, fwDaysFromStart, fiscalWeek
Dim fwPrevYearStart, fwPrevFirstMonday, fwPrevDayOfWeek
' Calculate ISO week number
' ISO week 1 is the week containing the first Thursday of the year (or Jan 4th)
' Weeks start on Monday
Dim fwToday, fiscalWeek, fwDayOfWeek, fwThursday, fwYear, fwJan4, fwWeek1Start, fwDaysFromStart
fwToday = Date()
' Find first Monday of current year
fwYearStart = DateSerial(Year(fwToday), 1, 1)
fwDayOfWeek = Weekday(fwYearStart, vbMonday) ' 1=Monday, 7=Sunday
If fwDayOfWeek = 1 Then
fwFirstMonday = fwYearStart
Else
fwFirstMonday = DateAdd("d", 8 - fwDayOfWeek, fwYearStart)
End If
' Find Thursday of current week (ISO weeks are identified by their Thursday)
fwDayOfWeek = Weekday(fwToday, vbMonday) ' 1=Monday ... 7=Sunday
fwThursday = DateAdd("d", 4 - fwDayOfWeek, fwToday)
' If we're before the first Monday, use previous year's week count
If fwToday < fwFirstMonday Then
fwPrevYearStart = DateSerial(Year(fwToday) - 1, 1, 1)
fwPrevDayOfWeek = Weekday(fwPrevYearStart, vbMonday)
If fwPrevDayOfWeek = 1 Then
fwPrevFirstMonday = fwPrevYearStart
Else
fwPrevFirstMonday = DateAdd("d", 8 - fwPrevDayOfWeek, fwPrevYearStart)
End If
fwDaysFromStart = DateDiff("d", fwPrevFirstMonday, fwToday)
fiscalWeek = Int(fwDaysFromStart / 7) + 1
Else
fwDaysFromStart = DateDiff("d", fwFirstMonday, fwToday)
fiscalWeek = Int(fwDaysFromStart / 7) + 1
End If
' The year of the Thursday determines the ISO year
fwYear = Year(fwThursday)
' Find January 4th of that year (always in week 1)
fwJan4 = DateSerial(fwYear, 1, 4)
' Find Monday of the week containing Jan 4 (start of week 1)
fwDayOfWeek = Weekday(fwJan4, vbMonday)
fwWeek1Start = DateAdd("d", 1 - fwDayOfWeek, fwJan4)
' Calculate week number
fwDaysFromStart = DateDiff("d", fwWeek1Start, fwToday)
fiscalWeek = Int(fwDaysFromStart / 7) + 1
%>
<!--Start sidebar-wrapper-->
<div id="sidebar-wrapper" data-simplebar="" data-simplebar-auto-hide="true">

View File

@@ -1,6 +1,6 @@
<!--#include file="config.asp"-->
<%
' Zabbix API Configuration - uses ZABBIX_URL and ZABBIX_API_TOKEN from config.asp
' NOTE: config.asp must be included by the calling page (via sql.asp) before this file
' Function to make HTTP POST request to Zabbix API with Bearer token
Function ZabbixAPICall(jsonRequest)