Send a hold filled notification only when the item
is (assumed) to enter the hold shelf, i.e., when
the request status (reserves.found) is set to 'W'.
Signed-off-by: Daniel Sweeney <daniel.sweeney@liblime.com>
Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
Change to GetReservesFromBiblionumber() had effect
of causing all requests of constrainttype other
than 'o' to not be included in result.
while ($foo) {
$bar or next;
# do stuff
# do other stuff
}
is not equivalent to
while ($foo) {
if ($bar) {
# do stuff
}
# do other stuff
}
Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
This patch check that an item is not "Waiting" before do something in GetOtherReserves(because is the item is waiting, we don't need to do something).
Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
This patch was not fully tested because the actual behavior intended
by constraints 'o' and 'e' was apparently never implemented here.
But it had no chance of success as with:
my $sth = $dbh->prepare("");
This uses the inteneded query, removes unneeded $sth->finish calls and
fixes *some* redeclaration of my $variables in the same scope, as
would be needed to run under warnings pragma.
Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
This adds holds policy creation support to smart rules and read support to
C4/Circulation.pm, and the two reservation pages. It also adds a system
preference, AllowHoldPolicyOverride, to control whether the staff can override
these policies.
Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
Signed-off-by: Daniel Sweeney <daniel.sweeney@liblime.com>
Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
This adds notification code to Reserves.pm to send notifications through email
or SMS to patrons when their hold is filled. It does not send the letter
directly, but instead uses EnqueueLetter. Also, it relies on
EnhancedPatronMessaging being on and the hold notification being turned on for
the specific patron through the 'Messaging' tab.
Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
_Findgroupreserve, which identifies which hold request an
item should fill, is modified to check to see if
that item is targeted to fill a specific hold request.
It first checks for a targeted match with an item-level hold request,
then a targeted match with a title-level request. If no
such targeted match exists, it then checks for the top entries
in the holds queue.
The hold targeting map (i.e., the hold_fill_targets table) is
populated by the build_holds_queue.pl batch job. If that
job is not used, the behavior of _Findgroupreserve
is not changed.
This patch also
* adjusts ModReserveMinusPriority so that it calls
_FixPriority().
* adjusts circ/returns.pl so that it
correctly detects transfers.
Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
* Changed C4::Reserves::ModReserve so that if using it to take an
item off the hold shelf, reserves.waitingdate is cleared.
* Improved POD.
Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
When returning an item that has an item-level hold on it,
CheckReserves() will not consider it waiting unless the
priority has been set to 0 (i.e., the item has specifically
been marked as filling the request.)
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
If an item is not for loan (i.e., items.notforloan is not null),
do not use it to fill a title-level hold request when
item is checked in. Prior to this patch, a notforloan item
could fill a request - CheckReserves() was checking only
the item's item type's not for loan flag.
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
Fixed rules for determining whether an item is
available for an item-level hold request. Create a
new function in C4::Reserves, IsAvailableForItemRequest(),
that checks whether an item is potentially available for
an item-level hold request.
An item is considered available if:
* it is not lost AND,
* it is not marked not for loan AND,
* it is not withdrawn AND,
* it is not damaged (unless the AllowHoldsOnDamagedItems syspref is ON), AND
* it is not on loan (unless the AllowOnShelfHolds syspref is ON)
Preventing a hold request on withdrawn items is bug 1739, as is
the new preference on whether to allow holds on damaged items.
Removing the condition that an item cannot be requested if
it has already been requested by another patron is the topic of bug 1710.
Note that this patch does not change the behavior where if
independent branches is on and the canreservefromotherbranches
syspref is off, a staff operator is prevented from placing
an item-level hold request on an item from a different branch.
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
C4::Reserves::_Findgroupreserves(), instead of
getting all requests for a bib, now gets only the
requests that are title-level (itemnumber is null)
or for that specific item. This prevents an item
from filling an item-level hold for a different item
attached to the same bib, which is the expected
behavior for item-level holds.
[LL Bug 22]
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
The new tables have the same structure and constraints
as the tables they archive with the following exceptions:
* borrowernumber and biblionumber in old_reserves can be
NULL
* the FK constraints (e.g., for itemnumber) on old_reserves
set the child column to NULL if the parent row is deleted
instead of deleting the child row.
* there is no FK constraint on old_issues.branchcode, allowing
a branch to be deleted without changing archived requests.
Some miscellaneous cleanup was done as part of this patch:
* GetMemberIssuesAndFines (C4::Members) now uses bind variables
* fixed POD for GetMemberIssuesAndFines
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
The reserve was cancelled only under certain circumstances (depending on reserve status)
cancelling everytime.
Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>