Standardize share toast notifications and fix PC scanning/editing
Share Toast Notifications: - Unified toast style across all pages (purple gradient, top-right position) - Updated displayapplication.asp, displaytopic.asp, displayudc.asp - Updated printerlinksgenerator.asp (replaced alert with toast) - Same text: "Link Copied!" / "This link will show the search term..." PC Scanning/Editing Fixes: - savedevicedirect.asp: Use machinetypeid=33 to detect PCs (not pctypeid) - savedevicedirect.asp: Use new Dell TBD model (ID 110) for new PCs - editpc.asp: Model dropdown includes current model even if vendor ispc=0 - editpc.asp: Fixed vendor query to use ispc=1 instead of ismachine=1 Database changes (manual): - Set ispc=1 for Dell, Dell Inc., DellInc., HP vendors - Created Dell TBD model (ID 110) as default PC model 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -22,8 +22,8 @@
|
||||
|
||||
' Check if serial number already exists - PHASE 2: Use machines table
|
||||
' Check ALL machines regardless of type to prevent duplicates
|
||||
Dim checkSQL, rsCheck, cmdCheck, existingMachineID, existingPCTypeID
|
||||
checkSQL = "SELECT machineid, pctypeid FROM machines WHERE serialnumber = ? AND isactive = 1"
|
||||
Dim checkSQL, rsCheck, cmdCheck, existingMachineID, existingMachineTypeID
|
||||
checkSQL = "SELECT machineid, machinetypeid FROM machines WHERE serialnumber = ? AND isactive = 1"
|
||||
Set cmdCheck = Server.CreateObject("ADODB.Command")
|
||||
cmdCheck.ActiveConnection = objConn
|
||||
cmdCheck.CommandText = checkSQL
|
||||
@@ -35,14 +35,14 @@
|
||||
If Not rsCheck.EOF Then
|
||||
' Serial number already exists - redirect to appropriate edit page
|
||||
existingMachineID = rsCheck("machineid")
|
||||
existingPCTypeID = rsCheck("pctypeid")
|
||||
existingMachineTypeID = rsCheck("machinetypeid")
|
||||
rsCheck.Close
|
||||
Set rsCheck = Nothing
|
||||
Set cmdCheck = Nothing
|
||||
objConn.Close
|
||||
|
||||
' Redirect to PC edit page if it's a PC (pctypeid IS NOT NULL), otherwise to machine edit page
|
||||
If Not IsNull(existingPCTypeID) Then
|
||||
' Redirect to PC edit page if it's a PC (machinetypeid 33), otherwise to machine edit page
|
||||
If existingMachineTypeID = 33 Then
|
||||
Response.Redirect("./editpc.asp?machineid=" & existingMachineID & "&scanned=1")
|
||||
Else
|
||||
Response.Redirect("./editmachine.asp?machineid=" & existingMachineID & "&scanned=1")
|
||||
@@ -57,13 +57,13 @@
|
||||
' Insert new PC with minimal required fields - PHASE 2: Use machines table
|
||||
' machinetypeid = 33 (PC), pctypeid = 1 (Standard)
|
||||
' machinestatusid = 2 (Inventory)
|
||||
' modelnumberid = 1 (default model)
|
||||
' modelnumberid = 110 (Dell TBD - default PC model)
|
||||
' maptop = 1519, mapleft = 1896 (default map location)
|
||||
' hostname = serialnumber (default)
|
||||
' isactive = 1
|
||||
Dim insertSQL, cmdInsert
|
||||
insertSQL = "INSERT INTO machines (serialnumber, hostname, machinetypeid, pctypeid, machinestatusid, modelnumberid, maptop, mapleft, isactive, lastupdated) " & _
|
||||
"VALUES (?, ?, 33, 1, 2, 1, 1519, 1896, 1, NOW())"
|
||||
"VALUES (?, ?, 33, 1, 2, 110, 1519, 1896, 1, NOW())"
|
||||
Set cmdInsert = Server.CreateObject("ADODB.Command")
|
||||
cmdInsert.ActiveConnection = objConn
|
||||
cmdInsert.CommandText = insertSQL
|
||||
|
||||
Reference in New Issue
Block a user