Bug 26553: Replace KohaTable with kohaTable - OPAC

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>

JD Amended patch: replace wrong occurrences of "kohatable" with "kohaTable"

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
Jonathan Druart 2024-12-02 11:55:53 +01:00 committed by Katrin Fischer
parent 25b3fd015b
commit 948366a509
No known key found for this signature in database
GPG Key ID: 0EF6E2C03357A834
6 changed files with 92 additions and 77 deletions

View File

@ -139,20 +139,23 @@
<script>
$(document).ready(function() {
table_settings = [% TablesSettings.GetTableSettings( 'opac', 'course_items', 'course-items-table', 'json' ) | $raw %];
KohaTable("#course-items-table", {
"dom": '<"top"<"table_controls"f>>t',
"sorting": [[ 1, "asc" ]],
"language": {
"search": "_INPUT_",
"searchPlaceholder": _("Search course reserves")
$("#course-items-table").kohaTable(
{
dom: '<"top"<"table_controls"f>>t',
sorting: [[1, "asc"]],
language: {
search: "_INPUT_",
searchPlaceholder: _("Search course reserves"),
},
responsive: {
details: { type: "column", target: -1 },
},
columnDefs: [
{ className: "dtr-control", orderable: false, targets: -1 },
],
},
"responsive": {
"details": { "type": 'column',"target": -1 }
},
"columnDefs": [
{ "className": 'dtr-control', "orderable": false, "targets": -1 },
],
}, table_settings );
table_settings
);
});
</script>
[% END %]

View File

@ -86,23 +86,24 @@
<script>
$(document).ready(function() {
table_settings = [% TablesSettings.GetTableSettings( 'opac', 'course_list', 'course_reserves_table', 'json' ) | $raw %]
KohaTable("#course_reserves_table", {
"dom": '<"top"<"table_controls"f>>rt<"clear">',
"sorting": [[ 1, "asc" ]],
"asColumnDefs": [
{ "aTargets": [ 1 ], "sType": "nsb-nse" },
],
"language": {
"search": "_INPUT_",
"searchPlaceholder": _("Search courses")
$("#course_reserves_table").kohaTable(
{
dom: '<"top"<"table_controls"f>>rt<"clear">',
sorting: [[1, "asc"]],
asColumnDefs: [{ aTargets: [1], sType: "nsb-nse" }],
language: {
search: "_INPUT_",
searchPlaceholder: _("Search courses"),
},
responsive: {
details: { type: "column", target: -1 },
},
cColumnDefs: [
{ className: "dtr-control", orderable: false, targets: -1 },
],
},
"responsive": {
"details": { "type": 'column',"target": -1 }
},
"cColumnDefs": [
{ "className": 'dtr-control', "orderable": false, "targets": -1 },
],
}, table_settings );
table_settings
);
});
</script>
[% END %]

View File

@ -1862,41 +1862,49 @@
var table_settings = [% TablesSettings.GetTableSettings( 'opac', 'biblio-detail', 'holdingst', 'json' ) | $raw %];
KohaTable("#holdingst", {
dom: '<"clearfix">t',
"columnDefs": [
{ "className": "dtr-control", "orderable": false, "targets": -1 }
],
"bKohaColumnsUseNames": true,
"responsive": {
"details": { "type": 'column', "target": -1 }
}
}, table_settings);
KohaTable("#otherholdingst", {
dom: '<"clearfix">t',
"columnDefs": [
{ "className": "dtr-control", "orderable": false, "targets": -1 }
],
"bKohaColumnsUseNames": true,
"responsive": {
"details": { "type": 'column', "target": -1 }
}
}, table_settings);
$("#holdingst").kohaTable(
{
dom: '<"clearfix">t',
columnDefs: [
{ className: "dtr-control", orderable: false, targets: -1 },
],
bKohaColumnsUseNames: true,
responsive: {
details: { type: "column", target: -1 },
},
},
table_settings
);
$("#otherholdingst").kohaTable(
{
dom: '<"clearfix">t',
columnDefs: [
{ className: "dtr-control", orderable: false, targets: -1 },
],
bKohaColumnsUseNames: true,
responsive: {
details: { type: "column", target: -1 },
},
},
table_settings
);
var serial_table_settings = [% TablesSettings.GetTableSettings( 'opac', 'biblio-detail', 'subscriptionst', 'json' ) | $raw %];
KohaTable(".subscriptionst", {
dom: '<"clearfix">t',
"sorting": [[ 1, "desc" ]],
"bKohaColumnsUseNames": true,
"responsive": {
"details": { "type": 'column', "target": -1 }
$("#subscriptionst").kohaTable(
{
dom: '<"clearfix">t',
sorting: [[1, "desc"]],
bKohaColumnsUseNames: true,
responsive: {
details: { type: "column", target: -1 },
},
columnDefs: [
{ className: "dtr-control", orderable: false, targets: -1 },
],
},
"columnDefs": [
{ "className": "dtr-control", "orderable": false, "targets": -1 }
],
}, serial_table_settings);
serial_table_settings
);
var dTables = $("#holdingst,.subscriptionst,#otherholdingst");
$('a[data-bs-toggle="tab"]').on('shown.bs.tab', function (event) {

View File

@ -185,7 +185,7 @@
$("#sort").change(function () {
$("#sortform").submit();
});
var table = KohaTable("#table_holdshistory", {
var table = $("#table_holdshistory").kohaTable({
dom: '<"top"<"table_entries"i><"table_controls"fB>>t',
autoWidth: false,
sorting: [[4, "desc"]],

View File

@ -229,21 +229,24 @@
$('#sortform').submit();
});
var table = KohaTable("#readingrec", {
"dom": '<"top"<"table_entries"i><"table_controls"fB>>t',
"language": {
"search": "_INPUT_",
"searchPlaceholder": _("Search")
var table = $("#readingrec").kohaTable(
{
dom: '<"top"<"table_entries"i><"table_controls"fB>>t',
language: {
search: "_INPUT_",
searchPlaceholder: _("Search"),
},
responsive: {
details: { type: "column", target: -1 },
},
columnDefs: [
{ className: "dtr-control", orderable: false, targets: [-1] },
{ visible: false, targets: [0] },
{ orderable: false, targets: [1] },
],
},
"responsive": {
"details": {"type": 'column',"target": -1}
},
"columnDefs": [
{ "className": "dtr-control","orderable": false,"targets": [-1] },
{ "visible": false, "targets": [0]},
{ "orderable": false, "targets": [1]}
],
});
);
let table_dt = table.DataTable();
$("#tabs a[data-bs-toggle='tab']").on("shown.bs.tab", function (e) {

View File

@ -295,7 +295,7 @@
$(document).ready(function () {
// We show table ordered by descending dates by default
// (so that the more recent query is shown first)
var table = KohaTable(".historyt", {
let history_tables = $(".historyt").kohaTable({
order: [[1, "desc"]],
dom: '<"top"<"table_entries"><"table_controls"fB>>t',
columnDefs: [
@ -312,7 +312,7 @@
});
$('a[data-bs-toggle="tab"]').on("shown.bs.tab", function (e) {
table.DataTable().responsive.recalc();
history_tables.DataTable().responsive.recalc();
});
$(".CheckNone").click(function (e) {