Refined Returns module.
[koha.git] / C4 / Interface / RenewalsCDK.pm
1 package C4::Interface::RenewalsCDK; #asummes C4/Interface/RenewalsCDK
2
3 #uses Newt
4 use strict;
5 use Cdk;
6 use C4::Format;
7 use C4::InterfaceCDK;
8 use Date::Manip;
9 #use C4::Circulation;
10
11 require Exporter;
12 use DBI;
13 use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
14   
15 # set the version for version checking
16 $VERSION = 0.01;
17     
18 @ISA = qw(Exporter);
19 @EXPORT = qw(renew_window);
20 %EXPORT_TAGS = ( );     # eg: TAG => [ qw!name1 name2! ],
21                   
22 # your exported package globals go here,
23 # as well as any optionally exported functions
24
25 @EXPORT_OK   = qw($Var1 %Hashit);
26 # non-exported package globals go here
27 use vars qw(@more $stuff);
28         
29 # initalize package globals, first exported ones
30
31 my $Var1   = '';
32 my %Hashit = ();
33                     
34 # then the others (which are still accessible as $Some::Module::stuff)
35 my $stuff  = '';
36 my @more   = ();
37         
38 # all file-scoped lexicals must be created before
39 # the functions below that se them.
40                 
41 # file-private lexicals go here
42 my $priv_var    = '';
43 my %secret_hash = ();
44
45 #defining keystrokes used for screens
46
47 # here's a file-private function as a closure,
48 # callable as &$priv_func;  it cannot be prototyped.
49 my $priv_func = sub {
50   # stuff goes here.
51 };
52                                                     
53 # make all your functions, whether exported or not;
54
55 sub renew_window {
56   my ($env,$issueditems,$borrower,$amountowing,$odues)=@_;
57   my $titlepanel = C4::InterfaceCDK::titlepanel($env,$env->{'sysarea'},"Renewals");
58   my @sel = ("N ","Y ");
59   my $issuelist = new Cdk::Selection ('Title'=>"Renew items",
60     'List'=>\@$issueditems,'Choices'=>\@sel,
61     'Height'=> 14,'Width'=>78,'Ypos'=>8);
62   my $x = 0;
63   my $borrbox = C4::InterfaceCDK::borrowerbox($env,$borrower,$amountowing);
64   $borrbox->draw();
65   my @renews = $issuelist->activate();
66   $issuelist->erase();
67   undef $titlepanel;
68   undef $issuelist;
69   undef $borrbox;
70   return \@renews;
71 }  
72                                
73 END { }       # module clean-up code here (global destructor)
74
75