Bugzilla – Attachment 182945 Details for
Bug 40013
Allow custom/plugable filtering options for OPAC ILL table
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 40013: Allow plugging in custom dataFilters to OPAC kohaTable
Bug-40013-Allow-plugging-in-custom-dataFilters-to-.patch (text/plain), 2.04 KB, created by
HKS3 Tadeusz Sośnierz
on 2025-06-04 11:26:02 UTC
(
hide
)
Description:
Bug 40013: Allow plugging in custom dataFilters to OPAC kohaTable
Filename:
MIME Type:
Creator:
HKS3 Tadeusz Sośnierz
Created:
2025-06-04 11:26:02 UTC
Size:
2.04 KB
patch
obsolete
>From b120ef48b9eeeed237b24bd9a0df4a1bf7715f1d Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?Tadeusz=20=E2=80=9Etadzik=E2=80=9D=20So=C5=9Bnierz?= > <tadeusz@sosnierz.com> >Date: Tue, 3 Jun 2025 15:54:49 +0200 >Subject: [PATCH] Bug 40013: Allow plugging in custom dataFilters to OPAC > kohaTable > >This allows plugins/opacJS to alter the response data before it's displayed to the user. >--- > .../opac-tmpl/bootstrap/en/modules/opac-illrequests.tt | 2 ++ > koha-tmpl/opac-tmpl/bootstrap/js/datatables.js | 6 ++++++ > 2 files changed, 8 insertions(+) > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-illrequests.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-illrequests.tt >index bcbcf04f25..1f19e4ec30 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-illrequests.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-illrequests.tt >@@ -422,6 +422,7 @@ > return status_label; > } > let opac_illrequests_additional_filters = {}; >+ let opac_illrequests_data_filters = []; > $("#illrequestlist").kohaTable({ > order: [[ 0, "desc" ]], > dom: '<"dt-info"i><"top pager"<"table_entries"lp>t<"bottom pager"pi>', >@@ -436,6 +437,7 @@ > return data; > } > } ], >+ dataFilters: opac_illrequests_data_filters, > columns: [ > { > data: 'ill_request_id', >diff --git a/koha-tmpl/opac-tmpl/bootstrap/js/datatables.js b/koha-tmpl/opac-tmpl/bootstrap/js/datatables.js >index 114dfcd22a..f90a61ae7a 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/js/datatables.js >+++ b/koha-tmpl/opac-tmpl/bootstrap/js/datatables.js >@@ -102,6 +102,12 @@ function _dt_default_ajax(params) { > json.draw = draw; > } > >+ if (options.dataFilters) { >+ for (const filter of options.dataFilters) { >+ json.data = filter(json.data); >+ } >+ } >+ > return JSON.stringify(json); > }, > data: function (data, settings) { >-- >2.49.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 40013
:
182813
|
182944
| 182945 |
182947