From c435ceb9160d20d0a904f38d6c4652ae0646ba20 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 Signed-off-by: Katrin Fischer Attributes only display when 'display in OPAC' is configured. Attribute shows correct description, when authorised value is used. Works as expected, updating is currently not yet possible. Signed-off-by: Tomas Cohen Arazi --- .../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 2d0b2e4ed0..ad35bc02f5 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 ba9eca4709..8ca517bfcc 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.20.1