added 440* and 490* 'series' indexes
[koha.git] / members / borrowers_details.pl
blob2f150ad1aa2df3c09e90cf32436373c846968237
1 #!/usr/bin/perl
2 # NOTE: This file uses standard 8-space tabs
3 # DO NOT SET TAB SIZE TO 4
6 #script to set up screen for modification of borrower details
7 #written 20/12/99 by chris@katipo.co.nz
10 # Copyright 2000-2002 Katipo Communications
12 # This file is part of Koha.
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.
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.
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
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;
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 });
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');
56 if ( $data{'surname'} eq '')
58 $data=GetMember($borrowernumber,'borrowernumber');
59 %data=%$data;
61 my $borrowercategory = GetBorrowercategory($data{'categorycode'});
63 $template->param( borrowernumber => $borrowernumber,#register number
64 #transform value in capital or capital for first letter of the word
65 firstname => ucfirst($data{'firstname'}),
66 surname => uc($data{'surname'}),
67 categorycode => $data{'categorycode'},
68 title => $data{'title'},
69 category_type => $borrowercategory ->{'category_type'},
70 "title_".$data{'title'} => " SELECTED ",
71 dateofbirth => format_date($data{'dateofbirth'}),
72 description => $borrowercategory->{'description'}
74 $template->param(Institution => 1) if ($category_type eq "I");
75 output_html_with_http_headers $input, $cookie, $template->output;
77 # Local Variables:
78 # tab-width: 8
79 # End: