LP1838553 User Display Name
authorMichele Morgan <mmorgan@noblenet.org>
Wed, 12 Oct 2022 20:40:21 +0000 (16:40 -0400)
committerMichele Morgan <mmorgan@noblenet.org>
Wed, 12 Oct 2022 20:40:21 +0000 (16:40 -0400)
Add preferred names to 'User Alias or Display Name'

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

index 88e80b5..9a6c302 100644 (file)
@@ -2270,12 +2270,12 @@ SELECT  h.id, h.request_time, h.capture_time, h.fulfillment_time, h.checkin_time
             u.alias
         ELSE
             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+,', ',')
         END AS usr_alias_or_display_name,