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