fix: prevent report dropdown parameter mismatch

This commit is contained in:
Marco0300
2026-09-01 23:04:51 +02:00
parent 99aaaf3338
commit 2b3e04825c
2 changed files with 9 additions and 3 deletions
+2
View File
@@ -15,5 +15,7 @@ jobcard_feature_assert(str_contains($front, "j.status <> 'closed'"), 'Default Jo
jobcard_feature_assert(str_contains($front, "j.status = 'closed'"), 'Closed filter must explicitly select closed records.');
jobcard_feature_assert(str_contains($front, 'All clients') && str_contains($front, '$reportClient'), 'Reports must use a client-name dropdown.');
jobcard_feature_assert(str_contains($front, 'format=xls&detail=1'), 'Reports must expose detailed XLS export.');
jobcard_feature_assert(str_contains($front, "if (\$user['role_name'] === 'Technician') {") && str_contains($front, '$reportClientsStmt->execute'), 'Report client dropdown must bind parameters only on the technician prepared-query branch.');
jobcard_feature_assert(!str_contains($front, 'if ($reportClients instanceof PDOStatement) $reportClients->execute'), 'Report client dropdown must not execute parameters against the non-technician query branch.');
foreach (['Work requested', 'Technician notes / Work performed', 'Hours notes'] as $heading) jobcard_feature_assert(str_contains($front, $heading), "Detailed report must include {$heading}.");
printf("Jobcard search/close/report tests: 10 passed\n");