From e2825f0e1ec9265b6d0e4e71d54ed14d793f320c Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Thu, 7 Aug 2014 14:18:50 -0400 Subject: [PATCH] Bug 12718 - Show extended patron attributes in the OPAC At some point the patron details page in the OPAC lost the display of patron attributes. This patch returns the attributes to the update page. To test, log in to the OPAC as a patron who has data in one or more extended patron attributes. View the "your personal details" page (opac-memberentry.pl): - Confirm that the information displays correctly. - Test with OPACPatronDetails both on and off. - Test with patron who has no data in extended patron attributes. Signed-off-by: Chris Cormack --- .../opac-tmpl/bootstrap/en/modules/opac-memberentry.tt | 18 ++++++++++++++++++ opac/opac-memberentry.pl | 9 +++++++++ 2 files changed, 27 insertions(+) diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt index 2d0b2e4..ad35bc0 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt @@ -740,6 +740,24 @@ [% END %] + [% IF ( borrower.ExtendedPatronAttributes ) %] +
+ Additional information +
    + [% FOREACH patron_attribute IN borrower.patron_attributes %] +
  1. + + [% IF ( patron_attribute.value_description ) %] + [% patron_attribute.value_description %] + [% ELSE %] + [% patron_attribute.value |html_line_break %] + [% END %] +
  2. + [% END %] +
+
+ [% END %] + [% IF action == 'edit' %] [% IF OPACPatronDetails %]
diff --git a/opac/opac-memberentry.pl b/opac/opac-memberentry.pl index ba9eca4..8ca517b 100755 --- a/opac/opac-memberentry.pl +++ b/opac/opac-memberentry.pl @@ -197,6 +197,15 @@ elsif ( $action eq 'update' ) { } elsif ( $action eq 'edit' ) { #Display logged in borrower's data my $borrower = GetMember( borrowernumber => $borrowernumber ); + + if (C4::Context->preference('ExtendedPatronAttributes')) { + my $attributes = C4::Members::Attributes::GetBorrowerAttributes($borrowernumber, 'opac'); + if (scalar(@$attributes) > 0) { + $borrower->{ExtendedPatronAttributes} = 1; + $borrower->{patron_attributes} = $attributes; + } + } + $template->param( borrower => $borrower, ); -- 2.0.1