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:
@@ -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">
|
||||
|
||||
Reference in New Issue
Block a user