View | Details | Raw Unified | Return to bug 15448
Collapse All | Expand All

(-)a/opac/opac-reserve.pl (-1 / +14 lines)
Lines 42-47 use Koha::ItemTypes; Link Here
42
use Koha::Checkouts;
42
use Koha::Checkouts;
43
use Koha::Libraries;
43
use Koha::Libraries;
44
use Koha::Patrons;
44
use Koha::Patrons;
45
use Koha::Util::SystemPreferences qw(get_yaml_pref_hash);
45
use Date::Calc qw/Today Date_to_Days/;
46
use Date::Calc qw/Today Date_to_Days/;
46
use List::MoreUtils qw/uniq/;
47
use List::MoreUtils qw/uniq/;
47
48
Lines 71-76 for ( C4::Context->preference("OPACShowHoldQueueDetails") ) { Link Here
71
}
72
}
72
73
73
my $patron = Koha::Patrons->find( $borrowernumber );
74
my $patron = Koha::Patrons->find( $borrowernumber );
75
my $category = $patron->category;
74
76
75
my $can_place_hold_if_available_at_pickup = C4::Context->preference('OPACHoldsIfAvailableAtPickup');
77
my $can_place_hold_if_available_at_pickup = C4::Context->preference('OPACHoldsIfAvailableAtPickup');
76
unless ( $can_place_hold_if_available_at_pickup ) {
78
unless ( $can_place_hold_if_available_at_pickup ) {
Lines 461-466 foreach my $biblioNum (@biblionumbers) { Link Here
461
    my @notforloan_avs = Koha::AuthorisedValues->search_by_koha_field({ kohafield => 'items.notforloan', frameworkcode => $frameworkcode });
463
    my @notforloan_avs = Koha::AuthorisedValues->search_by_koha_field({ kohafield => 'items.notforloan', frameworkcode => $frameworkcode });
462
    my $notforloan_label_of = { map { $_->authorised_value => $_->opac_description } @notforloan_avs };
464
    my $notforloan_label_of = { map { $_->authorised_value => $_->opac_description } @notforloan_avs };
463
465
466
    # no OpacHiddenItems rules used if category is excepted
467
    my $rules =
468
        ( $category->override_hidden_items )
469
      ? {}
470
      : get_yaml_pref_hash('OpacHiddenItems');
471
472
    my $visible_items = { map { $_->itemnumber => 1 } $biblio->items->filter_by_visible_in_opac( { rules => $rules } ) };
473
474
    # Only keep the items that are visible in the opac (i.e. those in %visible_items)
475
    # FIXME: We should get rid of itemInfos altogether and use $visible_items
476
    $biblioData->{itemInfos} = [ grep { $visible_items->{ $_->{itemnumber} } } @{ $biblioData->{itemInfos} } ];
477
464
    $biblioLoopIter{itemLoop} = [];
478
    $biblioLoopIter{itemLoop} = [];
465
    my $numCopiesAvailable = 0;
479
    my $numCopiesAvailable = 0;
466
    my $numCopiesOPACAvailable = 0;
480
    my $numCopiesOPACAvailable = 0;
467
- 

Return to bug 15448