Updated FIXME comment. This file is obsolete, right?
[koha.git] / C4 / Circmain.pm
1 package C4::Circmain; #assumes C4/Circulation
2
3 #package to deal with circulation 
4
5
6 # Copyright 2000-2002 Katipo Communications
7 #
8 # This file is part of Koha.
9 #
10 # Koha is free software; you can redistribute it and/or modify it under the
11 # terms of the GNU General Public License as published by the Free Software
12 # Foundation; either version 2 of the License, or (at your option) any later
13 # version.
14 #
15 # Koha is distributed in the hope that it will be useful, but WITHOUT ANY
16 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
17 # A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
18 #
19 # You should have received a copy of the GNU General Public License along with
20 # Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
21 # Suite 330, Boston, MA  02111-1307 USA
22
23 # FIXME - This module doesn't compile! Then again, it's never used, so
24 # presumably this file is obsolete, right?
25
26 use strict;
27 require Exporter;
28 use DBI;
29 use C4::Circulation::Main;
30 use C4::Circulation::Issues;
31 use C4::Circulation::Returns;
32 use C4::Circulation::Renewals;
33 use C4::Circulation::Borrower;
34 use C4::Reserves;
35 use C4::InterfaceCDK;
36 use C4::Security;
37
38 use vars qw($VERSION @ISA @EXPORT);
39   
40 # set the version for version checking
41 $VERSION = 0.01;
42     
43 @ISA = qw(Exporter);
44 @EXPORT = qw(&Start_circ);
45
46 sub Start_circ{
47   my ($env)=@_;
48   #connect to database
49   #start interface
50   &startint($env,'Circulation');
51   getbranch($env);
52   getprinter($env);
53   my $donext = 'Circ';
54   my $reason;
55   my $data;
56   while ($donext ne 'Quit') {
57     if ($donext  eq "Circ") {
58       #($reason,$data) = menu($env,'console','Circulation', 
59       #  ('Issues','Returns','Borrower Enquiries','Reserves','Log In'));
60       #&startint($env,"Menu");
61       ($reason,$data) = menu($env,'console','Circulation',
62         ('Issues','Returns','Select Branch','Select Printer')); 
63     } else {
64       $data = $donext;
65     }
66     if ($data eq 'Issues') {  
67       $donext=Issue($env); #C4::Circulation::Issues 
68     } elsif ($data eq 'Returns') {
69       $donext=Returns($env); #C4::Circulation::Returns 
70     } elsif ($data eq 'Select Branch') {
71       getbranch($env);
72     } elsif ($data eq 'Select Printer') {
73       getprinter($env);      
74     } elsif ($data eq 'Borrower Enquiries') {
75       #  $donext=Borenq($env); #C4::Circulation::Borrower - conversion
76     } elsif ($data eq 'Reserves'){
77       $donext=EnterReserves($env); #C4::Reserves 
78     } elsif ($data eq 'Quit') { 
79       $donext = $data;
80     }
81   }
82   &endint($env)  
83 }
84
85
86 END { }       # module clean-up code here (global destructor)