push @biblionumbers, $input->multi_param('biblionumber');
}
+my $multihold = scalar $input->param('multi_hold');
# FIXME multi_hold should not be a variable but depends on the number of elements in @biblionumbers
$template->param(multi_hold => scalar $input->param('multi_hold'));
my $logged_in_patron = Koha::Patrons->find( $borrowernumber );
+my $wants_check;
+if ($patron) {
+ $wants_check = $patron->wants_check_for_previous_checkout;
+}
my $itemdata_enumchron = 0;
my $itemdata_ccode = 0;
my @biblioloop = ();
foreach my $itemnumber ( @{ $itemnumbers_of_biblioitem{$biblioitemnumber} } ) {
my $item = $iteminfos_of->{$itemnumber};
-
+ my $do_check;
+ if ( $patron ) {
+ $do_check = $patron->do_check_for_previous_checkout($item) if $wants_check;
+ if ( $do_check && $wants_check ) {
+ $item->{checked_previously} = $do_check;
+ if ( $multihold ) {
+ $biblioloopiter{checked_previously} = $do_check;
+ } else {
+ $template->param( checked_previously => $do_check );
+ }
+ }
+ }
$item->{force_hold_level} = $force_hold_level;
unless (C4::Context->preference('item-level_itypes')) {
if (
!$item->{cantreserve}
&& !$exceeded_maxreserves
- && IsAvailableForItemLevelRequest($item, $patron_unblessed)
+ && IsAvailableForItemLevelRequest($item_object, $patron)
&& $can_item_be_reserved->{status} eq 'OK'
)
{
}
elsif ( C4::Context->preference('AllowHoldPolicyOverride') ) {
# If AllowHoldPolicyOverride is set, it should override EVERY restriction, not just branch item rules
- $item->{override} = 1;
- $num_override++;
+ # with the exception of itemAlreadyOnHold because, you know, the item is already on hold
+ if ( $can_item_be_reserved ne 'itemAlreadyOnHold' ) {
+ $item->{override} = 1;
+ $num_override++;
+ }
push( @available_itemtypes, $item->{itype} );
}