Bug 13940 : (QA followup) Add test for ModOAISet
[koha.git] / members / routing-lists.pl
index 25b0f85..efd067e 100755 (executable)
 
 use strict;
 #use warnings; FIXME - Bug 2505
-use CGI;
+use CGI qw ( -utf8 );
 use C4::Output;
 use C4::Auth qw/:DEFAULT get_session/;
 use C4::Branch; # GetBranches
 use C4::Members;
+use C4::Members::Attributes qw(GetBorrowerAttributes);
 use C4::Context;
 use C4::Serials;
 use CGI::Session;
@@ -101,8 +102,8 @@ if ($borrowernumber) {
 
 
 # Computes full borrower address
-my (undef, $roadttype_hashref) = &GetRoadTypes();
-my $address = $borrower->{'streetnumber'}.' '.$roadttype_hashref->{$borrower->{'streettype'}}.' '.$borrower->{'address'};
+my $roadtype = C4::Koha::GetAuthorisedValueByCode( 'ROADTYPE', $borrower->{streettype} );
+my $address = $borrower->{'streetnumber'} . " $roadtype " . $borrower->{'address'};
 
 $template->param(
 
@@ -111,23 +112,38 @@ $template->param(
     borrowernumber    => $borrowernumber,
     branch            => $branch,
     branchname        => GetBranchName($borrower->{'branchcode'}),
+    title             => $borrower->{'title'},
+    initials          => $borrower->{'initials'},
     firstname         => $borrower->{'firstname'},
     surname           => $borrower->{'surname'},
+    othernames        => $borrower->{'othernames'},
     categorycode      => $borrower->{'categorycode'},
     categoryname      => $borrower->{description},
     address           => $address,
     address2          => $borrower->{'address2'},
+    phone             => $borrower->{'phone'},
+    phonepro          => $borrower->{'phonepro'},
+    mobile            => $borrower->{'mobile'},
     email             => $borrower->{'email'},
     emailpro          => $borrower->{'emailpro'},
     borrowernotes     => $borrower->{'borrowernotes'},
     city              => $borrower->{'city'},
+    state             => $borrower->{'state'},
     zipcode           => $borrower->{'zipcode'},
     country           => $borrower->{'country'},
-    phone             => $borrower->{'phone'} || $borrower->{'mobile'},
     cardnumber        => $borrower->{'cardnumber'},
+    RoutingSerials => C4::Context->preference('RoutingSerials'),
 );
 
-my ($picture, $dberror) = GetPatronImage($borrower->{'cardnumber'});
+if (C4::Context->preference('ExtendedPatronAttributes')) {
+    my $attributes = GetBorrowerAttributes($borrowernumber);
+    $template->param(
+        ExtendedPatronAttributes => 1,
+        extendedattributes => $attributes
+    );
+}
+
+my ($picture, $dberror) = GetPatronImage($borrower->{'borrowernumber'});
 $template->param( picture => 1 ) if $picture;
 
 output_html_with_http_headers $query, $cookie, $template->output;