Cleaned things up a bit.
[koha.git] / C4 / Interface / RenewalsCDK.pm
1 package C4::Interface::RenewalsCDK; #assumes C4/Interface/RenewalsCDK
2
3 #uses Newt
4
5 # Copyright 2000-2002 Katipo Communications
6 #
7 # This file is part of Koha.
8 #
9 # Koha is free software; you can redistribute it and/or modify it under the
10 # terms of the GNU General Public License as published by the Free Software
11 # Foundation; either version 2 of the License, or (at your option) any later
12 # version.
13 #
14 # Koha is distributed in the hope that it will be useful, but WITHOUT ANY
15 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
16 # A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
17 #
18 # You should have received a copy of the GNU General Public License along with
19 # Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
20 # Suite 330, Boston, MA  02111-1307 USA
21
22 use strict;
23 use Cdk;
24 use C4::InterfaceCDK;
25 use Date::Manip;
26 #use C4::Circulation;
27
28 require Exporter;
29 use DBI;
30 use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
31   
32 # set the version for version checking
33 $VERSION = 0.01;
34     
35 @ISA = qw(Exporter);
36 @EXPORT = qw(renew_window);
37 %EXPORT_TAGS = ( );     # eg: TAG => [ qw!name1 name2! ],
38                   
39 # your exported package globals go here,
40 # as well as any optionally exported functions
41
42 @EXPORT_OK   = qw($Var1 %Hashit);
43 # non-exported package globals go here
44 use vars qw(@more $stuff);
45         
46 # initalize package globals, first exported ones
47
48 my $Var1   = '';
49 my %Hashit = ();
50                     
51 # then the others (which are still accessible as $Some::Module::stuff)
52 my $stuff  = '';
53 my @more   = ();
54         
55 # all file-scoped lexicals must be created before
56 # the functions below that se them.
57                 
58 # file-private lexicals go here
59 my $priv_var    = '';
60 my %secret_hash = ();
61
62 #defining keystrokes used for screens
63
64 # here's a file-private function as a closure,
65 # callable as &$priv_func;  it cannot be prototyped.
66 my $priv_func = sub {
67   # stuff goes here.
68 };
69                                                     
70 # make all your functions, whether exported or not;
71
72 sub renew_window {
73   my ($env,$issueditems,$borrower,$amountowing,$odues)=@_;
74   my $titlepanel = C4::InterfaceCDK::titlepanel($env,$env->{'sysarea'},"Renewals");
75   my @sel = ("N ","Y ");
76   my $issuelist = new Cdk::Selection ('Title'=>"Renew items",
77     'List'=>\@$issueditems,'Choices'=>\@sel,
78     'Height'=> 14,'Width'=>78,'Ypos'=>8);
79   my $x = 0;
80   my $borrbox = C4::InterfaceCDK::borrowerbox($env,$borrower,$amountowing);
81   $borrbox->draw();
82   my @renews = $issuelist->activate();
83   $issuelist->erase();
84   undef $titlepanel;
85   undef $issuelist;
86   undef $borrbox;
87   return \@renews;
88 }  
89                                
90 END { }       # module clean-up code here (global destructor)
91
92