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) {
52 # can place holds defaults to yes
54 unless ( ( $item->{'notforloan_per_itemtype'} > 0 )
55 || ( $item->{'itemnotforloan'} > 0 ) );
58 if ( $query->cookie("holdfor") ) {
60 GetMember
( 'borrowernumber' => $query->cookie("holdfor") );
62 holdfor
=> $query->cookie("holdfor"),
63 holdfor_surname
=> $holdfor_patron->{'surname'},
64 holdfor_firstname
=> $holdfor_patron->{'firstname'},
65 holdfor_cardnumber
=> $holdfor_patron->{'cardnumber'},
69 if ( C4
::Context
->preference("LocalCoverImages") ) {
70 my @images = ListImagesForBiblio
($biblionumber);
71 $template->{VARS
}->{'LocalCoverImages'} = 1;
72 $template->{VARS
}->{'images'} = \
@images;
73 $template->{VARS
}->{'imagenumber'} = $imagenumber || $images[0] || '';
75 $template->{VARS
}->{'count'} = $itemcount;
76 $template->{VARS
}->{'biblionumber'} = $biblionumber;
77 $template->{VARS
}->{'norequests'} = $norequests;
78 $template->param(C4
::Search
::enabled_staff_search_views
);
79 $template->{VARS
}->{'biblio'} = $biblio;
81 output_html_with_http_headers
$query, $cookie, $template->output;