Koha/opac/svc/shelfbrowser.pl
Julian Maurice 96cc447045 Bug 25898: Prohibit indirect object notation
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2020-10-15 12:56:30 +02:00

40 lines
1.2 KiB
Perl
Executable file

#!/usr/bin/perl
use Modern::Perl;
use CGI qw ( -utf8 );
use C4::Auth;
use C4::Context;
use C4::Output;
use C4::ShelfBrowser;
my $cgi = CGI->new;
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
{
template_name => "svc/shelfbrowser.tt",
query => $cgi,
type => "opac",
authnotrequired => ( C4::Context->preference("OpacPublic") ? 1 : 0 ),
}
);
# Shelf Browser Stuff
if (C4::Context->preference("OPACShelfBrowser")) {
my $starting_itemnumber = $cgi->param('shelfbrowse_itemnumber');
if (defined($starting_itemnumber)) {
my $nearby = GetNearbyItems($starting_itemnumber);
$template->param(
starting_homebranch => $nearby->{starting_homebranch}->{description},
starting_location => $nearby->{starting_location}->{description},
starting_ccode => $nearby->{starting_ccode}->{description},
shelfbrowser_prev_item => $nearby->{prev_item},
shelfbrowser_next_item => $nearby->{next_item},
shelfbrowser_items => $nearby->{items},
OpenOPACShelfBrowser => 1,
);
}
}
output_html_with_http_headers $cgi, $cookie, $template->output;