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 <veron@veron.ch>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Amended-patch: Correct some indents/spaces
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
[% ELSIF guarantor %]
<li>
<span class="label">Guarantor:</span>
- <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% guarantor.borrowernumber %]">[% guarantor.firstname %] [% guarantor.surname %]</a>
+ [% IF guarantor.borrowernumber %]
+ <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% guarantor.borrowernumber %]">[% guarantor.firstname %] [% guarantor.surname %]</a>
+ [% ELSE %]
+ [% guarantor.firstname %] [% guarantor.surname %]
+ [% END %]
</li>
[% END %]
</ol>
$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 );