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