[OPEN-ILS-DEV] generate_circ_notices.pl patch (bugfix in handling ampersands in patrons' first names; making profile name available in print-notice XSLT)

Ben Ostrowsky ben at esilibrary.com
Mon Nov 23 10:38:15 EST 2009


This change allows using [% user.profile.name %] in the
overdue_combined_xml template, which in turn makes it easier to use
different language when addressing various kinds of users, such as
students (who might care about their transcript being held) and
faculty (who might not).

It also gracefully handles users whose first name includes an
ampersand, which would otherwise cause an error.

svn diff attached, but here's an eyeballable version:

Index: Open-ILS/src/support-scripts/generate_circ_notices.pl
===================================================================
--- Open-ILS/src/support-scripts/generate_circ_notices.pl       (revision 15003)
+++ Open-ILS/src/support-scripts/generate_circ_notices.pl       (working copy)
@@ -400,7 +400,7 @@
         $usr_id,
         {   flesh => 1,
             flesh_fields => {
-                au => [qw/card billing_address mailing_address/]
+                au => [qw/card billing_address mailing_address profile/]
             }
         }
     ]);
@@ -409,6 +409,10 @@
     # the user's email if they have one.
     $usr->email($opt_use_email_recipient) if $usr->email and
$opt_use_email_recipient;

+    # if there are wacky characters in the user's name, such as
+    # an account shared by "Jack & Diane", escape them.
+    $usr->first_given_name(escape_xml($usr->first_given_name));
+
     my $circ_lib = $ORG_CACHE{$circ_lib_id} ||
         $e->retrieve_actor_org_unit([
             $circ_lib_id,


Ben

-- 
Please join us for the Evergreen 2010 International Conference, April 20-23,
2010 at the Amway Grand Hotel and Convention Center, Grand Rapids, Michigan.
http://www.evergreen2010.org/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: generate_circ_notices.pl.patch
Type: text/x-patch
Size: 1003 bytes
Desc: not available
Url : http://libmail.georgialibraries.org/pipermail/open-ils-dev/attachments/20091123/0b0b625b/attachment.bin 


More information about the Open-ils-dev mailing list