Bug 27422: YouTube videos are HTTPS only
[koha-ffzg.git] / members / files.pl
index 40d4c65..18487ae 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;
 
@@ -38,7 +38,6 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
         template_name   => "members/files.tt",
         query           => $cgi,
         type            => "intranet",
-        authnotrequired => 0,
         flagsrequired   => { borrowers => 'edit_borrowers' },
         debug           => 1,
     }
@@ -47,7 +46,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 +68,7 @@ if ( $op eq 'download' ) {
 else {
 
     my $patron_category = $patron->category;
-    $template->param(%{ $patron->unblessed});
+    $template->param( patron => $patron );
 
     my %errors;
 
@@ -107,23 +106,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(),