Dates.pm -- Comment and perldoc cleanup.
[koha_fer] / C4 / Reserves.pm
index d6bb83a..8a850e6 100644 (file)
@@ -22,7 +22,6 @@ package C4::Reserves;
 # Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
 # Suite 330, Boston, MA  02111-1307 USA
 
-# $Id$
 
 use strict;
 require Exporter;
@@ -37,7 +36,7 @@ our ($VERSION,@ISA,@EXPORT,@EXPORT_OK,%EXPORT_TAGS);
 my $library_name = C4::Context->preference("LibraryName");
 
 # set the version for version checking
-$VERSION = do { my @v = '$Revision$' =~ /\d+/g; shift(@v) . "." . join( "_", map { sprintf "%03d", $_ } @v ); };
+$VERSION = 3.00;
 
 =head1 NAME
 
@@ -95,8 +94,7 @@ C4::Reserves - Koha functions for dealing with reservation.
   &GetReservesToBranch
   &GetReserveCount
   &GetReserveFee
-  &GetReservesForBranch
-  &GetReservesToBranch
+
   &GetOtherReserves
   
   &ModReserveFill
@@ -217,7 +215,8 @@ sub GetReservesFromBiblionumber {
                 reservedate,
                 constrainttype,
                 found,
-                itemnumber
+                itemnumber,
+                reservenotes
         FROM     reserves
         WHERE     cancellationdate IS NULL
         AND    (found <> \'F\' OR found IS NULL)
@@ -557,15 +556,22 @@ sub GetReservesToBranch {
 sub GetReservesForBranch {
     my ($frombranch) = @_;
     my $dbh          = C4::Context->dbh;
-    my $sth          = $dbh->prepare( "
-        SELECT borrowernumber,reservedate,itemnumber,waitingdate
+       my $query        = "SELECT borrowernumber,reservedate,itemnumber,waitingdate
         FROM   reserves 
         WHERE   priority='0'
             AND cancellationdate IS NULL 
-            AND found='W' 
-            AND branchcode=?
-        ORDER BY waitingdate" );
-    $sth->execute($frombranch);
+            AND found='W' ";
+    if ($frombranch){
+        $query .= " AND branchcode=? ";
+       }
+    $query .= "ORDER BY waitingdate" ;
+    my $sth = $dbh->prepare($query);
+    if ($frombranch){
+               $sth->execute($frombranch);
+       }
+    else {
+               $sth->execute();
+       }
     my @transreserv;
     my $i = 0;
     while ( my $data = $sth->fetchrow_hashref ) {