koha-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Koha-cvs] koha/opac opac-review.pl


From: Chris Cormack
Subject: [Koha-cvs] koha/opac opac-review.pl
Date: Sat, 17 Jun 2006 03:18:32 +0000

CVSROOT:        /sources/koha
Module name:    koha
Changes by:     Chris Cormack <rangi>   06/06/17 03:18:32

Modified files:
        opac           : opac-review.pl 

Log message:
        Tidying up, and getting it working again

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/opac/opac-review.pl?cvsroot=koha&r1=1.1&r2=1.2

Patches:
Index: opac-review.pl
===================================================================
RCS file: /sources/koha/koha/opac/opac-review.pl,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- opac-review.pl      3 Sep 2005 00:07:55 -0000       1.1
+++ opac-review.pl      17 Jun 2006 03:18:32 -0000      1.2
@@ -1,4 +1,22 @@
 #!/usr/bin/perl
+
+# Copyright 2006 Katipo Communications
+#
+# This file is part of Koha.
+#
+# Koha is free software; you can redistribute it and/or modify it under the
+# terms of the GNU General Public License as published by the Free Software
+# Foundation; either version 2 of the License, or (at your option) any later
+# version.
+#
+# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along with
+# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
+# Suite 330, Boston, MA  02111-1307 USA
+
 use strict;
 require Exporter;
 use CGI;
@@ -7,60 +25,65 @@
 use C4::Koha;
 use HTML::Template;
 use C4::Interface::CGI::Output;
-use C4::Search;
 use C4::Circulation::Circ2;
 use C4::Review;
+use C4::Biblio;
 
 my $query = new CGI;
 my $biblionumber = $query->param('biblionumber');
 my $type = $query->param('type');
 my $review = $query->param('review');
-my ($template, $borrowernumber, $cookie) 
-    = get_template_and_user({template_name => "opac-review.tmpl",
+my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
+    {
+        template_name   => "opac-review.tmpl",
                             query => $query,
                             type => "opac",
                             authnotrequired => 0,
-                            flagsrequired => {borrow => 1},
+        flagsrequired   => { borrow => 1 },
                             debug => 1,
-                            });
+    }
+);
 
 # get borrower information ....
 # my ($borr, $flags) = getpatroninformation(undef, $borrowernumber);
 # $template->param($borr);
 
-my $biblio=bibdata($biblionumber,'opac');
+my $biblio = bibdata( $biblionumber, 'opac' );
 
-my $savedreview=getreview($biblionumber,$borrowernumber);
-if ($type eq 'save'){
-   savereview($biblionumber,$borrowernumber,$review);    
+my $savedreview = getreview( $biblionumber, $borrowernumber );
+if ( $type eq 'save' ) {
+    savereview( $biblionumber, $borrowernumber, $review );
 }
-if ($type eq 'update'){
-    updatereview($biblionumber,$borrowernumber,$review);
+if ( $type eq 'update' ) {
+    updatereview( $biblionumber, $borrowernumber, $review );
+}
+if ($savedreview) {
+    $type = "update";
 }
-if ($savedreview){
-       $type="update";
-    }
 else {
-    $type="save";
+    $type = "save";
 }
-my $reviewdata=$savedreview->{'review'};
-$template->param('biblionumber' => $biblionumber,
+my $reviewdata = $savedreview->{'review'};
+$template->param(
+    'biblionumber'   => $biblionumber,
     'borrowernumber' => $borrowernumber,
-    'type'=>$type,
-    'review'=>$reviewdata,
-    'title'=>$biblio->{'title'});
+    'type'           => $type,
+    'review'         => $reviewdata,
+    'title'          => $biblio->{'title'}
+);
 
 # get the record
-my $order=$query->param('order');
-my $order2=$order;
-if ($order2 eq ''){
-  $order2="date_due desc";
-}
-my $limit=$query->param('limit');
-if ($limit eq 'full'){
-  $limit=0;
-} else {
-  $limit=50;
+my $order  = $query->param('order');
+my $order2 = $order;
+if ( $order2 eq '' ) {
+    $order2 = "date_due desc";
+}
+my $limit = $query->param('limit');
+if ( $limit eq 'full' ) {
+    $limit = 0;
+}
+else {
+    $limit = 50;
 }
 
 output_html_with_http_headers $query, $cookie, $template->output;




reply via email to

[Prev in Thread] Current Thread [Next in Thread]