Bugzilla – Attachment 177214 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: Replace dataTable constructor with kohaTable - Staff
Bug-38255-Replace-dataTable-constructor-with-kohaT.patch (text/plain), 134.67 KB, created by
Jonathan Druart
on 2025-01-28 08:35:53 UTC
(
hide
)
Description:
Bug 38255: Replace dataTable constructor with kohaTable - Staff
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2025-01-28 08:35:53 UTC
Size:
134.67 KB
patch
obsolete
>From f380beb3ed91ad122bb4fee05a251a5e19494502 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Thu, 28 Nov 2024 16:20:24 +0100 >Subject: [PATCH] Bug 38255: Replace dataTable constructor with kohaTable - > Staff > >Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> >--- > .../prog/en/modules/acqui/basket.tt | 15 +- > .../prog/en/modules/acqui/basketgroup.tt | 52 +++--- > .../prog/en/modules/acqui/booksellers.tt | 18 +- > .../prog/en/modules/acqui/invoice-files.tt | 12 +- > .../prog/en/modules/acqui/invoice.tt | 28 ++- > .../prog/en/modules/acqui/invoices.tt | 14 +- > .../en/modules/acqui/newordersubscription.tt | 12 +- > .../en/modules/acqui/newordersuggestion.tt | 12 +- > .../prog/en/modules/acqui/ordered.tt | 10 +- > .../prog/en/modules/acqui/parcel.tt | 31 ++-- > .../prog/en/modules/acqui/parcels.tt | 6 +- > .../prog/en/modules/acqui/spent.tt | 10 +- > .../prog/en/modules/acqui/supplier.tt | 10 +- > .../prog/en/modules/acqui/uncertainprice.tt | 10 +- > .../prog/en/modules/acqui/z3950_search.tt | 18 +- > .../en/modules/admin/additional-fields.tt | 19 +- > .../prog/en/modules/admin/aqbudgetperiods.tt | 25 +-- > .../modules/admin/auth_subfields_structure.tt | 10 +- > .../en/modules/admin/auth_tag_structure.tt | 10 +- > .../modules/admin/branch_transfer_limits.tt | 13 +- > .../prog/en/modules/admin/cash_registers.tt | 12 +- > .../prog/en/modules/admin/credit_types.tt | 4 +- > .../prog/en/modules/admin/debit_types.tt | 4 +- > .../prog/en/modules/admin/koha2marclinks.tt | 10 +- > .../prog/en/modules/admin/localization.tt | 14 +- > .../en/modules/admin/marc-overlay-rules.tt | 4 +- > .../prog/en/modules/admin/marctagstructure.tt | 10 +- > .../prog/en/modules/admin/oai_servers.tt | 10 +- > .../prog/en/modules/admin/overdrive.tt | 10 +- > .../en/modules/admin/systempreferences.tt | 14 +- > .../prog/en/modules/admin/z3950servers.tt | 10 +- > .../prog/en/modules/catalogue/detail.tt | 12 +- > .../en/modules/catalogue/search-history.tt | 16 +- > .../modules/cataloguing/z3950_auth_search.tt | 14 +- > .../prog/en/modules/circ/article-requests.tt | 25 +-- > .../prog/en/modules/circ/checkout-notes.tt | 14 +- > .../circ/circulation_batch_checkouts.tt | 16 +- > .../prog/en/modules/circ/on-site_checkouts.tt | 2 +- > .../prog/en/modules/circ/returns.tt | 15 +- > .../prog/en/modules/circ/transfers_to_send.tt | 16 +- > .../en/modules/circ/transferstoreceive.tt | 16 +- > .../prog/en/modules/clubs/club-enrollments.tt | 12 +- > .../prog/en/modules/clubs/clubs.tt | 26 ++- > .../prog/en/modules/clubs/patron-clubs-tab.tt | 12 +- > .../en/modules/labels/label-edit-batch.tt | 16 +- > .../prog/en/modules/labels/label-manage.tt | 12 +- > .../en/modules/members/alert-subscriptions.tt | 3 +- > .../prog/en/modules/members/discharges.tt | 4 +- > .../prog/en/modules/members/notices.tt | 8 +- > .../modules/members/purchase-suggestions.tt | 12 +- > .../prog/en/modules/members/statistics.tt | 8 +- > .../prog/en/modules/members/update-child.tt | 14 +- > .../prog/en/modules/patron_lists/lists.tt | 12 +- > .../modules/patron_lists/patron-lists-tab.tt | 12 +- > .../prog/en/modules/patroncards/edit-batch.tt | 18 +- > .../intranet-tmpl/prog/en/modules/pos/pay.tt | 4 +- > .../prog/en/modules/pos/register.tt | 8 +- > .../prog/en/modules/pos/registers.tt | 8 +- > .../en/modules/recalls/recalls_to_pull.tt | 14 +- > .../en/modules/recalls/recalls_waiting.tt | 12 +- > .../en/modules/reports/cash_register_stats.tt | 8 +- > .../modules/reports/guided_reports_start.tt | 4 +- > .../prog/en/modules/reports/itemtypes.tt | 8 +- > .../prog/en/modules/reports/serials_stats.tt | 6 +- > .../prog/en/modules/reserve/request.tt | 9 +- > .../prog/en/modules/serials/claims.tt | 14 +- > .../en/modules/serials/serials-collection.tt | 20 +-- > .../prog/en/modules/serials/serials-search.tt | 50 +++--- > .../serials/subscription-numberpatterns.tt | 10 +- > .../prog/en/modules/tags/list.tt | 12 +- > .../prog/en/modules/tools/access_files.tt | 10 +- > .../en/modules/tools/additional-contents.tt | 14 +- > .../en/modules/tools/batch_delete_records.tt | 36 ++-- > .../modules/tools/batch_extend_due_dates.tt | 32 ++-- > .../tools/batch_record_modification.tt | 32 ++-- > .../prog/en/modules/tools/holidays.tt | 26 +-- > .../en/modules/tools/manage-marc-import.tt | 4 +- > .../prog/en/modules/tools/overduerules.tt | 12 +- > .../prog/en/modules/tools/problem-reports.tt | 14 +- > .../prog/en/modules/tools/quotes-upload.tt | 2 +- > .../prog/en/modules/virtualshelves/shelves.tt | 4 +- > .../intranet-tmpl/prog/js/addorderiso2709.js | 16 +- > koha-tmpl/intranet-tmpl/prog/js/authtype.js | 14 +- > .../intranet-tmpl/prog/js/biblio_framework.js | 14 +- > koha-tmpl/intranet-tmpl/prog/js/cart.js | 20 +-- > koha-tmpl/intranet-tmpl/prog/js/checkouts.js | 2 +- > koha-tmpl/intranet-tmpl/prog/js/datatables.js | 16 +- > .../prog/js/elasticsearch-mappings.js | 16 +- > koha-tmpl/intranet-tmpl/prog/js/holds.js | 2 +- > .../prog/js/marc_subfields_structure.js | 14 +- > .../prog/js/pages/preferences.js | 16 +- > .../prog/js/pages/tags-review.js | 14 +- > koha-tmpl/intranet-tmpl/prog/js/recalls.js | 14 +- > .../prog/js/rotating-collections.js | 16 +- > .../intranet-tmpl/prog/js/subscription-add.js | 4 +- > .../ERM/EHoldingsEBSCOTitlePackagesList.vue | 165 +++++++++--------- > .../ERM/EHoldingsLocalTitlePackagesList.vue | 3 +- > .../ERM/EHoldingsLocalTitlesFormImport.vue | 110 ++++++------ > 98 files changed, 754 insertions(+), 827 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt >index 3ba9f929461..f08c3e5553d 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt >@@ -1159,17 +1159,18 @@ > $(document).ready(function() { > var table_settings = [% TablesSettings.GetTableSettings( 'acqui', 'basket', 'orders', 'json' ) | $raw %]; > [% IF !(Koha.Preference('EDIFACT') && ediaccount) %] >+ // FIXME This cannot work correctly without bKohaColumnsUseNames > table_settings['columns'].splice(18, 1); > [% END %] >- KohaTable("orders", { >- "pagingType": "full", >- "autoWidth": false, >- "exportColumns": [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18[% IF (Koha.Preference('EDIFACT') && ediaccount) %],19[% END %]], >+ $("#orders").kohaTable({ >+ pagingType: "full", >+ autoWidth: false, >+ exportColumns: [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18[% IF (Koha.Preference('EDIFACT') && ediaccount) %],19[% END %]], > }, table_settings); > >- var cancelledorderst = $("#cancelledorderst").dataTable($.extend(true, {}, dataTablesDefaults, { >- "pagingType": "full" >- } ) ); >+ $("#cancelledorderst").kohaTable({ >+ pagingType: "full" >+ }); > $("#reopenform").on("submit",function(e){ > var skip = [% IF ( skip_confirm_reopen ) %] 1 [% ELSE %] 0 [% END %]; > var is_confirmed = skip || confirm(_("Are you sure you want to reopen this basket?")); >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basketgroup.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basketgroup.tt >index 8278005b2ff..c98ea862c2e 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basketgroup.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basketgroup.tt >@@ -399,34 +399,32 @@ > $("#basket_groups a[href='#opened']").tab("show"); > [% END %] > [% UNLESS ( grouping ) %] >- $("table").dataTable($.extend(true, {}, dataTablesDefaults, { >- "columnDefs": [ >- { "targets": [ -1 ], "orderable": false, "searchable": false }, >- ], >- "autoWidth": false, >- "pagingType": "full" >- } )); >+ let dt_params = { >+ columnDefs: [{ targets: [-1], orderable: false, searchable: false }], >+ autoWidth: false, >+ pagingType: "full", >+ }; >+ $("#ungrouped").kohaTable(dt_params); >+ $("#grouped").kohaTable(dt_params); >+ $("#basket_group_opened").kohaTable(dt_params); >+ $("#basket_group_closed").kohaTable(dt_params); > [% ELSE %] >- grouped = $("#grouped").DataTable($.extend(true, {}, dataTablesDefaults, { >- "dom": 't', >- "columnDefs": [ >- { 'sortable': false, 'targets': [ 'NoSort' ] } >- ], >- 'autoWidth': false, >- "language": { >- "emptyTable": _("There are no baskets in this group") >- } >- } )); >- ungrouped = $("#ungrouped").DataTable($.extend(true, {}, dataTablesDefaults, { >- "dom": 't', >- "columnDefs": [ >- { 'sortable': false, 'targets': [ 'NoSort' ] } >- ], >- 'autoWidth': false, >- "language": { >- "emptyTable": _("There are no ungrouped baskets") >- } >- } )); >+ grouped = $("#grouped").kohaTable({ >+ dom: "t", >+ columnDefs: [{ sortable: false, targets: ["NoSort"] }], >+ autoWidth: false, >+ language: { >+ emptyTable: _("There are no baskets in this group"), >+ }, >+ }); >+ ungrouped = $("#ungrouped").kohaTable({ >+ dom: "t", >+ columnDefs: [{ sortable: false, targets: ["NoSort"] }], >+ autoWidth: false, >+ language: { >+ emptyTable: _("There are no ungrouped baskets"), >+ }, >+ }); > [% END %] > > $("#basketgroupcolumns").on("click", ".addtogroup", function(){ >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/booksellers.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/booksellers.tt >index efd6a578fb7..16428f244b4 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/booksellers.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/booksellers.tt >@@ -263,16 +263,14 @@ > [% Asset.js("js/acq.js") | $raw %] > <script> > $(document).ready(function() { >- $("table.baskets").dataTable($.extend(true, {}, dataTablesDefaults, { >- "dom": 't', >- "paginate": false, >- "searching": false, >- "info": false, >- "order": [[ 1, "asc" ]], >- "columnDefs": [ >- { "targets": [-1], "orderable": false } >- ] >- })); >+ $("table.baskets").kohaTable({ >+ dom: "t", >+ paginate: false, >+ searching: false, >+ info: false, >+ order: [[1, "asc"]], >+ columnDefs: [{ targets: [-1], orderable: false }], >+ }); > $("#supplierlist").change(function() { > var id = $(this).find("option:selected").val(); > window.location.href = "#vendor" + id; >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoice-files.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoice-files.tt >index 37fed1785b0..daa7340869f 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoice-files.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoice-files.tt >@@ -130,14 +130,14 @@ > [% INCLUDE 'datatables.inc' %] > <script> > $(document).ready(function() { >- $("#invoice_files_details_table").dataTable($.extend(true, {}, dataTablesDefaults, { >- "columnDefs": [ >+ $("#invoice_files_details_table").kohaTable({ >+ columnDefs: [ > { "targets": [ -1, -2 ], "orderable": false, "searchable": false } > ], >- "info": false, >- "paging": false, >- "searching": false, >- "dom": "t" >+ info: false, >+ paging: false, >+ searching: false, >+ dom: "t" > })); > $(".delete_file").click(function(){ > return ( confirm( _("Are you sure you want to delete this file?") ) ); >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoice.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoice.tt >index 4bf835b4feb..79606c413aa 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoice.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoice.tt >@@ -563,22 +563,20 @@ > } > > $(document).ready(function() { >- $("#orderst").dataTable($.extend(true, {}, dataTablesDefaults, { >- "info": false, >- "paging": false, >- "searching": false, >- "dom": "t", >- "columnDefs": [ >- { "type": "anti-the", "targets": [ "anti-the" ] } >- ] >- })); >+ $("#orderst").kohaTable({ >+ info: false, >+ paging: false, >+ searching: false, >+ dom: "t", >+ columnDefs: [{ type: "anti-the", targets: ["anti-the"] }], >+ }); > [% IF ( (Koha.Preference('AcqEnableFiles')) && files ) %] >- $("#invoice_files_table").dataTable($.extend(true, {}, dataTablesDefaults, { >- "info": false, >- "paging": false, >- "searching": false, >- "dom": "t" >- })); >+ $("#invoice_files_table").kohaTable({ >+ info: false, >+ paging: false, >+ searching: false, >+ dom: "t", >+ }); > [% END %] > $("#show_all_details").click(function(){ > updateColumnsVisibility( $(this).is(":checked") ); >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoices.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoices.tt >index 12ec5748043..3d50226731a 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoices.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoices.tt >@@ -440,14 +440,14 @@ > }); > }); > >- var resultst = $("table.result").dataTable($.extend(true, {}, dataTablesDefaults, { >- "paging": false, >- "columnDefs": [ >- { "orderable": false, "targets": [1, -1] }, >- { "visible": false, "targets": [0] } >+ var resultst = $("table.result").kohaTable({ >+ paging: false, >+ columnDefs: [ >+ { orderable: false, targets: [1, -1] }, >+ { visible: false, targets: [0] }, > ], >- autoWidth: false >- })); >+ autoWidth: false, >+ }); > > $(".show_only_subscription").prop("checked", false); > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/newordersubscription.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/newordersubscription.tt >index 884fdd79bc6..5c61515fec9 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/newordersubscription.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/newordersubscription.tt >@@ -134,13 +134,13 @@ > } > > $(document).ready(function() { >- $("#srlt").dataTable($.extend(true, {}, dataTablesDefaults, { >- "columnDefs": [ >- { "orderable": false, "searchable": false, "targets": [ 'NoSort' ] }, >- { "type": "anti-the", "targets": [ "anti-the" ] } >+ $("#srlt").kohaTable({ >+ columnDefs: [ >+ { orderable: false, searchable: false, targets: ["NoSort"] }, >+ { type: "anti-the", targets: ["anti-the"] }, > ], >- "pagingType": "full" >- })); >+ pagingType: "full", >+ }); > > $("#show_only_renewed").click(function(){ > updateRowsVisibility( $(this).is(":checked") ); >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/newordersuggestion.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/newordersuggestion.tt >index bcfc924e68b..15c9f02880a 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/newordersuggestion.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/newordersuggestion.tt >@@ -131,13 +131,13 @@ > [% INCLUDE 'calendar.inc' %] > <script> > $(document).ready(function() { >- var suggestionst = $("#suggestionst").dataTable($.extend(true, {}, dataTablesDefaults, { >- "columnDefs": [ >- { "targets": [ 0 ], "visible": false, "searchable": true }, // must be searchable for filtering >- { "targets": [ -1 ], "orderable": false, "searchable": false }, >+ var suggestionst = $("#suggestionst").kohaTable({ >+ columnDefs: [ >+ { targets: [0], visible: false, searchable: true }, // must be searchable for filtering >+ { targets: [-1], orderable: false, searchable: false }, > ], >- "pagingType": "full" >- })); >+ pagingType: "full", >+ }); > let table_dt = suggestionst.DataTable(); > $("#show_only_mine").on('click', function(e){ > e.preventDefault(); >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/ordered.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/ordered.tt >index 4790f235020..379536e022a 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/ordered.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/ordered.tt >@@ -143,12 +143,10 @@ > [% INCLUDE 'datatables.inc' %] > <script> > $(document).ready(function() { >- $("#spent").dataTable($.extend(true, {}, dataTablesDefaults, { >- "columnDefs": [ >- { "type": "anti-the", "targets": [ "anti-the" ] } >- ], >- "pagingType": "full" >- })); >+ $("#spent").kohaTable({ >+ columnDefs: [{ type: "anti-the", targets: ["anti-the"] }], >+ pagingType: "full", >+ }); > }); > </script> > [% END %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt >index 0d3d2a16ed2..b3ade8daa82 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt >@@ -372,19 +372,21 @@ > }); > > if ( $("#receivedt").length ) { >- var receivedt = $("#receivedt").dataTable($.extend(true, {}, dataTablesDefaults, { >- "stateSave": true, // We do not have table settings on this table >- "pageLength": 10, >- "lengthMenu": [[5, 10, 20, 50, 100, -1], [5, 10, 20, 50, 100, _("All")]], >- "columnDefs": [ >- { "targets": [ 5, -1 ], "orderable": false, "searchable": false }, >+ var receivedt = $("#receivedt").kohaTable({ >+ stateSave: true, // We do not have table settings on this table >+ pageLength: 10, >+ lengthMenu: [ >+ [5, 10, 20, 50, 100, -1], >+ [5, 10, 20, 50, 100, _("All")], > ], >- "columns": [ >- { "type": "html" }, >- { "type": "html" }, >- { "type": "html" }, >- { "type": "num-html" }, >- { "type": "anti-the" }, >+ columnDefs: [{ targets: [5, -1], orderable: false, searchable: false }], >+ columns: [ >+ { type: "html" }, >+ { type: "html" }, >+ { type: "html" }, >+ { type: "num-html" }, >+ { type: "anti-the" }, >+ null, > null, > null, > null, >@@ -392,10 +394,9 @@ > null, > null, > null, >- null > ], >- "pagingType": "full" >- })); >+ pagingType: "full", >+ }); > } > > var options = { >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcels.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcels.tt >index 14653654fc1..c4d00f246c4 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcels.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcels.tt >@@ -263,9 +263,9 @@ > [% INCLUDE 'datatables.inc' %] > <script> > $(document).ready(function() { >- var parcelst = $("#parcelst").dataTable($.extend(true, {}, dataTablesDefaults, { >- "paginate": false >- })); >+ $("#parcelst").kohaTable({ >+ paginate: false >+ }); > > //keep a copy of all budgets before removing the inactives > var budgetId = $("#shipmentcost_budgetid"); >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/spent.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/spent.tt >index c6a471d8b10..15794e50bac 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/spent.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/spent.tt >@@ -158,12 +158,10 @@ > [% INCLUDE 'datatables.inc' %] > <script> > $(document).ready(function() { >- $("#spent").dataTable($.extend(true, {}, dataTablesDefaults, { >- "columnDefs": [ >- { "type": "anti-the", "targets": [ "anti-the" ] } >- ], >- "pagingType": "full" >- } ) ); >+ $("#spent").kohaTable({ >+ columnDefs: [{ type: "anti-the", targets: ["anti-the"] }], >+ pagingType: "full", >+ }); > }); > </script> > [% END %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/supplier.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/supplier.tt >index 4ef054da936..5995fae3b6e 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/supplier.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/supplier.tt >@@ -690,12 +690,12 @@ > } > > $(document).ready(function() { >- var contractst = $("#contractst").dataTable($.extend(true, {}, dataTablesDefaults, { >- "columnDefs": [ >- { "orderable": false, "searchable": false, "targets": [ 'NoSort' ] } >+ var contractst = $("#contractst").kohaTable({ >+ columnDefs: [ >+ { orderable: false, searchable: false, targets: [ 'NoSort' ] } > ], >- "dom": 't' >- } ) ); >+ dom: 't' >+ } ); > $('body').on('click', '.delete-contact', null, delete_contact); > $('#add-contact').click(add_contact); > $('body').on('click', '.contact_acqprimary', null, function () { >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/uncertainprice.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/uncertainprice.tt >index 820e49373cd..8415f0373c1 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/uncertainprice.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/uncertainprice.tt >@@ -183,12 +183,10 @@ > [% INCLUDE 'datatables.inc' %] > <script> > $(document).ready(function() { >- var uncertainpricet = $("#uncertainpricet").dataTable($.extend(true, {}, dataTablesDefaults, { >- "columnDefs": [ >- { "orderable": false, "searchable": false, "targets": [ 'NoSort' ] }, >- ], >- "pagingType": "full" >- })); >+ var uncertainpricet = $("#uncertainpricet").kohaTable({ >+ columnDefs: [{ orderable: false, searchable: false, targets: ["NoSort"] }], >+ pagingType: "full", >+ }); > $(".check_uncertain").on("change",function(){ > var form = document.getElementById("uncertainprices"); > var ordernumber = $(this).data("ordernumber"); >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/z3950_search.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/z3950_search.tt >index 0dac1852d19..730666aa19f 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/z3950_search.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/z3950_search.tt >@@ -311,16 +311,16 @@ tr.selected td { > [% Asset.js("js/z3950_search.js") | $raw %] > <script> > $(document).ready(function(){ >- var resultst = $("#resultst").dataTable($.extend(true, {}, dataTablesDefaults, { >- "columnDefs": [ >- { "targets": [ -1, -2 ], "orderable": false, "searchable": false }, >- { "targets": [ 1 ], "type": "nsb-nse" }, >+ var resultst = $("#resultst").kohaTable({ >+ columnDefs: [ >+ { targets: [-1, -2], orderable: false, searchable: false }, >+ { targets: [1], type: "nsb-nse" }, > ], >- "order": [[ 1, "asc" ]], >- "paginate": false, >- "searching": false, >- "info": false >- })); >+ order: [[1, "asc"]], >+ paginate: false, >+ searching: false, >+ info: false, >+ }); > InitLastAction(); > }); > </script> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/additional-fields.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/additional-fields.tt >index 638cd39ab40..54d7b4c7618 100755 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/additional-fields.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/additional-fields.tt >@@ -310,14 +310,17 @@ > $('#selecttable').submit(); > }); > >- $("#fieldst").dataTable($.extend(true, {}, dataTablesDefaults, { >- "autoWidth": false, >- "dom": 't<"bottom pager"ilpf>', >- "pagingType": 'full', >- "lengthMenu": [[10, 20, 50, 100, -1], [10, 20, 50, 100, "All"]], >- "pageLength": 20, >- "order": [[ 0, "asc" ]], >- })); >+ $("#fieldst").kohaTable({ >+ autoWidth: false, >+ dom: 't<"bottom pager"ilpf>', >+ pagingType: "full", >+ lengthMenu: [ >+ [10, 20, 50, 100, -1], >+ [10, 20, 50, 100, "All"], >+ ], >+ pageLength: 20, >+ order: [[0, "asc"]], >+ }); > > $("#add_field").on('submit', function() { > if ( $("#marcfield").length && $("select[name='authorised_value_category']").length ) { >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgetperiods.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgetperiods.tt >index d9fc1223c3e..3ce557eb3c8 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgetperiods.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgetperiods.tt >@@ -565,18 +565,19 @@ > $("#budgetsTabs li:eq([% tab | html %]) a").tab("show"); > [% END %] > >- $("#activeperiodst,#inactiveperiodst").dataTable($.extend(true, {}, dataTablesDefaults, { >- "columnDefs": [ >- { "targets": [ -1 ], "orderable": false, "searchable": false }, >- ], >- "pagingType": "full", >- "autoWidth": false >- } ) ); >+ let dt_params = { >+ columnDefs: [{ targets: [-1], orderable: false, searchable: false }], >+ pagingType: "full", >+ autoWidth: false, >+ }; >+ >+ $("#activeperiodst").kohaTable(dt_params); >+ $("#inactiveperiodst").kohaTable(dt_params); > > [% IF close_form %] >- $("#budgeth").dataTable($.extend(true, {}, dataTablesDefaults, { >- "dom": "t" >- })); >+ $("#budgeth").kohaTable({ >+ dom: "t", >+ }); > $("#move_form").submit(function(){ > var budget_from = "[% budget_period_description | html %]"; > var budget_to = $("#to_budget_period_id").find("option:selected").html(); >@@ -586,7 +587,7 @@ > }); > [% END %] > [% IF closed %] >- var oTable = $("#closed_report").dataTable($.extend(true, {}, dataTablesDefaults, { >+ var oTable = $("#closed_report").kohaTable({ > // The following is a c/p from aqbudgets.tt and is a candidate for refactoring. > "drawCallback": function ( oSettings ) { > if ( oSettings.aiDisplay.length == 0 ) >@@ -622,7 +623,7 @@ > "orderFixed": [[ 1, 'asc' ]], > "autoWidth": false, > "pagingType": "full_numbers" >- })); >+ }); > [% END %] > $("#add_modify_budget").validate({ > rules: { >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/auth_subfields_structure.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/auth_subfields_structure.tt >index 9afca612843..e68e58a45ff 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/auth_subfields_structure.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/auth_subfields_structure.tt >@@ -411,13 +411,11 @@ > [% Asset.js("js/admin-menu.js") | $raw %] > <script> > $(document).ready(function() { >- $("#table_authsubfieldstructure").dataTable($.extend(true, {}, dataTablesDefaults, { >- "columnDefs": [ >- { 'sortable': false, 'targets': [ 'NoSort' ] } >- ], >+ $("#table_authsubfieldstructure").kohaTable({ >+ columnDefs: [{ sortable: false, targets: ["NoSort"] }], > aaSorting: [], >- paginate: false >- })); >+ paginate: false, >+ }); > > if ($("#subfieldtabs").length > 0) { > [% IF ( tagsubfield && tagsubfield == "@") %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/auth_tag_structure.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/auth_tag_structure.tt >index 18c400ba087..8e3bfbe1037 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/auth_tag_structure.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/auth_tag_structure.tt >@@ -298,12 +298,10 @@ > [% Asset.js("js/admin-menu.js") | $raw %] > <script> > $(document).ready(function() { >- $("#table_authtagstructure").dataTable($.extend(true, {}, dataTablesDefaults, { >- "columnDefs": [ >- { "targets": [ -1 ], "orderable": false, "searchable": false }, >- ], >- "pagingType": "full" >- })); >+ $("#table_authtagstructure").kohaTable({ >+ columnDefs: [{ targets: [-1], orderable: false, searchable: false }], >+ pagingType: "full", >+ }); > }); > </script> > [% END %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/branch_transfer_limits.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/branch_transfer_limits.tt >index 71cc0446c89..85b33038154 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/branch_transfer_limits.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/branch_transfer_limits.tt >@@ -167,12 +167,13 @@ > }) > }); > >- $(".sorted").dataTable($.extend(true, {}, dataTablesDefaults, { >- "columnDefs": [ >- { "targets": [ -1 ], "orderable": false, "searchable": false }, >- ], >- "paginate": false >- })); >+ >+ [% FOREACH codes_loo IN codes_loop %] >+ $("#[% codes_loo.code | html %]table").kohaTable({ >+ columnDefs: [{ targets: [-1], orderable: false, searchable: false }], >+ paginate: false, >+ }); >+ [% END %] > }); > </script> > [% END %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/cash_registers.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/cash_registers.tt >index 43e99fe29aa..2250ea8f8d6 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/cash_registers.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/cash_registers.tt >@@ -264,13 +264,11 @@ > } > > $(document).ready(function() { >- var crtable = $("#table_cash_registers").DataTable($.extend(true, {}, dataTablesDefaults, { >- "columnDefs": [ >- { "targets": [ -1, -2 ], "orderable": false, "searchable": false }, >- ], >- "order": [[ 1, "asc" ]], >- "paginationType": "full", >- })); >+ var crtable = $("#table_cash_registers").kohaTable({ >+ columnDefs: [{ targets: [-1, -2], orderable: false, searchable: false }], >+ order: [[1, "asc"]], >+ paginationType: "full", >+ }); > > $("#branch_filter").on("change", function(){ > // Table must be filtered by the <option>'s text, not its value >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/credit_types.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/credit_types.tt >index fa5f38deac9..0e755700902 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/credit_types.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/credit_types.tt >@@ -249,7 +249,7 @@ > $(document).ready(function() { > var txtActivefilter = _("Filter system credit types"); > var txtInactivefilter = _("Show all credit types"); >- var table_credit_types = $("#table_credit_types").dataTable($.extend(true, {}, dataTablesDefaults, { >+ var table_credit_types = $("#table_credit_types").kohaTable({ > "columnDefs": [ > { "targets": [ -1 ], "orderable": false, "searchable": false }, > { "targets": [ 0, 1 ], "orderable": false, "visible": false }, >@@ -258,7 +258,7 @@ > "dom": 'C<"top pager"ilpfB><"#filter_s">tr<"bottom pager"ip>', > "pageLength": 20, > "pagingType": "full_numbers" >- })); >+ }); > $("#filter_s").html('<p><a href="#" id="filter_system"><i class="fa fa-filter"></i> '+txtActivefilter+'</a>'); > $('#filter_system').click(function(e) { > e.preventDefault(); >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/debit_types.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/debit_types.tt >index 83dffd3e92c..3be2e230919 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/debit_types.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/debit_types.tt >@@ -269,7 +269,7 @@ > $(document).ready(function() { > var txtActivefilter = _("Filter system debit types"); > var txtInactivefilter = _("Show all debit types"); >- var table_debit_types = $("#table_debit_types").dataTable($.extend(true, {}, dataTablesDefaults, { >+ var table_debit_types = $("#table_debit_types").kohaTable({ > "columnDefs": [ > { "targets": [ -1 ], "orderable": false, "searchable": false }, > { "targets": [ 0, 1 ], "orderable": false, "visible": false }, >@@ -278,7 +278,7 @@ > "dom": 'C<"top pager"ilpfB><"#filter_s">tr<"bottom pager"ip>', > "pageLength": 20, > "pagingType": "full_numbers" >- })); >+ }); > $("#filter_s").html('<p><a href="#" id="filter_system"><i class="fa fa-filter"></i> '+txtActivefilter+'</a>'); > $('#filter_system').click(function(e) { > e.preventDefault(); >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/koha2marclinks.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/koha2marclinks.tt >index e941c0dd2d7..3e7dacd70cc 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/koha2marclinks.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/koha2marclinks.tt >@@ -114,12 +114,10 @@ > } > } > $(document).ready(function() { >- $("#kohafields").dataTable($.extend(true, {}, dataTablesDefaults, { >- "columnDefs": [ >- { "targets": [ -1 ], "orderable": false, "searchable": false }, >- ], >- "paging": false >- } )); >+ $("#kohafields").kohaTable({ >+ columnDefs: [{ targets: [-1], orderable: false, searchable: false }], >+ paging: false, >+ }); > > $(".addfld").on("click", function(e){ > e.preventDefault(); >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/localization.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/localization.tt >index fc500a8e31c..9210dfa6257 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/localization.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/localization.tt >@@ -184,14 +184,12 @@ > $(document).ready(function() { > $(".dialog").hide(); > >- var table = $("#localization").DataTable($.extend(true, {}, dataTablesDefaults, { >- "dom": 't', >- "columnDefs": [ >- { 'sortable': false, 'targets': [ 'NoSort' ] } >- ], >- "paginate": false, >- 'autoWidth': false, >- })); >+ var table = $("#localization").kohaTable({ >+ dom: "t", >+ columnDefs: [{ sortable: false, targets: ["NoSort"] }], >+ paginate: false, >+ autoWidth: false, >+ }); > > var languages_select = $('<select name="lang" id="lang"></select>'); > [% FOR language IN languages %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/marc-overlay-rules.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/marc-overlay-rules.tt >index 7b7d1894a3b..9ffe3c95986 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/marc-overlay-rules.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/marc-overlay-rules.tt >@@ -364,7 +364,7 @@ > }); > } > >- $('#marc-overlay-rules').dataTable($.extend(true, {}, dataTablesDefaults, { >+ $('#marc-overlay-rules').kohaTable({ > "columns": [ > {"searchable": false, "orderable": false}, > {"orderDataType": "dom-input"}, >@@ -379,7 +379,7 @@ > {"searchable": false, "orderable": false} > ], > "pagingType": "simple" >- })); >+ }); > > var overlay_rules_presets = {}; > overlay_rules_presets["protect"] = { >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/marctagstructure.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/marctagstructure.tt >index dff8b2f5041..b2486edb6f4 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/marctagstructure.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/marctagstructure.tt >@@ -311,12 +311,10 @@ > [% Asset.js("js/admin-menu.js") | $raw %] > <script> > $(document).ready(function() { >- $("#table_marctagstructure").dataTable($.extend(true, {}, dataTablesDefaults, { >- "columnDefs": [ >- { "targets": [ -1 ], "orderable": false, "searchable": false }, >- ], >- "pagingType": "full" >- })); >+ $("#table_marctagstructure").kohaTable({ >+ columnDefs: [{ targets: [-1], orderable: false, searchable: false }], >+ pagingType: "full", >+ }); > $("#select_display").on("change",function(){ > var checked = $(this).prop("checked") ? 1: 0; > Cookies.set("marctagstructure_selectdisplay", checked, { sameSite: 'Lax' }); >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/oai_servers.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/oai_servers.tt >index e4162e41a1e..430d9fb4d02 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/oai_servers.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/oai_servers.tt >@@ -221,12 +221,10 @@ > }); > [% ELSE %] > $(document).ready(function() { >- $("#serverst").dataTable($.extend(true, {}, dataTablesDefaults, { >- "columnDefs": [ >- { 'sortable': false, 'targets': [ 'NoSort' ] } >- ], >- "pagingType": "full", >- })); >+ $("#serverst").kohaTable({ >+ columnDefs: [{ sortable: false, targets: ["NoSort"] }], >+ pagingType: "full", >+ }); > $(".delete").on("click",function(e){ > var servername = $(this).data("servername"); > let formid = $(this).data("formid"); >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/overdrive.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/overdrive.tt >index 3fb27186088..59839acd88d 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/overdrive.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/overdrive.tt >@@ -84,12 +84,10 @@ > [% INCLUDE 'datatables.inc' %] > <script> > $(document).ready(function() { >- $("#od_info").dataTable($.extend(true, {}, dataTablesDefaults, { >- "columnDefs": [ >- { "targets": [ -1 ], "orderable": false, "searchable": false }, >- ], >- "pagingType": "full" >- })); >+ $("#od_info").kohaTable({ >+ columnDefs: [{ targets: [-1], orderable: false, searchable: false }], >+ pagingType: "full", >+ }); > }); > </script> > [% END %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/systempreferences.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/systempreferences.tt >index 114744d15c6..40822e3a3b0 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/systempreferences.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/systempreferences.tt >@@ -462,13 +462,13 @@ > [% INCLUDE 'datatables.inc' %] > <script> > $(document).ready(function() { >- [% IF ( loop ) %]$("#sysprefst").dataTable($.extend(true, {}, dataTablesDefaults, { >- "dom": '<"top pager"ilf>t', >- "columnDefs": [ >- { "targets": [ -1, -2, -3 ], "orderable": false } >- ], >- "paginate": false >- }));[% END %] >+ [% IF ( loop ) %] >+ $("#sysprefst").kohaTable({ >+ dom: '<"top pager"ilf>t', >+ columnDefs: [{ targets: [-1, -2, -3], orderable: false }], >+ paginate: false, >+ }); >+ [% END %] > }); > </script> > [% END %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/z3950servers.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/z3950servers.tt >index 842aff59a6d..b7063483e10 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/z3950servers.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/z3950servers.tt >@@ -326,12 +326,10 @@ > } > [% ELSE %] > $(document).ready(function() { >- $("#serverst").dataTable($.extend(true, {}, dataTablesDefaults, { >- "columnDefs": [ >- { "targets": [-1], "orderable": false, "searchable": false }, >- ], >- "pagingType": "full" >- })); >+ $("#serverst").kohaTable({ >+ columnDefs: [{ targets: [-1], orderable: false, searchable: false }], >+ pagingType: "full", >+ }); > $(".delete").on("click",function(e){ > var servername = $(this).data("servername"); > let formid = $(this).data("formid"); >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >index 00c00d00861..477116e6bf1 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >@@ -2032,13 +2032,13 @@ > [% END %] > > [% IF suggestions.count %] >- $(".sorted").dataTable($.extend(true, {}, dataTablesDefaults, { >- "columnDefs": [ >- { "orderable": false, "searchable": false, "targets": [ 'NoSort' ] }, >- { "type": "anti-the", "targets": [ "anti-the" ] } >+ $("#suggestions").kohaTable({ >+ columnDefs: [ >+ { orderable: false, searchable: false, targets: ["NoSort"] }, >+ { type: "anti-the", targets: ["anti-the"] }, > ], >- "pagingType": "full" >- })); >+ pagingType: "full", >+ }); > [% END %] > > [% IF ( reviews ) %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/search-history.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/search-history.tt >index 2bb748d05c2..fa7fbf8b782 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/search-history.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/search-history.tt >@@ -227,13 +227,11 @@ > $(document).ready(function() { > // We show table ordered by descending dates by default > // (so that the more recent query is shown first) >- $(".historyt").dataTable($.extend(true, {}, dataTablesDefaults, { >- "order": [[ 1, "desc" ]], >- "columnDefs": [ >- { "targets": [ 0 ], "orderable": false, "searchable": false } >- ], >- "pagingType": "full_numbers" >- })); >+ $(".historyt").kohaTable({ >+ order: [[1, "desc"]], >+ columnDefs: [{ targets: [0], orderable: false, searchable: false }], >+ pagingType: "full_numbers", >+ }); > > // DataTables removes hidden rows from the DOM, so we can't expect a > // "regular" submit to work and we need to build another form containing >@@ -242,7 +240,7 @@ > e.preventDefault(); > > var form = $(this); >- var table = form.find('table').dataTable(); >+ var table = form.find('table').kohaTable(); > > var new_form = $('<form>') > .attr('action', form.attr('action')) >@@ -280,7 +278,7 @@ > $(".action_delete").click(function(e){ > e.preventDefault(); > var form = $(this).parents("form").first(); >- var table = form.find('table').dataTable(); >+ var table = form.find('table').kohaTable(); > var ids = $("input:checkbox:checked", table); > if ( $(ids).length < 1 ) { > return false; >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/z3950_auth_search.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/z3950_auth_search.tt >index edd4fe08d2c..efe79dd2415 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/z3950_auth_search.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/z3950_auth_search.tt >@@ -233,14 +233,12 @@ > [% Asset.js("js/z3950_search.js") | $raw %] > <script> > $(document).ready(function(){ >- $("#resultst").dataTable($.extend(true, {}, dataTablesDefaults, { >- "dom": 't', >- "columnDefs": [ >- { "targets": [ -1 ], "orderable": false, "searchable": false }, >- ], >- "order": [[ 1, "asc" ]], >- "paginate": false >- })); >+ $("#resultst").kohaTable({ >+ dom: "t", >+ columnDefs: [{ targets: [-1], orderable: false, searchable: false }], >+ order: [[1, "asc"]], >+ paginate: false, >+ }); > InitLastAction(); > }); > </script> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/article-requests.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/article-requests.tt >index 1453e7c3276..092a9bfc6ac 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/article-requests.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/article-requests.tt >@@ -582,22 +582,15 @@ > if( link.length > 0 ) link[0].focus(); > }); > >- requested_datatable = $("#article-requests-requested-table").DataTable($.extend(true, {}, dataTablesDefaults, { >- "columnDefs": [ >- { "targets": [0, -1], "orderable": false, "searchable": false }, >- ], >- })); >- >- pending_datatable = $("#article-requests-pending-table").DataTable($.extend(true, {}, dataTablesDefaults, { >- "columnDefs": [ >- { "targets": [0, -1], "orderable": false, "searchable": false }, >- ], >- })); >- processing_datatable = $("#article-requests-processing-table").DataTable($.extend(true, {}, dataTablesDefaults, { >- "columnDefs": [ >- { "targets": [0, -1], "orderable": false, "searchable": false }, >- ], >- })); >+ requested_datatable = $("#article-requests-requested-table").kohaTable({ >+ columnDefs: [{ targets: [0, -1], orderable: false, searchable: false }], >+ }); >+ pending_datatable = $("#article-requests-pending-table").kohaTable({ >+ columnDefs: [{ targets: [0, -1], orderable: false, searchable: false }], >+ }); >+ processing_datatable = $("#article-requests-processing-table").kohaTable({ >+ columnDefs: [{ targets: [0, -1], orderable: false, searchable: false }], >+ }); > active_datatable = requested_datatable; > activateBatchActions( active_tab ); > $(".starthidden").show(); >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/checkout-notes.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/checkout-notes.tt >index 96e7527fc7c..b79e67362ee 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/checkout-notes.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/checkout-notes.tt >@@ -142,14 +142,14 @@ > [% INCLUDE 'datatables.inc' %] > <script> > $(document).ready(function(){ >- $("#notestable").dataTable($.extend(true, {}, dataTablesDefaults, { >- "order": [[ 1, "asc" ]], >- "columnDefs": [ >- { "orderable": false, "searchable": false, 'targets': [ 'NoSort' ] }, >- { "type": "anti-the", "targets": [ "anti-the" ] } >+ $("#notestable").kohaTable({ >+ order: [[1, "asc"]], >+ columnDefs: [ >+ { orderable: false, searchable: false, targets: ["NoSort"] }, >+ { type: "anti-the", targets: ["anti-the"] }, > ], >- "pagingType": "full" >- })); >+ pagingType: "full", >+ }); > > $(".SelectAll").on("click", function(){ > $("input[name='issue_ids'][type='checkbox']").prop("checked", true); >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation_batch_checkouts.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation_batch_checkouts.tt >index a6a1c86dec1..2f3238e43c6 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation_batch_checkouts.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation_batch_checkouts.tt >@@ -363,15 +363,15 @@ > } else if ($('#checkoutrenew').length) { > $('#checkoutrenew').focus(); > } >- $("#checkout_infos").dataTable($.extend(true, {}, dataTablesDefaults, { >- "dom": 't', >- "order": [], >- "columnDefs": [ >- { "orderable": false, "searchable": false, "targets": [ 'NoSort' ] }, >- { "type": "anti-the", "targets": [ "anti-the" ] } >+ $("#checkout_infos").kohaTable({ >+ dom: "t", >+ order: [], >+ columnDefs: [ >+ { orderable: false, searchable: false, targets: ["NoSort"] }, >+ { type: "anti-the", targets: ["anti-the"] }, > ], >- "paginate": false >- })); >+ paginate: false, >+ }); > }); > // On-site batch checkout > function toggle_onsite_checkout(){ >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/on-site_checkouts.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/on-site_checkouts.tt >index 5aadfdd2b51..f0f2dda2afd 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/on-site_checkouts.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/on-site_checkouts.tt >@@ -101,7 +101,7 @@ > <script> > $(document).ready(function(){ > if ( $("#pending_onsite_checkout").length ) { >- $("#pending_onsite_checkout").dataTable($.extend(true, {}, dataTablesDefaults)); >+ $("#pending_onsite_checkout").kohaTable(); > } > }); > </script> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt >index 6f091f67a6e..cf42ce558c3 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt >@@ -1700,12 +1700,15 @@ > }); > }); > >- $('#items-bundle-contents-table').dataTable($.extend(true, {}, dataTablesDefaults, { >- "searching": false, >- "paginate": false, >- "info": false, >- "order": [[ 1, 'asc' ], [ 0, 'asc' ]] >- })); >+ $("#items-bundle-contents-table").kohaTable({ >+ searching: false, >+ paginate: false, >+ info: false, >+ order: [ >+ [1, "asc"], >+ [0, "asc"], >+ ], >+ }); > > [% IF ( !(Koha.Preference('TransfersBlockCirc')) && Koha.Preference('AutomaticConfirmTransfer') ) %] > $("#wrong-transfer-modal").on('hidden.bs.modal',function(){ >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/transfers_to_send.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/transfers_to_send.tt >index 4c058f2589e..26c3c6ff31e 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/transfers_to_send.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/transfers_to_send.tt >@@ -120,14 +120,14 @@ > <script> > $(document).ready(function() { > [% FOREACH library IN libraries %] >- $("#transferst[% library.branchcode | html %]").dataTable($.extend(true, {}, dataTablesDefaults, { >- "columnDefs": [ >- { "targets": [ -1 ], "orderable": false, "searchable": false }, >- { "type": "anti-the", "targets": [ "anti-the" ] } >- ], >- "dom": 't', >- "paginate": false >- })); >+ $("#transferst[% library.branchcode | html %]").kohaTable({ >+ columnDefs: [ >+ { targets: [-1], orderable: false, searchable: false }, >+ { type: "anti-the", targets: ["anti-the"] }, >+ ], >+ dom: "t", >+ paginate: false, >+ }); > [% END %] > }); > </script> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/transferstoreceive.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/transferstoreceive.tt >index 3eb34e8a832..b5a0c1f4b49 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/transferstoreceive.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/transferstoreceive.tt >@@ -124,14 +124,14 @@ > <script> > $(document).ready(function() { > [% FOREACH branchesloo IN branchesloop %] >- $("#transferst[% branchesloo.branchcode | html %]").dataTable($.extend(true, {}, dataTablesDefaults, { >- "columnDefs": [ >- { "targets": [ -1 ], "orderable": false, "searchable": false }, >- { "type": "anti-the", "targets": [ "anti-the" ] } >- ], >- "dom": 't', >- "paginate": false >- })); >+ $("#transferst[% branchesloo.branchcode | html %]").kohaTable({ >+ columnDefs: [ >+ { targets: [-1], orderable: false, searchable: false }, >+ { type: "anti-the", targets: ["anti-the"] }, >+ ], >+ dom: "t", >+ paginate: false, >+ }); > [% END %] > }); > </script> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/club-enrollments.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/club-enrollments.tt >index 9b291153be4..45d9138f62f 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/club-enrollments.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/club-enrollments.tt >@@ -107,13 +107,11 @@ > [% Asset.js("js/tools-menu.js") | $raw %] > <script> > $(document).ready(function() { >- eTable = $('#enrollments-table').dataTable($.extend(true, {}, dataTablesDefaults, { >- "pagingType": "full", >- "dom": 'C<"top pager"ilpf><"#filter_c">tr<"bottom pager"ip>', >- "columnDefs": [ >- { "targets": [ -1, -2 ], "orderable": false, "searchable": false }, >- ] >- } )); >+ eTable = $("#enrollments-table").kohaTable({ >+ pagingType: "full", >+ dom: 'C<"top pager"ilpf><"#filter_c">tr<"bottom pager"ip>', >+ columnDefs: [{ targets: [-1, -2], orderable: false, searchable: false }], >+ }); > }); > </script> > [% END %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/clubs.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/clubs.tt >index 7ccbcffcad2..6411fc0fb7c 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/clubs.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/clubs.tt >@@ -165,21 +165,17 @@ > [% Asset.js("js/tools-menu.js") | $raw %] > <script> > $(document).ready(function() { >- tTable = $('#club-templates-table').dataTable($.extend(true, {}, dataTablesDefaults, { >- "pagingType": "full", >- "dom": 'C<"top pager"ilpf><"#filter_c">tr<"bottom pager"ip>', >- "columnDefs": [ >- { "targets": [ -1 ], "orderable": false, "searchable": false }, >- ] >- } )); >- >- cTable = $('#clubs-table').dataTable($.extend(true, {}, dataTablesDefaults, { >- "pagingType": "full", >- "dom": 'C<"top pager"ilpf><"#filter_c">tr<"bottom pager"ip>', >- "columnDefs": [ >- { "targets": [ -1 ], "orderable": false, "searchable": false }, >- ] >- } )); >+ tTable = $("#club-templates-table").kohaTable({ >+ pagingType: "full", >+ dom: 'C<"top pager"ilpf><"#filter_c">tr<"bottom pager"ip>', >+ columnDefs: [{ targets: [-1], orderable: false, searchable: false }], >+ }); >+ >+ cTable = $("#clubs-table").kohaTable({ >+ pagingType: "full", >+ dom: 'C<"top pager"ilpf><"#filter_c">tr<"bottom pager"ip>', >+ columnDefs: [{ targets: [-1], orderable: false, searchable: false }], >+ }); > > $("body").on("click", ".delete_club", function(e){ > e.preventDefault(); >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/patron-clubs-tab.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/patron-clubs-tab.tt >index 855683ea266..15d3a76eff9 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/patron-clubs-tab.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/patron-clubs-tab.tt >@@ -67,12 +67,12 @@ > [% END %] > > <script> >-$("#table_clubnoenrollmemnts, #table_clubenrollments").dataTable($.extend(true, {}, dataTablesDefaults, { >- "columnDefs": [ >- { 'sortable': false, 'targets': [ 'NoSort' ] } >- ], >- paginate: true >-})); >+let dt_params = { >+ columnDefs: [{ sortable: false, targets: ["NoSort"] }], >+ paginate: true, >+}; >+$("#table_clubnoenrollmemnts").kohaTable(dt_params); >+$("#table_clubenrollments").kohaTable(dt_params); > > [% IF CAN_user_clubs_enroll %] > function loadEnrollmentForm( id, enrollent_id = 0 ) { >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-edit-batch.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-edit-batch.tt >index a2ce9ac4900..9809b940517 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-edit-batch.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-edit-batch.tt >@@ -333,15 +333,15 @@ > [% ELSE %] > $("#description").hide(); > [% END %] >- $("#batcht").dataTable($.extend(true, {}, dataTablesDefaults, { >- "autoWidth": false, >- "columnDefs": [ >- { "type": "anti-the", "targets": [ "anti-the" ] }, >- { "targets": [ -1, -2 ], "orderable": false, "searchable": false }, >+ $("#batcht").kohaTable({ >+ autoWidth: false, >+ columnDefs: [ >+ { type: "anti-the", targets: ["anti-the"] }, >+ { targets: [-1, -2], orderable: false, searchable: false }, > ], >- "order": [[ 0, "asc" ]], >- "pagingType": "full" >- })); >+ order: [[0, "asc"]], >+ pagingType: "full", >+ }); > $("#additems").click(function(){ > Add(); > return false; >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-manage.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-manage.tt >index c94ab771e3d..fd7e45867c4 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-manage.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-manage.tt >@@ -194,13 +194,11 @@ > $(".delete").on("click", function(){ > return confirmDelete( _("Are you sure you want to delete this?") ); > }); >- $("#labels-table").dataTable($.extend(true, {}, dataTablesDefaults, { >- "pagingType": "full", >- "order": [[ 1, "asc" ]], >- "columnDefs": [ >- { "targets": [ -1 ], "orderable": false, "searchable": false }, >- ] >- })); >+ $("#labels-table").kohaTable({ >+ pagingType: "full", >+ order: [[1, "asc"]], >+ columnDefs: [{ targets: [-1], orderable: false, searchable: false }], >+ }); > }); > </script> > [% END %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/alert-subscriptions.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/alert-subscriptions.tt >index 30521c9908a..42a3726cb60 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/alert-subscriptions.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/alert-subscriptions.tt >@@ -105,8 +105,7 @@ > [% INCLUDE 'datatables.inc' %] > <script> > $(document).ready(function() { >- $("#subscriptions").dataTable($.extend(true, {}, dataTablesDefaults, { >- })); >+ $("#subscriptions").kohaTable(); > $(".unsubscribe").submit(function(){ > var patron = $(this).data('patron'); > var title = $(this).data('title'); >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/discharges.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/discharges.tt >index d7c19cb018e..daa31fbe252 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/discharges.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/discharges.tt >@@ -74,7 +74,7 @@ > [% INCLUDE 'datatables.inc' %] > <script> > $(document).ready(function() { >- $('#pending_updates table').DataTable($.extend(true, {}, dataTablesDefaults, { >+ $('#pending_updates table').kohaTable({ > paging: false, > info: true, > searching: true, >@@ -82,7 +82,7 @@ > columnDefs: [ > { targets: -1, orderable: false } > ], >- })); >+ )); > }); > </script> > [% END %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/notices.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/notices.tt >index a9920782018..6fb6e6092d9 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/notices.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/notices.tt >@@ -164,10 +164,10 @@ > [% INCLUDE 'datatables.inc' %] > <script> > $(document).ready(function() { >- $("#noticestable").dataTable($.extend(true, {}, dataTablesDefaults, { >- "order": [[ 3, "desc" ]], >- "pagingType": "full" >- })); >+ $("#noticestable").kohaTable({ >+ order: [[3, "desc"]], >+ pagingType: "full", >+ }); > > $("#noticestable").on("click", ".notice-title", function(e){ > e.preventDefault(); >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/purchase-suggestions.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/purchase-suggestions.tt >index 34bb11213fd..09650329680 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/purchase-suggestions.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/purchase-suggestions.tt >@@ -142,12 +142,12 @@ > [% INCLUDE 'datatables.inc' %] > <script> > $(document).ready(function() { >- $("#suggestions").dataTable($.extend(true, {}, dataTablesDefaults, { >- "paginate": false, >- "searching": false, >- "info": false, >- "dom": 't' >- } )); >+ $("#suggestions").kohaTable({ >+ paginate: false, >+ searching: false, >+ info: false, >+ dom: "t", >+ }); > }); > </script> > [% END %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/statistics.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/statistics.tt >index 327713c5cf7..72c85391d00 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/statistics.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/statistics.tt >@@ -114,10 +114,10 @@ > [% INCLUDE 'datatables.inc' %] > <script> > $(document).ready(function() { >- $("#statistics").dataTable($.extend(true, {}, dataTablesDefaults, { >- "dom": 't', >- "paginate": false >- })); >+ $("#statistics").kohaTable({ >+ dom: "t", >+ paginate: false, >+ }); > }); > </script> > [% END %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/update-child.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/update-child.tt >index 617d9928806..022918d82da 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/update-child.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/update-child.tt >@@ -64,14 +64,12 @@ > <script> > > $(document).ready(function() { >- $("#catst").dataTable($.extend(true, {}, dataTablesDefaults, { >- "dom": 't', >- "order": [[ 2, "asc" ]], >- "columnDefs": [ >- { "targets": [ 0 ], "orderable": false, "searchable": false } >- ], >- "paginate": false >- })); >+ $("#catst").kohaTable({ >+ dom: "t", >+ order: [[2, "asc"]], >+ columnDefs: [{ targets: [0], orderable: false, searchable: false }], >+ paginate: false, >+ }); > $("#updatechildf").validate({ > rules: { > catcode: { >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/patron_lists/lists.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/patron_lists/lists.tt >index 19b3e305d29..bb0eba04737 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/patron_lists/lists.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/patron_lists/lists.tt >@@ -156,13 +156,11 @@ > > let selectedPatronLists = new Array(); > >- $('#patron-lists-table').dataTable($.extend(true, {}, dataTablesDefaults, { >- "autoWidth": false, >- "columnDefs": [ >- { "orderable": false, "searchable": false, "targets": [ 'NoSort' ] } >- ], >- "pagingType": "full" >- } )); >+ $("#patron-lists-table").kohaTable({ >+ autoWidth: false, >+ columnDefs: [{ orderable: false, searchable: false, targets: ["NoSort"] }], >+ pagingType: "full", >+ }); > $(".delete_patron").on("click", function(){ > $(".dropdown").removeClass("open"); > var list = $(this).data("list-name"); >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/patron_lists/patron-lists-tab.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/patron_lists/patron-lists-tab.tt >index 92f339b135f..22cb62e57d2 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/patron_lists/patron-lists-tab.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/patron_lists/patron-lists-tab.tt >@@ -104,12 +104,12 @@ > [% END %] > > <script> >- $("#table_listnopatron, #table_inlists").dataTable($.extend(true, {}, dataTablesDefaults, { >- "columnDefs": [ >- { 'sortable': false, "bSearchable": false, 'targets': [ 'NoSort' ] } >- ], >- "sPaginationType": "full" >- })); >+ let dt_params = { >+ columnDefs: [{ sortable: false, bSearchable: false, targets: ["NoSort"] }], >+ sPaginationType: "full", >+ }; >+ $("#table_listnopatron").kohaTable(dt_params); >+ $("#table_inlists").kohaTable(dt_params); > > [% IF CAN_user_tools_manage_patron_lists %] > function addToList() { >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/patroncards/edit-batch.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/patroncards/edit-batch.tt >index 55873393ad9..6ca730085c3 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/patroncards/edit-batch.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/patroncards/edit-batch.tt >@@ -309,16 +309,14 @@ > [% ELSE %] > $("#description").hide(); > [% END %] >- $("#batcht").dataTable($.extend(true, {}, dataTablesDefaults, { >- "columnDefs": [ >- { "targets": [ -2, -1 ], "orderable": false, "searchable": false } >- ], >- "order": [[ 0, "asc" ]], >- "pagingType": "full", >- "lengthMenu": [aLengthMenu, aLengthMenuLabel], >- "pageLength": patronsPerPage, >- "autoWidth": false >- })); >+ $("#batcht").kohaTable({ >+ columnDefs: [{ targets: [-2, -1], orderable: false, searchable: false }], >+ order: [[0, "asc"]], >+ pagingType: "full", >+ lengthMenu: [aLengthMenu, aLengthMenuLabel], >+ pageLength: patronsPerPage, >+ autoWidth: false, >+ }); > $("#additems").click(function(){ > return Add(); > }); >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/pos/pay.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/pos/pay.tt >index 43d2564645b..058585c83c2 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/pos/pay.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/pos/pay.tt >@@ -334,7 +334,7 @@ > > $(document).ready(function() { > const sale_table = document.getElementById('sale'); >- const saleDataTable = $("#sale").DataTable($.extend(true, {}, dataTablesDefaults, { >+ const saleDataTable = $("#sale").kohaTable({ > "paginate": false, > "searching": false, > "info": false, >@@ -383,7 +383,7 @@ > $('#paid').val(total_price).trigger('change'); > }, > "autoWidth": false >- })); >+ }); > > $("#sale").on("click", "button.drop", function(){ > saleDataTable.row($(this).parents('tr')).remove().draw(false); >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/pos/register.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/pos/register.tt >index e449fef31c7..e09834e9659 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/pos/register.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/pos/register.tt >@@ -355,7 +355,7 @@ > [% Asset.js("js/modal_printer.js") | $raw %] > [% INCLUDE 'calendar.inc' %] > <script> >- var sales_table = $("#sales").dataTable($.extend(true, {}, dataTablesDefaults, { >+ var sales_table = $("#sales").kohaTable({ > orderFixed: [ 0, 'asc'], > ordering: false, > columnDefs: [ { >@@ -380,9 +380,9 @@ > initComplete: function() { > $("#sales").show(); > } >- })); >+ }); > >- var past_sales_table = $("#past_sales").dataTable($.extend(true, {}, dataTablesDefaults, { >+ var past_sales_table = $("#past_sales").kohaTable({ > orderFixed: [ 0, 'asc'], > ordering: false, > columnDefs: [ { >@@ -402,7 +402,7 @@ > }, > endRender: null, > } >- })); >+ }); > > $("#issueRefundModal").on("shown.bs.modal", function(e){ > var button = $(e.relatedTarget); >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/pos/registers.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/pos/registers.tt >index be750d4e5e8..9d6950a761f 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/pos/registers.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/pos/registers.tt >@@ -209,10 +209,10 @@ > $("#income").text('[% ctotal | $Price %] ([% cctotal | $Price %])'); > $("#outgoing").text('[% dtotal | $Price %] ([% cdtotal | $Price %])'); > >- var registers_table = $("#registers").dataTable($.extend(true, {}, dataTablesDefaults, { >- "searching": false, >- "paginationType": "full" >- })); >+ var registers_table = $("#registers").kohaTable({ >+ searching: false, >+ paginationType: "full", >+ }); > > $("#confirmCashupModal").on("shown.bs.modal", function(e){ > var button = $(e.relatedTarget); >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/recalls/recalls_to_pull.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/recalls/recalls_to_pull.tt >index b2af89c0521..1c5736cf6c0 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/recalls/recalls_to_pull.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/recalls/recalls_to_pull.tt >@@ -166,14 +166,14 @@ > [% INCLUDE 'columns_settings.inc' %] > <script> > $(document).ready(function(){ >- $("#recalls-table").dataTable($.extend(true, {}, dataTablesDefaults, { >- "columnDefs": [ >- { "orderable": false, "targets": [ 'nosort' ] }, >- { "type": "title-string", "targets": [ "title-string" ] }, >- { "type": "anti-the", "targets": [ "anti-the" ] } >+ $("#recalls-table").kohaTable({ >+ columnDefs: [ >+ { orderable: false, targets: ["nosort"] }, >+ { type: "title-string", targets: ["title-string"] }, >+ { type: "anti-the", targets: ["anti-the"] }, > ], >- "pagingType": "full_numbers" >- })); >+ pagingType: "full_numbers", >+ }); > > $(".cancelreturn").click(function(){ > return confirmDelete(_("Are you sure you want to remove this recall and return the item to its home library?")); >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/recalls/recalls_waiting.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/recalls/recalls_waiting.tt >index a2adf81e9b8..632de94a16f 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/recalls/recalls_waiting.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/recalls/recalls_waiting.tt >@@ -166,13 +166,11 @@ > [% INCLUDE 'columns_settings.inc' %] > <script> > $(document).ready(function() { >- $("#recallswaiting-table, #recallsover-table").dataTable($.extend(true, {}, dataTablesDefaults, { >- "autoWidth": false, >- "columnDefs": [ >- { "orderable": false, "targets": [ 'nosort' ] }, >- ], >- "pagingType": "full_numbers" >- })); >+ $("#recallswaiting-table, #recallsover-table").kohaTable({ >+ autoWidth: false, >+ columnDefs: [{ orderable: false, targets: ["nosort"] }], >+ pagingType: "full_numbers", >+ }); > > $(".revert_recall").click(function(e) { > return confirmDelete(_("Are you sure you want to revert this recall's status from Waiting?")); >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/cash_register_stats.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/cash_register_stats.tt >index de68d3cedda..466ffe62371 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/cash_register_stats.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/cash_register_stats.tt >@@ -218,10 +218,10 @@ > <script> > actTotal = ""; > $(document).ready(function() { >- $("#tbl_cash_register_stats").dataTable($.extend(true, {}, dataTablesDefaults, { >- "pageLength": 50, >- "pagingType": "full_numbers" >- })); >+ $("#tbl_cash_register_stats").kohaTable({ >+ pageLength: 50, >+ pagingType: "full_numbers", >+ }); > > $("#branch").on("change", function() { > var selectedBranch = $("#branch").children( >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt >index cdba5aad888..127e9f42a3a 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt >@@ -2404,7 +2404,7 @@ > $(".mana_search_status").hide(); > $("#mana_search_result_label").text(_("Results from Mana Knowledge Base")); > $("#mana-loading").hide(); >- $("#mana_results_datatable").dataTable($.extend(true, {}, dataTablesDefaults,{ >+ $("#mana_results_datatable").kohaTable({ > "pagingType": "full", > "autoWidth": false, > "columnDefs": [ >@@ -2414,7 +2414,7 @@ > { "orderable": false, "searchable": false, "targets": [ 'NoSort' ] }, > { "type": "anti-the", "targets": [ 'anti-the'] } > ] >- })); >+ }); > > $(".showbutton").on("click", function(e){ > e.preventDefault(); >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/itemtypes.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/itemtypes.tt >index b280d104d42..301a16cf155 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/itemtypes.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/itemtypes.tt >@@ -111,10 +111,10 @@ > [% INCLUDE 'datatables.inc' %] > <script> > $(document).ready(function(){ >- $("#itemtypest").dataTable($.extend(true, {}, dataTablesDefaults, { >- "dom": 't', >- "paginate": false >- })); >+ $("#itemtypest").kohaTable({ >+ dom: "t", >+ paginate: false, >+ }); > }); > </script> > [% END %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/serials_stats.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/serials_stats.tt >index 551efed0832..e74a04a669f 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/serials_stats.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/serials_stats.tt >@@ -170,9 +170,9 @@ > [% INCLUDE 'datatables.inc' %] > <script> > $(document).ready(function() { >- $("#resulttable").dataTable($.extend(true, {}, dataTablesDefaults, { >- "paginate": false, >- })); >+ $("#resulttable").kohaTable({ >+ paginate: false, >+ }); > }); > </script> > [% END %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt >index 22bd8a8ab9e..038354e02c7 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt >@@ -1568,11 +1568,10 @@ > }); > [% END %] > >- var my_table = $("#requestspecific").dataTable($.extend(true, {}, dataTablesDefaults, { >- "paginate": false, >- "dom": '<"top pager"ilf>t', >- })); >- >+ var my_table = $("#requestspecific").kohaTable({ >+ paginate: false, >+ dom: '<"top pager"ilf>t', >+ }); > > $("#club-request-form").on("submit", function() { > let $t = $(this); >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/claims.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/claims.tt >index 8972144c207..8cd485aeb0e 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/claims.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/claims.tt >@@ -245,14 +245,14 @@ > <script> > var sTable; > $(document).ready(function() { >- sTable = $("#claimst").dataTable($.extend(true, {}, dataTablesDefaults, { >- "dom": 't', >- "columnDefs": [ >- { "targets": [ 0 ], "orderable": false, "searchable": false }, >- { "type": "anti-the", "targets": [ 'anti-the'] } >+ sTable = $("#claimst").kohaTable({ >+ dom: "t", >+ columnDefs: [ >+ { targets: [0], orderable: false, searchable: false }, >+ { type: "anti-the", targets: ["anti-the"] }, > ], >- "paginate": false >- })); >+ paginate: false, >+ }); > $('#supplierid').change(function() { > $('#claims').submit(); > }); >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-collection.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-collection.tt >index 25de1031a8b..38138c8770e 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-collection.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-collection.tt >@@ -365,17 +365,15 @@ > if( $("#subscription_years .tab-pane.active").length < 1 ){ > $("#subscription_years a:first").tab("show"); > } >- $(".subscription-year-table").dataTable($.extend(true, {}, dataTablesDefaults, { >- "columnDefs": [ >- { "targets": [ 0,-1 ], "orderable": false, "searchable": false } >- ], >- "order": [[0, 'desc']], >- "dom": 't', >- "autoWidth": false, >- "paginate": false, >- "info": false, >- "searching": false, >- } )); >+ $(".subscription-year-table").kohaTable({ >+ columnDefs: [{ targets: [0, -1], orderable: false, searchable: false }], >+ order: [[0, "desc"]], >+ dom: "t", >+ autoWidth: false, >+ paginate: false, >+ info: false, >+ searching: false, >+ }); > > $(".CheckAll").on("click", function(e){ > e.preventDefault(); >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-search.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-search.tt >index 8305cebeafe..452493410c1 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-search.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-search.tt >@@ -345,32 +345,32 @@ > } > > $(document).ready(function() { >- var osrlt = $("#opened_panel table").dataTable($.extend(true, {}, dataTablesDefaults, { >- "pagingType": "full", >- "order": [[ 2, "asc" ]], >- "columnDefs": [ >- { "orderable": false, "searchable": false, "targets": [ 'NoSort' ] }, >- { "type": "anti-the", "targets": [ 'anti-the'] } >- ] >- })); >- >- var csrlt = $("#closed_panel table").dataTable($.extend(true, {}, dataTablesDefaults, { >+ var osrlt = $("#opened_panel table").kohaTable({ >+ pagingType: "full", >+ order: [[2, "asc"]], >+ columnDefs: [ >+ { orderable: false, searchable: false, targets: ["NoSort"] }, >+ { type: "anti-the", targets: ["anti-the"] }, >+ ], >+ }); >+ >+ var csrlt = $("#closed_panel table").kohaTable({ > // FIXME sort function of additional_fields! >- "order": [[ 2, "asc" ]], >- "pagingType": "full", >- "columnDefs": [ >- { "orderable": false, "targets": [ 'NoSort' ] }, >- { "type": "anti-the", "targets": [ 'anti-the'] } >- ] >- })); >- >- var manarlt = $("#mana_results_datatable").dataTable($.extend(true, {}, dataTablesDefaults, { >- "pagingType": "full", >- "columnDefs": [ >- { "orderable": false, "searchable": false, "targets": [ 'NoSort' ] }, >- { "type": "anti-the", "targets": [ 'anti-the'] } >- ] >- })); >+ order: [[2, "asc"]], >+ pagingType: "full", >+ columnDefs: [ >+ { orderable: false, targets: ["NoSort"] }, >+ { type: "anti-the", targets: ["anti-the"] }, >+ ], >+ }); >+ >+ var manarlt = $("#mana_results_datatable").kohaTable({ >+ pagingType: "full", >+ columnDefs: [ >+ { orderable: false, searchable: false, targets: ["NoSort"] }, >+ { type: "anti-the", targets: ["anti-the"] }, >+ ], >+ }); > > $("#reopensub").click(function(){ > return confirm(_("Are you sure you want to reopen this subscription?")); >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-numberpatterns.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-numberpatterns.tt >index e9fbe2d539b..b5e48432224 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-numberpatterns.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-numberpatterns.tt >@@ -404,12 +404,10 @@ > } > $(document).ready(function(){ > >- $("#numberpatternst").dataTable($.extend(true, {}, dataTablesDefaults, { >- "columnDefs": [ >- { "targets": [ -1 ], "orderable": false, "searchable": false }, >- ], >- "pagingType": "full" >- })); >+ $("#numberpatternst").kohaTable({ >+ columnDefs: [{ targets: [-1], orderable: false, searchable: false }], >+ pagingType: "full", >+ }); > > $(".delete_pattern").on("click",function(){ > return confirmDelete(); >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tags/list.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tags/list.tt >index a14552675ed..32ab4313b41 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tags/list.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tags/list.tt >@@ -129,13 +129,11 @@ tr.selected { background-color : #FFFFCC; } tr.selected td { background-color : > event.preventDefault(); > } > }); >- $("#itemst").dataTable($.extend(true, {}, dataTablesDefaults, { >- "columnDefs": [ >- { "targets": [ -1, -2 ], "orderable": false, "searchable": false }, >- ], >- "order": [[ 0, "asc" ]], >- "pagingType": "full" >- })); >+ $("#itemst").kohaTable({ >+ columnDefs: [{ targets: [-1, -2], orderable: false, searchable: false }], >+ order: [[0, "asc"]], >+ pagingType: "full", >+ }); > }); > </script> > [% END %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/access_files.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/access_files.tt >index 48f404aac69..21b777cfffb 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/access_files.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/access_files.tt >@@ -80,12 +80,12 @@ > [% INCLUDE 'datatables.inc' %] > <script> > $(document).ready(function() { >- $("#files").dataTable($.extend(true, {}, dataTablesDefaults, { >- "columnDefs": [ >- { "targets": [ -1 ], "orderSequence": [ "desc", "asc" ], "searchable": false } >+ $("#files").kohaTable({ >+ columnDefs: [ >+ { targets: [-1], orderSequence: ["desc", "asc"], searchable: false }, > ], >- "paginate": false >- })); >+ paginate: false, >+ }); > }); > </script> > [% END %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/additional-contents.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/additional-contents.tt >index d9b1aec16b3..2faee1b7d64 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/additional-contents.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/additional-contents.tt >@@ -603,14 +603,14 @@ > > $(document).ready(function() { > >- var table = $("#table_additional_contents").DataTable($.extend(true, {}, dataTablesDefaults, { >- "order": [[ 4, "desc" ]], >- "columnDefs": [ >- { "sortable": false, "searchable": false, 'targets': [ 'NoSort' ] }, >- { "type": "anti-the", "targets": [ "anti-the" ] } >+ var table = $("#table_additional_contents").kohaTable({ >+ order: [[4, "desc"]], >+ columnDefs: [ >+ { sortable: false, searchable: false, targets: ["NoSort"] }, >+ { type: "anti-the", targets: ["anti-the"] }, > ], >- "pagingType": "full_numbers" >- })); >+ pagingType: "full_numbers", >+ }); > > $("#del_form").on("click", ".delete_news", function(e){ > e.preventDefault(); >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_delete_records.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_delete_records.tt >index cdfb20d0fb4..0e44827ad92 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_delete_records.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_delete_records.tt >@@ -343,25 +343,25 @@ > }); > [% END %] > >- $("table#biblios").dataTable($.extend(true, {}, dataTablesDefaults, { >- "columnDefs": [ >- { "targets": [ 0 ], "orderable": false, "searchable": false }, >- { "targets": [ 3, 4 ], "type": "num-html" } >- ], >- "dom": 't', >- "order": [], >- "paginate": false >- })); >+ $("#biblios").kohaTable({ >+ columnDefs: [ >+ { targets: [0], orderable: false, searchable: false }, >+ { targets: [3, 4], type: "num-html" }, >+ ], >+ dom: "t", >+ order: [], >+ paginate: false, >+ }); > >- $("table#authorities").dataTable($.extend(true, {}, dataTablesDefaults, { >- "columnDefs": [ >- { "targets": [ 0 ], "orderable": false, "searchable": false }, >- { "targets": [ 3 ], "type": "num-html" } >- ], >- "dom": 't', >- "order": [], >- "paginate": false >- })); >+ $("#authorities").kohaTable({ >+ columnDefs: [ >+ { targets: [0], orderable: false, searchable: false }, >+ { targets: [3], type: "num-html" }, >+ ], >+ dom: "t", >+ order: [], >+ paginate: false, >+ }); > > $("#selectrecords").on("submit",function(){ > var nb_checked = $("#selectrecords").find("input[type='checkbox'][name='record_id']:checked").size(); >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_extend_due_dates.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_extend_due_dates.tt >index 0571a26bfb0..515dc44931b 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_extend_due_dates.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_extend_due_dates.tt >@@ -278,25 +278,25 @@ > > $("#selectall").click(); > >- $("#checkouts").dataTable($.extend(true, {}, dataTablesDefaults, { >- "columnDefs": [ >- { "targets": [0, 3], "orderable": false, "searchable": false }, >- { "targets": [1], "type": "num-html" } >+ $("#checkouts").kohaTable({ >+ columnDefs: [ >+ { targets: [0, 3], orderable: false, searchable: false }, >+ { targets: [1], type: "num-html" }, > ], >- "dom": 't', >- "order": [], >- "paginate": false >- })); >+ dom: "t", >+ order: [], >+ paginate: false, >+ }); > >- $("#checkouts_result").dataTable($.extend(true, {}, dataTablesDefaults, { >- "columnDefs": [ >- { "targets": [0, 3], "orderable": false, "searchable": false }, >- { "targets": [1], "type": "num-html" } >+ $("#checkouts_result").kohaTable({ >+ columnDefs: [ >+ { targets: [0, 3], orderable: false, searchable: false }, >+ { targets: [1], type: "num-html" }, > ], >- "dom": 't', >- "order": [], >- "paginate": false >- })); >+ dom: "t", >+ order: [], >+ paginate: false, >+ }); > > $("#extend_due_dates_form").on('submit', function(e) { > var new_hard_due_date = $("#new_hard_due_date").val(); >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_record_modification.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_record_modification.tt >index e23050d091e..292ed122928 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_record_modification.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_record_modification.tt >@@ -337,25 +337,25 @@ > > $("#selectall").click(); > >- $("table#biblios").dataTable($.extend(true, {}, dataTablesDefaults, { >- "columnDefs": [ >- { "targets": [0, 3], "orderable": false, "searchable": false }, >- { "targets": [1], "type": "num-html" } >+ $("#biblios").kohaTable({ >+ columnDefs: [ >+ { targets: [0, 3], orderable: false, searchable: false }, >+ { targets: [1], type: "num-html" }, > ], >- "dom": 't', >- "order": [], >- "paginate": false >- })); >+ dom: "t", >+ order: [], >+ paginate: false, >+ }); > >- $("table#authorities").dataTable($.extend(true, {}, dataTablesDefaults, { >- "columnDefs": [ >- { "targets": [0, 3], "orderable": false, "searchable": false }, >- { "targets": [1], "type": "num-html" } >+ $("#authorities").kohaTable({ >+ columnDefs: [ >+ { targets: [0, 3], orderable: false, searchable: false }, >+ { targets: [1], type: "num-html" }, > ], >- "dom": 't', >- "order": [], >- "paginate": false >- })); >+ dom: "t", >+ order: [], >+ paginate: false, >+ }); > > $("#mainformsubmit").click(function() { > if ($("input[type=checkbox][name='record_id']:checked").length == 0) { >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/holidays.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/holidays.tt >index c6fc9957161..aa4a2098f37 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/holidays.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/holidays.tt >@@ -593,20 +593,24 @@ > var first_td = $(this).find('td').first(); > first_td.html(weekdays[first_td.html()]); > }); >- $("#holidayweeklyrepeatable").dataTable($.extend(true, {}, dataTablesDefaults, { >- "dom": 't', >- "paginate": false >- })); >- var tables = $("#holidayexceptions, #holidaysyearlyrepeatable, #holidaysunique").DataTable($.extend(true, {}, dataTablesDefaults, { >- "dom": 't', >- "paginate": false, >- "createdRow": function( row, data, dataIndex ) { >+ $("#holidayweeklyrepeatable").kohaTable({ >+ dom: "t", >+ paginate: false, >+ }); >+ >+ let dt_params = { >+ dom: "t", >+ paginate: false, >+ createdRow: function (row, data, dataIndex) { > var holiday = $(row).data("date"); >- if( holiday < datestring ){ >+ if (holiday < datestring) { > $(row).addClass("date_past"); > } >- } >- })); >+ }, >+ }; >+ $("#holidayexceptions").kohaTable(dt_params); >+ $("#holidaysyearlyrepeatable").kohaTable(dt_params); >+ $("#holidaysunique").kohaTable(dt_params); > > $(".show_past").on("change", function(){ > tables.draw(); >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/manage-marc-import.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/manage-marc-import.tt >index 9ab8d7c9f89..0402aa62959 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/manage-marc-import.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/manage-marc-import.tt >@@ -462,7 +462,7 @@ > }); > > [% IF import_batch_id %] >- $("#records-table").dataTable($.extend(true, {}, dataTablesDefaults, { >+ $("#records-table").kohaTable({ > "autoWidth": false, > "searching": false, > "processing": true, >@@ -588,7 +588,7 @@ > ); > } > }, >- })); >+ }); > $("#revert_batch_form").on("submit", function() { > return confirm(_("Are you sure you want to undo the import of this batch into the catalog?")); > }); >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/overduerules.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/overduerules.tt >index 69973c1a56d..0b63f1f97e3 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/overduerules.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/overduerules.tt >@@ -191,13 +191,11 @@ > if( $("#rulestabs .tab-pane.active").length < 1 ){ > $("#rulestabs a:first").tab("show"); > } >- $(".overduerulest").dataTable($.extend(true, {}, dataTablesDefaults, { >- "columnDefs": [ >- { "targets": [ "NoSort" ], "orderable": false, "searchable": false }, >- ], >- "dom": '<"top pager"f>rt<"clear">', >- "paginate": false, >- })); >+ $(".overduerulest").kohaTable({ >+ columnDefs: [{ targets: ["NoSort"], orderable: false, searchable: false }], >+ dom: '<"top pager"f>rt<"clear">', >+ paginate: false, >+ }); > > $("#overduerulesf").on("submit", function(e){ > $(".overduerulest").DataTable().search('').draw(); >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/problem-reports.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/problem-reports.tt >index 878bfdc8eb5..9573602744f 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/problem-reports.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/problem-reports.tt >@@ -148,14 +148,14 @@ > [% INCLUDE 'datatables.inc' %] > <script> > $(document).ready(function(){ >- $("#problemreportstable").dataTable($.extend(true, {}, dataTablesDefaults, { >- "order": [[ 1, "asc" ]], >- "columnDefs": [ >- { "orderable": false, "searchable": false, 'targets': [ 'NoSort' ] }, >- { "type": "anti-the", "targets": [ "anti-the" ] } >+ $("#problemreportstable").kohaTable({ >+ order: [[1, "asc"]], >+ columnDefs: [ >+ { orderable: false, searchable: false, targets: ["NoSort"] }, >+ { type: "anti-the", targets: ["anti-the"] }, > ], >- "pagingType": "full" >- })); >+ pagingType: "full", >+ }); > > $(".SelectAll").on("click", function(){ > $("input[name='report_ids'][type='checkbox']").prop("checked", true); >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/quotes-upload.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/quotes-upload.tt >index 76367fb3c0a..f9e7d7dff05 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/quotes-upload.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/quotes-upload.tt >@@ -256,7 +256,7 @@ > $('#quotes_editor').show(); > $("#save_quotes").on("click", yuiGetData); > >- let table = $('#quotes_editor').dataTable( { >+ let table = $('#quotes_editor').kohaTable( { > "autoWidth" : false, > "paging" : true, > "ordering" : false, >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 926afb5c1fc..544a9802920 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt >@@ -638,7 +638,7 @@ > 'vs.lastmodified', > ]; > >- var dtListResults = $("#listresultst").dataTable($.extend(true, {}, dataTablesDefaults, { >+ var dtListResults = $("#listresultst").kohaTable({ > order: [[ 5, "asc" ]], > serverSide: true, > ajax: { >@@ -676,7 +676,7 @@ > "searching": false, > "processing": true, > "orderCellsTop": true >- })); >+ }); > _dt_add_delay_filters(dtListResults.api(), $("#listresultst")); > > /* Select correct tab based on URL parameter */ >diff --git a/koha-tmpl/intranet-tmpl/prog/js/addorderiso2709.js b/koha-tmpl/intranet-tmpl/prog/js/addorderiso2709.js >index 332712a3a70..85fc74092eb 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/addorderiso2709.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/addorderiso2709.js >@@ -1,15 +1,15 @@ >-/* global dataTablesDefaults __ template_path */ >+/* global __ template_path */ > > $(document).ready(function() { > $("#Aform").preventDoubleFormSubmit(); >- $("#files").dataTable($.extend(true, {}, dataTablesDefaults, { >- "columnDefs": [ >- { "orderable": false, "searchable": false, "targets": [ 'NoSort' ] }, >- { "type": "anti-the", "targets": [ "anti-the" ] } >+ $("#files").kohaTable({ >+ columnDefs: [ >+ { orderable: false, searchable: false, targets: ["NoSort"] }, >+ { type: "anti-the", targets: ["anti-the"] }, > ], >- "pagingType": "full", >- "order": [] >- }) ); >+ pagingType: "full", >+ order: [], >+ }); > > checkOrderBudgets(); > var all_budget_id = $("#all_budget_id"); >diff --git a/koha-tmpl/intranet-tmpl/prog/js/authtype.js b/koha-tmpl/intranet-tmpl/prog/js/authtype.js >index 229cf187bd3..7a1edb2da7b 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/authtype.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/authtype.js >@@ -3,14 +3,14 @@ > var importing = false; > > $(document).ready(function() { >- $("#authtypes").dataTable($.extend(true, {}, dataTablesDefaults, { >- "columnDefs": [ >- { "targets": [ -1 ], "orderable": false, "searchable": false }, >- { "targets": [ 0, 1 ], "type": "natural" }, >+ $("#authtypes").kohaTable({ >+ columnDefs: [ >+ { targets: [-1], orderable: false, searchable: false }, >+ { targets: [0, 1], type: "natural" }, > ], >- "ordering": true, >- "pagingType": "full" >- })); >+ ordering: true, >+ pagingType: "full", >+ }); > > $("body").css("cursor", "auto"); > $('.import_export_options').hide(); >diff --git a/koha-tmpl/intranet-tmpl/prog/js/biblio_framework.js b/koha-tmpl/intranet-tmpl/prog/js/biblio_framework.js >index 39e96788464..5061ac6d579 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/biblio_framework.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/biblio_framework.js >@@ -4,14 +4,14 @@ > var importing = false; > > $(document).ready(function() { >- $("#table_biblio_frameworks").dataTable($.extend(true, {}, dataTablesDefaults, { >- "columnDefs": [ >- { "targets": [ -1 ], "orderable": false, "searchable": false }, >- { "targets": [ 0, 1 ], "type": "natural" }, >+ $("#table_biblio_frameworks").kohaTable({ >+ columnDefs: [ >+ { targets: [-1], orderable: false, searchable: false }, >+ { targets: [0, 1], type: "natural" }, > ], >- "ordering": true, >- "pagingType": "full" >- })); >+ ordering: true, >+ pagingType: "full", >+ }); > > $("body").css("cursor", "auto"); > $('.import_export_options').hide(); >diff --git a/koha-tmpl/intranet-tmpl/prog/js/cart.js b/koha-tmpl/intranet-tmpl/prog/js/cart.js >index 0514331af74..b2dc940cd59 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/cart.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/cart.js >@@ -1,4 +1,4 @@ >-/* global __ dataTablesDefaults showMore showLess delSelRecords addSelToShelf sendBasket printBasket delBasket openBiblio selRecord */ >+/* global __ showMore showLess delSelRecords addSelToShelf sendBasket printBasket delBasket openBiblio selRecord */ > > function placeHold () { > var checkedItems = $("input:checkbox:checked"); >@@ -83,16 +83,16 @@ $(document).ready(function(){ > $(".hold").text( __("Place hold") ); > $("#downloadcartc").empty(); > >- $("#itemst").dataTable($.extend(true, {}, dataTablesDefaults, { >- "dom": 't', >- "columnDefs": [ >- { "orderable": false, "searchable": false, "targets": [ 'NoSort' ] }, >- { "type": "anti-the", "targets": [ "anti-the" ] }, >- { "type": "callnumbers", "targets": [ "callnumbers"] } >+ $("#itemst").kohaTable({ >+ dom: "t", >+ columnDefs: [ >+ { orderable: false, searchable: false, targets: ["NoSort"] }, >+ { type: "anti-the", targets: ["anti-the"] }, >+ { type: "callnumbers", targets: ["callnumbers"] }, > ], >- "order": [[ 1, "asc" ]], >- "paging": false >- })); >+ order: [[1, "asc"]], >+ paging: false, >+ }); > > $(".showdetails").on("click",function(e){ > e.preventDefault(); >diff --git a/koha-tmpl/intranet-tmpl/prog/js/checkouts.js b/koha-tmpl/intranet-tmpl/prog/js/checkouts.js >index 394d319cbba..255571c0b76 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/checkouts.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/checkouts.js >@@ -1025,7 +1025,7 @@ $(document).ready(function() { > } > function loadReturnClaimsTable() { > if ( ! returnClaimsTable ) { >- returnClaimsTable = $("#return-claims-table").dataTable({ >+ returnClaimsTable = $("#return-claims-table").kohaTable({ > "autoWidth": false, > "dom": "rt", > "order": [], >diff --git a/koha-tmpl/intranet-tmpl/prog/js/datatables.js b/koha-tmpl/intranet-tmpl/prog/js/datatables.js >index 084cb8c82c8..e28859d719c 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/datatables.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/datatables.js >@@ -1062,17 +1062,25 @@ function _dt_save_restore_state(table_settings, external_filter_nodes={}){ > }; > } > >+ if (options.ajax) { >+ options.ajax = Object.assign( >+ {}, >+ options.ajax, >+ _dt_default_ajax({ default_filters, options }) >+ ); >+ options.serverSide = true; >+ options.processing = true; >+ options.pagingType = "full_numbers"; >+ } >+ > settings = $.extend(true, {}, dataTablesDefaults, { > "paging": true, >- 'serverSide': true, > 'searching': true, >- 'pagingType': 'full_numbers', >- 'processing': true, > 'language': { > 'emptyTable': (options.emptyTable) ? options.emptyTable : __("No data available in table") > }, >- 'ajax': _dt_default_ajax({default_filters, options}), > }, options); >+ > } > > settings["buttons"] = _dt_buttons({settings, table_settings}); >diff --git a/koha-tmpl/intranet-tmpl/prog/js/elasticsearch-mappings.js b/koha-tmpl/intranet-tmpl/prog/js/elasticsearch-mappings.js >index b975d34173b..2a7fb63b445 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/elasticsearch-mappings.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/elasticsearch-mappings.js >@@ -1,4 +1,4 @@ >-/* global __ dataTablesDefaults */ >+/* global __ */ > > function clean_line(line) { > $(line).find('input[type="text"]').val(""); >@@ -37,15 +37,11 @@ function tableInit( oldtabid, newtabid ) { > oldTableId.DataTable().destroy(); > } > >- var newTableId = $("#" + newtabid + "_table"); >- newTableId.DataTable( >- $.extend(true, {}, dataTablesDefaults, { >- "columnDefs": [ >- { "orderable": false, "searchable": false, 'targets': ['NoSort'] }, >- ], >- "paging": false, >- "autoWidth": false >- })); >+ $("#" + newtabid + "_table").kohaTable({ >+ columnDefs: [{ orderable: false, searchable: false, targets: ["NoSort"] }], >+ paging: false, >+ autoWidth: false, >+ }); > } > > $(document).ready(function () { >diff --git a/koha-tmpl/intranet-tmpl/prog/js/holds.js b/koha-tmpl/intranet-tmpl/prog/js/holds.js >index d18d394787f..de80f9fc699 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/holds.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/holds.js >@@ -91,7 +91,7 @@ function display_pickup_location (state) { > }; > })(jQuery); > >-/* global __ dataTablesDefaults borrowernumber SuspendHoldsIntranet */ >+/* global __ borrowernumber SuspendHoldsIntranet */ > $(document).ready(function() { > > function suspend_hold(hold_id, end_date) { >diff --git a/koha-tmpl/intranet-tmpl/prog/js/marc_subfields_structure.js b/koha-tmpl/intranet-tmpl/prog/js/marc_subfields_structure.js >index 7c8c4988a63..df738c1e72b 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/marc_subfields_structure.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/marc_subfields_structure.js >@@ -1,4 +1,4 @@ >-/* global dataTablesDefaults tagsubfield selectBsTabByHash */ >+/* global tagsubfield selectBsTabByHash */ > $(document).ready(function() { > if( tagsubfield && tagsubfield == "@"){ > $("#subfieldtabs a[href='#AT_panel']").tab("show"); >@@ -29,13 +29,11 @@ $(document).ready(function() { > $("input[id^='hidden-']").each(function() { > populateHiddenCheckboxes($(this).attr('id').split('-')[1]); > }); >- $("#table_marcsubfieldstructure").dataTable($.extend(true, {}, dataTablesDefaults, { >- "columnDefs": [ >- { 'sortable': false, 'targets': [ 'NoSort' ] } >- ], >- "order": [], >- "paginate": false >- })); >+ $("#table_marcsubfieldstructure").kohaTable({ >+ columnDefs: [{ sortable: false, targets: ["NoSort"] }], >+ order: [], >+ paginate: false, >+ }); > > selectBsTabByHash("subfieldtabs"); > >diff --git a/koha-tmpl/intranet-tmpl/prog/js/pages/preferences.js b/koha-tmpl/intranet-tmpl/prog/js/pages/preferences.js >index 58eae20d353..8330df19e7d 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/pages/preferences.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/pages/preferences.js >@@ -1,5 +1,5 @@ > /* keep tidy */ >-/* global KOHA CodeMirror to_highlight search_jumped humanMsg dataTablesDefaults themelang */ >+/* global KOHA CodeMirror to_highlight search_jumped humanMsg themelang */ > // We can assume 'KOHA' exists, as we depend on KOHA.AJAX > > KOHA.Preferences = { >@@ -208,14 +208,12 @@ function addConsentDeleteHandler() { > }); > } > >-$("table.preferences").dataTable( >- $.extend(true, {}, dataTablesDefaults, { >- dom: "t", >- columnDefs: [{ targets: [-1], orderable: false, searchable: false }], >- paging: false, >- fixedHeader: false, >- }) >-); >+$("table.preferences").kohaTable({ >+ dom: "t", >+ columnDefs: [{ targets: [-1], orderable: false, searchable: false }], >+ paging: false, >+ fixedHeader: false, >+}); > > $(".prefs-tab") > .find("input.preference, textarea.preference") >diff --git a/koha-tmpl/intranet-tmpl/prog/js/pages/tags-review.js b/koha-tmpl/intranet-tmpl/prog/js/pages/tags-review.js >index af4c719ec88..94f26ede746 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/pages/tags-review.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/pages/tags-review.js >@@ -58,14 +58,14 @@ var success_test_call = function() { > }; > > $(document).ready(function() { >- $("#tagst").dataTable($.extend(true, {}, dataTablesDefaults, { >- "columnDefs": [ >- { "orderable": false, "searchable": false, "targets": [ 'NoSort' ] }, >- { "type": "anti-the", "targets": [ "anti-the" ] } >+ $("#tagst").kohaTable({ >+ columnDefs: [ >+ { orderable: false, searchable: false, targets: ["NoSort"] }, >+ { type: "anti-the", targets: ["anti-the"] }, > ], >- "order": [[ 2, "desc" ]], >- "pagingType": "full" >- })); >+ order: [[2, "desc"]], >+ pagingType: "full", >+ }); > $('.ajax_buttons' ).css({visibility:"visible"}); > $("p.check").html("<div id=\"searchheader\"><a id=\"CheckAll\" href=\"/cgi-bin/koha/tags/review.pl\"><i class=\"fa fa-check\" aria-hidden=\"false\"><\/i> " + __("Select all") + "<\/a> | <a id=\"CheckNone\" href=\"/cgi-bin/koha/tags/review.pl\"><i class=\"fa fa-times\" aria-hidden=\"false\"><\/i> " + __("Clear all") + "<\/a> | <a id=\"CheckPending\" href=\"/cgi-bin/koha/tags/review.pl\"> " + __("Select all pending") + "<\/a><\/div>"); > >diff --git a/koha-tmpl/intranet-tmpl/prog/js/recalls.js b/koha-tmpl/intranet-tmpl/prog/js/recalls.js >index 9ab3494f1bf..56a69cfea40 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/recalls.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/recalls.js >@@ -102,14 +102,14 @@ $(document).ready(function() { > } > }); > >- $("#recalls-table").dataTable($.extend(true, {}, dataTablesDefaults, { >- "columnDefs": [ >- { "orderable": false, "targets": [ 'nosort' ] }, >- { "type": "title-string", "targets": [ "title-string" ] }, >- { "type": "anti-the", "targets": [ "anti-the" ] } >+ $("#recalls-table").kohaTable({ >+ columnDefs: [ >+ { orderable: false, targets: ["nosort"] }, >+ { type: "title-string", targets: ["title-string"] }, >+ { type: "anti-the", targets: ["anti-the"] }, > ], >- "pagingType": "full_numbers" >- })); >+ pagingType: "full_numbers", >+ }); > > $("#cancel_selected").click(function(e){ > if ($("input[name='recall_ids']:checked").length > 0){ >diff --git a/koha-tmpl/intranet-tmpl/prog/js/rotating-collections.js b/koha-tmpl/intranet-tmpl/prog/js/rotating-collections.js >index 9031eb646b4..8eb96648300 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/rotating-collections.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/rotating-collections.js >@@ -1,4 +1,4 @@ >-/* global _ dataTablesDefaults */ >+/* global _ */ > > $(document).ready(function(){ > $("#barcode").focus(); >@@ -19,14 +19,10 @@ $(document).ready(function(){ > }); > > if( $('#rotating-collections-table').length > 0 ){ >- $('#rotating-collections-table').dataTable($.extend(true, {}, dataTablesDefaults, { >- "autoWidth": false, >- "columnDefs": [ >- { "targets": [ -1 ], "orderable": false, "searchable": false }, >- ], >- "pagingType": "full" >- } )); >+ $("#rotating-collections-table").kohaTable({ >+ autoWidth: false, >+ columnDefs: [{ targets: [-1], orderable: false, searchable: false }], >+ pagingType: "full", >+ }); > } >- >- > }); >diff --git a/koha-tmpl/intranet-tmpl/prog/js/subscription-add.js b/koha-tmpl/intranet-tmpl/prog/js/subscription-add.js >index 6544ed844fa..ea45704cb5b 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/subscription-add.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/subscription-add.js >@@ -430,7 +430,7 @@ function mana_search() { > .done( function( result ) { > $("#mana_search_result .modal-body").html(result); > $("#mana_search_result_label").text( __("Results from Mana Knowledge Base") ); >- $("#mana_results_datatable").dataTable($.extend(true, {}, dataTablesDefaults, { >+ $("#mana_results_datatable").kohaTable({ > "pagingType": "full", > "order":[[4, "desc"], [5, "desc"]], > "autoWidth": false, >@@ -441,7 +441,7 @@ function mana_search() { > { "orderable": false, "searchable": false, "targets": [ 'NoSort' ] }, > { "type": "anti-the", "targets": [ 'anti-the'] } > ] >- })); >+ }); > if( $("#mana_results_datatable").length && $("td.dataTables_empty").length == 0){ > $("#mana_search").html("<p>" + __("Subscription found on Mana Knowledge Base:") + "</p><p> <a href=\"#\" data-bs-toggle=\"modal\" data-bs-target=\"#mana_search_result\"><i class=\"fa-solid fa-window-maximize\"></i> " + __("Show Mana results") + "</a></p>"); > } >diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/EHoldingsEBSCOTitlePackagesList.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/EHoldingsEBSCOTitlePackagesList.vue >index 22329daec46..f4d65b61903 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/EHoldingsEBSCOTitlePackagesList.vue >+++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/EHoldingsEBSCOTitlePackagesList.vue >@@ -89,97 +89,92 @@ export default { > $.fn.dataTable.ext.search = $.fn.dataTable.ext.search.filter( > search => search.name != "apply_filter" > ) >- $("#" + table_id).dataTable({ >- ...dataTablesDefaults, >- ...{ >- data: resources, >- embed: ["package.name"], >- ordering: false, >- dom: '<"top pager"<"table_entries"ilp>>tr<"bottom pager"ip>', >- lengthMenu: [ >- [10, 20, 50, 100], >- [10, 20, 50, 100], >- ], >- autoWidth: false, >- columns: [ >- { >- title: __("Name"), >- data: "package.name", >- searchable: false, >- orderable: false, >- render: function (data, type, row, meta) { >- // Rendering done in drawCallback >- return "" >- }, >- width: "100%", >+ $("#" + table_id).kohaTable({ >+ data: resources, >+ embed: ["package.name"], >+ ordering: false, >+ dom: '<"top pager"<"table_entries"ilp>>tr<"bottom pager"ip>', >+ lengthMenu: [ >+ [10, 20, 50, 100], >+ [10, 20, 50, 100], >+ ], >+ autoWidth: false, >+ columns: [ >+ { >+ title: __("Name"), >+ data: "package.name", >+ searchable: false, >+ orderable: false, >+ render: function (data, type, row, meta) { >+ // Rendering done in drawCallback >+ return "" > }, >- ], >- drawCallback: function (settings) { >- var api = new $.fn.dataTable.Api(settings) >+ width: "100%", >+ }, >+ ], >+ drawCallback: function (settings) { >+ var api = new $.fn.dataTable.Api(settings) > >- if (!api.rows({ search: "applied" }).count()) return >+ if (!api.rows({ search: "applied" }).count()) return > >- $.each( >- $(this).find("tbody tr td:first-child"), >- function (index, e) { >- let tr = $(this).parent() >- let row = api.row(tr).data() >- if (!row) return // Happen if the table is empty >- let { href } = router.resolve({ >- name: "EHoldingsEBSCOResourcesShow", >- params: { resource_id: row.resource_id }, >- }) >- let n = createVNode( >- "a", >- { >- role: "button", >- href, >- onClick: e => { >- e.preventDefault() >- show_resource(row.resource_id) >- }, >+ $.each( >+ $(this).find("tbody tr td:first-child"), >+ function (index, e) { >+ let tr = $(this).parent() >+ let row = api.row(tr).data() >+ if (!row) return // Happen if the table is empty >+ let { href } = router.resolve({ >+ name: "EHoldingsEBSCOResourcesShow", >+ params: { resource_id: row.resource_id }, >+ }) >+ let n = createVNode( >+ "a", >+ { >+ role: "button", >+ href, >+ onClick: e => { >+ e.preventDefault() >+ show_resource(row.resource_id) > }, >- `${row.package.name}` >- ) >- if (row.is_selected) { >- n = createVNode("span", {}, [ >- n, >- " ", >- createVNode("i", { >- class: "fa fa-check-square", >- style: { >- color: "green", >- float: "right", >- }, >- title: __("Is selected"), >- }), >- ]) >- } >- render(n, e) >- } >- ) >- }, >- initComplete: function () { >- $.fn.dataTable.ext.search.push( >- function apply_filter( >- settings, >- data, >- dataIndex, >- row >- ) { >- return ( >- row.package.name.match( >- new RegExp(filters.package_name, "i") >- ) && >- (filters.selection_type == 0 || >- (filters.selection_type == 1 && >- row.is_selected) || >- (filters.selection_type == 2 && >- !row.is_selected)) >- ) >+ }, >+ `${row.package.name}` >+ ) >+ if (row.is_selected) { >+ n = createVNode("span", {}, [ >+ n, >+ " ", >+ createVNode("i", { >+ class: "fa fa-check-square", >+ style: { >+ color: "green", >+ float: "right", >+ }, >+ title: __("Is selected"), >+ }), >+ ]) > } >+ render(n, e) >+ } >+ ) >+ }, >+ initComplete: function () { >+ $.fn.dataTable.ext.search.push(function apply_filter( >+ settings, >+ data, >+ dataIndex, >+ row >+ ) { >+ return ( >+ row.package.name.match( >+ new RegExp(filters.package_name, "i") >+ ) && >+ (filters.selection_type == 0 || >+ (filters.selection_type == 1 && >+ row.is_selected) || >+ (filters.selection_type == 2 && >+ !row.is_selected)) > ) >- }, >+ }) > }, > }) > }, >diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/EHoldingsLocalTitlePackagesList.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/EHoldingsLocalTitlePackagesList.vue >index 0ccecdb5d23..c96fe78e3fa 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/EHoldingsLocalTitlePackagesList.vue >+++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/EHoldingsLocalTitlePackagesList.vue >@@ -33,8 +33,7 @@ export default { > let resources = this.resources > let table_id = this.table_id > >- $("#" + table_id).dataTable( >- $.extend(true, {}, dataTablesDefaults, { >+ $("#" + table_id).kohaTable({ > data: resources, > embed: ["package.name"], > order: [[0, "asc"]], >diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/EHoldingsLocalTitlesFormImport.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/EHoldingsLocalTitlesFormImport.vue >index 0d439ccb981..0b1994a8828 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/EHoldingsLocalTitlesFormImport.vue >+++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/EHoldingsLocalTitlesFormImport.vue >@@ -82,70 +82,60 @@ export default { > let lists = this.logged_in_user_lists > let table_id = this.table_id > let import_from_list = this.import_from_list >- $("#" + table_id).dataTable( >- $.extend(true, {}, dataTablesDefaults, { >- data: lists, >- order: [[0, "asc"]], >- autoWidth: false, >- columns: [ >- { >- title: __("Name"), >- data: "shelfname", >- searchable: true, >- orderable: true, >- width: "100%", >- render: function (data, type, row, meta) { >- return ( >- row.shelfname + >- " (#" + >- row.shelfnumber + >- ")" >- ) >- }, >+ $("#" + table_id).kohaTable({ >+ data: lists, >+ order: [[0, "asc"]], >+ autoWidth: false, >+ columns: [ >+ { >+ title: __("Name"), >+ data: "shelfname", >+ searchable: true, >+ orderable: true, >+ width: "100%", >+ render: function (data, type, row, meta) { >+ return row.shelfname + " (#" + row.shelfnumber + ")" > }, >- { >- title: __("Actions"), >- data: function (row, type, val, meta) { >- return '<div class="actions"></div>' >- }, >- className: "actions noExport", >- searchable: false, >- orderable: false, >+ }, >+ { >+ title: __("Actions"), >+ data: function (row, type, val, meta) { >+ return '<div class="actions"></div>' > }, >- ], >- drawCallback: function (settings) { >- var api = new $.fn.dataTable.Api(settings) >- >- $.each( >- $(this).find("td .actions"), >- function (index, e) { >- let tr = $(this).parent().parent() >- let list_id = api.row(tr).data().shelfnumber >- let importButton = createVNode( >- "a", >- { >- class: "btn btn-default btn-xs", >- role: "button", >- onClick: () => { >- import_from_list(list_id) >- }, >- }, >- [ >- createVNode("i", { >- class: "fa fa-download", >- "aria-hidden": "true", >- }), >- __("Import"), >- ] >- ) >+ className: "actions noExport", >+ searchable: false, >+ orderable: false, >+ }, >+ ], >+ drawCallback: function (settings) { >+ var api = new $.fn.dataTable.Api(settings) > >- let n = createVNode("span", {}, [importButton]) >- render(n, e) >- } >+ $.each($(this).find("td .actions"), function (index, e) { >+ let tr = $(this).parent().parent() >+ let list_id = api.row(tr).data().shelfnumber >+ let importButton = createVNode( >+ "a", >+ { >+ class: "btn btn-default btn-xs", >+ role: "button", >+ onClick: () => { >+ import_from_list(list_id) >+ }, >+ }, >+ [ >+ createVNode("i", { >+ class: "fa fa-download", >+ "aria-hidden": "true", >+ }), >+ __("Import"), >+ ] > ) >- }, >- }) >- ) >+ >+ let n = createVNode("span", {}, [importButton]) >+ render(n, e) >+ }) >+ }, >+ }) > }, > }, > mounted() { >-- >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