[% ELSE %]
<li id="contact-details" style="display: none">
[% END %]
- <span class="label">Patron #:</span> [% IF ( guarantorid ) %] <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% guarantorid %]" target="blank">[% guarantorid |html %]</a>[% END %]
+ <span class="label">Patron #:</span>
+ [% IF guarantorid %]
+ [% IF logged_in_user.can_see_patron_infos( guarantor ) %]
+ <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% guarantorid %]" target="blank">[% guarantorid | html %]</a>
+ [% ELSE %]
+ [% guarantorid | html %]
+ [% END %]
+ [% END %]
</li>
[% UNLESS nocontactname %]
<li>
<span class="label">Guarantees:</span>
<ul>
[% FOREACH guarantee IN guarantees %]
- <li><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% guarantee.borrowernumber %]">[% guarantee.firstname | html %] [% guarantee.surname | html %]</a></li>
+ [% IF logged_in_user.can_see_patron_infos( guarantee ) %]
+ <li><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% guarantee.borrowernumber %]">[% guarantee.firstname | html %] [% guarantee.surname | html %]</a></li>
+ [% ELSE %]
+ <li>[% guarantee.firstname | html %] [% guarantee.surname | html %]</li>
+ [% END %]
[% END %]
</ul>
</li>
[% ELSIF guarantor %]
<li>
<span class="label">Guarantor:</span>
- [% IF guarantor.borrowernumber %]
+ [% IF guarantor.borrowernumber AND logged_in_user.can_see_patron_infos( guarantor ) %]
<a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% guarantor.borrowernumber %]">[% guarantor.firstname | html %] [% guarantor.surname | html %]</a>
[% ELSE %]
[% guarantor.firstname | html %] [% guarantor.surname | html %]
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,