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