Bug 29878 - Use multiple select widget for AdvancedSearchTypes system preference
Summary: Use multiple select widget for AdvancedSearchTypes system preference
Status: CLOSED WONTFIX
Alias: None
Product: Koha
Classification: Unclassified
Component: System Administration (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Owen Leonard
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-01-13 17:34 UTC by Owen Leonard
Modified: 2022-12-12 21:23 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Bug 29878: Use multiple select widget for AdvancedSearchTypes system preference (4.26 KB, patch)
2022-01-13 17:56 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 29878: Use multiple select widget for AdvancedSearchTypes system preference (4.32 KB, patch)
2022-01-13 18:14 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 29878: Use multiple select widget for AdvancedSearchTypes system preference (4.40 KB, patch)
2022-01-19 12:55 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 29878: (follow-up) Fix opac-topissues.pl (1.98 KB, patch)
2022-01-29 02:08 UTC, Fridolin Somers
Details | Diff | Splinter Review
Bug 29878: (follow-up) Change system preference type to multiple (3.85 KB, patch)
2022-01-29 02:09 UTC, Fridolin Somers
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Owen Leonard 2022-01-13 17:34:25 UTC
The AdvancedSearchTypes system preference asks for pipe-delimited text, which isn't very user-friendly. We can use a multiple-select widget (as used for  OpacAdvSearchOptions for example) to allow the user to select one or more predefined options.
Comment 1 Owen Leonard 2022-01-13 17:56:29 UTC
Created attachment 129429 [details] [review]
Bug 29878: Use multiple select widget for AdvancedSearchTypes system preference

This patch updates system preferences so that the AdvancedSearchTypes
preference uses a multiple-select widget. This lets users select one or
more checkboxes in a dropdown rather than requiring that they enter
pipe-delimited text.

To test, apply the patch and run updatedatabase.

- Go to Administration -> System Preferences and search for
  'AdvancedSearchTypes'
- The input should be styled as a multiple-select widget. Test that you
  can select one, more, or all of the options.
- Test that your selections are saved successfully and that the changes
  are reflected on the OPAC and staff interface advanced search pages.
Comment 2 Lucas Gass (lukeg) 2022-01-13 18:14:03 UTC
Created attachment 129431 [details] [review]
Bug 29878: Use multiple select widget for AdvancedSearchTypes system preference

This patch updates system preferences so that the AdvancedSearchTypes
preference uses a multiple-select widget. This lets users select one or
more checkboxes in a dropdown rather than requiring that they enter
pipe-delimited text.

To test, apply the patch and run updatedatabase.

- Go to Administration -> System Preferences and search for
  'AdvancedSearchTypes'
- The input should be styled as a multiple-select widget. Test that you
  can select one, more, or all of the options.
- Test that your selections are saved successfully and that the changes
  are reflected on the OPAC and staff interface advanced search pages.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Comment 3 Jonathan Druart 2022-01-19 12:55:59 UTC
Created attachment 129603 [details] [review]
Bug 29878: Use multiple select widget for AdvancedSearchTypes system preference

This patch updates system preferences so that the AdvancedSearchTypes
preference uses a multiple-select widget. This lets users select one or
more checkboxes in a dropdown rather than requiring that they enter
pipe-delimited text.

To test, apply the patch and run updatedatabase.

- Go to Administration -> System Preferences and search for
  'AdvancedSearchTypes'
- The input should be styled as a multiple-select widget. Test that you
  can select one, more, or all of the options.
- Test that your selections are saved successfully and that the changes
  are reflected on the OPAC and staff interface advanced search pages.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 4 Fridolin Somers 2022-01-29 02:08:45 UTC
Created attachment 129963 [details] [review]
Bug 29878: (follow-up) Fix opac-topissues.pl

This page is using the preference AdvancedSearchTypes with wrong split character

Test plan :
1) Enable preference OpacTopissue
2) In OPAC click on 'Most popular'
3) Check you see filters on ccode and/or itemtype when they are in AdvancedSearchTypes
Comment 5 Fridolin Somers 2022-01-29 02:09:03 UTC
Created attachment 129964 [details] [review]
Bug 29878: (follow-up) Change system preference type to multiple

AdvancedSearchTypes type must be changed from 'Choice' to 'multiple'.
'Choice' was in fact not the correct type.

Also fix options even if they are useless.
Other multiple preferences set them.

Also replaces split /\,/ with /,/
There is no need to escape.
Comment 6 Fridolin Somers 2022-01-29 02:17:16 UTC
This needs a bit more work.

We see in preference description (searching.pref) :
  Tabs appear in the order listed.

Looks like it is not valid :
Values defined in preference are 'itemtypes,ccode,loc'
I see in system preference page :
    Collection
    Item type
    Shelving location

Is it alphabetical ?

When I select all and save value changes to 'ccode,itemtypes,loc';

Values can not be ordered anymore, we should remove this text.
Comment 7 Katrin Fischer 2022-01-29 22:34:32 UTC
I don't think we should remove the ability to have the tabs appear in the order the library likes. If we can't do this with the multi select, we should not use it. Could we do something similar like we have for the languages? You can check/uncheck and order them.
Comment 8 Katrin Fischer 2022-01-29 22:36:55 UTC
It does work in 20.11: ccode|loc|itemtypes makes the tabs appear in this order in the OPAC.