LP1847827 - Evergreen Web Based Self Check - Use prefered first name in header.
authorJosh Stompro <stompro@stompro.org>
Mon, 13 Dec 2021 19:58:02 +0000 (13:58 -0600)
committerBill Erickson <berickxx@gmail.com>
Wed, 16 Mar 2022 20:51:59 +0000 (16:51 -0400)
Thank you to Suzanne Paterno for showing me what to edit.

After this is installed, just set and unset a preferred first name for an account
and make sure it shows up correctly in the web based self check interface.
https://example.com/eg/circ/selfcheck/main

Signed-off-by: Josh Stompro <stompro@stompro.org>
Signed-off-by: Jennifer Pringle <jennifer.pringle@bclibraries.coop>
Signed-off-by: Bill Erickson <berickxx@gmail.com>

Open-ILS/web/js/ui/default/circ/selfcheck/selfcheck.js

index 002dd34..32f6664 100644 (file)
@@ -468,7 +468,8 @@ SelfCheckManager.prototype.fetchPatron = function(barcode, usrname) {
 
         this.handleAlert('', false, 'login-success');
         dojo.byId('oils-selfck-user-banner').innerHTML = 
-            dojo.string.substitute(localeStrings.WELCOME_BANNER, [this.patron.first_given_name()]);
+            dojo.string.substitute(localeStrings.WELCOME_BANNER, [
+              ( this.patron.pref_first_given_name() ? this.patron.pref_first_given_name() : this.patron.first_given_name() ) ]);
 
         if (this.patron.email() && // they have an email address set and ...
             this.patron.email().match(/.*@.*/).length > 0 // it sorta looks like an email address