From e8cad4deb0f8889df8b6e59fc3d3734a39eb1eb2 Mon Sep 17 00:00:00 2001
From: Nick Clemens
Date: Thu, 12 Aug 2021 11:13:46 +0000
Subject: [PATCH] Bug 28847: Cleanup of branch limitsand fix OPAC_SEARCH_LIMIT
The opac had 'branch_group_limit' parameters which can be simplified to more
closely match intranet code.
Adjust C4::Auth for chaneg above to ensure dropdowns correctly populate
Expand JS to prevent selection of single and multibranch limits
To test:
1 - Enable OpacAddMastheadLibraryPulldown system preference
2 - Ensure branches and groups show as before patch
3 - Ensure single and multibranch limits from masthead apply as expected
4 - Test advanced search page, ensure you cannot select both single and multibranch limit
5 - Follow test plan on 28845 - ensure multibranch limit still correctly pre-selected
Signed-off-by: Andrew Fuerste-Henry
---
C4/Auth.pm | 2 +-
.../prog/en/modules/catalogue/advsearch.tt | 31 +++++++++++++------
.../bootstrap/en/includes/masthead.inc | 12 +++----
.../bootstrap/en/modules/opac-advsearch.tt | 21 +++++++++++--
4 files changed, 47 insertions(+), 19 deletions(-)
diff --git a/C4/Auth.pm b/C4/Auth.pm
index fd327bf618..8203cfa51b 100644
--- a/C4/Auth.pm
+++ b/C4/Auth.pm
@@ -561,7 +561,7 @@ sub get_template_and_user {
if (
( $opac_limit_override && $opac_search_limit && $opac_search_limit =~ /branch:([\w-]+)/ ) ||
( $in->{'query'}->param('limit') && $in->{'query'}->param('limit') =~ /branch:([\w-]+)/ ) ||
- ( $in->{'query'}->param('multibranchlimit') && $in->{'query'}->param('multibranchlimit') =~ /multibranchlimit-(\w+)/ )
+ ( $in->{'query'}->param('limit') && $in->{'query'}->param('limit') =~ /multibranchlimit:(\w+)/ )
) {
$opac_name = $1; # opac_search_limit is a branch, so we use it.
} elsif ( $in->{'query'}->param('multibranchlimit') ) {
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/advsearch.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/advsearch.tt
index a4d7c6d9d7..f46e93a93c 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/advsearch.tt
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/advsearch.tt
@@ -289,17 +289,16 @@
[%# FIXME Should not we filter the libraries displayed? %]
[% PROCESS options_for_libraries prefix => "branch:" libraries => Branches.all( unfiltered => 1, do_not_select_my_library => 1 ) %]