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

(-)a/opac/opac-ISBDdetail.pl (-10 / +2 lines)
Lines 42-48 use Modern::Perl; Link Here
42
42
43
use C4::Auth qw( get_template_and_user );
43
use C4::Auth qw( get_template_and_user );
44
use C4::Context;
44
use C4::Context;
45
use C4::Output qw( parametrized_url output_html_with_http_headers redirect_if_opac_suppressed );
45
use C4::Output qw( parametrized_url output_html_with_http_headers redirect_if_opac_hidden redirect_if_opac_suppressed );
46
use CGI        qw ( -utf8 );
46
use CGI        qw ( -utf8 );
47
use C4::Biblio qw(
47
use C4::Biblio qw(
48
    CountItemsIssued
48
    CountItemsIssued
Lines 93-107 my $patron = Koha::Patrons->find($loggedinuser); Link Here
93
93
94
my $opachiddenitems_rules = C4::Context->yaml_preference('OpacHiddenItems');
94
my $opachiddenitems_rules = C4::Context->yaml_preference('OpacHiddenItems');
95
95
96
unless ( $patron and $patron->category->override_hidden_items ) {
96
redirect_if_opac_hidden( $query, $biblio, $patron );
97
98
    # only skip this check if there's a logged in user
99
    # and its category overrides OpacHiddenItems
100
    if ( $biblio->hidden_in_opac( { rules => $opachiddenitems_rules } ) ) {
101
        print $query->redirect('/cgi-bin/koha/errors/404.pl');    # escape early
102
        exit;
103
    }
104
}
105
97
106
my $record = $biblio->metadata->record;
98
my $record = $biblio->metadata->record;
107
my @items  = $biblio->items->filter_by_visible_in_opac( { patron => $patron } )->as_list;
99
my @items  = $biblio->items->filter_by_visible_in_opac( { patron => $patron } )->as_list;
(-)a/opac/opac-MARCdetail.pl (-10 / +2 lines)
Lines 46-52 use Modern::Perl; Link Here
46
46
47
use C4::Auth qw( get_template_and_user );
47
use C4::Auth qw( get_template_and_user );
48
use C4::Context;
48
use C4::Context;
49
use C4::Output qw( parametrized_url output_html_with_http_headers redirect_if_opac_suppressed );
49
use C4::Output qw( parametrized_url output_html_with_http_headers redirect_if_opac_hidden redirect_if_opac_suppressed );
50
use CGI        qw ( -utf8 );
50
use CGI        qw ( -utf8 );
51
use C4::Biblio qw(
51
use C4::Biblio qw(
52
    CountItemsIssued
52
    CountItemsIssued
Lines 100-114 if ( !$biblio ) { Link Here
100
redirect_if_opac_suppressed( $query, $biblio )
100
redirect_if_opac_suppressed( $query, $biblio )
101
    if C4::Context->preference('OpacSuppression');
101
    if C4::Context->preference('OpacSuppression');
102
102
103
unless ( $patron and $patron->category->override_hidden_items ) {
103
redirect_if_opac_hidden( $query, $biblio, $patron );
104
105
    # only skip this check if there's a logged in user
106
    # and its category overrides OpacHiddenItems
107
    if ( $biblio->hidden_in_opac( { rules => C4::Context->yaml_preference('OpacHiddenItems') } ) ) {
108
        print $query->redirect('/cgi-bin/koha/errors/404.pl');    # escape early
109
        exit;
110
    }
111
}
112
104
113
my $metadata_extractor = $biblio->metadata_extractor;
105
my $metadata_extractor = $biblio->metadata_extractor;
114
106
(-)a/opac/opac-detail.pl (-6 / +2 lines)
Lines 33-39 use C4::Koha qw( Link Here
33
);
33
);
34
use C4::Search  qw( new_record_from_zebra searchResults getRecords );
34
use C4::Search  qw( new_record_from_zebra searchResults getRecords );
35
use C4::Serials qw( CountSubscriptionFromBiblionumber SearchSubscriptions GetLatestSerials );
35
use C4::Serials qw( CountSubscriptionFromBiblionumber SearchSubscriptions GetLatestSerials );
36
use C4::Output  qw( parametrized_url output_html_with_http_headers redirect_if_opac_suppressed );
36
use C4::Output qw( parametrized_url output_html_with_http_headers redirect_if_opac_hidden redirect_if_opac_suppressed );
37
use C4::Biblio  qw(
37
use C4::Biblio  qw(
38
    CountItemsIssued
38
    CountItemsIssued
39
    GetBiblioData
39
    GetBiblioData
Lines 127-136 unless ( $patron and $patron->category->override_hidden_items ) { Link Here
127
127
128
    # only skip this check if there's a logged in user
128
    # only skip this check if there's a logged in user
129
    # and its category overrides OpacHiddenItems
129
    # and its category overrides OpacHiddenItems
130
    if ( $biblio->hidden_in_opac( { rules => C4::Context->yaml_preference('OpacHiddenItems') } ) ) {
130
    redirect_if_opac_hidden( $query, $biblio, $patron );
131
        print $query->redirect('/cgi-bin/koha/errors/404.pl');    # escape early
132
        exit;
133
    }
134
    if ( $items->count >= 1 ) {
131
    if ( $items->count >= 1 ) {
135
        $items = $items->filter_by_visible_in_opac( { patron => $patron } );
132
        $items = $items->filter_by_visible_in_opac( { patron => $patron } );
136
    }
133
    }
137
- 

Return to bug 27734