Set the default CStoreEditor locale on page load
authorBill Erickson <berick@esilibrary.com>
Fri, 17 Aug 2012 14:10:55 +0000 (10:10 -0400)
committerDan Scott <dscott@laurentian.ca>
Sun, 19 Aug 2012 04:38:25 +0000 (00:38 -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 fc4374c..eceeb9b 100644 (file)
@@ -171,6 +171,10 @@ sub load_context {
         $cgi->cookie(OILS_HTTP_COOKIE_LOCALE) || $default_locale ||
         parse_accept_lang($r->headers_in->get('Accept-Language'));
 
+
+    # 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