LP#1792482 My OPAC settings preferred name field
authorBill Erickson <berickxx@gmail.com>
Sun, 16 Sep 2018 23:28:11 +0000 (19:28 -0400)
committerKathy Lussier <klussier@masslnc.org>
Tue, 18 Sep 2018 19:34:04 +0000 (15:34 -0400)
Adds a new row to the patron account preferences page for Preferred
Name.  The field only displays when a preferred first, middle, or last
value is present and follows the same display logic as preferred names
in the staff client, where first and last fall-through to the primary
name.

Signed-off-by: Bill Erickson <berickxx@gmail.com>
Signed-off-by: Kathy Lussier <klussier@masslnc.org>
Open-ILS/src/templates/opac/myopac/prefs.tt2

index f3b80db..4608f1e 100644 (file)
 
                 <td class='light_border'>[% l(
                     HUMAN_NAME_FORMAT,
-                    (ctx.user.pref_prefix || ctx.user.prefix), 
+                    ctx.user.prefix, 
+                    ctx.user.first_given_name,
+                    ctx.user.second_given_name, 
+                    ctx.user.family_name,
+                    ctx.user.suffix
+                ) | html %]</td>
+
+                <td></td>
+            </tr>
+            [% IF ctx.user.pref_first_given_name || ctx.user.pref_second_given_name || ctx.user.pref_family_name %]
+            <tr>
+                <td width='30%'
+                    class='color_4 light_border'>[% l("Preferred Name") %]</td>
+
+                <td class='light_border'>[% l(
+                    HUMAN_NAME_FORMAT,
+                    ctx.user.pref_prefix, 
                     (ctx.user.pref_first_given_name || ctx.user.first_given_name),
-                    (ctx.user.pref_second_given_name || ctx.user.second_given_name)
+                    ctx.user.pref_second_given_name
                     (ctx.user.pref_family_name || ctx.user.family_name),
-                    (ctx.user.pref_suffix || ctx.user.suffix)
+                    ctx.user.pref_suffix
                 ) | html %]</td>
 
                 <td></td>
             </tr>
+            [%  END %]
 
             <tr>
                 <td class='color_4 light_border'>[% l("Day Phone") %]</td>