Bug 14257 - Add show_attributes to GetPatronInfo
[koha.git] / C4 / ILSDI / Services.pm
index e69c070..b1db742 100644 (file)
@@ -34,6 +34,7 @@ use HTML::Entities;
 use CGI qw ( -utf8 );
 use DateTime;
 use C4::Auth;
+use C4::Members::Attributes qw(GetBorrowerAttributes);
 
 =head1 NAME
 
@@ -428,6 +429,11 @@ sub GetPatronInfo {
         $borrower->{'loans'}->{'loan'} = $issues;
     }
 
+    if ( $cgi->param('show_attributes') eq "1" ) {
+        my $attrs = GetBorrowerAttributes( $borrowernumber, 0, 1 );
+        $borrower->{'attributes'} = $attrs;
+    }
+
     return $borrower;
 }