Script to display reviews, given a biblionumber
authorrangi <rangi>
Sat, 3 Sep 2005 00:09:34 +0000 (00:09 +0000)
committerrangi <rangi>
Sat, 3 Sep 2005 00:09:34 +0000 (00:09 +0000)
opac/opac-showreviews.pl [new file with mode: 0755]

diff --git a/opac/opac-showreviews.pl b/opac/opac-showreviews.pl
new file mode 100755 (executable)
index 0000000..4bdc0d1
--- /dev/null
@@ -0,0 +1,33 @@
+#!/usr/bin/perl
+use strict;
+require Exporter;
+use CGI;
+
+use C4::Auth;
+use C4::Koha;
+use HTML::Template;
+use C4::Interface::CGI::Output;
+use C4::Search;
+use C4::Circulation::Circ2;
+use C4::Review;
+
+my $query = new CGI;
+my $biblionumber = $query->param('biblionumber');
+
+my ($template, $borrowernumber, $cookie) 
+    = get_template_and_user({template_name => "opac-showreviews.tmpl",
+                            query => $query,
+                            type => "opac",
+                            authnotrequired => 0,
+                            flagsrequired => {borrow => 1},
+                            debug => 1,
+                            });
+
+my $biblio=bibdata($biblionumber,'opac');
+my $reviews=getreviews($biblionumber,1);
+
+$template->param('reviews' => $reviews,
+'title' => $biblio->{'title'});
+
+output_html_with_http_headers $query, $cookie, $template->output;
+