Bug 39810 - Use select2 to select library limitations in credit and debit type administration
Summary: Use select2 to select library limitations in credit and debit type administra...
Status: Pushed to main
Alias: None
Product: Koha
Classification: Unclassified
Component: Templates (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-05-01 18:58 UTC by Owen Leonard
Modified: 2025-05-26 15:20 UTC (History)
3 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: - Debit types - Credit types Instead of selecting multiple values from a dropdown 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 39810: Use select2 to select library limitations in credit and debit type administration (5.68 KB, patch)
2025-05-06 12:45 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 39810: Use select2 to select library limitations in credit and debit type administration (5.72 KB, patch)
2025-05-08 22:42 UTC, David Nind
Details | Diff | Splinter Review
Bug 39810: Use select2 to select library limitations in credit and debit type administration (5.79 KB, patch)
2025-05-16 12:13 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 Owen Leonard 2025-05-01 18:58:33 UTC
Like Bug 39099.
Comment 1 Owen Leonard 2025-05-06 12:45:54 UTC
Created attachment 181968 [details] [review]
Bug 39810: Use select2 to select library limitations in credit and debit type administration

This patch updates the credit and debit type administration templates so
that library selection uses a Select2-styled menu instead of a standard
<select>. Both pages 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 -> Credit types edit a credit 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 credit type again to clear all your selections and confirm
  that it saves correctly.
- Repeat the same process on the debit types page.

Sponsored-by: Athens County Public Libraries
Comment 2 David Nind 2025-05-08 22:42:27 UTC
Created attachment 182132 [details] [review]
Bug 39810: Use select2 to select library limitations in credit and debit type administration

This patch updates the credit and debit type administration templates so
that library selection uses a Select2-styled menu instead of a standard
<select>. Both pages 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 -> Credit types edit a credit 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 credit type again to clear all your selections and confirm
  that it saves correctly.
- Repeat the same process on the debit types page.

Sponsored-by: Athens County Public Libraries
Signed-off-by: David Nind <david@davidnind.com>
Comment 3 Martin Renvoize (ashimema) 2025-05-16 12:13:02 UTC
Created attachment 182521 [details] [review]
Bug 39810: Use select2 to select library limitations in credit and debit type administration

This patch updates the credit and debit type administration templates so
that library selection uses a Select2-styled menu instead of a standard
<select>. Both pages 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 -> Credit types edit a credit 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 credit type again to clear all your selections and confirm
  that it saves correctly.
- Repeat the same process on the debit types page.

Sponsored-by: Athens County Public Libraries
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Comment 4 Katrin Fischer 2025-05-16 12:27:16 UTC
Pushed for 25.05!

Well done everyone, thank you!
Comment 5 Jonathan Druart 2025-05-21 14:03:07 UTC
With ktd sample data:
http://localhost:8081//cgi-bin/koha/admin/debit_types.pl
Uncaught TypeError: $(...)[0] is undefined
Comment 6 Owen Leonard 2025-05-21 15:46:22 UTC
> Uncaught TypeError: $(...)[0] is undefined

See Bug 39957