[OPEN-ILS-DEV] generate_circ_notices.pl patch (bugfix in handling ampersands in patrons' first names; making profile name available in print-notice XSLT)
Bill Erickson
erickson at esilibrary.com
Mon Nov 23 15:16:34 EST 2009
On Mon, Nov 23, 2009 at 10:38 AM, Ben Ostrowsky <ben at esilibrary.com> wrote:
> 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/]
> }
> }
> ]);
>
Looks good, thanks.
> @@ -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,
>
>
I will hold off on committing this part of the patch, though. XML escaping
should happen in the XML templates themselves, since the script is used to
generate non-XML data as well. IOW, we wouldn't want to see "Dear Jack
& Diane" in an email.
Thanks, Ben.
-b
--
Bill Erickson
| VP, Software Development & Integration
| Equinox Software, Inc. / The Evergreen Experts
| phone: 877-OPEN-ILS (673-6457)
| email: erickson at esilibrary.com
| web: http://esilibrary.com
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 --------------
An HTML attachment was scrubbed...
URL: http://libmail.georgialibraries.org/pipermail/open-ils-dev/attachments/20091123/0b525bb0/attachment.htm
More information about the Open-ils-dev
mailing list