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

(-)a/C4/Output.pm (-1 / +27 lines)
Lines 34-39 BEGIN { Link Here
34
        setlanguagecookie getlanguagecookie pagination_bar parametrized_url
34
        setlanguagecookie getlanguagecookie pagination_bar parametrized_url
35
        output_html_with_http_headers output_ajax_with_http_headers output_with_http_headers
35
        output_html_with_http_headers output_ajax_with_http_headers output_with_http_headers
36
        output_and_exit_if_error output_and_exit output_error
36
        output_and_exit_if_error output_and_exit output_error
37
        redirect_if_opac_hidden
37
        redirect_if_opac_suppressed
38
        redirect_if_opac_suppressed
38
    );
39
    );
39
}
40
}
Lines 426-431 sub parametrized_url { Link Here
426
    return $ret;
427
    return $ret;
427
}
428
}
428
429
430
=item redirect_if_opac_hidden
431
432
    redirect_if_opac_hidden( $query, $biblio, $patron );
433
434
For a given I<Koha::Biblio> and I<Koha::Patron> object, it handles redirection
435
if it is hidden from the OPAC.
436
437
=cut
438
439
sub redirect_if_opac_hidden {
440
    my ( $query, $biblio, $patron ) = @_;
441
442
    if ( $patron and $patron->category->override_hidden_items ) {
443
        return;
444
    }
445
446
    if ( $biblio->hidden_in_opac( { rules => C4::Context->yaml_preference('OpacHiddenItems') } ) ) {
447
        if ( C4::Context->preference("OpacHiddenRecordRedirect") ) {
448
            print $query->redirect("/cgi-bin/koha/opac-blocked.pl?hidden=1");
449
        } else {
450
            print $query->redirect('/cgi-bin/koha/errors/404.pl');
451
        }
452
        C4::Auth::safe_exit();
453
    }
454
}
455
429
=item redirect_if_opac_suppressed
456
=item redirect_if_opac_suppressed
430
457
431
    redirect_if_opac_suppressed( $query, $biblio )
458
    redirect_if_opac_suppressed( $query, $biblio )
432
- 

Return to bug 27734