Bug 6964 - 'Add child' function should be dependant on system preference 'borrowerRel...
authorAleksa Vujicic <aleksa@catalyst.net.nz>
Fri, 20 Jan 2012 03:00:19 +0000 (16:00 +1300)
committerPaul Poulain <paul.poulain@biblibre.com>
Thu, 2 Feb 2012 10:36:05 +0000 (11:36 +0100)
The 'Add Child' button is not shown if 'borrowerRelationship' is empty.

System preference description changed.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
15 files changed:
circ/circulation.pl
koha-tmpl/intranet-tmpl/prog/en/includes/circ-toolbar.inc
koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc
koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref
members/boraccount.pl
members/deletemem.pl
members/mancredit.pl
members/maninvoice.pl
members/member-flags.pl
members/member-password.pl
members/moremember.pl
members/notices.pl
members/pay.pl
members/paycollect.pl
members/readingrec.pl

index 1b6c619..e8d22cb 100755 (executable)
@@ -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
index 913076f..a4acfdf 100644 (file)
@@ -118,7 +118,7 @@ function update_child() {
         [% END %]
        [% END %]
        [% IF ( CAN_user_borrowers ) %]
-        [% IF ( adultborrower ) %]<li><a id="addchild" href="/cgi-bin/koha/members/memberentry.pl?op=add&amp;guarantorid=[% borrowernumber %]&amp;category_type=C">Add child</a></li>[% END %]
+        [% IF ( adultborrower AND activeBorrowerRelationship ) %]<li><a id="addchild" href="/cgi-bin/koha/members/memberentry.pl?op=add&amp;guarantorid=[% borrowernumber %]&amp;category_type=C">Add child</a></li>[% END %]
         [% IF ( CAN_user_staffaccess ) %] <li><a id="changepassword" href="/cgi-bin/koha/members/member-password.pl?member=[% borrowernumber %]">Change Password</a></li>[% END %]
     [% END %]
     <li><a id="duplicate" href="/cgi-bin/koha/members/memberentry.pl?op=duplicate&amp;borrowernumber=[% borrowernumber %]&amp;category_type=[% category_type %]">Duplicate</a></li>
index bc3e920..bad8502 100644 (file)
@@ -114,7 +114,7 @@ function update_child() {
                 <li><a id="editpatron" href="/cgi-bin/koha/members/memberentry.pl?op=modify&amp;borrowernumber=[% borrowernumber %]&amp;category_type=A">Edit</a></li>
             [% END %]
         [% END %]
-       [% IF ( adultborrower ) %]<li><a id="addchild" href="/cgi-bin/koha/members/memberentry.pl?op=add&amp;guarantorid=[% borrowernumber %]&amp;category_type=C">Add child</a></li>[% END %]
+       [% IF ( adultborrower AND activeBorrowerRelationship ) %]<li><a id="addchild" href="/cgi-bin/koha/members/memberentry.pl?op=add&amp;guarantorid=[% borrowernumber %]&amp;category_type=C">Add child</a></li>[% END %]
        [% IF CAN_user_staffaccess %]<li><a id="changepassword" href="/cgi-bin/koha/members/member-password.pl?member=[% borrowernumber %]">Change Password</a></li> [% END %]
        <li><a id="duplicate" href="/cgi-bin/koha/members/memberentry.pl?op=duplicate&amp;borrowernumber=[% borrowernumber %]&amp;category_type=[% category_type %]">Duplicate</a></li>
     <li id="printmenuc"><a id="printpage" href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrowernumber %]&amp;print=page">Print Page</a></li>
index 1277ac4..3d88883 100644 (file)
@@ -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
index 2805f27..44db953 100755 (executable)
@@ -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;
index b1ba709..924245a 100755 (executable)
@@ -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);
index 3c664c2..88200d0 100755 (executable)
@@ -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;
 }
index 1f42093..f1c572c 100755 (executable)
@@ -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;
 }
index 76f300e..ca8c9d0 100755 (executable)
@@ -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;
index 25e9551..8128a3d 100755 (executable)
@@ -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 ''),
        );
 
 
index 6e5407c..c477100 100755 (executable)
@@ -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
index 41f2a90..51a843c 100755 (executable)
@@ -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;
 
index 6bc18fc..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;
index cbddc05..e05a5a6 100755 (executable)
@@ -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;
index b4fb8a7..c4a8237 100755 (executable)
@@ -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;