use C4::Auth;
use C4::Context;
use C4::Output;
-use C4::Branch;
use C4::Members;
use C4::Members::Attributes qw(GetBorrowerAttributes);
use C4::Suggestions;
+use Koha::Patrons;
my $input = new CGI;
my $borrowernumber = $input->param('borrowernumber');
-# Set informations for the patron
-my $borrower = GetMemberDetails( $borrowernumber, 0 );
-foreach my $key ( keys %$borrower ) {
- $template->param( $key => $borrower->{$key} );
+my $patron = Koha::Patrons->find( $borrowernumber );
+unless ( $patron ) {
+ print $input->redirect("/cgi-bin/koha/circ/circulation.pl?borrowernumber=$borrowernumber");
+ exit;
+}
+my $category = $patron->category;
+my $data = $patron->unblessed;
+$data->{description} = $category->description;
+$data->{category_type} = $category->category_type;
+foreach my $key ( keys %$data ) {
+ $template->param( $key => $data->{$key} );
}
$template->param(
suggestionsview => 1,
- categoryname => $borrower->{'description'},
- branchname => GetBranchName( $borrower->{'branchcode'} ),
+ categoryname => $data->{'description'},
RoutingSerials => C4::Context->preference('RoutingSerials'),
);
);
}
-my ($picture, $dberror) = GetPatronImage($borrowernumber);
-$template->param( picture => 1 ) if $picture;
+$template->param( picture => 1 ) if $patron->image;
my $suggestions = SearchSuggestion( { suggestedby => $borrowernumber } );