Bug 1633: [SIGNED-OFF] Display local cover images
[koha.git] / opac / opac-detail.pl
index 8949444..c4d8218 100755 (executable)
@@ -45,6 +45,7 @@ use C4::Charset;
 use MARC::Record;
 use MARC::Field;
 use List::MoreUtils qw/any none/;
+use C4::Images;
 
 BEGIN {
        if (C4::Context->preference('BakerTaylorEnabled')) {
@@ -690,6 +691,11 @@ if (scalar(@serialcollections) > 0) {
        serialcollections => \@serialcollections);
 }
 
+# Local cover Images stuff
+if (C4::Context->preference("OPACLocalCoverImages")){
+               $template->param(OPACLocalCoverImages => 1);
+}
+
 # Amazon.com Stuff
 if ( C4::Context->preference("OPACAmazonEnabled") ) {
     $template->param( AmazonTld => get_amazon_tld() );
@@ -915,4 +921,9 @@ my $defaulttab =
         ? 'serialcollection' : 'subscription';
 $template->param('defaulttab' => $defaulttab);
 
+if (C4::Context->preference('OPACLocalCoverImages') == 1) {
+    my @images = ListImagesForBiblio($biblionumber);
+    $template->{VARS}->{localimages} = \@images;
+}
+
 output_html_with_http_headers $query, $cookie, $template->output;