From 3982d97af3599aab990d407f9a5f973ae3922149 Mon Sep 17 00:00:00 2001 From: Aleksa Vujicic Date: Fri, 20 Jan 2012 16:00:19 +1300 Subject: [PATCH] Bug 6964 - 'Add child' function should be dependant on system preference 'borrowerRelationship' The 'Add Child' button is not shown if 'borrowerRelationship' is empty. System preference description changed. Signed-off-by: Owen Leonard Signed-off-by: Paul Poulain --- circ/circulation.pl | 1 + koha-tmpl/intranet-tmpl/prog/en/includes/circ-toolbar.inc | 2 +- koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc | 2 +- .../prog/en/modules/admin/preferences/patrons.pref | 2 +- members/boraccount.pl | 1 + members/deletemem.pl | 1 + members/mancredit.pl | 1 + members/maninvoice.pl | 1 + members/member-flags.pl | 1 + members/member-password.pl | 1 + members/moremember.pl | 1 + members/notices.pl | 1 + members/pay.pl | 2 ++ members/paycollect.pl | 1 + members/readingrec.pl | 1 + 15 files changed, 16 insertions(+), 3 deletions(-) diff --git a/circ/circulation.pl b/circ/circulation.pl index 1b6c6194ff..e8d22cb158 100755 --- a/circ/circulation.pl +++ b/circ/circulation.pl @@ -705,6 +705,7 @@ $template->param( soundon => C4::Context->preference("SoundOn"), fast_cataloging => $fast_cataloging, CircAutoPrintQuickSlip => C4::Context->preference("CircAutoPrintQuickSlip"), + activeBorrowerRelationship => (C4::Context->preference('borrowerRelationship') ne ''), ); # save stickyduedate to session diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-toolbar.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/circ-toolbar.inc index 913076f8d5..a4acfdfe0a 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-toolbar.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/circ-toolbar.inc @@ -118,7 +118,7 @@ function update_child() { [% END %] [% END %] [% IF ( CAN_user_borrowers ) %] - [% IF ( adultborrower ) %]
  • Add child
  • [% END %] + [% IF ( adultborrower AND activeBorrowerRelationship ) %]
  • Add child
  • [% END %] [% IF ( CAN_user_staffaccess ) %]
  • Change Password
  • [% END %] [% END %]
  • Duplicate
  • diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc index bc3e920af3..bad8502d4f 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc @@ -114,7 +114,7 @@ function update_child() {
  • Edit
  • [% END %] [% END %] - [% IF ( adultborrower ) %]
  • Add child
  • [% END %] + [% IF ( adultborrower AND activeBorrowerRelationship ) %]
  • Add child
  • [% END %] [% IF CAN_user_staffaccess %]
  • Change Password
  • [% END %]
  • Duplicate
  • Print Page
  • diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref index 1277ac4447..3d88883843 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref @@ -42,7 +42,7 @@ Patrons: - "Guarantors can be the following of those they guarantee:" - pref: borrowerRelationship class: multi - - (input multiple choices separated by |) + - (input multiple choices separated by |). Leave empty to deactivate - - "Borrowers can have the following titles:" - pref: BorrowersTitles diff --git a/members/boraccount.pl b/members/boraccount.pl index 2805f275cd..44db953da5 100755 --- a/members/boraccount.pl +++ b/members/boraccount.pl @@ -128,6 +128,7 @@ $template->param( is_child => ($data->{'category_type'} eq 'C'), reverse_col => $reverse_col, accounts => $accts, + activeBorrowerRelationship => (C4::Context->preference('borrowerRelationship') ne ''), ); output_html_with_http_headers $input, $cookie, $template->output; diff --git a/members/deletemem.pl b/members/deletemem.pl index b1ba709c65..924245a62c 100755 --- a/members/deletemem.pl +++ b/members/deletemem.pl @@ -102,6 +102,7 @@ if ($countissues > 0 or $flags->{'CHARGES'} or $data->{'borrowernumber'}){ email => $bor->{'email'}, branchcode => $bor->{'branchcode'}, branchname => GetBranchName($bor->{'branchcode'}), + activeBorrowerRelationship => (C4::Context->preference('borrowerRelationship') ne ''), ); if ($countissues >0) { $template->param(ItemsOnIssues => $countissues); diff --git a/members/mancredit.pl b/members/mancredit.pl index 3c664c2ce6..88200d0e20 100755 --- a/members/mancredit.pl +++ b/members/mancredit.pl @@ -106,6 +106,7 @@ if (C4::Context->preference('ExtendedPatronAttributes')) { branchcode => $data->{'branchcode'}, branchname => GetBranchName($data->{'branchcode'}), is_child => ($data->{'category_type'} eq 'C'), + activeBorrowerRelationship => (C4::Context->preference('borrowerRelationship') ne ''), ); output_html_with_http_headers $input, $cookie, $template->output; } diff --git a/members/maninvoice.pl b/members/maninvoice.pl index 1f42093677..f1c572c1d7 100755 --- a/members/maninvoice.pl +++ b/members/maninvoice.pl @@ -133,6 +133,7 @@ if (C4::Context->preference('ExtendedPatronAttributes')) { branchcode => $data->{'branchcode'}, branchname => GetBranchName($data->{'branchcode'}), is_child => ($data->{'category_type'} eq 'C'), + activeBorrowerRelationship => (C4::Context->preference('borrowerRelationship') ne ''), ); output_html_with_http_headers $input, $cookie, $template->output; } diff --git a/members/member-flags.pl b/members/member-flags.pl index 76f300e398..ca8c9d0860 100755 --- a/members/member-flags.pl +++ b/members/member-flags.pl @@ -191,6 +191,7 @@ $template->param( branchname => GetBranchName($bor->{'branchcode'}), loop => \@loop, is_child => ($bor->{'category_type'} eq 'C'), + activeBorrowerRelationship => (C4::Context->preference('borrowerRelationship') ne ''), ); output_html_with_http_headers $input, $cookie, $template->output; diff --git a/members/member-password.pl b/members/member-password.pl index 25e9551c8d..8128a3dff8 100755 --- a/members/member-password.pl +++ b/members/member-password.pl @@ -121,6 +121,7 @@ if (C4::Context->preference('ExtendedPatronAttributes')) { destination => $destination, is_child => ($bor->{'category_type'} eq 'C'), defaultnewpassword => $defaultnewpassword, + activeBorrowerRelationship => (C4::Context->preference('borrowerRelationship') ne ''), ); diff --git a/members/moremember.pl b/members/moremember.pl index 6e5407c58a..c477100658 100755 --- a/members/moremember.pl +++ b/members/moremember.pl @@ -481,6 +481,7 @@ $template->param( "dateformat_" . (C4::Context->preference("dateformat") || '') => 1, samebranch => $samebranch, quickslip => $quickslip, + activeBorrowerRelationship => (C4::Context->preference('borrowerRelationship') ne ''), ); #Get the slip news items diff --git a/members/notices.pl b/members/notices.pl index 41f2a903bf..51a843c2f6 100755 --- a/members/notices.pl +++ b/members/notices.pl @@ -68,6 +68,7 @@ $template->param( sentnotices => 1, branchname => GetBranchName($borrower->{'branchcode'}), categoryname => $borrower->{'description'}, + activeBorrowerRelationship => (C4::Context->preference('borrowerRelationship') ne ''), ); output_html_with_http_headers $input, $cookie, $template->output; diff --git a/members/pay.pl b/members/pay.pl index 6bc18fc774..72a109f49c 100755 --- a/members/pay.pl +++ b/members/pay.pl @@ -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; diff --git a/members/paycollect.pl b/members/paycollect.pl index cbddc05be6..e05a5a662b 100755 --- a/members/paycollect.pl +++ b/members/paycollect.pl @@ -138,6 +138,7 @@ $template->param( borrowenumber => $borrowernumber, # some templates require global borrower => $borrower, total => $total_due + activeBorrowerRelationship => (C4::Context->preference('borrowerRelationship') ne ''), ); output_html_with_http_headers $input, $cookie, $template->output; diff --git a/members/readingrec.pl b/members/readingrec.pl index b4fb8a7d9c..c4a8237815 100755 --- a/members/readingrec.pl +++ b/members/readingrec.pl @@ -133,6 +133,7 @@ $template->param( branchname => GetBranchName($data->{'branchcode'}), showfulllink => (scalar @loop_reading > 50), loop_reading => \@loop_reading, + activeBorrowerRelationship => (C4::Context->preference('borrowerRelationship') ne ''), ); output_html_with_http_headers $input, $cookie, $template->output; -- 2.39.5