Patch from Joe Atzberger to remove $Id$ and $Log$ from scripts
[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 Date::Manip;
29 use CGI;
30 use C4::Auth;
31 use C4::Context;
32 use C4::Output;
33 use C4::Members;
34 use C4::Koha;
35 use C4::Date;
36 use C4::Input;
37 use C4::Log;
38 my $input = new CGI;
39 my $dbh = C4::Context->dbh;
40 my %data;
41
42 my ($template, $loggedinuser, $cookie)
43     = get_template_and_user({template_name => "members/borrowers_details.tmpl",
44                              query => $input,
45                              type => "intranet",
46                              authnotrequired => 0,
47                              flagsrequired => {borrowers => 1},
48                              debug => 1,
49                              });
50
51 my $data;
52 my $categorycode=$input->param('categorycode');
53 my $borrowernumber=$input->param('borrowernumber');
54 my $description=$input->param('description');
55 my $category_type=$input->param('category_type');
56
57  if ( $data{'surname'} eq '') 
58         {
59                 $data=GetMember($borrowernumber,'borrowernumber');
60                 %data=%$data;
61         }
62  my $borrowercategory = GetBorrowercategory($data{'categorycode'});     
63
64 $template->param(               borrowernumber  => $borrowernumber,#register number
65                                 #transform value  in capital or capital for first letter of the word
66                                 firstname       => ucfirst($data{'firstname'}),
67                                 surname         => uc($data{'surname'}),
68                                 categorycode    => $data{'categorycode'},
69                                 title           => $data{'title'},
70                                 category_type   => $borrowercategory ->{'category_type'},
71                                 "title_".$data{'title'}             => " SELECTED ",                    
72                                 dateofbirth     => format_date($data{'dateofbirth'}),
73                                 description     => $borrowercategory->{'description'}
74                                 );
75         $template->param(Institution => 1) if ($category_type eq "I");
76         output_html_with_http_headers $input, $cookie, $template->output;
77
78 # Local Variables:
79 # tab-width: 8
80 # End: