3 # Copyright 2011 C & P Bibliography Services
5 # This file is part of Koha.
7 # Koha is free software; you can redistribute it and/or modify it under the
8 # terms of the GNU General Public License as published by the Free Software
9 # Foundation; either version 2 of the License, or (at your option) any later
12 # Koha is distributed in the hope that it will be useful, but WITHOUT ANY
13 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
14 # A PARTICULAR PURPOSE. See the GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License along
17 # with Koha; if not, write to the Free Software Foundation, Inc.,
18 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
32 my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
34 template_name => "catalogue/imageviewer.tmpl",
38 flagsrequired => { catalogue => 1 },
42 my $biblionumber = $query->param('biblionumber') || $query->param('bib');
43 my $imagenumber = $query ->param('imagenumber');
44 my ($count, $biblio) = GetBiblio($biblionumber);
45 my $itemcount = GetItemsCount($biblionumber);
47 my @items = GetItemsInfo( $biblionumber );
50 foreach my $item (@items) {
51 # can place holds defaults to yes
52 $norequests = 0 unless ( ( $item->{'notforloan_per_itemtype'} > 0 ) || ( $item->{'itemnotforloan'} > 0 ) );
55 if($query->cookie("holdfor")){
56 my $holdfor_patron = GetMember('borrowernumber' => $query->cookie("holdfor"));
58 holdfor => $query->cookie("holdfor"),
59 holdfor_surname => $holdfor_patron->{'surname'},
60 holdfor_firstname => $holdfor_patron->{'firstname'},
61 holdfor_cardnumber => $holdfor_patron->{'cardnumber'},
65 if (C4::Context->preference("LocalCoverImages")) {
66 my @images = ListImagesForBiblio($biblionumber);
67 $template->{VARS}->{'LocalCoverImages'} = 1;
68 $template->{VARS}->{'images'} = \@images;
69 $template->{VARS}->{'imagenumber'} = $imagenumber || $images[0] || '';
71 $template->{VARS}->{'count'} = $itemcount;
72 $template->{VARS}->{'biblionumber'} = $biblionumber;
73 $template->{VARS}->{'norequests'} = $norequests;
74 $template->param( C4::Search::enabled_staff_search_views );
75 $template->{VARS}->{'biblio'} = $biblio;
77 output_html_with_http_headers $query, $cookie, $template->output;