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