From 8683af3a5ef15a400c8b674674225696bcec8482 Mon Sep 17 00:00:00 2001 From: Victoria Lewis Date: Tue, 8 Sep 2015 13:48:54 -0700 Subject: [PATCH] Making demo branch of 1854, 1858, 1859 set default search option --- Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Search.pm | 5 +++-- Open-ILS/src/templates/opac/parts/org_selector.tt2 | 10 +++++----- Open-ILS/src/templates/staff/t_splash.tt2 | 12 ++++++++++++ Open-ILS/web/js/ui/default/staff/cat/catalog/app.js | 4 ++++ 4 files changed, 24 insertions(+), 7 deletions(-) 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 19f3a258e9..ec9dfce14f 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Search.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Search.pm @@ -141,7 +141,8 @@ sub _prepare_biblio_search { my $pref_ou = $ctx->{pref_ou}; if (defined($pref_ou) and $pref_ou ne '' and $pref_ou != $org and ($pref_ou ne $ctx->{aou_tree}->()->id) and not $query =~ / pref_ou\(\S+\)/) { my $plib = $ctx->{get_aou}->($pref_ou)->shortname; - $query = "pref_ou($plib) $query"; + my $pref_scrubber = "pref_ou($plib) $query"; + push @naive_query_re, $pref_scrubber; } if (my $grp = $ctx->{copy_location_group}) { @@ -174,7 +175,7 @@ sub _prepare_biblio_search { push @naive_query_re, $thing; } - # This gives templates a way to take site() and depth() back out of + # This gives templates a way to take site(), pref_ou(), and depth() back out of # query strings when they shouldn't be there (because they're controllable # with other widgets). $ctx->{naive_query_scrub} = sub { diff --git a/Open-ILS/src/templates/opac/parts/org_selector.tt2 b/Open-ILS/src/templates/opac/parts/org_selector.tt2 index 433ac80138..afadc321c2 100644 --- a/Open-ILS/src/templates/opac/parts/org_selector.tt2 +++ b/Open-ILS/src/templates/opac/parts/org_selector.tt2 @@ -32,12 +32,12 @@ BLOCK build_org_selector; name='[% name %]'> [%- WHILE node_stack.size > 0; - node = node_stack.pop(); #node becomes the popped node stack - org_unit = node.org; #org_unit becomes node's org - loc_grp = node.loc_grp; #loc_grp(location) becomes the node_stack's array? - ou_id = org_unit.id; #ou_id shorthand for org_unit.id + node = node_stack.pop(); + org_unit = node.org; + loc_grp = node.loc_grp; + ou_id = org_unit.id; css_class = ''; - disabled = ''; #clear css_class, disabled, and selected + disabled = ''; selected = ''; visible = org_unit.opac_visible == 't'; #enable visibility for org_unit's opac_visible option diff --git a/Open-ILS/src/templates/staff/t_splash.tt2 b/Open-ILS/src/templates/staff/t_splash.tt2 index 2884ba6c0f..970d0983f0 100644 --- a/Open-ILS/src/templates/staff/t_splash.tt2 +++ b/Open-ILS/src/templates/staff/t_splash.tt2 @@ -43,6 +43,18 @@ [% l('Copy Buckets') %] +
+
+ + +
+
diff --git a/Open-ILS/web/js/ui/default/staff/cat/catalog/app.js b/Open-ILS/web/js/ui/default/staff/cat/catalog/app.js index 4cd81d71fa..6593210851 100644 --- a/Open-ILS/web/js/ui/default/staff/cat/catalog/app.js +++ b/Open-ILS/web/js/ui/default/staff/cat/catalog/app.js @@ -261,8 +261,12 @@ function($scope , $routeParams , $location , $q , egCore , egHolds, // The URL is otherwise generated through user navigation. if ($scope.catalog_url) return; + var default_search_library = egCore.hatch.getLocalItem('eg.search.lib.default'); var url = $location.absUrl().replace(/\/staff.*/, '/opac/advanced'); + if (default_search_library.id) { + url += '?locg=' + default_search_library.id; + } // A record ID in the path indicates a request for the record- // specific page. if ($routeParams.record_id) { -- 2.11.0