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