(bug #3695) allow to limit overdues by categorycode
[koha.git] / opac / opac-detail.pl
index 9c01eaf..a95329f 100755 (executable)
@@ -35,7 +35,6 @@ use C4::Dates qw/format_date/;
 use C4::XISBN qw(get_xisbns get_biblionumber_from_isbn get_biblio_from_xisbn);
 use C4::External::Amazon;
 use C4::Review;
-use C4::Serials;
 use C4::Members;
 use C4::XSLT;
 
@@ -101,7 +100,7 @@ my $collections =  GetKohaAuthorisedValues('items.ccode',$dat->{'frameworkcode'}
 my $subscriptionsnumber = CountSubscriptionFromBiblionumber($biblionumber);
 my @subscriptions       = GetSubscriptions( $dat->{title}, $dat->{issn}, $biblionumber );
 my @subs;
-$dat->{'serial'}=1 if $subscriptionsnumber;
+$dat->{'serials'}=1 if $subscriptionsnumber;
 foreach my $subscription (@subscriptions) {
     my %cell;
     $cell{subscriptionid}    = $subscription->{subscriptionid};
@@ -284,7 +283,11 @@ if ( C4::Context->preference("OPACAmazonEnabled") && C4::Context->preference("OP
     my $similar_products_exist;
     my $amazon_reviews  = C4::Context->preference("AmazonReviews");
     my $amazon_similars = C4::Context->preference("AmazonSimilarItems");
+    my @services;
+    my $amazon_details = &get_amazon_details( $dat->{isbn}, $record, $marcflavour, \@services );
+
     if ( $amazon_reviews ) {
+       
         my $item = $amazon_details->{Items}->{Item}->[0];
         my $customer_reviews = \@{ $item->{CustomerReviews}->{Review} };
         for my $one_review ( @$customer_reviews ) {
@@ -308,14 +311,10 @@ if ( C4::Context->preference("OPACAmazonEnabled") && C4::Context->preference("OP
                 push @similar_products, +{ similar_biblionumbers => $similar_biblionumbers, title => $similar_product->{Title}, ASIN => $similar_product->{ASIN}  };
             }
         }
-    }
-    my $editorial_reviews = \@{$amazon_details->{Items}->{Item}->{EditorialReviews}->{EditorialReview}};
-    my $average_rating = $amazon_details->{Items}->{Item}->{CustomerReviews}->{AverageRating} || 0;
-    $template->param( OPACAmazonSimilarItems => $similar_products_exist );
-    $template->param( amazon_average_rating => $average_rating * 20);
-    $template->param( AMAZON_CUSTOMER_REVIEWS    => $customer_reviews );
-    $template->param( AMAZON_SIMILAR_PRODUCTS => \@similar_products );
-    $template->param( AMAZON_EDITORIAL_REVIEWS    => $editorial_reviews );
+       $template->param( OPACAmazonSimilarItems => $similar_products_exist );
+       $template->param( AMAZON_SIMILAR_PRODUCTS => \@similar_products );
+    }    
+    
 }
 
 # Babelthèque