Bug 16659

Summary: Add the possibility to search for multiple branches (libraries) or groups in the advanced search in the opac and the staff interface
Product: Koha Reporter: Gaetan Boisson <gaetan.boisson>
Component: SearchingAssignee: Jonathan Druart <jonathan.druart>
Status: RESOLVED DUPLICATE QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: jonathan.druart
Version: Main   
Hardware: All   
OS: All   
GIT URL: Change sponsored?: ---
Patch complexity: Trivial patch Documentation contact:
Documentation submission: Text to go in the release notes:
Version(s) released in:
Circulation function:
Attachments: Bug 16659: Add the possibility to search for multiple branches
[SIGNED OFF] Bug 16659: Add the possibility to search for multiple branches

Description Gaetan Boisson 2016-06-04 07:52:12 UTC
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.

It would be consistent with the current interface to add this feature as a tab, next to item types, locations, and collection codes, with multiple checkboxes.

While we need to keep the feature of searching a group of libraries, if we make it possible to check libraries in the first part of the form and keep the dropdown menu, conflicts will arise between choices made in the two parts of the form.

For this reason the dropdown menu will be removed, and library groups will appear along libraries in the checkboxes.

Right now, the interface groups "location and availability" under the same title. We will only keep availability as a checkbox here.

In advanced search if the searchmylibraryfirst system preference is activated, the library of the logged in patron is preselected in the dropdown menu. We need to keep the functionality by checking the appropriate box in the new form.
Comment 1 Jonathan Druart 2016-06-04 08:18:46 UTC Comment hidden (obsolete)
Comment 2 Gaetan Boisson 2016-06-04 08:26:52 UTC
It's great works perfectly!
Comment 3 Katrin Fischer 2016-06-04 08:33:10 UTC
Created attachment 52030 [details] [review]
[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>
Comment 4 Katrin Fischer 2016-06-04 08:39:11 UTC
Comment on attachment 52030 [details] [review]
[SIGNED OFF] Bug 16659: Add the possibility to search for multiple branches

Review of attachment 52030 [details] [review]:
-----------------------------------------------------------------

Patch is a good start, but...

::: catalogue/search.pl
@@ +406,5 @@
> +my @branch = map uri_unescape($_), $cgi->multi_param('branch');
> +if( @branch ) {
> +    push @limits, '(' . join (" or ", map {'branch: ' . $_ } @branch ) . ')';
> +}
> +

You should do this differently...
Comment 5 Katrin Fischer 2016-06-04 08:50:52 UTC
some comment with good reasons and helpful ...
Comment 6 Gaetan Boisson 2016-06-04 08:59:07 UTC
This bug was used to demo the community workflow for contributing to koha. Its content can be ignored.
Bug 16663 has been opened to manage this feature request specifically.

*** This bug has been marked as a duplicate of bug 16663 ***