[Koha-devel] The Many Faces of CheckReserves
Ian Walls
ian.walls at bywatersolutions.com
Wed Apr 6 23:55:28 CEST 2011
Fellow Kohackers,
I'll state this boldly and up front: C4::Reserves::CheckReserves must die.
Read the POD. It's purpose is unclear, and without a clear purpose, how can
we expect to make coherent use of it? You feed it an itemnumber (or a
barcode), and it gives you a status and a reserve hash. It's utilized in 11
places in Koha, each to a different end:
C4::Search::searchResults - to get determine whether each item is "waiting"
for someone or not
C4::XSLT::buildKohaItemsNamespace - again, to indicate if the item is
"waiting" or not
C4::Items::GetItemsInfo - to populate the count_reserves key in the
returned value
C4::Reserves::GetOtherReserves - returns whether to transfer the item (and
transfers it) if a hold for the passed item exists, and the borrower who
it's meant for
C4::Circulation::transferbook - tell the routine to 'dotransfer' if there
there is a hold and holds aren't being ignored
C4::Circulation::CanBookBeIssued - indicate that the title is on hold for
someone else, waiting or not
C4::Circulation::AddIssue - marks the reserve as filled and advances the
next, or cancels the hold if told
C4::Circulation::AddReturn - returns the next hold
C4::Circulation::CanBookBeRenewed - block renewals if there is a hold
circ/circulation.pl - add the "renew_error" to the issues table
opac/opac-user.pl - add 'reserved' note to the issued items table
What functions are needed here?
We need a way to indicate that a particular item should be used to fill a
pending hold. (this will be subject to many rules, and in some cases can
block issuing, transfer or renewal)
We need a mechanism to fill a hold using a particular item, marking it as
'committed', and handling the rest of the holds queue as appropriate
We need some way to indicate that a particular item has been committed to
fill a hold.
That looks like three subroutines to me:
$reservenumber = ReserveItemCanFill($itemnumber)
$messages = FillReserve($reserve, $itemnumber)
$reservenumber = IsItemWaitingForReserve($itemnumber)
The last could even be done as another field in the items table, onhold,
like the onloan field, and populated with the expiration date of the hold.
Yes, this depends on there being a primary key to the reserves table, but
that's in the works, and will open many doors for us once it's in place.
Thoughts? Comments? Counterarguments?
-Ian
--
Ian Walls
Lead Development Specialist
ByWater Solutions
ALA Booth 732
Phone # (888) 900-8944
http://bywatersolutions.com
ian.walls at bywatersolutions.com
Twitter: @sekjal
-------------- next part --------------
An HTML attachment was scrubbed...
URL: </pipermail/koha-devel/attachments/20110406/b2601a17/attachment-0001.htm>
More information about the Koha-devel
mailing list