gdc_cmod/app/Config/Printers.php
mahdahar cfb81201a2 feat: Implement configurable printer system and enhance UAT workflow
Add comprehensive printer configuration support:
- New Printers.php config with role-based printer defaults (lab, phlebo, reception)
- Update LabelController for configurable printer routing with error handling
- Add ResponseTrait for proper JSON responses (success/error status)
- Update routes to accept optional printer parameter for label printing
- Add default printer configuration per role in shared config

Enhance report generation workflow:
- Support REPORT_LANG from CM_REQUESTS table for language preference
- Prioritize URL parameter, then database value, then default
- Add language info to PDF generation response (Indonesian/English)
- Update all report methods (view, eng, preview, generate) with unified logic

Improve UI and user experience:
- Add dialog_results_generate to all role dashboards (superuser, admin, lab, phlebo, cs)
- Update skeleton loading states widths in content requests
- Add printer selection capability in sample collection flow

Add comprehensive UAT documentation:
- New UAT_GDC_CMOD_Checklist.md with 150+ test cases
- Cover all roles: superuser, admin, lab, phlebo, cs, and cross-role scenarios
- Include acceptance criteria (functional, security, performance, usability, data integrity)
- Test categories: authentication, user management, validation, sample management, audit trail, reporting
- Detailed sign-off structure for stakeholders

Add barcode printing documentation:
- docs/barcode_print_all.php - all labels printing implementation
- docs/barcode_print_coll.php - collection label implementation
- docs/barcode_print_disp.php - dispatch label implementation

Update TODO tracking:
- Mark Reprint Label and PDF Generation as completed
- Update pending tasks for testing and audit trails
2026-02-05 06:21:08 +07:00

49 lines
1.2 KiB
PHP

<?php
namespace Config;
use CodeIgniter\Config\BaseConfig;
class Printers extends BaseConfig
{
public array $printers = [
'lab' => [
'name' => 'Lab Printer',
'command' => 'copy /B file.txt \\\\print-server\\lab-printer',
],
'phlebo' => [
'name' => 'Phlebo Printer',
'command' => 'copy /B file.txt \\\\print-server\\phlebo-printer',
],
'reception' => [
'name' => 'Reception Printer',
'command' => 'copy /B file.txt \\\\print-server\\reception-printer',
],
];
public array $roleDefaults = [
0 => 'lab',
1 => 'lab',
2 => 'lab',
3 => 'phlebo',
4 => 'reception',
];
public string $defaultPrinter = 'lab';
public function getPrinter(string $printerKey): ?array
{
return $this->printers[$printerKey] ?? null;
}
public function getCommand(string $printerKey): ?string
{
return $this->printers[$printerKey]['command'] ?? null;
}
public function getDefaultForRole(int $roleId): string
{
return $this->roleDefaults[$roleId] ?? $this->defaultPrinter;
}
}