Added a couple of comments.
[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!
24
25 use strict;
26 require Exporter;
27 use DBI;
28 use C4::Circulation::Main;
29 use C4::Circulation::Issues;
30 use C4::Circulation::Returns;
31 use C4::Circulation::Renewals;
32 use C4::Circulation::Borrower;
33 use C4::Reserves;
34 use C4::InterfaceCDK;
35 use C4::Security;
36
37 use vars qw($VERSION @ISA @EXPORT);
38   
39 # set the version for version checking
40 $VERSION = 0.01;
41     
42 @ISA = qw(Exporter);
43 @EXPORT = qw(&Start_circ);
44
45 sub Start_circ{
46   my ($env)=@_;
47   #connect to database
48   #start interface
49   &startint($env,'Circulation');
50   getbranch($env);
51   getprinter($env);
52   my $donext = 'Circ';
53   my $reason;
54   my $data;
55   while ($donext ne 'Quit') {
56     if ($donext  eq "Circ") {
57       #($reason,$data) = menu($env,'console','Circulation', 
58       #  ('Issues','Returns','Borrower Enquiries','Reserves','Log In'));
59       #&startint($env,"Menu");
60       ($reason,$data) = menu($env,'console','Circulation',
61         ('Issues','Returns','Select Branch','Select Printer')); 
62     } else {
63       $data = $donext;
64     }
65     if ($data eq 'Issues') {  
66       $donext=Issue($env); #C4::Circulation::Issues 
67     } elsif ($data eq 'Returns') {
68       $donext=Returns($env); #C4::Circulation::Returns 
69     } elsif ($data eq 'Select Branch') {
70       getbranch($env);
71     } elsif ($data eq 'Select Printer') {
72       getprinter($env);      
73     } elsif ($data eq 'Borrower Enquiries') {
74       #  $donext=Borenq($env); #C4::Circulation::Borrower - conversion
75     } elsif ($data eq 'Reserves'){
76       $donext=EnterReserves($env); #C4::Reserves 
77     } elsif ($data eq 'Quit') { 
78       $donext = $data;
79     }
80   }
81   &endint($env)  
82 }
83
84
85 END { }       # module clean-up code here (global destructor)