From fda87270ad49d403e70f3db4291c2ca65649cfeb Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Mon, 10 Apr 2017 10:23:37 -0300 Subject: [PATCH] Bug 18403: Guarantors Technically a kid from your library group could have a guarantor attached to another group of library, let's deal with this case. Test plan: - Create a kid from your library group - With a superlibrarian staff user create a guarantor that is outside of the group of libraries of the kid - Login with a limited staff user and confirm that on the patron detail page you do not see the link to the guarantor detail page. Note that you see the firstname and surname of the guarantor Q. should it be hidden? Signed-off-by: Signed-off-by: Jon McGowan Signed-off-by: Jonathan Druart --- .../prog/en/modules/members/memberentrygen.tt | 9 ++++++++- .../intranet-tmpl/prog/en/modules/members/moremember.tt | 8 ++++++-- members/memberentry.pl | 5 ++++- 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt index 0957468c7e..ed02f796ee 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt @@ -460,7 +460,14 @@ $(document).ready(function() { [% ELSE %] [% UNLESS nocontactname %]
  • diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt index 3898166eb4..5ea5ac37b5 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt @@ -271,14 +271,18 @@ function validate1(date) { Guarantees:
  • [% ELSIF guarantor %]
  • Guarantor: - [% IF guarantor.borrowernumber %] + [% IF guarantor.borrowernumber AND logged_in_user.can_see_patron_infos( guarantor ) %] [% guarantor.firstname | html %] [% guarantor.surname | html %] [% ELSE %] [% guarantor.firstname | html %] [% guarantor.surname | html %] diff --git a/members/memberentry.pl b/members/memberentry.pl index 5f5c922ffa..b72f8daf2c 100755 --- a/members/memberentry.pl +++ b/members/memberentry.pl @@ -755,10 +755,13 @@ $template->param( check_member => $check_member,#to know if the borrower already exist(=>1) or not (=>0) "op$op" => 1); +$guarantorid = $borrower_data->{'guarantorid'} || $guarantorid; +my $guarantor = $guarantorid ? Koha::Patrons->find( $guarantorid ) : undef; $template->param( nodouble => $nodouble, borrowernumber => $borrowernumber, #register number - guarantorid => ($borrower_data->{'guarantorid'} || $guarantorid), + guarantor => $guarantor, + guarantorid => $guarantorid, relshiploop => \@relshipdata, btitle=> $default_borrowertitle, guarantorinfo => $guarantorinfo, -- 2.39.5