Use a patron's preferred first name, preferred second name, or
preferred family name in SIP2 responses. If a preferred name field
has no value, then the corresponding regular name field will be used.
To test this patch, you can find a patron with a preferred name field
set and look them up using a Patron Status Request message (23) via
your favorite SIP2 client. Before applying the patch, the name field
(AE) in the Patron Status Response message (24) will NOT use the
patron's preferred name(s). After applying the patch and restarting
Evergreen on the server, you repeat the previous Patron Status
Request, and the response will now use the patron's preferred
name(s) in the name field.
Signed-off-by: Jason Stephenson <jason@sigio.com>
Signed-off-by: Galen Charlton <gmc@equinoxOLI.org>
sub format_name {
my $u = shift;
return sprintf('%s %s %s',
- ($u->first_given_name || ''),
- ($u->second_given_name || ''),
- ($u->family_name || ''));
+ ($u->pref_first_given_name || $u->first_given_name || ''),
+ ($u->pref_second_given_name || $u->second_given_name || ''),
+ ($u->pref_family_name || $u->family_name || ''));
}
sub home_library {