Bug - 11345 - Self registration captcha
[koha.git] / members / purchase-suggestions.pl
index d071425..4c58c3e 100755 (executable)
 
 use Modern::Perl;
 
-use CGI;
+use CGI qw ( -utf8 );
 use C4::Auth;
 use C4::Context;
 use C4::Output;
 use C4::Branch;
 use C4::Members;
+use C4::Members::Attributes qw(GetBorrowerAttributes);
 use C4::Suggestions;
 
 my $input = new CGI;
@@ -47,10 +48,28 @@ foreach my $key ( keys %$borrower ) {
     $template->param( $key => $borrower->{$key} );
 }
 $template->param(
+    suggestionsview  => 1,
     categoryname => $borrower->{'description'},
     branchname   => GetBranchName( $borrower->{'branchcode'} ),
+    RoutingSerials => C4::Context->preference('RoutingSerials'),
 );
 
+if (C4::Context->preference('ExtendedPatronAttributes')) {
+    my $attributes = GetBorrowerAttributes($borrowernumber);
+    $template->param(
+        ExtendedPatronAttributes => 1,
+        extendedattributes => $attributes
+    );
+}
+
+# Computes full borrower address
+my $roadtype = C4::Koha::GetAuthorisedValueByCode( 'ROADTYPE', $borrower->{streettype} );
+my $address = $borrower->{'streetnumber'} . " $roadtype " . $borrower->{'address'};
+$template->param( address => $address );
+
+my ($picture, $dberror) = GetPatronImage($borrowernumber);
+$template->param( picture => 1 ) if $picture;
+
 my $suggestions = SearchSuggestion( { suggestedby => $borrowernumber } );
 
 $template->param( suggestions => $suggestions );