Bugzilla – Attachment 52030 Details for
Bug 16659
Add the possibility to search for multiple branches (libraries) or groups in the advanced search in the opac and the staff interface
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[SIGNED OFF] Bug 16659: Add the possibility to search for multiple branches
SIGNED-OFF-Bug-16659-Add-the-possibility-to-search.patch (text/plain), 3.69 KB, created by
Katrin Fischer
on 2016-06-04 08:33:10 UTC
(
hide
)
Description:
[SIGNED OFF] Bug 16659: Add the possibility to search for multiple branches
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2016-06-04 08:33:10 UTC
Size:
3.69 KB
patch
obsolete
>From 9cbe08041785b8c62210b6dd74ce9fa4c8948fdc Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >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 <gaetan.boisson@biblibre.com> >--- > 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 @@ > </fieldset> > > <fieldset id="select-libs"> >- <p><label for="branchloop">Individual libraries:</label><select name="limit" id="branchloop" onchange='if(this.value != ""){document.getElementById("categoryloop").disabled=true;} else {document.getElementById("categoryloop").disabled=false;}'> >- <option value="">All libraries</option> >- [% FOREACH branchloo IN branchloop %] >- [% IF ( branchloo.selected ) %] >- <option value="branch:[% branchloo.value %]" selected="selected">[% branchloo.branchname %]</option> >- [% ELSE %] >- <option value="branch:[% branchloo.value %]">[% branchloo.branchname %]</option> >- [% END %] >- [% END %] >- </select></p> >+ <p> >+ <label for="branchloop">Individual libraries:</label> >+ [% FOREACH branchloo IN branchloop %] >+ <p> >+ [% IF ( branchloo.selected ) %] >+ <input id="branch_[% branchloo.value %]" type="checkbox" checked="checked" name="branch" value="[% branchloo.value %]" /> >+ [% ELSE %] >+ <input id="branch_[% branchloo.value %]" type="checkbox" name="branch" value="[% branchloo.value %]" /> >+ [% END %] >+ <label for="branch_[% branchloo.value %]">[% branchloo.branchname %]</label> >+ </p> >+ [% END %] >+ </p> > <!-- <input type="hidden" name="limit" value="branch: MAIN" /> --> > [% IF ( searchdomainloop ) %] > <p>OR</p> <!-- should addjs to grey out group pulldown if a library is selected. --> >-- >2.7.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 16659
:
52029
| 52030