Bug 17829: Move GetMember to Koha::Patron
[srvgit] / members / files.pl
index 5002c3e..ddb99f7 100755 (executable)
@@ -29,8 +29,8 @@ use C4::Members::Attributes qw(GetBorrowerAttributes);
 use C4::Debug;
 
 use Koha::DateUtils;
+use Koha::Patrons;
 use Koha::Patron::Files;
-use Koha::Patron::Images;
 
 my $cgi = CGI->new;
 
@@ -63,8 +63,8 @@ if ( $op eq 'download' ) {
     print $file->{'file_content'};
 }
 else {
-    my $data = GetMember( borrowernumber => $borrowernumber );
-    $template->param(%$data);
+    my $patron = Koha::Patrons->find( $borrowernumber );
+    $template->param(%{ $patron->unblessed});
 
     my %errors;
 
@@ -102,7 +102,7 @@ else {
     }
 
     $template->param(
-        categoryname    => $data->{'description'},
+        categoryname    => $patron->category->description,
         RoutingSerials => C4::Context->preference('RoutingSerials'),
     );
 
@@ -114,8 +114,7 @@ else {
         );
     }
 
-    my $patron_image = Koha::Patron::Images->find($data->{borrowernumber});
-    $template->param( picture => 1 ) if $patron_image;
+    $template->param( picture => 1 ) if $patron->image;
 
     $template->param( adultborrower => 1 ) if ( $data->{category_type} eq 'A' || $data->{category_type} eq 'I' );
     $template->param(