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