Bugzilla – Attachment 182126 Details for
Bug 39843
Use select2 for multiple selects on patron attributes and extend due dates pages
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 39843: Use select2 for multiple selects on patron attributes and extend due dates pages
Bug-39843-Use-select2-for-multiple-selects-on-patr.patch (text/plain), 4.37 KB, created by
David Nind
on 2025-05-08 21:50:59 UTC
(
hide
)
Description:
Bug 39843: Use select2 for multiple selects on patron attributes and extend due dates pages
Filename:
MIME Type:
Creator:
David Nind
Created:
2025-05-08 21:50:59 UTC
Size:
4.37 KB
patch
obsolete
>From f320870682c3aed80a59c8f4f0b69430fe8fcd30 Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Tue, 6 May 2025 13:55:01 +0000 >Subject: [PATCH] Bug 39843: Use select2 for multiple selects on patron > attributes and extend due dates pages > >This patch adds Select2 functionality to the select[multiple] fields on >the patron attributes and batch extend due dates pages. > >To test, apply the patch and go to Administration -> Patron attribute >types. > >- Create or edit a patron attribute type. >- Test the "Library limitation" field: Selecting a single or multiple > library and clearing selections. >- Save your changes and confirm that your selections were saved > correctly. >- Perform the same test on Tools -> Batch extend due dates: > - Test the patron categories, item types, and libraries fields. > >Sponsored-by: Athens County Public Libraries >Signed-off-by: David Nind <david@davidnind.com> >--- > .../prog/en/modules/admin/patron-attr-types.tt | 10 +++++++--- > .../prog/en/modules/tools/batch_extend_due_dates.tt | 6 +++++- > 2 files changed, 12 insertions(+), 4 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/patron-attr-types.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/patron-attr-types.tt >index 985bf59713..56ab6a79b9 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/patron-attr-types.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/patron-attr-types.tt >@@ -235,12 +235,12 @@ > > > </li> > <li >- ><label for="branches">Library limitation: </label> >- <select id="branches" name="branches" multiple size="10"> >+ ><label for="library_limitation">Library limitation: </label> >+ <select id="library_limitation" name="branches" multiple size="10"> > <option value="">All libraries</option> > [% PROCESS options_for_libraries libraries => Branches.all( selected => attribute_type.library_limits ) %] > </select> >- <div class="hint">Select "All libraries" if this attribute type should always be displayed. Otherwise select libraries you want to associate with this value. </div> >+ <div class="hint">Limits the use of this attribute to the selected libraries. </div> > </li> > <li> > <label for="category">Category: </label> >@@ -406,6 +406,7 @@ > [% MACRO jsinclude BLOCK %] > [% Asset.js("js/admin-menu.js") | $raw %] > [% INCLUDE 'datatables.inc' %] >+ [% INCLUDE 'select2.inc' %] > <script> > $(document).ready(function () { > function toggle_search_default() { >@@ -466,6 +467,9 @@ > null > ); > }); >+ >+ $("#library_limitation")[0].style.minWidth = "450px"; >+ $("#library_limitation").select2(); > }); > </script> > [% END %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_extend_due_dates.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_extend_due_dates.tt >index e2fe82ee1a..e975b76132 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_extend_due_dates.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_extend_due_dates.tt >@@ -87,7 +87,7 @@ > <legend>Checkout criteria:</legend> > <ol> > <li> >- <label for="categorycodes">Patrons' categories: </label> >+ <label for="categorycodes">Patrons categories: </label> > [% SET categories = Categories.all() %] > <select id="categorycodes" name="categorycodes" multiple="multiple"> > [% FOREACH cat IN categories %] >@@ -248,6 +248,7 @@ > [% Asset.js("js/tools-menu.js") | $raw %] > [% INCLUDE 'calendar.inc' %] > [% INCLUDE 'datatables.inc' %] >+ [% INCLUDE 'select2.inc' %] > [% Asset.js("lib/jquery/plugins/humanmsg.js") | $raw %] > <script> > $(document).ready(function () { >@@ -297,6 +298,9 @@ > } > return true; > }); >+ >+ $("#extend_due_dates_form select[multiple]").css("minWidth", "450px"); >+ $("#extend_due_dates_form select[multiple]").select2(); > }); > </script> > [% END %] >-- >2.39.5
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 39843
:
181980
|
182126
|
182522