Fix dualpath propagation, getShopfloorPCs filtering, USB management, and printer features
- Fix dualpath PC propagation direction (Equipment->PC) in api.asp and db_helpers.asp - Fix early exit in CreatePCMachineRelationship preventing propagation - Fix getShopfloorPCs to filter machinetypeid IN (33,34,35) instead of >= 33 - Fix getShopfloorPCs to show equipment numbers via GROUP_CONCAT subquery - Add detailed PropagateDP logging for dualpath debugging - Default "Show on Shopfloor Dashboard" checkbox to checked in addnotification.asp - Add USB label batch printing, single USB labels, and USB history pages - Add printer supplies tracking and toner report enhancements - Add uptime map visualization page - Add dashboard/lobby display SQL migration - Update CLAUDE.md with IIS 401 workaround documentation - Update TODO.md Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -524,8 +524,8 @@ End If
|
||||
<%
|
||||
End If
|
||||
%>
|
||||
<!-- Machines Controlled by This PC -->
|
||||
<h6 class="mt-3 mb-2"><i class="zmdi zmdi-settings"></i> Machines Controlled by This PC</h6>
|
||||
<!-- Connected Equipment -->
|
||||
<h6 class="mt-3 mb-2"><i class="zmdi zmdi-settings"></i> Connected Equipment</h6>
|
||||
<div class="table-responsive mb-4">
|
||||
<table class="table table-hover table-striped">
|
||||
<thead>
|
||||
@@ -533,42 +533,59 @@ End If
|
||||
<th>Machine Number</th>
|
||||
<th>Type</th>
|
||||
<th>Model</th>
|
||||
<th>Location</th>
|
||||
<th>Relationship</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<%
|
||||
' Query machines that THIS PC controls
|
||||
' Query ALL equipment related to this PC via machinerelationships
|
||||
' Check both directions - the equipment is identified by pctypeid IS NULL
|
||||
strSQL2 = "SELECT m.machineid, m.machinenumber, mt.machinetype, mo.modelnumber, 'Controls' as relationshiptype " & _
|
||||
strSQL2 = "SELECT m.machineid, m.machinenumber, mt.machinetype, mo.modelnumber, rt.relationshiptype " & _
|
||||
"FROM machinerelationships mr " & _
|
||||
"JOIN relationshiptypes rt ON mr.relationshiptypeid = rt.relationshiptypeid " & _
|
||||
"JOIN machines m ON (mr.machineid = m.machineid OR mr.related_machineid = m.machineid) " & _
|
||||
"LEFT JOIN models mo ON m.modelnumberid = mo.modelnumberid " & _
|
||||
"LEFT JOIN machinetypes mt ON mo.machinetypeid = mt.machinetypeid " & _
|
||||
"WHERE (mr.machineid = ? OR mr.related_machineid = ?) AND mr.relationshiptypeid = 3 " & _
|
||||
"WHERE (mr.machineid = ? OR mr.related_machineid = ?) " & _
|
||||
" AND m.pctypeid IS NULL AND m.machineid <> ? AND mr.isactive = 1 " & _
|
||||
"ORDER BY machinenumber"
|
||||
"ORDER BY rt.relationshiptype, m.machinenumber"
|
||||
Set rs2 = ExecuteParameterizedQuery(objConn, strSQL2, Array(machineid, machineid, machineid))
|
||||
|
||||
If rs2.EOF Then
|
||||
Response.Write("<tr><td colspan='4' class='text-muted text-center'>This PC does not control any machines</td></tr>")
|
||||
Response.Write("<tr><td colspan='5' class='text-muted text-center'>No connected equipment</td></tr>")
|
||||
Else
|
||||
Do While Not rs2.EOF
|
||||
Dim ctrlMachineNum, ctrlType, ctrlModel, ctrlMachineID
|
||||
Dim ctrlMachineNum, ctrlType, ctrlModel, ctrlMachineID, ctrlRelType
|
||||
ctrlMachineNum = rs2("machinenumber") & ""
|
||||
ctrlType = rs2("machinetype") & ""
|
||||
ctrlModel = rs2("modelnumber") & ""
|
||||
ctrlMachineID = rs2("machineid")
|
||||
ctrlRelType = rs2("relationshiptype") & ""
|
||||
|
||||
If ctrlMachineNum = "" Then ctrlMachineNum = "<span class='text-muted'>N/A</span>"
|
||||
If ctrlMachineNum = "" Then ctrlMachineNum = "N/A"
|
||||
If ctrlType = "" Then ctrlType = "<span class='text-muted'>N/A</span>"
|
||||
If ctrlModel = "" Then ctrlModel = "<span class='text-muted'>N/A</span>"
|
||||
|
||||
' Badge color based on relationship type
|
||||
Dim ctrlRelBadge
|
||||
Select Case LCase(ctrlRelType)
|
||||
Case "controls"
|
||||
ctrlRelBadge = "badge-primary"
|
||||
Case "dualpath"
|
||||
ctrlRelBadge = "badge-warning"
|
||||
Case "connected to"
|
||||
ctrlRelBadge = "badge-success"
|
||||
Case Else
|
||||
ctrlRelBadge = "badge-info"
|
||||
End Select
|
||||
|
||||
Response.Write("<tr>")
|
||||
Response.Write("<td><a href='./displaymachine.asp?machineid=" & ctrlMachineID & "'>" & Server.HTMLEncode(ctrlMachineNum) & "</a></td>")
|
||||
Response.Write("<td>" & ctrlType & "</td>")
|
||||
Response.Write("<td>" & ctrlModel & "</td>")
|
||||
Response.Write("<td><span class='badge badge-success'>" & Server.HTMLEncode(rs2("relationshiptype") & "") & "</span></td>")
|
||||
Response.Write("<td>" & Server.HTMLEncode(ctrlMachineNum) & " <a href='#' class='location-link text-info' data-machineid='" & ctrlMachineID & "' data-name='" & Server.HTMLEncode(ctrlMachineNum) & "'><i class='zmdi zmdi-pin'></i></a></td>")
|
||||
Response.Write("<td><span class='badge " & ctrlRelBadge & "'>" & Server.HTMLEncode(ctrlRelType) & "</span></td>")
|
||||
Response.Write("</tr>")
|
||||
rs2.MoveNext
|
||||
Loop
|
||||
|
||||
Reference in New Issue
Block a user