LP#1924185: use preferred name before legal name in My Account
authorJeff Davis <jdavis@sitka.bclibraries.ca>
Tue, 27 Apr 2021 18:25:50 +0000 (11:25 -0700)
committerJane Sandberg <sandbej@linnbenton.edu>
Sun, 16 May 2021 04:31:57 +0000 (21:31 -0700)
Signed-off-by: Jeff Davis <jdavis@sitka.bclibraries.ca>
Signed-off-by: Michele Morgan <mmorgan@noblenet.org>
Signed-off-by: Jane Sandberg <sandbej@linnbenton.edu>
Open-ILS/src/templates-bootstrap/opac/myopac/prefs.tt2
Open-ILS/src/templates-bootstrap/opac/parts/topnav_links.tt2
Open-ILS/src/templates/opac/myopac/prefs.tt2

index d0aa764..bf9f116 100755 (executable)
@@ -7,36 +7,36 @@
 <div id="acct_info_main">
     <table title="[% l('Account preference') %]" class='light_border table table-hover'>
         <tbody id='myopac_summary_tbody'>
+            [% IF ctx.user.pref_first_given_name || ctx.user.pref_second_given_name || ctx.user.pref_family_name %]
             <tr>
-                <td class='color_4 light_border'>[% l("Name") %]</td>
+                <td class='color_4 light_border'>[% l("Preferred Name") %]</td>
 
                 <td class='light_border'>[% l(
                     HUMAN_NAME_FORMAT,
-                    ctx.user.prefix,
-                    ctx.user.first_given_name,
-                    ctx.user.second_given_name,
-                    ctx.user.family_name,
-                    ctx.user.suffix
+                    ctx.user.pref_prefix,
+                    (ctx.user.pref_first_given_name || ctx.user.first_given_name),
+                    ctx.user.pref_second_given_name,
+                    (ctx.user.pref_family_name || ctx.user.family_name),
+                    ctx.user.pref_suffix
                 ) | html %]</td>
 
                 <td></td>
             </tr>
-             [% IF ctx.user.pref_first_given_name || ctx.user.pref_second_given_name || ctx.user.pref_family_name %]
+            [%  END %]
             <tr>
-                <td class='color_4 light_border'>[% l("Preferred Name") %]</td>
+                <td class='color_4 light_border'>[% l("Legal 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.pref_family_name || ctx.user.family_name),
-                    ctx.user.pref_suffix
+                    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>
-            [%  END %]
 
             <tr>
                 <td class='color_4 light_border'>[% l("Day Phone") %]</td>
index 7d8745c..a33dd15 100755 (executable)
@@ -41,7 +41,7 @@
     <li><div class="dropdown-divider"></div></li>
        <!--User-->
        <li class="nav-item">
-               <a class="nav-link disabled active mx-2" href="#">Hello, [%  l('[_1] [_2]', ctx.user.first_given_name, ctx.user.family_name) | html %]</a>
+               <a class="nav-link disabled active mx-2" href="#">Hello, [%  l('[_1] [_2]', ctx.user.pref_first_given_name || ctx.user.first_given_name, ctx.user.pref_family_name || ctx.user.family_name) | html %]</a>
        </li>
        <!--Messages with sup tag for # of messages-->
        <li class="nav-item">
index 94d93ef..683d36c 100644 (file)
     <table width='70%' title="[% l('Account preference') %]"
         class='light_border data_grid'>
         <tbody id='myopac_summary_tbody'>
+            [% 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("Name") %]</td>
+                    class='color_4 light_border'>[% l("Preferred Name") %]</td>
 
                 <td class='light_border'>[% l(
                     HUMAN_NAME_FORMAT,
-                    ctx.user.prefix, 
-                    ctx.user.first_given_name,
-                    ctx.user.second_given_name, 
-                    ctx.user.family_name,
-                    ctx.user.suffix
+                    ctx.user.pref_prefix,
+                    (ctx.user.pref_first_given_name || ctx.user.first_given_name),
+                    ctx.user.pref_second_given_name,
+                    (ctx.user.pref_family_name || ctx.user.family_name),
+                    ctx.user.pref_suffix
                 ) | html %]</td>
 
                 <td></td>
                 <td></td>
             </tr>
-            [% IF ctx.user.pref_first_given_name || ctx.user.pref_second_given_name || ctx.user.pref_family_name %]
+            [%  END %]
+
             <tr>
                 <td width='30%'
-                    class='color_4 light_border'>[% l("Preferred Name") %]</td>
+                    class='color_4 light_border'>[% l("Legal 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.pref_family_name || ctx.user.family_name),
-                    ctx.user.pref_suffix
+                    ctx.user.prefix,
+                    ctx.user.first_given_name,
+                    ctx.user.second_given_name,
+                    ctx.user.family_name,
+                    ctx.user.suffix
                 ) | html %]</td>
 
                 <td></td>
                 <td></td>
             </tr>
-            [%  END %]
 
             <tr>
                 <td class='color_4 light_border'>[% l("Day Phone") %]</td>