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 9ed74d2792..a3f1379470 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt @@ -1231,17 +1231,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 ae0fa3423f..c46aecc128 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basketgroup.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basketgroup.tt @@ -423,34 +423,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 5cb331c2a4..a1ac247f2b 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 %] 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 80c36d5c7c..a083d41e2e 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoice.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoice.tt @@ -560,22 +560,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 bb62e0d764..fb00c76613 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoices.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoices.tt @@ -498,16 +498,14 @@ }); }); - var resultst = $("table.result").dataTable( - $.extend(true, {}, dataTablesDefaults, { - paging: false, - columnDefs: [ - { orderable: false, targets: [1, -1] }, - { visible: false, targets: [0] }, - ], - autoWidth: false, - }) - ); + var resultst = $("table.result").kohaTable({ + paging: false, + columnDefs: [ + { orderable: false, targets: [1, -1] }, + { visible: false, targets: [0] }, + ], + 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 5ec14700a2..f19e75f157 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/newordersubscription.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/newordersubscription.tt @@ -124,15 +124,13 @@ } $(document).ready(function () { - $("#srlt").dataTable( - $.extend(true, {}, dataTablesDefaults, { - columnDefs: [ - { orderable: false, searchable: false, targets: ["NoSort"] }, - { type: "anti-the", targets: ["anti-the"] }, - ], - pagingType: "full", - }) - ); + $("#srlt").kohaTable({ + columnDefs: [ + { orderable: false, searchable: false, targets: ["NoSort"] }, + { type: "anti-the", targets: ["anti-the"] }, + ], + 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 62c13a176c..e3e1c09e74 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/newordersuggestion.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/newordersuggestion.tt @@ -118,13 +118,13 @@ [% INCLUDE 'calendar.inc' %] [% 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 9d612f1277..890fd64669 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt @@ -369,19 +369,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, @@ -389,10 +391,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 fdac8dc272..81aef2a1f6 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcels.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcels.tt @@ -270,11 +270,9 @@ [% INCLUDE 'datatables.inc' %] [% 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 6dc116d91f..afc1fc662d 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/supplier.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/supplier.tt @@ -687,12 +687,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 68d929f4b1..3f488434aa 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/uncertainprice.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/uncertainprice.tt @@ -191,12 +191,10 @@ [% INCLUDE 'datatables.inc' %] 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 12771a9499..46d8d31898 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 @@ -308,19 +308,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 5b3434c8bb..5d4b6e30f4 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgetperiods.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgetperiods.tt @@ -567,18 +567,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(); @@ -588,7 +589,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 ) @@ -624,7 +625,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 ab4e6ea47a..c70e790a6b 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 @@ -437,13 +437,11 @@ [% Asset.js("js/admin-menu.js") | $raw %] [% 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 032204c70f..a81080c0e6 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 @@ -135,54 +135,55 @@ [% Asset.js("js/admin-menu.js") | $raw %] [% INCLUDE 'datatables.inc' %] [% 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 009a63e20b..486ddf1eee 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 @@ -253,13 +253,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 '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 0dbf8966fc..04fe052dc5 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 @@ -241,21 +241,19 @@ $(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, { - columnDefs: [ - { targets: [-1], orderable: false, searchable: false }, - { targets: [0, 1], orderable: false, visible: false }, - ], - order: [ - [0, "asc"], - [2, "asc"], - ], - dom: 'C<"top pager"ilpfB><"#filter_s">tr<"bottom pager"ip>', - pageLength: 20, - pagingType: "full_numbers", - }) - ); + var table_credit_types = $("#table_credit_types").kohaTable({ + columnDefs: [ + { targets: [-1], orderable: false, searchable: false }, + { targets: [0, 1], orderable: false, visible: false }, + ], + order: [ + [0, "asc"], + [2, "asc"], + ], + dom: 'C<"top pager"ilpfB><"#filter_s">tr<"bottom pager"ip>', + pageLength: 20, + pagingType: "full_numbers", + }); $("#filter_s").html(' ' + txtActivefilter + ""); $("#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 1666160f11..dbe0198abe 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 @@ -257,21 +257,19 @@ $(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, { - columnDefs: [ - { targets: [-1], orderable: false, searchable: false }, - { targets: [0, 1], orderable: false, visible: false }, - ], - order: [ - [0, "asc"], - [2, "asc"], - ], - dom: 'C<"top pager"ilpfB><"#filter_s">tr<"bottom pager"ip>', - pageLength: 20, - pagingType: "full_numbers", - }) - ); + var table_debit_types = $("#table_debit_types").kohaTable({ + columnDefs: [ + { targets: [-1], orderable: false, searchable: false }, + { targets: [0, 1], orderable: false, visible: false }, + ], + order: [ + [0, "asc"], + [2, "asc"], + ], + dom: 'C<"top pager"ilpfB><"#filter_s">tr<"bottom pager"ip>', + pageLength: 20, + pagingType: "full_numbers", + }); $("#filter_s").html(' ' + txtActivefilter + ""); $("#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 ea64ed9772..2b8a8749c1 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/koha2marclinks.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/koha2marclinks.tt @@ -108,12 +108,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 89f4f1bb8a..bb8f2e1f2b 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/localization.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/localization.tt @@ -198,14 +198,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 = $(''); [% 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 4b460c1a37..afd9a028d8 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 @@ -393,7 +393,7 @@ }); } - $('#marc-overlay-rules').dataTable($.extend(true, {}, dataTablesDefaults, { + $('#marc-overlay-rules').kohaTable({ "columns": [ {"searchable": false, "orderable": false}, {"orderDataType": "dom-input"}, @@ -408,7 +408,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 fc1f3e8505..1f74452322 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/marctagstructure.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/marctagstructure.tt @@ -325,12 +325,10 @@ [% Asset.js("js/admin-menu.js") | $raw %] [% 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 cd7936b44a..7064999c52 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/systempreferences.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/systempreferences.tt @@ -495,13 +495,13 @@ [% INCLUDE 'datatables.inc' %] [% 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 cac044ecf3..d354bd7d14 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/z3950servers.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/z3950servers.tt @@ -318,12 +318,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 f67a973da8..c901585fb0 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt @@ -2081,13 +2081,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 8a1b840c8d..71b58cb314 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 @@ -222,13 +222,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 @@ -237,7 +235,7 @@ e.preventDefault(); var form = $(this); - var table = form.find("table").dataTable(); + var table = form.find("table").kohaTable(); var new_form = $("").attr("action", form.attr("action")).attr("method", form.attr("method")); form.find('input[type="hidden"]') @@ -275,7 +273,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 68e3ae421f..7995ae6838 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 @@ -265,14 +265,12 @@ [% Asset.js("js/z3950_search.js") | $raw %] 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 5b5db41341..63ad4ee8d6 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 @@ -574,22 +574,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 ); }); 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 1fc47b62eb..3da5fce04f 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 @@ -120,16 +120,14 @@ [% INCLUDE 'datatables.inc' %] 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 39c7500712..5af5b9b895 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt @@ -1706,12 +1706,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 4b204fb825..f978274327 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 @@ -99,14 +99,14 @@ 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 f757bf9f7f..d656d9eef0 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/transferstoreceive.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/transferstoreceive.tt @@ -114,14 +114,14 @@ 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 8c3d0c58ba..63c804d03f 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 @@ -93,13 +93,11 @@ [% Asset.js("js/tools-menu.js") | $raw %] [% 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 644ce4969d..809c6bcf28 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/clubs.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/clubs.tt @@ -148,21 +148,17 @@ [% Asset.js("js/tools-menu.js") | $raw %] [% 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 e239cb4860..0415742472 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 @@ -94,7 +94,7 @@ [% INCLUDE 'datatables.inc' %] [% 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 1cacdb14ab..b72be92c86 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/notices.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/notices.tt @@ -182,12 +182,10 @@ [% INCLUDE 'datatables.inc' %] [% 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 043687feff..bd9a999add 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/statistics.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/statistics.tt @@ -104,12 +104,10 @@ [% INCLUDE 'datatables.inc' %] [% 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 3403a229bf..a3a5d9fcac 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 @@ -65,14 +65,12 @@ [% INCLUDE 'datatables.inc' %] [% 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 682d7bb321..63ab0a5c9f 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 @@ -147,11 +147,9 @@ [% INCLUDE 'datatables.inc' %] [% 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 4b74435b50..7f76c4f89f 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt @@ -1508,11 +1508,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 cd5a788257..d16381bfb9 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/claims.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/claims.tt @@ -217,16 +217,14 @@ [% 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 18e044fff3..beccfa4252 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 @@ -67,12 +67,10 @@ [% INCLUDE 'datatables.inc' %] [% 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 7487064420..0a87a700ac 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 @@ -604,16 +604,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"] }, - ], - pagingType: "full_numbers", - }) - ); + 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", + }); $("#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 b27d561aee..c325868b00 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 @@ -346,25 +346,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 6702c348b3..e4188a8edc 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 @@ -267,29 +267,25 @@ $("#selectall").click(); - $("#checkouts").dataTable( - $.extend(true, {}, dataTablesDefaults, { - columnDefs: [ - { targets: [0, 3], orderable: false, searchable: false }, - { targets: [1], type: "num-html" }, - ], - dom: "t", - order: [], - paginate: false, - }) - ); + $("#checkouts").kohaTable({ + columnDefs: [ + { targets: [0, 3], orderable: false, searchable: false }, + { targets: [1], type: "num-html" }, + ], + dom: "t", + order: [], + paginate: false, + }); - $("#checkouts_result").dataTable( - $.extend(true, {}, dataTablesDefaults, { - columnDefs: [ - { targets: [0, 3], orderable: false, searchable: false }, - { targets: [1], type: "num-html" }, - ], - dom: "t", - order: [], - paginate: false, - }) - ); + $("#checkouts_result").kohaTable({ + columnDefs: [ + { targets: [0, 3], orderable: false, searchable: false }, + { targets: [1], type: "num-html" }, + ], + 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 984e8f090b..d61e04840a 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 @@ -353,25 +353,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 65cf99194f..b6877639cf 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/holidays.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/holidays.tt @@ -608,20 +608,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 e3f38155b0..86dd59d378 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 @@ -470,7 +470,7 @@ }); [% IF import_batch_id %] - $("#records-table").dataTable($.extend(true, {}, dataTablesDefaults, { + $("#records-table").kohaTable({ "autoWidth": false, "searching": false, "processing": true, @@ -596,7 +596,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 b720bcf85e..094feee82f 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/overduerules.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/overduerules.tt @@ -188,13 +188,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 a06557a65c..2141d41132 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 @@ -142,16 +142,14 @@ [% INCLUDE 'datatables.inc' %]
' + txtActivefilter + ""); $("#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 1666160f11..dbe0198abe 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 @@ -257,21 +257,19 @@ $(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, { - columnDefs: [ - { targets: [-1], orderable: false, searchable: false }, - { targets: [0, 1], orderable: false, visible: false }, - ], - order: [ - [0, "asc"], - [2, "asc"], - ], - dom: 'C<"top pager"ilpfB><"#filter_s">tr<"bottom pager"ip>', - pageLength: 20, - pagingType: "full_numbers", - }) - ); + var table_debit_types = $("#table_debit_types").kohaTable({ + columnDefs: [ + { targets: [-1], orderable: false, searchable: false }, + { targets: [0, 1], orderable: false, visible: false }, + ], + order: [ + [0, "asc"], + [2, "asc"], + ], + dom: 'C<"top pager"ilpfB><"#filter_s">tr<"bottom pager"ip>', + pageLength: 20, + pagingType: "full_numbers", + }); $("#filter_s").html('
' + txtActivefilter + ""); $("#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 ea64ed9772..2b8a8749c1 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/koha2marclinks.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/koha2marclinks.tt @@ -108,12 +108,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 89f4f1bb8a..bb8f2e1f2b 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/localization.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/localization.tt @@ -198,14 +198,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 = $(''); [% 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 4b460c1a37..afd9a028d8 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 @@ -393,7 +393,7 @@ }); } - $('#marc-overlay-rules').dataTable($.extend(true, {}, dataTablesDefaults, { + $('#marc-overlay-rules').kohaTable({ "columns": [ {"searchable": false, "orderable": false}, {"orderDataType": "dom-input"}, @@ -408,7 +408,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 fc1f3e8505..1f74452322 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/marctagstructure.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/marctagstructure.tt @@ -325,12 +325,10 @@ [% Asset.js("js/admin-menu.js") | $raw %] [% 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 cd7936b44a..7064999c52 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/systempreferences.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/systempreferences.tt @@ -495,13 +495,13 @@ [% INCLUDE 'datatables.inc' %] [% 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 cac044ecf3..d354bd7d14 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/z3950servers.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/z3950servers.tt @@ -318,12 +318,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 f67a973da8..c901585fb0 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt @@ -2081,13 +2081,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 8a1b840c8d..71b58cb314 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 @@ -222,13 +222,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 @@ -237,7 +235,7 @@ e.preventDefault(); var form = $(this); - var table = form.find("table").dataTable(); + var table = form.find("table").kohaTable(); var new_form = $("