Deleted unused variables.
[koha.git] / C4 / Circulation.pm
index 4b602c0..a30ec95 100755 (executable)
@@ -1,11 +1,32 @@
-package C4::Circulation; #assumes C4/Circulation
+package C4::Circulation;
 
-#package to deal with circulation 
+# $Id$
+
+#package to deal with circulation
+
+
+# Copyright 2000-2002 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
+
+# FIXME - This package is never used. Is it obsolete?
 
 use strict;
 require Exporter;
 use DBI;
-use C4::Database;
 use C4::Circulation::Issues;
 use C4::Circulation::Returns;
 use C4::Circulation::Renewals;
@@ -15,10 +36,10 @@ use C4::Reserves;
 use C4::Security;
 
 use vars qw($VERSION @ISA @EXPORT);
-  
+
 # set the version for version checking
 $VERSION = 0.01;
-    
+
 @ISA = qw(Exporter);
 @EXPORT = qw(&Start_circ &scanborrower);
 
@@ -32,14 +53,14 @@ sub Start_circ{
   my $data;
   while ($donext ne 'Quit') {
     if ($donext  eq "Circ") {
-      clearscreen();        
-      ($reason,$data) = menu($env,'console','Circulation', 
+      clearscreen();
+      ($reason,$data) = menu($env,'console','Circulation',
         ('Issues','Returns','Borrower Enquiries','Reserves','Log In'));
       #debug_msg($env,"data = $data");
     } else {
       $data = $donext;
     }
-    if ($data eq 'Issues') {  
+    if ($data eq 'Issues') {
       $donext=Issue($env); #C4::Circulation::Issues
       #debug_msg("","do next $donext");
     } elsif ($data eq 'Returns') {
@@ -52,14 +73,17 @@ sub Start_circ{
       &endint($env);
       &Login($env);   #C4::Security
       &startint($env,'Circulation');
-    } elsif ($data eq 'Quit') { 
+    } elsif ($data eq 'Quit') {
       $donext = $data;
     }
     #debug_msg($env,"donext -  $donext");
   }
-  &endint($env)  
+  &endint($env)
 }
 
+# Not exported.
+# FIXME - This is not the same as &C4::Circulation::Main::pastitems,
+# though the two appear to share some code.
 sub pastitems{
   #Get list of all items borrower has currently on issue
   my ($env,$bornum,$dbh)=@_;
@@ -102,10 +126,12 @@ sub checkoverdues{
   $sth->finish;
 }
 
+# FIXME - This is quite similar to &C4::Circulation::Main::previousissue
+# FIXME - Never used. Obsolete, presumably.
 sub previousissue {
   my ($env,$itemnum,$dbh,$bornum)=@_;
   my $sth=$dbh->prepare("Select firstname,surname,issues.borrowernumber,cardnumber,returndate
-  from issues,borrowers where 
+  from issues,borrowers where
   issues.itemnumber='$itemnum' and
   issues.borrowernumber=borrowers.borrowernumber and issues.returndate is
 NULL");
@@ -119,37 +145,37 @@ NULL");
       my $resp = &msg_yn("Book is issued to this borrower", "Renew?");
       if ($resp == "y") {
         &renewbook($env,$dbh,$bornum,$itemnum);
-      }         
-      
+      }
+
     } else {
-      my $text="Issued to $borrower->{'firstname'} $borrower->{'surname'} ($borrower->{'cardnumber'})";    
+      my $text="Issued to $borrower->{'firstname'} $borrower->{'surname'} ($borrower->{'cardnumber'})";
       my $resp = &msg_yn($text,"Mark as returned?");
       if ($resp == "y") {
         &returnrecord($env,$dbh,$borrower->{'borrowernumber'},$itemnum);
        # can issue
       } else {
         # can't issue
-      }        
+      }
     }
-  } 
+  }
   return($borrower->{'borrowernumber'});
   $sth->finish;
 }
 
 
 sub checkreserve{
-  # Check for reserves for biblio 
+  # Check for reserves for biblio
   # does not look at constraints yet
   my ($env,$dbh,$itemnum)=@_;
   my $resbor = "";
-  my $query = "select * from reserves,items 
+  my $query = "select * from reserves,items
   where (items.itemnumber = '$itemnum')
   and (items.biblionumber = reserves.biblionumber)
   and (reserves.found is null) order by priority";
   my $sth = $dbh->prepare($query);
   $sth->execute();
   if (my $data=$sth->fetchrow_hashref) {
-    $resbor = $data->{'borrowernumber'}; 
+    $resbor = $data->{'borrowernumber'};
   }
   return ($resbor);
   $sth->finish;
@@ -165,12 +191,13 @@ sub checkwaiting{
   my $sth = $dbh->prepare($query);
   $sth->execute();
   if (my $data=$sth->fetchrow_hashref) {
-    push @itemswaiting,$data->{'itemnumber'}; 
+    push @itemswaiting,$data->{'itemnumber'};
   }
   return (\@itemswaiting);
   $sth->finish;
 }
 
+# FIXME - This is identical to &C4::Circulation/Main::scanbook
 sub scanbook {
   my ($env,$interface)=@_;
   #scan barcode
@@ -179,14 +206,12 @@ sub scanbook {
   return ($number,$reason);
 }
 
+# FIXME - This is very similar to &C4::Circulation::Main::scanborrower
 sub scanborrower {
   my ($env,$interface)=@_;
   #scan barcode
   my ($number,$reason,$book)=&borrower_dialog($env); #C4::Interface
-  $number= $number;
+  $number= $number;            # FIXME - WTF?
   $book=uc $book;
   return ($number,$reason,$book);
 }
-
-
-END { }       # module clean-up code here (global destructor)