synch'ing head and rel_2_2 (from 2.2.5, including npl templates)
[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 use C4::Interface::CGI::Output;
12 use C4::Date;
13
14 my $query = new CGI;
15 my ($template, $borrowernumber, $cookie) 
16     = get_template_and_user({template_name => "opac-userdetails.tmpl",
17                              query => $query,
18                              type => "opac",
19                              authnotrequired => 0,
20                              flagsrequired => {borrow => 1},
21                              debug => 1,
22                              });
23
24 # get borrower information ....
25 my ($borr, $flags) = getpatroninformation(undef, $borrowernumber);
26
27 $borr->{'dateenrolled'} = format_date($borr->{'dateenrolled'});
28 $borr->{'expiry'}       = format_date($borr->{'expiry'});
29 $borr->{'dateofbirth'}  = format_date($borr->{'dateofbirth'});
30 $borr->{'ethnicity'}    = fixEthnicity($borr->{'ethnicity'});
31
32
33 $template->param($borr);
34 $template->param(LibraryName => C4::Context->preference("LibraryName"),
35                                         suggestion => C4::Context->preference("suggestion"),
36                                         virtualshelves => C4::Context->preference("virtualshelves"),
37         );
38
39 output_html_with_http_headers $query, $cookie, $template->output;
40