Refined Returns module.
[koha.git] / C4 / Interface / BorrowerCDK.pm
1 package C4::Interface::BorrowerCDK; #asummes C4/Interface/BorrowerCDK
2
3 #uses Newt
4 use C4::Format;
5 use C4::InterfaceCDK;
6 use strict;
7 use Cdk;
8
9 require Exporter;
10 use DBI;
11 use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
12   
13 # set the version for version checking
14 $VERSION = 0.01;
15     
16 @ISA = qw(Exporter);
17 @EXPORT = qw(&BorrowerAddress);
18 %EXPORT_TAGS = ( );     # eg: TAG => [ qw!name1 name2! ],
19                   
20 # your exported package globals go here,
21 # as well as any optionally exported functions
22
23 @EXPORT_OK   = qw($Var1 %Hashit);
24 # non-exported package globals go here
25 use vars qw(@more $stuff);
26         
27 # initalize package globals, first exported ones
28
29 my $Var1   = '';
30 my %Hashit = ();
31                     
32 # then the others (which are still accessible as $Some::Module::stuff)
33 my $stuff  = '';
34 my @more   = ();
35         
36 # all file-scoped lexicals must be created before
37 # the functions below that use them.
38                 
39 # file-private lexicals go here
40 my $priv_var    = '';
41 my %secret_hash = ();
42                             
43 # here's a file-private function as a closure,
44 # callable as &$priv_func;  it cannot be prototyped.
45 my $priv_func = sub {
46   # stuff goes here.
47 };
48                                                     
49 # make all your functions, whether exported or not;
50 sub BorrowerAddress {
51   my ($env,$bornum,$borrower)=@_;
52   my $titlepanel = titlepanel($env,$env{'sysarea'},"Update Borrower");
53   $titlepanel->draw();
54   my BorrAdd = BorrAddpame   
55
56 sub BorrAddpanel {
57   my ($env,$bornum,$borrower)=@_;
58   my $titlepanel = titlepanel($env,$env{'sysarea'},"Update Borrower");
59   my @rowtitl = ("Card Number","Surname","First Name","Other Names","Initials",
60      "Address","Area","Town","Telephone","Email","Fax Number","Alt Address",
61      "Alt Area","Alt Town","Alt Phone","Contact Name");
62   my @coltitles = ("");
63   my @coltypes  = ("UMIXED");
64   my @colwidths = (40);
65   my $entrymatrix = new Cdk::Matrix (
66     'ColTitles'=> \@coltitles,
67     'RowTitles'=> \@rowtitles,
68     'ColWidths'=> \@colwidths,
69     'ColTypes'=>  \@coltypes,
70     'Vrows'=>     16,
71     'Vcols'=>     1,
72     'RowSpace'=>  0);
73   my @data;
74   $data[0] = $borrower{'cardnumber'};
75   $data[1] = $borrower{'surname'};
76   $data[2] = $borrower{'firstname'};
77   $data[3] = $borrower{'
78   $entrymatrix->inject('Input'=>"KEY_DOWN");
79   my $reason;
80   my ($rows,$cols,$info) = $entrymatrix->activate();
81   my @responses;
82   if (!defined $rows) {
83      $reason = "Circ";
84   } else {
85      my $i = 0;
86      while ($i < $numflds) {
87         $responses[$i] =$info->[$i][0];
88         $i++;
89      }     
90   } 
91   return($reason,@responses);
92 }
93
94 END { }       # module clean-up code here (global destructor)