Koha-clms/opac/sco
Martin Renvoize b336cf88d5
Bug 23909: Block waiting holds at SCO checkout
AllowItemsOnHoldCheckoutSCO was previously passed through to
CanBookBeIssued as the ignore_reserves flag, which skipped the entire
holds branch in C4::Circulation and silently allowed checkout of
items already waiting on the hold shelf (reserves.found = 'W') or in
transit/processing for another patron's hold.

With the pref now a 3-value Choice:
  0 = don't allow checkout of any held items
  1 = allow checkout of items with a pending hold only
  2 = allow checkout of items with any hold state

sco-main.pl now always calls CanBookBeIssued with ignore_reserves=0
and filters the needsconfirmation keys according to the pref value,
mirroring the pattern SIP already uses. RESERVE_WAITING, TRANSFERRED
and PROCESSING are added to the error-matching list and to the SCO
template so patrons see a specific "on the hold shelf" / "in transit"
/ "being processed" message instead of falling through to the generic
"please see a member of the library staff" line.

Test plan:
- Enable WebBasedSelfCheck; log in to /cgi-bin/koha/sco/sco-main.pl.
- Create an item with a pending hold for another patron
  (reserves.found IS NULL).
- With AllowItemsOnHoldCheckoutSCO = 0, scan the barcode: checkout is
  refused with "This item is on hold for another patron".
- Switch to 1 ("Allow pending holds only"): checkout succeeds.
- Set the hold to waiting (reserves.found = 'W') and try again with
  the pref still at 1: checkout is refused with "This item is waiting
  on the hold shelf for another patron".
- Switch to 2 ("Allow pending and waiting holds"): checkout succeeds.
- Repeat with found = 'T' and 'P' at pref = 1 -> refused with the
  appropriate transit/processing message; at pref = 2 -> allowed.

Signed-off-by: Kristi Krueger <kkrueger@cuyahogalibrary.org>
Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2026-05-01 11:04:19 -06:00
..
help.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
printslip.pl Bug 35267: Apply preferences to preview and mailing 2026-04-17 09:18:06 -06:00
sco-main.pl Bug 23909: Block waiting holds at SCO checkout 2026-05-01 11:04:19 -06:00
sco-patron-image.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00