Bug 39099 - Use select2 to select library limitations in item types, patron categories, and authorized values
Summary: Use select2 to select library limitations in item types, patron categories, a...
Status: Pushed to main
Alias: None
Product: Koha
Classification: Unclassified
Component: Staff interface (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Owen Leonard
QA Contact: Martin Renvoize (ashimema)
URL:
Keywords:
Depends on:
Blocks: 39957
  Show dependency treegraph
 
Reported: 2025-02-11 16:58 UTC by Juliet Heltibridle
Modified: 2025-05-26 15:24 UTC (History)
4 users (show)

See Also:
GIT URL:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
This improves the selection of the values for the 'Libraries limitation' field when adding and editing: * item types * patron categories * authorized value categories Instead of selecting multiple values from a drop-down list using the Ctrl key, you can either select or start typing the value, select or press enter, then repeat to select additional values.
Version(s) released in:
25.05.00
Circulation function:


Attachments
Bug 39099: Use select2 to select library limitations in item types, patron categories, and authorized values (9.15 KB, patch)
2025-02-18 15:24 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 39099: Use select2 to select library limitations in item types, patron categories, and authorized values (9.29 KB, patch)
2025-02-21 11:38 UTC, Biblibre Sandboxes
Details | Diff | Splinter Review
Bug 39099: Use select2 to select library limitations in item types, patron categories, and authorized values (9.34 KB, patch)
2025-02-26 15:11 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 39099: (follow-up) Re-word library limitation hint (3.17 KB, text/plain)
2025-05-06 12:42 UTC, Owen Leonard
Details
Bug 39099: (follow-up) Re-word library limitation hint (3.15 KB, patch)
2025-05-06 13:58 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 39099: Use select2 to select library limitations in item types, patron categories, and authorized values (9.40 KB, patch)
2025-05-16 12:17 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 39099: (follow-up) Re-word library limitation hint (3.21 KB, patch)
2025-05-16 12:17 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Juliet Heltibridle 2025-02-11 16:58:50 UTC
When adding library limitations to item types, patron categories and authorized values, Koha should use the select2 format to allow multiple libraries to be selected without using the CTRL key. This would reduce the chance of mistakenly losing the previously selected libraries when updating. I think it would be the same sort of select as was used to improve the item search multi-select in bug 36545.
Comment 1 Katrin Fischer 2025-02-11 17:01:24 UTC
I think this is a great idea to improve usability!
Comment 2 Owen Leonard 2025-02-18 15:24:28 UTC Comment hidden (obsolete)
Comment 3 Biblibre Sandboxes 2025-02-21 11:38:55 UTC Comment hidden (obsolete)
Comment 4 Lucas Gass (lukeg) 2025-02-25 23:31:40 UTC
Looks like Bug 26553 got in the way here and a rebase is needed.
Comment 5 Owen Leonard 2025-02-26 15:11:33 UTC
Created attachment 178727 [details] [review]
Bug 39099: Use select2 to select library limitations in item types, patron categories, and authorized values

This patch updates some administration templates so that library
selection uses a Select2-styled menu instead of a standard <select>.
Item types, patron categories, and authorized values all offer a
"library limitation" option, and Select2 will make library selection
behave like item search options do.

To test, apply the patch and rebuild the staff interface CSS.

- Go to Administration -> Item types and edit an item type.
- On the "Library limitation" line, click the field to trigger the
  Select2 menu. Confirm that it works as expected.
- Save your changes to confirm that the data is saved correctly.
- Edit the item type again to clear all your selections and confirm that
  it saves correctly.
- Repeat the same process on the authorized values page and the patron
  categories page.

Sponsored-by: Athens County Public Libraries
Signed-off-by: Janne Seppänen <janne.seppanen@lahti.fi>
Comment 6 Owen Leonard 2025-05-01 19:15:58 UTC
Working on Bug 39810 makes me realize the updated hints in this patch probably don't make sense.

I'm thinking something like this would be better:

"Limits the use of this authorized value to the selected libraries"

I think that makes it more clear given the fact that there isn't an "All libraries" option anymore.

Anyone have opinions?
Comment 7 Owen Leonard 2025-05-06 12:42:40 UTC
Created attachment 181967 [details]
Bug 39099: (follow-up) Re-word library limitation hint
Comment 8 Owen Leonard 2025-05-06 13:58:13 UTC
Created attachment 181976 [details] [review]
Bug 39099: (follow-up) Re-word library limitation hint
Comment 9 Martin Renvoize (ashimema) 2025-05-16 12:17:21 UTC
Created attachment 182523 [details] [review]
Bug 39099: Use select2 to select library limitations in item types, patron categories, and authorized values

This patch updates some administration templates so that library
selection uses a Select2-styled menu instead of a standard <select>.
Item types, patron categories, and authorized values all offer a
"library limitation" option, and Select2 will make library selection
behave like item search options do.

To test, apply the patch and rebuild the staff interface CSS.

- Go to Administration -> Item types and edit an item type.
- On the "Library limitation" line, click the field to trigger the
  Select2 menu. Confirm that it works as expected.
- Save your changes to confirm that the data is saved correctly.
- Edit the item type again to clear all your selections and confirm that
  it saves correctly.
- Repeat the same process on the authorized values page and the patron
  categories page.

Sponsored-by: Athens County Public Libraries
Signed-off-by: Janne Seppänen <janne.seppanen@lahti.fi>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Comment 10 Martin Renvoize (ashimema) 2025-05-16 12:17:24 UTC
Created attachment 182524 [details] [review]
Bug 39099: (follow-up) Re-word library limitation hint

Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Comment 11 Katrin Fischer 2025-05-16 12:27:13 UTC
Pushed for 25.05!

Well done everyone, thank you!