Introduces v2 role routes/views and moves request list filtering, sorting, and pagination to the backend for better performance. Also switches shared pages to a generated Tailwind CSS bundle with supporting npm assets.
- Update UnVal visibility condition from ISVAL check to VAL1USER && VAL2USER
- Fix validated-but-incomplete requests missing the UnVal action button
- Align isValidated() function with same logic for consistency
- Refactor AGENTS.md formatting
- Reduce cURL timeout from 10s to 3s total (2s connection)
- Add better error messages for spooler failures
- Continue processing remaining items if one fails
- Prevents getting stuck when spooler is slow/unreachable
- Create PdfBatchService class with generatePdf() method
- Extract PDF generation logic from ReportController for reuse
- Update SuperuserController to use direct method calls instead of HTTP/cURL
- Eliminates HTTP overhead for ~10x faster batch processing
Fixes 'Call to a member function getIPAddress() on null' error by calling
report/{id}/pdf endpoint via HTTP request instead of instantiating
ReportController directly, which ensures proper request initialization.
- Add /superuser/pdf-batch page with textarea input for access numbers
- Create API endpoint /api/superuser/pdf-batch to process batch PDF generation
- Use report/{id}/pdf endpoint for authenticated PDF generation
- Show results table with success/failed status, language, and type (new/regen)
- Remove deprecated /batch/pdf endpoint
- Add PDF Batch menu item to superuser navigation
Changes:
- app/Config/Routes.php: Add GET /batch/pdf/(:num) route without auth filter
- app/Controllers/ReportController.php: Add generatePdfNoAuth() method
- script.php: Update to use new batch/pdf endpoint with localhost URL
Usage: php script.php accessnumbers.txt
Endpoint: http://localhost/gdc_cmod/batch/pdf/{accessnumber}
No authentication required - for internal/batch processing only.
- Add support for scanning sample numbers (8 digits) in addition to access numbers (10 digits)
- Backend: Detect input type based on length, extract sample code and access suffix
- Frontend: Auto-select matching sample and highlight with primary ring border
- When sample number scanned (e.g., 10135026), extracts sample code (101) and auto-checks it
PDFs were being saved based on collection date but links were using
REQDATE, causing mismatches. Updated both regular and English PDF
links to use COLLECTIONDATE for consistency.
- Add POST /api/requests/{accessnumber}/pdf endpoint (no auth required)
- Add setPdfFlag() method to update CM_REQUESTS.ISPDF to 1
- Log PDF_FLAG events to AUDIT_EVENTS table
- Include ISPDF field in dashboard API response
- Add PDF icon indicator in dashboard table (after Val column)
- Icon shows green when ISPDF=1, gray when null/0
- Pass accessnumber to PDF spooler for tracking
Files modified:
- app/Config/Routes.php: Add external PDF endpoint route
- app/Controllers/RequestsController.php: Add setPdfFlag method, include ISPDF in query
- app/Controllers/ReportController.php: Pass accessnumber to spooler
- app/Libraries/PdfHelper.php: Pass accessnumber to spooler
- app/Views/shared/content_requests.php: Add PDF column with icon
- Remove dialog_eng_result.php include from CS index view
- Add role-based status display for Phlebo (role 3) showing Ready/Pending badges
- Fix indentation inconsistencies in content_requests.php dropdown menus
- Add role restrictions: hide Generate Result and Create Eng Result buttons for CS (role 4) and Phlebo (role 3)
- Move status sorting logic from fetchList to computeSorted for proper Alpine.js reactivity
- Add statusOrder mapping (Pend -> Coll -> Recv -> Inc -> Fin) for consistent request sorting
- Simplify Actions dropdown for Phlebo role to show only status indicator
- Replace reactive watchers with explicit method calls
- Add setFilterKey() and setFilterTable() methods for manual updates
- Update sort(), nextPage(), prevPage() to trigger computations
- Update templates to use new setter methods
- Compute derived data explicitly after data loading
- Add toastTimeouts array to track and clear pending timeouts
- Consolidate duplicate watchers (sortCol, sortAsc, sorted, currentPage)
- Add destroy() method to clean up data structures and timeouts
- Cache audit events in _cachedAuditEvents instead of computed getter
- Clear item data when closing dialogs
- Update collect() and unreceive() to accept samplenumber as path param
- Improve unreceive logic with better Firebird update handling
- Update routes and frontend to match new endpoint signature
- Add PDF generation events (GEN_PDF, REGEN_PDF) to AUDIT_REQUESTS table
- Track PDF print/generate/regenerate with timestamp and language
- Fix language parameter handling in ReportController (engQuery vs engQuery typo)
- Simplify result dialog to show report in iframe instead of async PDF loading
- Add PDF tab to audit dialog showing generation history