From 44b34fc82509a659adae57e93ddaf3e0f311fe86 Mon Sep 17 00:00:00 2001 From: Aleksa Vujicic Date: Fri, 20 Jan 2012 16:00:19 +1300 Subject: [PATCH] Bug 6964: The 'Add Child' button is not shown if 'borrowerRelationship' is empty. System preference description changed. --- circ/circulation.pl | 1 + .../prog/en/includes/circ-toolbar.inc | 2 +- .../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 1b6c619..e8d22cb 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 913076f..a4acfdf 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 bc3e920..bad8502 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 0e2f73b..9c3f76f 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 2805f27..44db953 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 b1ba709..924245a 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 3c664c2..88200d0 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 1f42093..f1c572c 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 76f300e..ca8c9d0 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 25e9551..8128a3d 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 6e5407c..c477100 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 41f2a90..51a843c 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 6bc18fc..72a109f 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 cbddc05..e05a5a6 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 b4fb8a7..c4a8237 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; -- 1.7.5.4