Replace machinetypeid 33-43 checks with pctypeid throughout codebase
- PCs now identified by pctypeid IS NOT NULL (not machinetypeid >= 33) - Equipment identified by pctypeid IS NULL (not machinetypeid < 33) - Updated 8 files: search.asp, savemachineedit.asp, displaymachine.asp, displaypc.asp, displaypcs.asp, machine_map.asp, displaymachines.asp, api.asp - Simplified queries and removed redundant machinetypeid checks - Updated all related comments to reflect new pattern 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -290,7 +290,7 @@ strControlPCSQL = "SELECT m.machineid, m.hostname, m.machinenumber FROM machiner
|
||||
"JOIN relationshiptypes rt ON mr.relationshiptypeid = rt.relationshiptypeid " & _
|
||||
"JOIN machines m ON mr.machineid = m.machineid " & _
|
||||
"WHERE mr.related_machineid = ? AND rt.relationshiptype = 'Controls' AND mr.isactive = 1 " & _
|
||||
"AND m.machinetypeid >= 33 LIMIT 1"
|
||||
"AND m.pctypeid IS NOT NULL LIMIT 1"
|
||||
Set rsControlPC = ExecuteParameterizedQuery(objConn, strControlPCSQL, Array(machineid))
|
||||
|
||||
If rsControlPC.EOF Then
|
||||
@@ -300,7 +300,7 @@ If rsControlPC.EOF Then
|
||||
"JOIN relationshiptypes rt ON mr.relationshiptypeid = rt.relationshiptypeid " & _
|
||||
"JOIN machines m ON mr.related_machineid = m.machineid " & _
|
||||
"WHERE mr.machineid = ? AND rt.relationshiptype = 'Controls' AND mr.isactive = 1 " & _
|
||||
"AND m.machinetypeid >= 33 LIMIT 1"
|
||||
"AND m.pctypeid IS NOT NULL LIMIT 1"
|
||||
Set rsControlPC = ExecuteParameterizedQuery(objConn, strControlPCSQL, Array(machineid))
|
||||
End If
|
||||
|
||||
@@ -412,7 +412,7 @@ End If
|
||||
<tbody>
|
||||
<%
|
||||
' Query PCs that control this machine (directly or via dualpath)
|
||||
' Check both directions - the PC is identified by machinetypeid IN (33-43)
|
||||
' Check both directions - the PC is identified by pctypeid IS NOT NULL
|
||||
' Use GROUP_CONCAT to combine multiple IPs into one row per PC
|
||||
strSQL2 = "SELECT m.machineid, m.machinenumber, m.hostname, GROUP_CONCAT(DISTINCT c.address ORDER BY c.address SEPARATOR ', ') as address, 'Controls' as relationshiptype " & _
|
||||
"FROM machinerelationships mr " & _
|
||||
|
||||
Reference in New Issue
Block a user