Set the default CStoreEditor locale on page load
authorBill Erickson <berick@esilibrary.com>
Fri, 17 Aug 2012 14:10:55 +0000 (10:10 -0400)
committerBill Erickson <berick@esilibrary.com>
Mon, 20 Aug 2012 20:16:53 +0000 (16:16 -0400)
Ech CStoreEditor request will use the locale of the current
page as the default opensrf session locale.

Signed-off-by: Bill Erickson <berick@esilibrary.com>
Signed-off-by: Dan Scott <dscott@laurentian.ca>

Open-ILS/src/perlmods/lib/OpenILS/WWW/EGWeb.pm

index 25285b1..02cf017 100644 (file)
@@ -170,6 +170,10 @@ sub load_context {
         $cgi->cookie(OILS_HTTP_COOKIE_LOCALE) || 
         parse_accept_lang($r->headers_in->get('Accept-Language')) || 'en_us';
 
+
+    # set the editor default locale for each page load
+    $OpenILS::Utils::CStoreEditor::default_locale = $ctx->{locale};
+
     my $mprefix = $ctx->{media_prefix};
     if($mprefix and $mprefix !~ /^http/ and $mprefix !~ /^\//) {
         # if a hostname is provided /w no protocol, match the protocol to the current page