From 3d445832480bb167523d0d1f4a428e2b8bd86a95 Mon Sep 17 00:00:00 2001 From: Lucas Gass Date: Tue, 5 Apr 2022 23:04:33 +0000 Subject: [PATCH] Bug 30077: (follow-up) retain branch selection To test: 1. Apply patch, updatedatabase, restart_all 2. Search for the system pref 'IntranetAddMastheadLibraryPulldown' 3. Set it to 'Show'. 4. Go to any page that contains header search box and click on 'Search the catalog'. 5. To the left of the search bar you should see a dropdown for branches. 6. This should be defaulted to 'All libraries'. 7. In the dropdown choose any branch and do a search and make sure it is correctly limiting to that branch. 8. Try changing to a different branch and doing another search. It should correcrly limit to that branch and retain that branch in the dropdown, just like the OPAC. 9. Try selecting 'All libraries' from the top of the dropdown and make sure it is correctly searching all branches. 10. Turn on the system pref 'IntranetCatalogSearchPulldown' and make sure it looks nice with both of those dropdowns and functions when you use limiters from both dropdowns. Signed-off-by: David Nind --- catalogue/search.pl | 6 ++++++ .../intranet-tmpl/prog/en/includes/catalogue-search-box.inc | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/catalogue/search.pl b/catalogue/search.pl index ef7f49088f..1ef7c2300e 100755 --- a/catalogue/search.pl +++ b/catalogue/search.pl @@ -241,8 +241,14 @@ my @search_groups = Koha::Library::Groups->get_search_groups( { interface => 'staff' } )->as_list; @search_groups = sort { $a->title cmp $b->title } @search_groups; +my $branch_limit = ''; +if ( scalar $cgi->param('limit') =~ /branch:([\w-]+)/ ) { + $branch_limit = $1; +} + $template->param( search_groups => \@search_groups, + branch_limit => $branch_limit ); # load the Type stuff diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/catalogue-search-box.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/catalogue-search-box.inc index 1404105a51..4e2e432435 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/catalogue-search-box.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/catalogue-search-box.inc @@ -10,7 +10,7 @@ [% IF ( Koha.Preference('IntranetAddMastheadLibraryPulldown') ) %] [% END %] -- 2.30.2