Bug 18936: (follow-up) Make possible to have unlimited value for holds_per_day
Without this it is not possible to make for a specific patron category or itemtype a more specific unlimited holds_per_day rule if you have a catch all rule (categorycode = *, itemtype = *) with limited holds_per_day value. Signed-off-by: Minna Kivinen <minna.kivinen@hamk.fi> Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This commit is contained in:
parent
61628c97c2
commit
0401d13d2c
|
|
@ -393,7 +393,8 @@ sub CanItemBeReserved {
|
|||
biblionumber => $item->biblionumber,
|
||||
}
|
||||
);
|
||||
if ( $holds->count() >= $holds_per_record ) {
|
||||
if ( defined $holds_per_record && $holds_per_record ne ''
|
||||
&& $holds->count() >= $holds_per_record ) {
|
||||
return { status => "tooManyHoldsForThisRecord", limit => $holds_per_record };
|
||||
}
|
||||
|
||||
|
|
@ -402,10 +403,9 @@ sub CanItemBeReserved {
|
|||
reservedate => dt_from_string->date
|
||||
});
|
||||
|
||||
if ( defined $holds_per_day &&
|
||||
( ( $holds_per_day > 0 && $today_holds->count() >= $holds_per_day )
|
||||
or ( $holds_per_day == 0 ) )
|
||||
) {
|
||||
if ( defined $holds_per_day && $holds_per_day ne ''
|
||||
&& $today_holds->count() >= $holds_per_day )
|
||||
{
|
||||
return { status => 'tooManyReservesToday', limit => $holds_per_day };
|
||||
}
|
||||
|
||||
|
|
@ -436,7 +436,8 @@ sub CanItemBeReserved {
|
|||
}
|
||||
|
||||
# we check if it's ok or not
|
||||
if ( $reservecount >= $allowedreserves ) {
|
||||
if ( defined $allowedreserves && $allowedreserves ne ''
|
||||
&& $reservecount >= $allowedreserves ) {
|
||||
return { status => 'tooManyReserves', limit => $allowedreserves };
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -277,7 +277,7 @@ elsif ($op eq 'add') {
|
|||
my $holds_per_record = $input->param('holds_per_record');
|
||||
my $holds_per_day = $input->param('holds_per_day');
|
||||
$holds_per_day =~ s/\s//g;
|
||||
$holds_per_day = undef if $holds_per_day !~ /^\d+/;
|
||||
$holds_per_day = '' if $holds_per_day !~ /^\d+/;
|
||||
my $onshelfholds = $input->param('onshelfholds') || 0;
|
||||
$maxissueqty =~ s/\s//g;
|
||||
$maxissueqty = '' if $maxissueqty !~ /^\d+/;
|
||||
|
|
|
|||
Loading…
Reference in New Issue