39 Commits

Author SHA1 Message Date
cproudlock
e382a3246e 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>
2026-02-03 10:44:55 -05:00
cproudlock
8945fe2a0a Add PC-machine relationships API and report, fix shopfloor dashboard
- Add getPCMachineRelationships API endpoint for PC-to-machine mappings
- Add pcmachinerelationships.asp report page with copy table/CSV/JSON export
- Fix shopfloor dashboard to immediately hide deactivated notifications
- Add Firewall (machinetypeid 46) support to network device pages
- Add model migration warning banner to networkdevices.asp
- Create SQL script for hybrid model/machine type view

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 16:06:33 -05:00
cproudlock
28e8071570 Add Employee Recognition feature to notifications system
- Add Recognition notification type (ID 5) with blue color
- Add employeesso field to notifications table
- Create carousel display for Recognition on shopfloor dashboard
- Show employee names (lookup from wjf_employees) instead of SSO
- Auto-set starttime to NOW and endtime to 4AM next day
- Auto-enable shopfloor display for Recognition type
- Add Achievements tab to employee profile (displayprofile.asp)
- Hide Recognition from calendar view
- Add lookupemployee.asp AJAX endpoint for name preview
- Fix datetime double-formatting bug in save/update files
- Fix URL parameter loading on shopfloor dashboard init

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-09 07:27:37 -05:00
cproudlock
51f4c078c7 Add badge printing, test pages, and eDNC cleanup script
- printbadge.asp: Machine badge printing with barcode (Code39)
- testcalc.asp: Test page for UDC calculation debugging
- testpage.asp: Generic test page template
- sql/drop_ednc_tables.sql: Cleanup script for deprecated eDNC tables

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-18 10:36:48 -05:00
cproudlock
a4096ace94 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>
2025-12-17 13:47:56 -05:00
cproudlock
a5b4013949 Add weekly/monthly views for events and tool data summaries
New views:
- vwudcevents_monthly: Monthly event counts by machine/type
- vwudctooldata_weekly: Weekly tool data trends by machine/tool
- vwudctooldata_monthly: Monthly tool data trends by machine/tool

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-16 10:13:49 -05:00
cproudlock
0d0e589ea4 Add UDC data retention and summarization system
- Creates daily summary tables: udcmeasurements_daily, udcevents_daily, udctooldata_daily
- Stored procedures:
  - sp_udc_backfill_summaries(): One-time backfill of historical data
  - sp_udc_summarize_date(date): Summarize a specific date
  - sp_udc_purge_old_data(days): Purge raw data older than X days
  - sp_udc_daily_maintenance(days): Daily summarize + purge
- Weekly/monthly views for trend analysis
- Keeps summaries forever, purges raw data after retention period

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-16 09:18:02 -05:00
cproudlock
ed52086732 Add UDC reporting views and fix udcactivesessions table structure
- Fixed udcactivesessions table to match actual production schema
- Added 11 new views for UDC reporting:
  - vwudctoolhealthbymachine: Tool health aggregated by machine
  - vwudctoolhealthbytool: Tool health by tool number
  - vwudcootdetail: OOT measurements detail
  - vwudctoolootdetail: Tool OOT detail
  - vwudcactivesessions: Active sessions with machine details
  - vwudcviolations: Violations with context
  - vwudcdailyproduction: Daily production summary
  - vwudcerrorsummary: Error summary by machine
  - vwudcconnectionsummary: Connection events summary
  - vwudcheaderupdates: Badge changes with context
  - vwudcclmfiles: CLM file import status

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-16 08:08:29 -05:00
cproudlock
8be7469e63 Add missing udcclmfiles table to UDC schema
The file tracking table was missing from udctables.sql but existed
in the database. Required for clmparser.py incremental imports.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-16 07:58:49 -05:00
cproudlock
91fe5a6c66 Add UDC Performance Dashboard and Tool Health features
- Add displayudc.asp with Dashboard tab containing:
  - Production Trend chart (daily parts)
  - OOT Rate Trend chart (daily OOT %)
  - Machine Utilization chart (top 10 by runtime hours)
  - Top Operators chart (top 10 by parts produced)
- Add tabs for drill-down: Live Activity, Operators, Machines, Parts,
  Quality/OOT, Timing, Activity Log, Tool Health, Uptime, IT Diagnostics

- Add Tool Health section to displaymachine.asp UDC tab:
  - Summary cards (tools monitored, measurements, OOT count)
  - Tool status table with health indicators
  - Recent OOT events display

- Add UDC API endpoints in api.asp:
  - getUDCPartRuns, getUDCOperatorStats, getUDCMachineStats, getUDCManualTiming

- Add sql/udctables.sql schema for UDC data storage

- Update docs/API.md with UDC endpoint documentation

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-16 07:54:13 -05:00
cproudlock
d67520152d Add vw_ednclogs view for easy querying with hostname
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-12 09:36:06 -05:00
cproudlock
1595dca751 Fix ednc_tables.sql - fresh table creation (not migration)
Production doesn't have the table yet, so create it fresh with
machineid schema from the start.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-12 09:35:06 -05:00
cproudlock
a1a10a51d2 eDNC: Use machineid instead of hostname for proper FK relationship
- ednclogs table now uses machineid to link to machines table
- Removed redundant hostname storage (derive from machines table)
- Updated LogDNCEvent to look up and insert machineid
- Updated GetDNCStats to join machines table for hostname
- Updated displaypc.asp queries to use machineid directly
- sql/ednc_tables.sql is now a migration script for existing production

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-12 09:33:27 -05:00
cproudlock
4e37378923 Add eDNC-Fix API endpoints and displaypc.asp integration
API endpoints:
- logDNCEvent: Log events from eDNC-Fix PowerShell script
- getDNCStats: Get all eDNC installations and stats

Database tables (sql/ednc_tables.sql):
- ednc_logs: Event log entries
- ednc_installations: Per-hostname tracking

displaypc.asp:
- Shows eDNC-Fix stats in Applications tab if installed

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-12 08:55:27 -05:00
cproudlock
131aaaddbf Centralize credentials and make migration idempotent
- Move all DB credentials to config.asp with DSN/ODBC toggle
- Add Zabbix API URL and token to centralized config
- Update sql.asp, api.asp, apiusb.asp, zabbix.asp to use config
- Add GetConnectionString() and GetEmployeeConnectionString() functions
- Make migration SQL idempotent (safe to run multiple times)
- Add duplicate index cleanup (appname_2) to migration
- Document employee DB access limitation in CLAUDE.md

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-12 08:11:28 -05:00
cproudlock
e0d89f9957 Security fixes and schema cleanup
- Fix SQL injection in displayprofile.asp (parameterized query)
- Add HTMLEncode to XSS-vulnerable output in 5 display pages
- Add Option Explicit to computers.asp, displaymachines.asp, displaypcs.asp, displayapplication.asp, displayprofile.asp
- Update STANDARDS.md with test script reference, secrets management, column naming gotchas
- Fix equipment type ranges in CLAUDE.md and QUICK_REFERENCE.md (1-15, 21-25)
- Add migration SQL to cleanup redundant PC machinetypes (34-46)

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-12 07:22:16 -05:00
cproudlock
4cdc2f0742 Clean up sql directory after production sync
- Remove 27 completed one-off migration scripts
- Remove old backup file (dev-backup-20251120)
- Remove completed shell scripts for prod import/export
- Archive migration_phase1-4 directories and documentation
- Keep only view_consolidation.sql as active script

All migrations have been applied to production.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-11 12:33:49 -05:00
cproudlock
0e3371f458 Add database view consolidation and migrate legacy tables
- Drop 27 unused views, create 24 new purpose-built views
- New views cover: equipment, PCs, printers, notifications, applications,
  knowledge base, USB history, subnets, maps, and reports/charts
- Migration scripts for legacy network device tables (servers, cameras,
  switches, accesspoints, idfs) to unified machines table
- Migration scripts for legacy tables (machineoverrides, dualpathassignments,
  networkinterfaces)
- Update displaydevice.asp and displaylocationdevice.asp to use machines table
- Fix deviceserver.asp type mismatch error with HTMLEncode
- Hide Applications tab for equipment in displaymachine.asp

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-11 11:16:48 -05:00
cproudlock
1f1bd8ee02 Remove legacy pc tables, fix ASP issues, update dashboard APIs
Database changes (run sql/migration_drop_pc_tables.sql on prod):
- Drop pc, pc_backup_phase2, pc_to_machine_id_mapping tables
- Rename pcid columns to machineid in machineoverrides, dualpathassignments, networkinterfaces
- Recreate 9 views to use machines.machineid instead of pcid
- Clean orphaned records and add FK constraints to machines table

ASP fixes:
- editprinter.asp: Fix CLng type mismatch when no printerid provided
- includes/sql.asp: Remove AutoDeactivateExpiredNotifications (endtime handles expiry)
- includes/leftsidebar.asp: Update fiscal week banner styling, remove dead Information link
- charts/warrantychart.asp: Use vw_warranty_status instead of pc table

Dashboard API renames (naming convention):
- shopfloor-dashboard: Update to use apishopfloor.asp, apibusinessunits.asp
- tv-dashboard: Rename api_slides.asp to apislides.asp

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-11 09:05:06 -05:00
cproudlock
e598f72616 Remove emojis from all markdown docs, add consolidation plan
- Strip emojis from 47 markdown files across docs/, sql/, and root
- Add docs/DOCS_CONSOLIDATION_PLAN.md with plan to reduce 45 docs to 8
- Establish no-emoji rule for documentation going forward

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-11 07:42:52 -05:00
cproudlock
249bfbba8c Standardize ASP filenames: remove underscores
Renamed 45 ASP files to follow lowercase concatenated naming convention:
- Direct handlers: save_machine_direct.asp -> savemachinedirect.asp
- USB files: checkin_usb.asp -> checkinusb.asp
- API files: api_usb.asp -> apiusb.asp
- Map files: network_map.asp -> networkmap.asp
- Printer files: printer_lookup.asp -> printerlookup.asp

Also:
- Updated 84+ internal references across all ASP and JS files
- Deleted 6 test/duplicate files (editmacine.asp, test_*.asp)
- Updated production migration guide with filename changes
- Added rename scripts for Linux (bash) and Windows (PowerShell)
2025-12-10 20:40:05 -05:00
cproudlock
6162db9fcf Fix compliance table column names (snake_case to camelCase)
Renamed columns in compliance and compliancescans tables:
- scan_date -> scandate
- deployment_notes -> deploymentnotes
- is_third_party_managed -> isthirdpartymanaged
- third_party_manager -> thirdpartymanager
- ot_asset_* -> otasset*
- is_compliant -> iscompliant
- compliance_notes -> compliancenotes
- scan_name -> scanname
- scan_result -> scanresult
- scan_details -> scandetails

Updated ASP files:
- displaymachine.asp, displaypc.asp - fixed column reads
- editmachine.asp, editpc.asp, editdevice.asp, machine_edit.asp - fixed column reads
- savemachineedit.asp, savemachine_direct.asp, updatedevice_direct.asp - fixed SQL

Updated production migration guide with new Step 4 for compliance columns.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-10 20:22:49 -05:00
cproudlock
aac39d8a9f Add comprehensive production migration guide for Dec 10, 2025 changes
Consolidates all database changes into a single step-by-step guide:
1. Table naming convention fix (6 tables renamed)
2. View recreation (9 views)
3. Fix backwards Controls relationships
4. Propagate controllers to dualpath machines
5. Sync equipment data between dualpath partners

Includes pre-deployment checklist, rollback plan, and verification steps.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-10 20:12:47 -05:00
cproudlock
b4b81b850a Add equipment data sync for dualpath partner machines
When a dualpath relationship is created, equipment data is now automatically
synced between partners. This ensures both machines share the same:
- Controller type and OS
- Model number
- Serial number
- Communication settings (IP, Serial config)

Location data (mapleft, maptop) is NOT synced since dualpath machines
occupy slightly different physical positions.

Changes:
- includes/db_helpers.asp: Add CopyEquipmentDataToDualpathPartner(),
  CopyCommConfigToDualpathPartner(), and SyncDualpathPartnerData() functions
- savemachineedit.asp: Call SyncDualpathPartnerData() on dualpath creation
- savemachine_direct.asp: Call SyncDualpathPartnerData() on dualpath creation
- sql/sync_dualpath_equipment_data.sql: One-time script to sync existing pairs

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-10 20:09:56 -05:00
cproudlock
f8083be467 Add automatic controller propagation for dualpath machines
When a PC is assigned to control equipment that has a dualpath relationship,
the controller is now automatically propagated to the dualpath partner machine.

Changes:
- includes/db_helpers.asp: Add PropagateControllerToDualpathMachines() and
  PropagateControllerFromDualpathMachine() helper functions
- savemachine_direct.asp: Call propagation on new equipment creation
- savemachineedit.asp: Call propagation when editing equipment relationships
- api.asp: Add PropagateControllerToDualpathMachinesAPI() for PowerShell API

Also includes one-time fix script (sql/fix_dualpath_controller_relationships.sql)
that fixes 140 backwards relationships (Equipment->PC to PC->Equipment) and
propagates controllers to 30 dualpath machines that were missing them.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-10 20:04:01 -05:00
cproudlock
30ea1bb42f Execute naming convention fix on dev - tables renamed, ASP updated
Database changes applied:
- machine_overrides -> machineoverrides
- pc_comm_config -> commconfig
- pc_dnc_config -> dncconfig
- pc_dualpath_assignments -> dualpathassignments
- pc_network_interfaces -> networkinterfaces
- usb_checkouts -> usbcheckouts

ASP files updated (10 files):
- api.asp, api_usb.asp
- displaypc.asp, displaysubnet.asp, displaymachine.asp
- displayusb.asp, displayprofile.asp
- usb_history.asp, savecheckin_usb.asp, savecheckout_usb.asp

9 views recreated with new table references.

Tested and verified working on dev environment.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-10 14:59:47 -05:00
cproudlock
946074148f Convert bash scripts to PowerShell for Windows production
- Replace 05_update_asp_files.sh with 05_update_asp_files.ps1
- Replace 06_update_docs.sh with 06_update_docs.ps1
- Update PRODUCTION_DEPLOYMENT_GUIDE.md with PowerShell commands

Both scripts support -Execute flag (dry run by default)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-10 14:50:42 -05:00
cproudlock
2894260235 Add database naming convention fix scripts
Scripts to standardize table names from snake_case to camelCase:
- machine_overrides -> machineoverrides
- pc_comm_config -> commconfig
- pc_dnc_config -> dncconfig
- pc_dualpath_assignments -> dualpathassignments
- pc_network_interfaces -> networkinterfaces
- usb_checkouts -> usbcheckouts

Includes:
- SQL scripts for table renames and view recreation
- ASP file update script
- Documentation update script
- Production deployment guide for Windows/IIS/MySQL 5.6

Related to Gitea Issue #1

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-10 14:48:40 -05:00
cproudlock
133aa29458 Add Part Marker machinetypeid and update editpc.asp filtering
sql/add_genspect_partmarker_machinetypes.sql:
- Add Genspect (machinetypeid 45) and Part Marker (machinetypeid 46)

editpc.asp:
- Add pctypeid 10 (Part Marker) -> machinetypeid 46 filter
- Fix comment for Genspect to show machinetypeid 45

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-09 11:11:20 -05:00
cproudlock
3fa1fc3812 Add pctypeid-based equipment filtering in editpc.asp, add Genspect machinetype
editpc.asp:
- Filter equipment dropdown by pctypeid instead of pcMachineTypeId
- pctypeid 5 (CMM) -> machinetypeid 3 (CMM)
- pctypeid 6 (Wax/Trace) -> machinetypeid 5 (Wax Trace)
- pctypeid 7 (Keyence) -> machinetypeid 23 (Measuring Machine)
- pctypeid 8 (Genspect) -> machinetypeid 45 (Genspect)
- pctypeid 9 (Heat Treat) -> machinetypeid 14 (Furnace)

sql/add_genspect_machinetype.sql:
- Add Genspect equipment type (machinetypeid 45)

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-09 11:05:45 -05:00
cproudlock
5c2b9105b8 Update SQL script with view changes for uptime tracking
- Replaced add_lastboottime_column.sql with comprehensive add_uptime_tracking.sql
- Updates 3 views to include lastboottime and uptime_days columns:
  - vw_active_pcs: Active PCs with warranty info
  - vw_shopfloor_pcs: Shopfloor PCs
  - vw_recent_updates: Recently updated machines
- Includes verification queries

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-09 09:54:02 -05:00
cproudlock
cd9058d81e Add PC uptime tracking feature
- Database: Add lastboottime column to machines table
- API: Accept lastBootUpTime parameter and store in lastboottime column
- PowerShell: Collect LastBootUpTime from Win32_OperatingSystem
  - Update-PC-Minimal.ps1: Add last boot time collection
  - Update-ShopfloorPCs-Remote.ps1: Add last boot time collection and API posting
- Display: Add Uptime column to displaypcs.asp with color-coded badges
  - > 90 days: red badge
  - > 30 days: yellow badge
  - > 7 days: blue badge
  - <= 7 days: muted text
- Filter: Add "Uptime > X days" filter dropdown (7, 30, 90 days)
- SQL: Production migration script for lastboottime column

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-09 09:36:23 -05:00
cproudlock
9f58adaf19 Add SQL script for HeatTreat application
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-09 08:11:13 -05:00
cproudlock
e2e7cb1466 Consolidate PC types: use pctypeid instead of multiple machinetypeids
All PCs now use machinetypeid 33 (PC) with pctypeid for sub-type:
- Standard, Engineer, Shopfloor, CMM, Wax/Trace, Keyence, Genspect, Heat Treat

Added new pctypes: Keyence, Genspect, Heat Treat

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-08 15:33:08 -05:00
cproudlock
1e97522831 Add SQL script to standardize printer names
Follows convention: CSFNAME-Location-Brand-Description
Examples:
- CSF21-7701-HP-LaserJet (with CSF)
- Coaching115-Xerox-Versalink (without CSF)

Fixes Coaching 115 and all other printer naming inconsistencies.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-08 12:58:13 -05:00
cproudlock
65b622c361 Add USB checkout system and SSO profile page
New Features:
- USB Device checkout/check-in system with barcode scanning
  - displayusb.asp: List all USB devices with status
  - addusb.asp: Add new USB devices via barcode scan
  - checkout_usb.asp/savecheckout_usb.asp: Check out USB to SSO
  - checkin_usb.asp/savecheckin_usb.asp: Check in with wipe confirmation
  - usb_history.asp: Full checkout history with filters
  - api_usb.asp: JSON API for AJAX lookups
- displayprofile.asp: SSO profile page showing user info and USB history
- Date/time format changed to 12-hour (MM/DD/YYYY h:mm AM/PM)
- SSO links in USB history now link to profile page via search

Database:
- New machinetypeid 44 for USB devices
- New usb_checkouts table for tracking checkouts

Cleanup:
- Removed v2 folder (duplicate/old files)
- Removed old debug/test files
- Removed completed migration documentation

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-07 11:16:14 -05:00
cproudlock
5413b20bba Add FQDN support for network devices and fix printer installer map
## Printer Installer Map Fixes
- Fixed printer_installer_map.asp to pass printer IDs instead of generated names
- Fixed install_printer.asp dictionary key collision by using printerid

## Network Device FQDN Support
- Added fqdn column to machines table (migration script included)
- Updated device edit pages: deviceaccesspoint.asp, deviceserver.asp,
  deviceswitch.asp, devicecamera.asp
- Updated save_network_device.asp to handle FQDN in INSERT/UPDATE
- Updated network_devices.asp to display FQDN for Server, Switch, Camera
- Updated vw_network_devices view to include FQDN from machines table
- Added FQDN field to machine_edit.asp Network tab
- Updated savemachineedit.asp to save FQDN

## Printer Install Path Edit
- Added installpath field to displayprinter.asp Edit tab
- Updated editprinter.asp to save installpath changes

## Documentation
- Added IIS log location to CLAUDE.md

## Production Migration
- sql/add_fqdn_to_machines.sql - Run on production to add column and update view

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-01 08:50:45 -05:00
cproudlock
08d95f579a Phase 2 Migration: Complete PC consolidation and fixes
## Phase 2 Migration Complete
Successfully migrated all 286 active PCs from pc table to machines table.

### Migration Scripts Added/Updated:
- **Phase 1.0**: Added ensure_all_machinetypes.sql (machinetypes 15-20)
- **Phase 1.5**: Added migrate_equipment_ips_to_communications.sql
- **Phase 2**: Updated 01_migrate_pcs_to_machines.sql for duplicate handling
- **Phase 2**: Updated 08_update_schema_for_api.sql (rename pcid→machineid)
- **Phase 2 Fixes**: Added FIX_migrate_remaining_pcs.sql (60 unmigrated PCs)
- **Phase 2 Fixes**: Added FIX_pc_machine_types.sql

### Network Devices View Updated:
- **CREATE_vw_network_devices_with_fqdn.sql**: Complete rewrite for Phase 2
  - Infrastructure devices (IDF, Server, Switch, Camera, Access Point) query machines table
  - Printers remain in separate printers table (has fqdn column)
  - UNION approach: machines (machinetypeid 15-19) + printers table

### Documentation Added:
- DATA_MIGRATION_EXPLAINED.md - Full migration architecture
- PRODUCTION_MIGRATION_PLAN.md - Production deployment plan
- VIEWS_MIGRATION_ANALYSIS.md - Views requiring updates
- PRINTER_INSTALLER_FIX_2025-11-20.md - Printer installer fixes
- SCHEMA_COMPARISON_REPORT_2025-11-20.md - Phase 2 schema comparison

### ASP Files Updated:
- api_printers.asp - Printer API fixes
- displaynotifications.asp - UI improvements
- install_printer.asp - Installer fixes
- v2/api_printers.asp - V2 API updates
- v2/install_printer.asp - V2 installer updates

### Migration Results (DEV):
- Total machines: 523 (237 equipment + 286 PCs)
- Communications: 1,309
- Warranties: 212
- Machine relationships: 201
- PC migration: 286/286 ✓
- Duplicate PCs removed: 166 duplicates cleaned

### Key Achievements:
✓ All 286 active PCs migrated to machines table
✓ Network devices view updated for Phase 2 architecture
✓ pc_to_machine_id_mapping table populated (286 entries)
✓ Duplicate PC records cleaned (452→286)
✓ Schema updates for API compatibility (pcid→machineid)

### Next Steps:
- Update PHP Dashboard API for Phase 2 schema (CRITICAL - see POWERSHELL_API_PHASE2_ISSUES.md)
- Update PowerShell scripts for Phase 2 schema
- Test Update-PC-CompleteAsset-Silent.bat
- Production deployment planning

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-21 09:15:47 -05:00
cproudlock
4bcaf0913f Complete Phase 2 PC migration and network device infrastructure updates
This commit captures 20 days of development work (Oct 28 - Nov 17, 2025)
including Phase 2 PC migration, network device unification, and numerous
bug fixes and enhancements.

## Major Changes

### Phase 2: PC Migration to Unified Machines Table
- Migrated all PCs from separate `pc` table to unified `machines` table
- PCs identified by `pctypeid IS NOT NULL` in machines table
- Updated all display, add, edit, and update pages for PC functionality
- Comprehensive testing: 15 critical pages verified working

### Network Device Infrastructure Unification
- Unified network devices (Switches, Servers, Cameras, IDFs, Access Points)
  into machines table using machinetypeid 16-20
- Updated vw_network_devices view to query both legacy tables and machines table
- Enhanced network_map.asp to display all device types from machines table
- Fixed location display for all network device types

### Machine Management System
- Complete machine CRUD operations (Create, Read, Update, Delete)
- 5-tab interface: Basic Info, Network, Relationships, Compliance, Location
- Support for multiple network interfaces (up to 3 per machine)
- Machine relationships: Controls (PC→Equipment) and Dualpath (redundancy)
- Compliance tracking with third-party vendor management

### Bug Fixes (Nov 7-14, 2025)
- Fixed editdevice.asp undefined variable (pcid → machineid)
- Migrated updatedevice.asp and updatedevice_direct.asp to Phase 2 schema
- Fixed network_map.asp to show all network device types
- Fixed displaylocation.asp to query machines table for network devices
- Fixed IP columns migration and compliance column handling
- Fixed dateadded column errors in network device pages
- Fixed PowerShell API integration issues
- Simplified displaypcs.asp (removed IP and Machine columns)

### Documentation
- Created comprehensive session summaries (Nov 10, 13, 14)
- Added Machine Quick Reference Guide
- Documented all bug fixes and migrations
- API documentation for ASP endpoints

### Database Schema Updates
- Phase 2 migration scripts for PC consolidation
- Phase 3 migration scripts for network devices
- Updated views to support hybrid table approach
- Sample data creation/removal scripts for testing

## Files Modified (Key Changes)
- editdevice.asp, updatedevice.asp, updatedevice_direct.asp
- network_map.asp, network_devices.asp, displaylocation.asp
- displaypcs.asp, displaypc.asp, displaymachine.asp
- All machine management pages (add/edit/save/update)
- save_network_device.asp (fixed machine type IDs)

## Testing Status
- 15 critical pages tested and verified
- Phase 2 PC functionality: 100% working
- Network device display: 100% working
- Security: All queries use parameterized commands

## Production Readiness
- Core functionality complete and tested
- 85% production ready
- Remaining: Full test coverage of all 123 ASP pages

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-17 20:04:06 -05:00