3 # Copyright 2006 Katipo Communications
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 with
17 # Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
18 # Suite 330, Boston, MA 02111-1307 USA
27 use C4::Interface::CGI::Output;
28 use C4::Circulation::Circ2;
33 my $biblionumber = $query->param('biblionumber');
34 my $type = $query->param('type');
35 my $review = $query->param('review');
36 my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
38 template_name => "opac-review.tmpl",
42 flagsrequired => { borrow => 1 },
47 # get borrower information ....
48 # my ($borr, $flags) = getpatroninformation(undef, $borrowernumber);
49 # $template->param($borr);
51 my $biblio = bibdata( $biblionumber, 'opac' );
53 my $savedreview = getreview( $biblionumber, $borrowernumber );
54 if ( $type eq 'save' ) {
55 savereview( $biblionumber, $borrowernumber, $review );
57 if ( $type eq 'update' ) {
58 updatereview( $biblionumber, $borrowernumber, $review );
66 my $reviewdata = $savedreview->{'review'};
68 'biblionumber' => $biblionumber,
69 'borrowernumber' => $borrowernumber,
71 'review' => $reviewdata,
72 'title' => $biblio->{'title'}
76 my $order = $query->param('order');
78 if ( $order2 eq '' ) {
79 $order2 = "date_due desc";
81 my $limit = $query->param('limit');
82 if ( $limit eq 'full' ) {
89 output_html_with_http_headers $query, $cookie, $template->output;