@@ -, +, @@ control setting --- Koha/Borrower.pm | 12 ++++++++++++ .../opac-tmpl/bootstrap/en/modules/opac-memberentry.tt | 3 +-- koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-privacy.tt | 5 ++--- opac/opac-memberentry.pl | 5 ++++- opac/opac-privacy.pl | 15 ++++++++------- 5 files changed, 27 insertions(+), 13 deletions(-) --- a/Koha/Borrower.pm +++ a/Koha/Borrower.pm @@ -35,6 +35,18 @@ Koha::Borrower - Koha Borrower Object class =cut +=head3 guarantor + +Returns a Koha::Borrower object for this borrower's guarantor + +=cut + +sub guarantor { + my ( $self ) = @_; + + return Koha::Borrowers->find( $self->guarantorid() ); +} + =head3 type =cut --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt +++ a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt @@ -73,8 +73,7 @@ - [% SET g = Koha.Find('Borrower',borrower.guarantorid) %] - Your guarantor is [% g.firstname %] [% g.surname %] + Your guarantor is [% guarantor.firstname %] [% guarantor.surname %] --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-privacy.tt +++ a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-privacy.tt @@ -68,8 +68,7 @@ - [% SET b = Koha.Find('Borrower', borrower.borrowernumber) %] - [% IF b.guarantorid && Koha.Preference('AllowPatronToSetCheckoutsVisibilityForGuarantor') %] + [% IF borrower.guarantorid && Koha.Preference('AllowPatronToSetCheckoutsVisibilityForGuarantor') %]
- Your guarantor is [% b.guarantor.firstname %] [% b.guarantor.surname %] + Your guarantor is [% borrower.guarantor.firstname %] [% borrower.guarantor.surname %]
[% END %] --- a/opac/opac-memberentry.pl +++ a/opac/opac-memberentry.pl @@ -24,6 +24,7 @@ use String::Random qw( random_string ); use C4::Auth; use C4::Output; use C4::Members; +use Koha::Borrowers; use Koha::Borrower::Modifications; use C4::Branch qw(GetBranchesLoop); use C4::Scrubber; @@ -209,7 +210,9 @@ elsif ( $action eq 'edit' ) { #Display logged in borrower's data } $template->param( - borrower => $borrower, ); + borrower => $borrower, + guarantor => Koha::Borrowers->find($borrowernumber)->guarantor(), + ); if (C4::Context->preference('OPACpatronimages')) { my ($image, $dberror) = GetPatronImage($borrower->{borrowernumber}); --- a/opac/opac-privacy.pl +++ a/opac/opac-privacy.pl @@ -25,6 +25,7 @@ use C4::Circulation; use C4::Members; use C4::Output; use C4::Dates; +use Koha::Borrowers; my $query = new CGI; @@ -76,15 +77,15 @@ elsif ( $op eq "delete_record" ) { } # get borrower privacy .... -my $borrower = GetMemberDetails( $borrowernumber ); +my $borrower = Koha::Borrowers->find( $borrowernumber );; $template->param( - 'Ask_data' => 1, - 'privacy' . $borrower->{'privacy'} => 1, - 'privacyview' => 1, - 'borrower' => $borrower, - 'surname' => $borrower->{surname}, - 'firstname' => $borrower->{firstname}, + 'Ask_data' => 1, + 'privacy' . $borrower->privacy() => 1, + 'privacyview' => 1, + 'borrower' => $borrower, + 'surname' => $borrower->{surname}, + 'firstname' => $borrower->{firstname}, ); output_html_with_http_headers $query, $cookie, $template->output; --