Bug 20287: Move ModMember to Koha::Patron
[srvgit] / members / files.pl
index 4fc42fc..2e38c0d 100755 (executable)
@@ -30,6 +30,7 @@ use C4::Debug;
 use Koha::DateUtils;
 use Koha::Patrons;
 use Koha::Patron::Files;
+use Koha::Patron::Categories;
 
 my $cgi = CGI->new;
 
@@ -114,9 +115,11 @@ else {
         );
     }
 
-
-    $template->param( adultborrower => 1 )
-        if ( $patron_category->category_type eq 'A' || $patron_category->category_type eq 'I' );
+    if ( $patron->is_child ) {
+        my $patron_categories = Koha::Patron::Categories->search_limited({ category_type => 'A' }, {order_by => ['categorycode']});
+        $template->param( 'CATCODE_MULTI' => 1) if $patron_categories->count > 1;
+        $template->param( 'catcode' => $patron_categories->next->categorycode )  if $patron_categories->count == 1;
+    }
 
     $template->param(
         files => Koha::Patron::Files->new( borrowernumber => $borrowernumber )