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