Bugzilla – Attachment 175185 Details for
Bug 38255
Do not use dataTable constructor directly
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 38255: Exceptions
Bug-38255-Exceptions.patch (text/plain), 3.93 KB, created by
Jonathan Druart
on 2024-12-04 13:45:17 UTC
(
hide
)
Description:
Bug 38255: Exceptions
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2024-12-04 13:45:17 UTC
Size:
3.93 KB
patch
obsolete
>From fc376bc207e0350c70da518314fd4e9d558cfb57 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 4 Dec 2024 11:59:55 +0100 >Subject: [PATCH] Bug 38255: Exceptions > >Those tables are using a svc script, not the REST API. It is not compatible >with kohaTable's default 'ajax' options. >--- > .../intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt | 1 + > koha-tmpl/intranet-tmpl/prog/js/checkouts.js | 3 +++ > koha-tmpl/intranet-tmpl/prog/js/datatables.js | 3 ++- > koha-tmpl/intranet-tmpl/prog/js/holds.js | 1 + > 4 files changed, 7 insertions(+), 1 deletion(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt >index 544a9802920..e90af41e9a1 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt >@@ -657,6 +657,7 @@ > }); > } > }, >+ bKohaAjaxSVC: true, > 'columns':[ > { "data": 'dt_public' }, > { "data": 'dt_shelfname' }, >diff --git a/koha-tmpl/intranet-tmpl/prog/js/checkouts.js b/koha-tmpl/intranet-tmpl/prog/js/checkouts.js >index a74e1baf092..6b34a69b916 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/checkouts.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/checkouts.js >@@ -436,6 +436,7 @@ function LoadIssuesTable() { > ajax: { > url: '/cgi-bin/koha/svc/checkouts?borrowernumber=%s'.format(borrowernumber), > }, >+ bKohaAjaxSVC: true, > "rowGroup":{ > "dataSrc": "issued_today", > "startRender": function ( rows, group ) { >@@ -974,6 +975,7 @@ $(document).ready(function() { > ajax: { > url: '/cgi-bin/koha/svc/checkouts?%s'.format(relatives_borrowernumbers.map(b => 'borrowernumber=%s'.format(b)).join('&')), > }, >+ bKohaAjaxSVC: true, > }, table_settings_relatives_issues_table); > } > }); >@@ -1170,6 +1172,7 @@ $(document).ready(function() { > } > } > }, >+ bKohaAjaxSVC: true, > "search": { "search": "is_unresolved" }, > "footerCallback": function (row, data, start, end, display) { > var api = this.api(); >diff --git a/koha-tmpl/intranet-tmpl/prog/js/datatables.js b/koha-tmpl/intranet-tmpl/prog/js/datatables.js >index 5ed1e001ba2..2234afa8acd 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/datatables.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/datatables.js >@@ -1036,7 +1036,7 @@ function _dt_save_restore_state(table_settings, external_filter_nodes={}){ > }; > } > >- if (options.ajax) { >+ if (options.ajax && !options.bKohaAjaxSVC) { > options.ajax = Object.assign( > {}, > options.ajax, >@@ -1076,6 +1076,7 @@ function _dt_save_restore_state(table_settings, external_filter_nodes={}){ > } > > $(this).data('bKohaColumnsUseNames', settings.bKohaColumnsUseNames); >+ $(this).data('bKohaAjaxSVC', settings.bKohaAjaxSVC); // Must not be used for new tables! > var table = $(this).dataTable(settings); > > var table_dt = table.DataTable(); >diff --git a/koha-tmpl/intranet-tmpl/prog/js/holds.js b/koha-tmpl/intranet-tmpl/prog/js/holds.js >index de80f9fc699..fd728c04100 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/holds.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/holds.js >@@ -328,6 +328,7 @@ $(document).ready(function() { > d.borrowernumber = borrowernumber; > } > }, >+ bKohaAjaxSVC: true, > }, table_settings_holds_table ); > > $('#holds-table').on( 'draw.dt', function () { >-- >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 38255
:
175181
|
175182
|
175183
|
175184
|
175185
|
175352
|
175598
|
175599
|
175872
|
175873
|
176062
|
176063
|
176064
|
176065
|
176066
|
176067
|
176068
|
176069
|
176070
|
176071
|
176146
|
176348
|
176349
|
176350
|
176351
|
176352
|
176353
|
176354
|
176355
|
176356
|
176357
|
176358
|
176550
|
176551
|
176552
|
176553
|
176554
|
176555
|
176556
|
176557
|
176558
|
176559
|
176560
|
177076
|
177077
|
177078
|
177079
|
177080
|
177081
|
177082
|
177083
|
177084
|
177085
|
177086
|
177214
|
177215
|
177216
|
177217
|
177218
|
177219
|
177220
|
177221
|
177222
|
177223
|
177224
|
177262