From e4d0363bc72403b4eea69cd7375e06ee2ecd729d Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Fri, 26 Feb 2016 21:08:55 +0000 Subject: [PATCH] Bug 15928 - Show unlinked guarantor MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit To test: 1 - Add guarantor data to patron account by typing it in but do not 'Set to patron' 2 - Note it is not displayed on patron details 3 - Apply patch 4 - Note the info is displayed 5 - Test that linked guarantors show as expected Signed-off-by: Marc Véron Signed-off-by: Jonathan Druart Amended-patch: Correct some indents/spaces Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com --- .../intranet-tmpl/prog/en/modules/members/moremember.tt | 6 +++++- members/moremember.pl | 7 +++++++ 2 files changed, 12 insertions(+), 1 deletion(-) 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 8355bf5614..6a4add02dd 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt @@ -246,7 +246,11 @@ function validate1(date) { [% ELSIF guarantor %]
  • Guarantor: - [% guarantor.firstname %] [% guarantor.surname %] + [% IF guarantor.borrowernumber %] + [% guarantor.firstname %] [% guarantor.surname %] + [% ELSE %] + [% guarantor.firstname %] [% guarantor.surname %] + [% END %]
  • [% END %] diff --git a/members/moremember.pl b/members/moremember.pl index 4a5c06dfd9..7c962a4a11 100755 --- a/members/moremember.pl +++ b/members/moremember.pl @@ -169,6 +169,13 @@ if ( my $guarantor = $patron->guarantor ) { $template->param( guarantor => $guarantor ); push @relatives, $guarantor->borrowernumber; push @relatives, $_->borrowernumber for $patron->siblings; +} elsif ( $patron->contactname || $patron->contactfirstname ) { + $template->param( + guarantor => { + firstname => $patron->contactfirstname, + surname => $patron->contactname, + } + ); } else { my @guarantees = $patron->guarantees; $template->param( guarantees => \@guarantees ); -- 2.39.5