LP1838553 User Display Name
authorTerran McCanna <tmccanna@georgialibraries.org>
Mon, 4 Apr 2022 17:03:02 +0000 (13:03 -0400)
committerMichele Morgan <mmorgan@noblenet.org>
Wed, 12 Oct 2022 20:24:52 +0000 (16:24 -0400)
This modifies the User Display Name to incorporate the Preferred
Name if present.

(Note: Ryan Eby did this work, I just put it into a git branch. I
have not tested it. - TMcCanna)

Signed-off-by: Gina Monti <gmonti@biblio.org>
Signed-off-by: Michele Morgan <mmorgan@noblenet.org>
Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/action.pm

index 7f1d95c..88e80b5 100644 (file)
@@ -2280,12 +2280,12 @@ SELECT  h.id, h.request_time, h.capture_time, h.fulfillment_time, h.checkin_time
         END AS usr_alias_or_display_name,
 
         REGEXP_REPLACE(ARRAY_TO_STRING(ARRAY[
-            COALESCE(u.family_name, ''),
-            COALESCE(u.suffix, ''),
+            COALESCE(u.pref_family_name, u.family_name, ''),
+            COALESCE(u.pref_suffix, u.suffix, ''),
             ', ',
-            COALESCE(u.prefix, ''),
-            COALESCE(u.first_given_name, ''),
-            COALESCE(u.second_given_name, '')
+            COALESCE(u.pref_prefix, u.prefix, ''),
+            COALESCE(u.pref_first_given_name, u.first_given_name, ''),
+            COALESCE(u.pref_second_given_name, u.second_given_name, '')
         ], ' '), E'\\s+,', ',') AS usr_display_name,
 
         uc.id AS ucard_id, uc.barcode AS ucard_barcode, uc.usr AS ucard_usr, uc.active AS ucard_active,