From 593614456c1c25ddb5ebd34d511a126cf659bc49 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 Signed-off-by: Katrin Fischer Signed-off-by: Tomas Cohen Arazi --- 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 be33c35e63..003658e31e 100755 --- a/catalogue/search.pl +++ b/catalogue/search.pl @@ -238,8 +238,14 @@ if($cgi->cookie("intranet_bib_list")){ my @search_groups = Koha::Library::Groups->get_search_groups( { interface => 'staff' } )->as_list; +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 a6ea0ab0b3..aac61e803f 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.39.5