Merge branch 'bug_9052' into 3.12-master
[koha.git] / members / notices.pl
index a6e65c8..51a843c 100755 (executable)
@@ -53,7 +53,14 @@ $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,7 @@ $template->param(
                        sentnotices             => 1,
                         branchname              => GetBranchName($borrower->{'branchcode'}),
                         categoryname            => $borrower->{'description'},
-                        extendedattributes      => $attributes,
+                       activeBorrowerRelationship => (C4::Context->preference('borrowerRelationship') ne ''),
 );
 output_html_with_http_headers $input, $cookie, $template->output;