[Koha-patches] [PATCH] patron attributes - OPAC display

Galen Charlton galen.charlton at liblime.com
Sat May 10 01:08:20 CEST 2008


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.
---
 opac/opac-userupdate.pl |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/opac/opac-userupdate.pl b/opac/opac-userupdate.pl
index 7bf250e..deac903 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;
 
-- 
1.5.5.rc0.16.g02b00




More information about the Koha-patches mailing list