From 61f1410e31bf0303e57fb6b08d5b54855179a0a7 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
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
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
Signed-off-by: Joonas Kylmälä
---
C4/Auth.pm | 2 +-
.../prog/en/modules/catalogue/advsearch.tt | 31 +++++++++++++------
.../bootstrap/en/includes/masthead.inc | 10 +++---
.../bootstrap/en/modules/opac-advsearch.tt | 21 +++++++++++--
4 files changed, 46 insertions(+), 18 deletions(-)
diff --git a/C4/Auth.pm b/C4/Auth.pm
index ac635b1a9c..816ae48ac1 100644
--- a/C4/Auth.pm
+++ b/C4/Auth.pm
@@ -559,7 +559,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 ) %]