|
Lines 102-118
if ( ! $record ) {
Link Here
|
| 102 |
exit; |
102 |
exit; |
| 103 |
} |
103 |
} |
| 104 |
|
104 |
|
| 105 |
my @all_items = GetItemsInfo($biblionumber); |
|
|
| 106 |
my $biblio = Koha::Biblios->find( $biblionumber ); |
105 |
my $biblio = Koha::Biblios->find( $biblionumber ); |
| 107 |
my $framework = $biblio ? $biblio->frameworkcode : q{}; |
106 |
unless ( $patron and $patron->category->override_hidden_items ) { |
| 108 |
my $tagslib = &GetMarcStructure( 0, $framework ); |
107 |
# only skip this check if there's a logged in user |
| 109 |
my ($tag_itemnumber,$subtag_itemnumber) = &GetMarcFromKohaField( 'items.itemnumber' ); |
108 |
# and its category overrides OpacHiddenItems |
| 110 |
my @nonhiddenitems = $record->field($tag_itemnumber); |
109 |
if ( $biblio->hidden_in_opac({ rules => C4::Context->yaml_preference('OpacHiddenItems') }) ) { |
| 111 |
if ( C4::Context->preference('OpacHiddenItemsHidesRecord') && scalar @all_items >= 1 && scalar @nonhiddenitems == 0 ) { |
110 |
print $query->redirect('/cgi-bin/koha/errors/404.pl'); # escape early |
| 112 |
print $query->redirect("/cgi-bin/koha/errors/404.pl"); |
111 |
exit; |
| 113 |
exit; |
112 |
} |
| 114 |
} |
113 |
} |
| 115 |
|
114 |
|
|
|
115 |
my $framework = $biblio ? $biblio->frameworkcode : q{}; |
| 116 |
my $tagslib = &GetMarcStructure( 0, $framework ); |
| 117 |
|
| 116 |
my $record_processor = Koha::RecordProcessor->new({ |
118 |
my $record_processor = Koha::RecordProcessor->new({ |
| 117 |
filters => 'ViewPolicy', |
119 |
filters => 'ViewPolicy', |
| 118 |
options => { |
120 |
options => { |
|
Lines 137-144
$template->param(
Link Here
|
| 137 |
$tagslib->{$bt_tag}->{$bt_subtag}->{hidden} > -8; # except -8; |
139 |
$tagslib->{$bt_tag}->{$bt_subtag}->{hidden} > -8; # except -8; |
| 138 |
|
140 |
|
| 139 |
my $allow_onshelf_holds; |
141 |
my $allow_onshelf_holds; |
| 140 |
for my $itm (@all_items) { |
142 |
my $items = $bibio->items; |
| 141 |
my $item = Koha::Items->find( $itm->{itemnumber} ); |
143 |
while ( my $item = $items->next ) { |
| 142 |
$allow_onshelf_holds = Koha::CirculationRules->get_onshelfholds_policy( { item => $item, patron => $patron } ); |
144 |
$allow_onshelf_holds = Koha::CirculationRules->get_onshelfholds_policy( { item => $item, patron => $patron } ); |
| 143 |
last if $allow_onshelf_holds; |
145 |
last if $allow_onshelf_holds; |
| 144 |
} |
146 |
} |