[open-ils-commits] [GIT] Evergreen ILS branch master updated. fdd829da38d9b62e301538af968b727a7f19c330

Evergreen Git git at git.evergreen-ils.org
Wed Aug 15 12:43:07 EDT 2018


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".

The branch, master has been updated
       via  fdd829da38d9b62e301538af968b727a7f19c330 (commit)
      from  65baf6b58639ed883960c9b88efed54b1bc61a3b (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit fdd829da38d9b62e301538af968b727a7f19c330
Author: Bill Erickson <berickxx at gmail.com>
Date:   Tue Aug 14 15:22:49 2018 -0400

    LP#1770981 Apply OpenSRF locale on webstaff page load
    
    Translate the locale from the locale cookie into the global
    OpenSRF.locale variable so network calls are stamped with the correct
    locale.
    
    Signed-off-by: Bill Erickson <berickxx at gmail.com>
    Signed-off-by: Ben Shum <ben at evergreener.net>

diff --git a/Open-ILS/web/js/ui/default/staff/services/startup.js b/Open-ILS/web/js/ui/default/staff/services/startup.js
index d947d75..41c6977 100644
--- a/Open-ILS/web/js/ui/default/staff/services/startup.js
+++ b/Open-ILS/web/js/ui/default/staff/services/startup.js
@@ -21,7 +21,9 @@ angular.module('egCoreMod')
 
 .factory('egStartup', 
        ['$q','$rootScope','$location','$window','egIDL','egAuth','egEnv','egOrg',
-function($q,  $rootScope,  $location,  $window,  egIDL,  egAuth,  egEnv , egOrg ) {
+        '$cookies',
+function($q,  $rootScope,  $location,  $window,  egIDL,  egAuth,  egEnv , egOrg ,
+         $cookies) {
 
     var service = { promise : null }
 
@@ -89,6 +91,16 @@ function($q,  $rootScope,  $location,  $window,  egIDL,  egAuth,  egEnv , egOrg
             return service.promise;
         } 
 
+        // Apply the locale from the cookie before any network 
+        // calls are made.
+        var locale = $cookies.get('eg_locale');
+        if (locale) {
+            // Cookie is stored aa_bb.  OpenSRF wants aa-BB
+            var parts = locale.split(/_/);
+            OpenSRF.locale = parts[0] + '-' + parts[1].toUpperCase();
+            console.debug('Applying locale ' + OpenSRF.locale);
+        }
+
         // create a new promise and fire off startup
         var deferred = $q.defer();
         service.promise = deferred.promise;

-----------------------------------------------------------------------

Summary of changes:
 .../web/js/ui/default/staff/services/startup.js    |   14 +++++++++++++-
 1 files changed, 13 insertions(+), 1 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list