Bug 24663: Test OpacPublic for all OPAC scripts
[srvgit] / members / moremember.pl
index 0e3a31b..5d7d522 100755 (executable)
@@ -32,7 +32,6 @@ use CGI qw ( -utf8 );
 use C4::Context;
 use C4::Auth;
 use C4::Output;
-use C4::Members::AttributeTypes;
 use C4::Form::MessagingPreferences;
 use List::MoreUtils qw/uniq/;
 use Koha::Patron::Attribute::Types;
@@ -41,6 +40,7 @@ use Koha::Patron::Messages;
 use Koha::DateUtils;
 use Koha::CsvProfiles;
 use Koha::Patrons;
+use Koha::Patron::Files;
 use Koha::Token;
 use Koha::Checkouts;
 
@@ -123,7 +123,6 @@ if ( !$patron->is_valid_age ) {
     $template->param( age_low => $patron->category->dateofbirthrequired );
     $template->param( age_high => $patron->category->upperagelimit );
 }
-$template->param( age => $patron->get_age );
 
 # Generate CSRF token for upload and delete image buttons
 $template->param(
@@ -155,7 +154,8 @@ if (C4::Context->preference('ExtendedPatronAttributes')) {
         attributes_loop => \@attributes_loop
     );
 
-    my $nb_of_attribute_types = Koha::Patron::Attribute::Types->filter_by_branch_limitations->count;
+    my $library_id = C4::Context->userenv ? C4::Context->userenv->{'branch'} : undef;
+    my $nb_of_attribute_types = Koha::Patron::Attribute::Types->search_with_library_limits({}, {}, $library_id)->count;
     if ( $nb_of_attribute_types == 0 ) {
         $template->param(no_patron_attribute_types => 1);
     }
@@ -210,6 +210,7 @@ $template->param(
     relatives_issues_count => $relatives_issues_count,
     relatives_borrowernumbers => \@relatives,
     logged_in_user => $logged_in_user,
+    files => Koha::Patron::Files->new( borrowernumber => $borrowernumber ) ->GetFilesInfo(),
 );
 
 output_html_with_http_headers $input, $cookie, $template->output;