bug 3222: tweak sending of hold filled notification

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>
This commit is contained in:
Galen Charlton 2009-05-20 11:35:56 -05:00
parent b6e62489d8
commit 17475d7772

View file

@ -973,6 +973,12 @@ sub ModReserveAffect {
my $sth = $dbh->prepare("SELECT biblionumber FROM items WHERE itemnumber=?");
$sth->execute($itemnumber);
my ($biblionumber) = $sth->fetchrow;
# get request - need to find out if item is already
# waiting in order to not send duplicate hold filled notifications
my $request = GetReserveInfo($borrowernumber, $biblionumber);
my $already_on_shelf = ($request && $request->{found} eq 'W') ? 1 : 0;
# If we affect a reserve that has to be transfered, don't set to Waiting
my $query;
if ($transferToDo) {
@ -998,7 +1004,7 @@ sub ModReserveAffect {
}
$sth = $dbh->prepare($query);
$sth->execute( $itemnumber, $borrowernumber,$biblionumber);
_koha_notify_reserve( $itemnumber, $borrowernumber, $biblionumber ) if ( !$transferToDo );
_koha_notify_reserve( $itemnumber, $borrowernumber, $biblionumber ) if ( !$transferToDo && !$already_on_shelf );
return;
}