Bug 7295: More granular permissions for baskets
[koha.git] / members / notices.pl
index a6e65c8..aca4514 100755 (executable)
@@ -47,13 +47,20 @@ my ($template, $loggedinuser, $cookie)
                                });
 
 $template->param( $borrower );
-my ($picture, $dberror) = GetPatronImage($borrower->{'cardnumber'});
+my ($picture, $dberror) = GetPatronImage($borrower->{'borrowernumber'});
 $template->param( picture => 1 ) if $picture;
 
 # Getting the messages
 my $queued_messages = C4::Letters::GetQueuedMessages({borrowernumber => $borrowernumber});
 $template->param( %{$borrower} );
-my $attributes = GetBorrowerAttributes($borrowernumber);
+
+if (C4::Context->preference('ExtendedPatronAttributes')) {
+    my $attributes = GetBorrowerAttributes($borrowernumber);
+    $template->param(
+        ExtendedPatronAttributes => 1,
+        extendedattributes => $attributes
+    );
+}
 
 $template->param(
                        QUEUED_MESSAGES         => $queued_messages,
@@ -61,7 +68,8 @@ $template->param(
                        sentnotices             => 1,
                         branchname              => GetBranchName($borrower->{'branchcode'}),
                         categoryname            => $borrower->{'description'},
-                        extendedattributes      => $attributes,
+                       activeBorrowerRelationship => (C4::Context->preference('borrowerRelationship') ne ''),
+            RoutingSerials => C4::Context->preference('RoutingSerials'),
 );
 output_html_with_http_headers $input, $cookie, $template->output;