From e839dc9285da8b035cf5c1fbcb7240b276cdd7c4 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 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 --- koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt | 6 +++++- members/moremember.pl | 5 +++++ 2 files changed, 10 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 8355bf5..31c357a 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 4a5c06d..d01764d 100755 --- a/members/moremember.pl +++ b/members/moremember.pl @@ -169,6 +169,11 @@ 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.1.4