From 8138b6dcacaeb283ecce3318c4e13667aed3b60f Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Mon, 12 May 2008 08:32:54 -0500 Subject: [PATCH] patron attributes - OPAC display If ExtendedPatronAttributes is ON, any patron attributes whose type is marked as displayble in the OPAC are now displayed in the 'my details' page in the OPAC (assuming that the patron is logged in). These appear in the 'Library Use' section. Currently, it is not possible for a patron to suggest changes to any of their extended attributes using opac-userupdate. Signed-off-by: Joshua Ferraro --- opac/opac-userupdate.pl | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/opac/opac-userupdate.pl b/opac/opac-userupdate.pl index 7bf250e829..deac903696 100755 --- a/opac/opac-userupdate.pl +++ b/opac/opac-userupdate.pl @@ -29,6 +29,7 @@ use C4::Circulation; use C4::Output; use C4::Dates qw/format_date/; use C4::Members; +use C4::Members::Attributes; use C4::Branch; my $query = new CGI; @@ -120,6 +121,14 @@ $borr->{'expiry'} = format_date( $borr->{'expiry'} ); $borr->{'dateofbirth'} = format_date( $borr->{'dateofbirth'} ); $borr->{'ethnicity'} = fixEthnicity( $borr->{'ethnicity'} ); +if (C4::Context->preference('ExtendedPatronAttributes')) { + my $attributes = C4::Members::Attributes::GetBorrowerAttributes($borrowernumber, 'opac'); + if (scalar(@$attributes) > 0) { + $borr->{ExtendedPatronAttributes} = 1; + $borr->{patron_attributes} = $attributes; + } +} + my @bordat; $bordat[0] = $borr; -- 2.39.5