Bugzilla – Attachment 164861 Details for
Bug 36545
Use select2 to improve multi-select in item search
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 36545: Use select2 in item search
Bug-36545-Use-select2-in-item-search.patch (text/plain), 4.45 KB, created by
Owen Leonard
on 2024-04-12 17:54:11 UTC
(
hide
)
Description:
Bug 36545: Use select2 in item search
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2024-04-12 17:54:11 UTC
Size:
4.45 KB
patch
obsolete
>From ae63d5008fc62f3b28273182f4fb061ad90450e5 Mon Sep 17 00:00:00 2001 >From: Michael Skarupianski <michael.skarupianski@gmail.com> >Date: Tue, 9 Apr 2024 14:00:15 +0000 >Subject: [PATCH] Bug 36545: Use select2 in item search > >This patch modifies the multi-select fields in the item search to use >the select2 framework. > >To test: >1. Apply patch >2. Go to staff interface -> "Item search" >3. Check item search form and search for > - Home library > - Current library > - Shelving location > - Item type > - Collection > - Status > - Lost > - Withdrawn > - Damaged >4. Search with multiple variations (nothing selected, only one value, > multiple values, ...) If no value is selected this means that "All" > values are searched >5. Check that the search is working well > >Sponsored-by: Karlsruhe Institute of Technology (KIT) >Signed-off-by: Owen Leonard <oleonard@myacpl.org> >--- > .../prog/en/modules/catalogue/itemsearch.tt | 26 ++++++++++++------- > 1 file changed, 17 insertions(+), 9 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt >index 09ea328b6ec..01062147206 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt >@@ -185,28 +185,28 @@ > </div> > </div> > <fieldset> >- [% INCLUDE form_field_select name="homebranch" options = branches empty_option = "All libraries" %] >- [% INCLUDE form_field_select name="holdingbranch" options = branches empty_option = "All libraries" %] >+ [% INCLUDE form_field_select name="homebranch" options = branches %] >+ [% INCLUDE form_field_select name="holdingbranch" options = branches %] > [% IF locations.size %] >- [% INCLUDE form_field_select name="location" options = locations empty_option = "All locations" %] >+ [% INCLUDE form_field_select name="location" options = locations %] > [% END %] > </fieldset> > <fieldset> >- [% INCLUDE form_field_select name="itype" options = itemtypes empty_option = "All item types" %] >+ [% INCLUDE form_field_select name="itype" options = itemtypes style="min-width:300px" %] > [% IF ccodes.size %] >- [% INCLUDE form_field_select name="ccode" options = ccodes empty_option = "All collection codes" %] >+ [% INCLUDE form_field_select name="ccode" options = ccodes %] > [% END %] > [% IF notforloans.size %] >- [% INCLUDE form_field_select name="notforloan" options = notforloans empty_option = "All statuses" %] >+ [% INCLUDE form_field_select name="notforloan" options = notforloans %] > [% END %] > [% IF itemlosts.size %] >- [% INCLUDE form_field_select name="itemlost" options = itemlosts empty_option = "All statuses" %] >+ [% INCLUDE form_field_select name="itemlost" options = itemlosts %] > [% END %] > [% IF withdrawns.size %] >- [% INCLUDE form_field_select name="withdrawn" options = withdrawns empty_option = "All statuses" %] >+ [% INCLUDE form_field_select name="withdrawn" options = withdrawns %] > [% END %] > [% IF damageds.size %] >- [% INCLUDE form_field_select name="damaged" options = damageds empty_option = "All statuses" %] >+ [% INCLUDE form_field_select name="damaged" options = damageds %] > [% END %] > <div class="form-field"> > <label class="form-field-label">Availability:</label> >@@ -289,6 +289,7 @@ > [% INCLUDE 'datatables.inc' %] > [% Asset.js("lib/jquery/plugins/jquery.dataTables.columnFilter.js") | $raw %] > [% Asset.js("lib/hc-sticky/hc-sticky.js") | $raw %] >+ [% INCLUDE 'select2.inc' %] > <script> > var authorised_values = [% authorised_values_json | $raw %]; > >@@ -720,6 +721,13 @@ > checkbox.change(); > } > }); >+ >+ // Apply select2 to all select fields having a "multiple" attribute >+ let selectFields = document.querySelectorAll('select[multiple]'); >+ selectFields.forEach((selectField) => { >+ selectField.style.minWidth = '320px'; >+ $(selectField).select2(); >+ }); > }); > </script> > [% END %] >-- >2.30.2
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 36545
:
164561
|
164861
|
164862
|
165018
|
165019
|
165838
|
165866
|
165867
|
165868