Bug 6964 - 'Add child' function should be dependant on system preference 'borrowerRel...
[koha.git] / members / pay.pl
index 9389f82..72a109f 100755 (executable)
@@ -103,6 +103,8 @@ for (@names) {
     }
 }
 
+$template->param( activeBorrowerRelationship => (C4::Context->preference('borrowerRelationship') ne '') );
+
 add_accounts_to_template();
 
 output_html_with_http_headers $input, $cookie, $template->output;
@@ -233,7 +235,13 @@ sub borrower_add_additional_fields {
     if ($picture) {
         $b_ref->{has_picture} = 1;
     }
-    $b_ref->{extendedattributes} = GetBorrowerAttributes($borrowernumber);
+
+    if (C4::Context->preference('ExtendedPatronAttributes')) {
+        $b_ref->{extendedattributes} = GetBorrowerAttributes($borrowernumber);
+        $template->param(
+            ExtendedPatronAttributes => 1,
+        );
+    }
 
     $b_ref->{branchname} = GetBranchName( $b_ref->{branchcode} );
     return;