Bug 23051: (follow-up) Add renewal feedback and move code to subroutines and test
[koha-ffzg.git] / members / files.pl
index 40d4c65..e35f7e9 100755 (executable)
@@ -24,12 +24,12 @@ use CGI qw ( -utf8 );
 use C4::Auth;
 use C4::Output;
 use C4::Members;
-use C4::Members::Attributes qw(GetBorrowerAttributes);
 use C4::Debug;
 
 use Koha::DateUtils;
 use Koha::Patrons;
 use Koha::Patron::Files;
+use Koha::Patron::Categories;
 
 my $cgi = CGI->new;
 
@@ -47,7 +47,7 @@ $template->param( 'borrower_files' => 1 );
 
 my $borrowernumber = $cgi->param('borrowernumber');
 
-my $logged_in_user = Koha::Patrons->find( $loggedinuser ) or die "Not logged in";
+my $logged_in_user = Koha::Patrons->find( $loggedinuser );
 my $patron         = Koha::Patrons->find($borrowernumber);
 output_and_exit_if_error( $cgi, $cookie, $template, { module => 'members', logged_in_user => $logged_in_user, current_patron => $patron } );
 
@@ -69,7 +69,7 @@ if ( $op eq 'download' ) {
 else {
 
     my $patron_category = $patron->category;
-    $template->param(%{ $patron->unblessed});
+    $template->param( patron => $patron );
 
     my %errors;
 
@@ -107,23 +107,6 @@ else {
     }
 
     $template->param(
-        categoryname    => $patron_category->description,
-    );
-
-    if (C4::Context->preference('ExtendedPatronAttributes')) {
-        my $attributes = GetBorrowerAttributes($borrowernumber);
-        $template->param(
-            ExtendedPatronAttributes => 1,
-            extendedattributes => $attributes
-        );
-    }
-
-    $template->param( picture => 1 ) if $patron->image;
-
-    $template->param( adultborrower => 1 )
-        if ( $patron_category->category_type eq 'A' || $patron_category->category_type eq 'I' );
-
-    $template->param(
         files => Koha::Patron::Files->new( borrowernumber => $borrowernumber )
           ->GetFilesInfo(),