Fix FSF address in directory install_misc/
[koha.git] / members / borrowers_details.pl
1 #!/usr/bin/perl
2 # NOTE: This file uses standard 8-space tabs
3 #       DO NOT SET TAB SIZE TO 4
4
5
6 #script to set up screen for modification of borrower details
7 #written 20/12/99 by chris@katipo.co.nz
8
9
10 # Copyright 2000-2002 Katipo Communications
11 #
12 # This file is part of Koha.
13 #
14 # Koha is free software; you can redistribute it and/or modify it under the
15 # terms of the GNU General Public License as published by the Free Software
16 # Foundation; either version 2 of the License, or (at your option) any later
17 # version.
18 #
19 # Koha is distributed in the hope that it will be useful, but WITHOUT ANY
20 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
21 # A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
22 #
23 # You should have received a copy of the GNU General Public License along with
24 # Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
25 # Suite 330, Boston, MA  02111-1307 USA
26
27 use strict;
28 use CGI;
29 use C4::Auth;
30 use C4::Context;
31 use C4::Output;
32 use C4::Members;
33 use C4::Koha;
34 use C4::Dates qw(format_date);
35 use C4::Input;
36 use C4::Log;
37 my $input = new CGI;
38 my $dbh = C4::Context->dbh;
39 my %data;
40
41 my ($template, $loggedinuser, $cookie)
42     = get_template_and_user({template_name => "members/borrowers_details.tmpl",
43                              query => $input,
44                              type => "intranet",
45                              authnotrequired => 0,
46                              flagsrequired => {borrowers => 1},
47                              debug => 1,
48                              });
49
50 my $data;
51 my $categorycode=$input->param('categorycode');
52 my $borrowernumber=$input->param('borrowernumber');
53 my $description=$input->param('description');
54 my $category_type=$input->param('category_type');
55
56 $data=GetMember('borrowernumber' => $borrowernumber);
57
58 $template->param(               borrowernumber  => $borrowernumber,#register number
59                                 #transform value  in capital or capital for first letter of the word
60                                 firstname       => ucfirst($data->{'firstname'}),
61                                 surname         => uc($data->{'surname'}),
62                                 categorycode    => $data->{'categorycode'},
63                                 title           => $data->{'title'},
64                                 category_type   => $data->{'category_type'},
65                                 "title_".$data->{'title'}           => " SELECTED ",                    
66                                 dateofbirth     => format_date($data->{'dateofbirth'}),
67                                 description     => $data->{'description'}
68                 );
69 $template->param(Institution => 1) if ($category_type eq "I");
70 output_html_with_http_headers $input, $cookie, $template->output;
71
72 # Local Variables:
73 # tab-width: 8
74 # End: