Bugzilla – Attachment 173462 Details for
Bug 33484
Ability to remember user's selected table configuration and search filters for tables
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 33484: Fix category select
Bug-33484-Fix-category-select.patch (text/plain), 2.63 KB, created by
Jonathan Druart
on 2024-10-28 09:45:28 UTC
(
hide
)
Description:
Bug 33484: Fix category select
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2024-10-28 09:45:28 UTC
Size:
2.63 KB
patch
obsolete
>From 3199910db0b084d7e52ca3c0c2606da3958d6a27 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 9 Oct 2024 11:43:08 +0200 >Subject: [PATCH] Bug 33484: Fix category select > >Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com> >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > koha-tmpl/intranet-tmpl/prog/js/datatables.js | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/js/datatables.js b/koha-tmpl/intranet-tmpl/prog/js/datatables.js >index b9f7a90973d..c560bd729bd 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/datatables.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/datatables.js >@@ -855,10 +855,10 @@ function _dt_add_filters(table_node, table_dt, filters_options = {}) { > $(th).removeClass('sorting').removeClass("sorting_asc").removeClass("sorting_desc"); > if ( is_searchable ) { > let input_type = 'input'; >+ let existing_search = column.search(); > if ( $(th).data('filter') || filters_options.hasOwnProperty(i)) { > input_type = 'select' > let filter_type = $(th).data('filter'); >- let existing_search = column.search(); > let select = $('<select class="dt-select-filter"><option value=""></option></select'); > > // FIXME eval here is bad and dangerous, how do we workaround that? >@@ -869,6 +869,9 @@ function _dt_add_filters(table_node, table_dt, filters_options = {}) { > } > $(filters_options[i]).each(function(){ > let o = $('<option value="%s">%s</option>'.format(this._id, this._str)); >+ // Compare with lc, or selfreg won't match ^SELFREG$ for instance, see bug 32517 >+ // This is only for category, we might want to apply it only in this case. >+ existing_search = existing_search.toLowerCase() > if ( existing_search === this._id || (existing_search && this._id.match(existing_search)) ) { > o.prop("selected", "selected"); > } >@@ -877,7 +880,6 @@ function _dt_add_filters(table_node, table_dt, filters_options = {}) { > $(th).html( select ); > } else { > var title = $(th).text(); >- var existing_search = table_dt.column(i).search(); > if ( existing_search ) { > $(th).html( '<input type="text" value="%s" style="width: 100%" />'.format(existing_search) ); > } else { >-- >2.34.1
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 33484
:
149444
|
149445
|
149447
|
149448
|
149449
|
149925
|
149926
|
149927
|
149928
|
149929
|
149930
|
149974
|
149975
|
149976
|
149977
|
149978
|
149979
|
173443
|
173444
|
173445
|
173446
|
173447
|
173448
|
173449
|
173450
|
173451
|
173452
|
173453
|
173454
|
173455
|
173456
|
173457
|
173458
|
173459
|
173460
|
173461
| 173462 |
173463
|
173464
|
173465
|
173466
|
173467
|
173468
|
173469
|
173470
|
173471
|
173472
|
173473
|
173474
|
173475
|
173476
|
173477
|
173478
|
173479
|
173480
|
173481
|
173482
|
173483
|
173484
|
173485
|
173486
|
173546
|
173606
|
173607
|
173985
|
174219