Patch from Brandon Uhlman addressing SIP2 unavailable holds display.
authormiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 29 Mar 2011 16:58:48 +0000 (16:58 +0000)
committermiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 29 Mar 2011 16:58:48 +0000 (16:58 +0000)
commitdef3eb022858e58d3f85e467c96059c498f4a922
treef8d9c8862cce1a2748c1f9defcc240ce78b142a4
parent3642a980c3fed8b2433a446647461b5391f958d6
Patch from Brandon Uhlman addressing SIP2 unavailable holds display.

The unavail_holds() function in OpenILS::SIP::Patron is a placeholder that returns an empty set, instead of an actual list of a patrons' holds not currently ready for pickup.

When an SC determines whether a patron has holds ready for pickup by comparing the cardinalities of hold_items() and unavail_holds() [*] using the existing unavail_holds() logic, it effectively reports every currently placed hold as ready for pickup, which is generally not true.

The attached patch assumes that unavailable holds are those that meet one of two sets of conditions:
- hold requests that are not cancelled (cancel_time = null), not fulfilled (fulfillment time = null), and not captured (capture_time = null)
- hold requests that are neither cancelled nor fulfilled (as above), are captured (capture_time != null), and for which, additionally, the current_copy does not have the status 'On holds shelf' (status = 8). The only items that should meet this condition are those that are in transit to a location where they will be added to the holds shelf.

The patch iterates through the items meeting each condition, and adds them to a master list of relevant holds, which it then processes (in the same way that hold_items is processed) and returns.

This patch was developed against and tested on rel_1_6_0 from SVN (~ 1.6.0.2), but should apply cleanly against current rel_1_6_0 and trunk; OpenSRF 1.2.2, PostgreSQL 8.3.8, Ubuntu Hardy 64-bit.

[*] The two cardinalities are returned by SIP message 64 as fixed-length integers in positions 35-38 and 55-58 respectively, so we don't need to iterate through the list ourseles.

git-svn-id: svn://svn.open-ils.org/ILS/branches/rel_1_6@19896 dcc99617-32d9-48b4-a31d-7c20da2025e4
Open-ILS/src/perlmods/OpenILS/SIP/Patron.pm