Bugzilla – Attachment 153873 Details for
Bug 34352
It would be great to have a generic flatpickr based input for datatables column filters
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 34352: Enable flatpickr on patron search
Bug-34352-Enable-flatpickr-on-patron-search.patch (text/plain), 2.11 KB, created by
Martin Renvoize
on 2023-07-25 13:31:25 UTC
(
hide
)
Description:
Bug 34352: Enable flatpickr on patron search
Filename:
MIME Type:
Creator:
Martin Renvoize
Created:
2023-07-25 13:31:25 UTC
Size:
2.11 KB
patch
obsolete
>From 4c3010bbf22c34921adc63037d78c363888c4414 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Tue, 25 Jul 2023 10:06:19 +0100 >Subject: [PATCH] Bug 34352: Enable flatpickr on patron search > >--- > .../intranet-tmpl/prog/en/includes/patron-search.inc | 1 + > koha-tmpl/intranet-tmpl/prog/js/datatables.js | 12 ++++++++++++ > 2 files changed, 13 insertions(+) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc >index 8f13fa0374..34502bcce7 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc >@@ -242,6 +242,7 @@ > </script> > > [% INCLUDE 'datatables.inc' %] >+ [% INCLUDE 'calendar.inc' %] > [% INCLUDE 'js-patron-get-age.inc' %] > [% INCLUDE 'js-patron-format.inc' %] > [% INCLUDE 'js-patron-format-address.inc' %] >diff --git a/koha-tmpl/intranet-tmpl/prog/js/datatables.js b/koha-tmpl/intranet-tmpl/prog/js/datatables.js >index fe4fe8de97..d61556681a 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/datatables.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/datatables.js >@@ -890,6 +890,14 @@ function _dt_add_filters(table_node, table_dt, filters_options = {}) { > o.appendTo(select); > }); > $(this).html( select ); >+ } else if (table_dt.settings()[0].aoColumns[i].sType == 'date' ) { >+ let existing_search = table_dt.column(i).search(); >+ let input = $('<input type="text" class="flatpickr" style="width: 100%" />'); >+ if (existing_search) { >+ input.prop("value", existing_search); >+ } >+ >+ $(this).html( input ); > } else { > var title = $(this).text(); > var existing_search = table_dt.column(i).search(); >@@ -920,6 +928,10 @@ function _dt_add_filters(table_node, table_dt, filters_options = {}) { > $(this).html(''); > } > } ); >+ >+ $(".flatpickr").each(function(){ >+ apply_flatpickr(this); >+ }); > } > > >-- >2.41.0
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 34352
: 153873 |
153874