From 6a28c8287940a63bde11ef7307d24f419fa0c671 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Tue, 4 Feb 2014 13:32:00 -0500 Subject: [PATCH] LP#1053397 MR TPAC filters; editing Signed-off-by: Bill Erickson --- .../lib/OpenILS/WWW/EGCatLoader/Account.pm | 24 ++++++++++++++-------- .../perlmods/lib/OpenILS/WWW/EGCatLoader/Search.pm | 4 +--- Open-ILS/src/perlmods/lib/OpenILS/WWW/EGWeb.pm | 5 ++++- Open-ILS/src/templates/opac/css/style.css.tt2 | 1 + .../src/templates/opac/parts/advanced/search.tt2 | 2 ++ .../opac/parts/metarecord_hold_filters.tt2 | 18 ++++++++++++++-- 6 files changed, 39 insertions(+), 15 deletions(-) diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm index c4431f7770..5b0a0a2149 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm @@ -1157,15 +1157,21 @@ sub compile_holdable_formats { my @selected_langs = $cgi->param("metarecord_langs_$mr_id"); # map the selected attrs into the JSON holdable_formats structure - @selected_formats = map { - {_attr => $format_attr, _val => $_} } @selected_formats; - @selected_langs = map { - {_attr => 'item_lang', _val => $_} } @selected_langs; - - return OpenSRF::Utils::JSON->perl2JSON({ - 0 => \@selected_formats, - 1 => \@selected_langs - }); + my $blob = {}; + if (@selected_formats) { + $blob->{0} = [ + map { {_attr => $format_attr, _val => $_} } + @selected_formats + ]; + } + if (@selected_langs) { + $blob->{1} = [ + map { {_attr => 'item_lang', _val => $_} } + @selected_langs + ]; + } + + return OpenSRF::Utils::JSON->perl2JSON($blob); } sub fetch_user_circs { diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Search.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Search.pm index b02b596744..0fb53acc26 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Search.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Search.pm @@ -324,9 +324,7 @@ sub load_rresults { return $bbag_err; } - if (!$internal) { - $ctx->{page} = $is_meta ? 'mresult' : 'rresult'; - } + $ctx->{page} = 'rresult' unless $internal; $ctx->{ids} = []; $ctx->{records} = []; $ctx->{search_facets} = {}; diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGWeb.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGWeb.pm index 57cb02b4dd..8b72e537eb 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGWeb.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGWeb.pm @@ -186,7 +186,10 @@ sub load_context { parse_accept_lang($r->headers_in->get('Accept-Language')); # set the editor default locale for each page load - OpenSRF::AppSession->default_locale(parse_eg_locale($ctx->{locale})); + my $ses_locale = parse_eg_locale($ctx->{locale}); + OpenSRF::AppSession->default_locale($ses_locale); + # give templates access to the en-US style locale + $ctx->{eg_locale} = $ses_locale; my $mprefix = $ctx->{media_prefix}; if($mprefix and $mprefix !~ /^http/ and $mprefix !~ /^\//) { diff --git a/Open-ILS/src/templates/opac/css/style.css.tt2 b/Open-ILS/src/templates/opac/css/style.css.tt2 index 1076338243..bc163066cd 100644 --- a/Open-ILS/src/templates/opac/css/style.css.tt2 +++ b/Open-ILS/src/templates/opac/css/style.css.tt2 @@ -960,6 +960,7 @@ table.acct_notes th { div.adv_search_available { margin-top: 1em; } + #myopac_loading { width:100%; text-align:center; diff --git a/Open-ILS/src/templates/opac/parts/advanced/search.tt2 b/Open-ILS/src/templates/opac/parts/advanced/search.tt2 index 1fbd037f93..bf6c9e9a8e 100644 --- a/Open-ILS/src/templates/opac/parts/advanced/search.tt2 +++ b/Open-ILS/src/templates/opac/parts/advanced/search.tt2 @@ -101,6 +101,8 @@ %] +
+ [% IF hold_data.metarecord_filters.langs.size; + my_lang = ctx.get_i18n_l(ctx.eg_locale).marc_code; + %]
[% l('Select your desired language(s)') %] @@ -63,13 +66,24 @@ limiting the set of desired records for a given metarecord.
+ [% END %]
 
[% END # metarecord_hold_filters_selector %] -- 2.11.0