little bugfixes for opac templated.
[koha.git] / opac / opac-userdetails.pl
1 #!/usr/bin/perl
2 use strict;
3 require Exporter;
4 use CGI;
5
6 use C4::Auth;
7 use C4::Koha;
8 use C4::Circulation::Circ2;
9 use C4::Search;
10 use HTML::Template;
11
12 my $query = new CGI;
13 my ($template, $borrowernumber, $cookie) 
14     = get_template_and_user({template_name => "opac-userdetails.tmpl",
15                              query => $query,
16                              type => "opac",
17                              authnotrequired => 0,
18                              flagsrequired => {borrow => 1},
19                              debug => 1,
20                              });
21
22 # get borrower information ....
23 my ($borr, $flags) = getpatroninformation(undef, $borrowernumber);
24
25 $borr->{'dateenrolled'} = slashifyDate($borr->{'dateenrolled'});
26 $borr->{'expiry'}       = slashifyDate($borr->{'expiry'});
27 $borr->{'dateofbirth'}  = slashifyDate($borr->{'dateofbirth'});
28 $borr->{'ethnicity'}    = fixEthnicity($borr->{'ethnicity'});
29
30
31 $template->param($borr);
32
33 print $query->header(-cookie => $cookie), $template->output;
34