From 9cbe08041785b8c62210b6dd74ce9fa4c8948fdc Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Sat, 4 Jun 2016 09:13:44 +0100 Subject: [PATCH] [SIGNED OFF] Bug 16659: Add the possibility to search for multiple branches At the moment, in advanced search it is possible to pre-select a library to filter results on. However we can only select one library at a time. This patch will allow users to select multiple libraries. This patch replaces the dropdown list of libraries with inputs to make several libraries searchable. Note that this patch is a bit ugly and is only for demo purpose. And also only work on the intranet interface. Test plan: 1/ Go to the adv search form 2/ Select 1 or more libraries ticking the checkboxes 3/ Make sure the results are consistent. 4/ When 1 or more checkboxes are checked, the dropdown list of group of libraries should be disabled Signed-off-by: Gaetan Boisson --- catalogue/search.pl | 5 +++++ .../prog/en/modules/catalogue/advsearch.tt | 23 ++++++++++++---------- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/catalogue/search.pl b/catalogue/search.pl index c70efb0..5b007b6 100755 --- a/catalogue/search.pl +++ b/catalogue/search.pl @@ -403,6 +403,11 @@ my @nolimits = map uri_unescape($_), $cgi->multi_param('nolimit'); my %is_nolimit = map { $_ => 1 } @nolimits; @limits = grep { not $is_nolimit{$_} } @limits; +my @branch = map uri_unescape($_), $cgi->multi_param('branch'); +if( @branch ) { + push @limits, '(' . join (" or ", map {'branch: ' . $_ } @branch ) . ')'; +} + if($params->{'multibranchlimit'}) { my $library_category = Koha::LibraryCategories->find( $params->{multibranchlimit} ); my @libraries = $library_category->libraries; 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 7df062f..81ce8be 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/advsearch.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/advsearch.tt @@ -250,16 +250,19 @@
-

+

+ + [% FOREACH branchloo IN branchloop %] +

+ [% IF ( branchloo.selected ) %] + + [% ELSE %] + + [% END %] + +

+ [% END %] +

[% IF ( searchdomainloop ) %]

OR

-- 2.7.4