use strict;
#use warnings; FIXME - Bug 2505
use CGI qw ( -utf8 );
-use Digest::MD5 qw(md5_base64);
-use Encode qw( encode );
use C4::Context;
use C4::Auth;
use C4::Output;
$template->param( error => $error ) if ( $error );
my $patron = Koha::Patrons->find($borrowernumber);
-my $issues = $patron->get_issues;
+my $issues = $patron->checkouts;
my $balance = $patron->account->balance;
$template->param(
issuecount => $issues->count,
$data->{$_} = '';
next;
}
- $template->param( $_ => dt_from_string( $userdate ) );
+ $data->{$_} = dt_from_string( $userdate );
}
$data->{'IS_ADULT'} = ( $data->{'categorycode'} ne 'I' );
my $totalprice = 0;
# Calculate and display patron's age
-$template->param( age => Koha::Patron->new({ dateofbirth => $data->{dateofbirth} })->get_age );
+if ( $data->{dateofbirth} ) {
+ $template->param( age => Koha::Patron->new({ dateofbirth => $data->{dateofbirth} })->get_age );
+}
### ###############################################################################
# BUILD HTML
$template->param( picture => 1 ) if $patron_image;
# Generate CSRF token for upload and delete image buttons
$template->param(
- csrf_token => Koha::Token->new->generate_csrf({
- id => Encode::encode( 'UTF-8', C4::Context->userenv->{id} ),
- secret => md5_base64( Encode::encode( 'UTF-8', C4::Context->config('pass') ) ),
- }),
+ csrf_token => Koha::Token->new->generate_csrf({ session_id => $input->cookie('CGISESSID'),}),
);