Bug 38984: Add NoSort when can replace targets

In those occurrences we can simply use NoSort. It fixes some bugs, where
the display of the column depends on some pref's values

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
Jonathan Druart 2025-01-28 11:32:21 +01:00 committed by Katrin Fischer
parent 9b39cddab3
commit af48a917fc
No known key found for this signature in database
GPG Key ID: 0EF6E2C03357A834
37 changed files with 64 additions and 118 deletions

View File

@ -16,7 +16,7 @@
<th>End date</th>
<th>Enrolled patrons</th>
[% UNLESS destination == 'holds' %]
<th>&nbsp;</th>
<th class="NoSort">&nbsp;</th>
[% END %]
</tr>
</thead>

View File

@ -271,7 +271,7 @@
<th>Billing place</th>
<th>Delivery place</th>
<th>Number of baskets</th>
<th>Action</th>
<th class="NoSort">Action</th>
</tr>
</thead>
<tbody>
@ -323,7 +323,7 @@
<th>Billing place</th>
<th>Delivery place</th>
<th>Number of baskets</th>
<th>Action</th>
<th class="NoSort">Action</th>
</tr>
</thead>
<tbody>
@ -426,7 +426,6 @@
[% END %]
[% UNLESS ( grouping ) %]
let dt_params = {
columnDefs: [{ targets: [-1], orderable: false, searchable: false }],
autoWidth: false,
pagingType: "full",
};

View File

@ -135,7 +135,7 @@
<th>Basket group</th>
<th>Internal note</th>
<th>Closed</th>
<th class="noExport">Actions</th>
<th class="noExport NoSort">Actions</th>
</tr>
</thead>
<tbody>
@ -269,7 +269,6 @@
searching: false,
info: false,
order: [[1, "asc"]],
columnDefs: [{ targets: [-1], orderable: false }],
});
$("#supplierlist").change(function () {
var id = $(this).find("option:selected").val();

View File

@ -59,7 +59,7 @@
[% IF CAN_user_acquisition_merge_invoices %]
<th>&nbsp;</th>
[% END %]
<th>&nbsp;</th>
<th class="NoSort">&nbsp;</th>
<th>Invoice number</th>
<th>Vendor</th>
<th>Shipment date</th>
@ -67,7 +67,7 @@
<th>Received bibliographic records</th>
<th>Received items</th>
<th>Status</th>
<th>&nbsp;</th>
<th class="NoSort">&nbsp;</th>
</tr>
</thead>
<tbody>
@ -500,10 +500,7 @@
var resultst = $("table.result").kohaTable({
paging: false,
columnDefs: [
{ orderable: false, targets: [1, -1] },
{ visible: false, targets: [0] },
],
columnDefs: [{ visible: false, targets: [0] }],
autoWidth: false,
});

View File

@ -57,7 +57,7 @@
<th>Price</th>
<th>Quantity</th>
<th>Total</th>
<th>&nbsp;</th>
<th class="NoSort">&nbsp;</th>
</tr>
</thead>
<tbody>
@ -121,7 +121,6 @@
var suggestionst = $("#suggestionst").kohaTable({
columnDefs: [
{ targets: [0], visible: false, searchable: true }, // must be searchable for filtering
{ targets: [-1], orderable: false, searchable: false },
],
pagingType: "full",
});

View File

@ -153,14 +153,14 @@
<th>Order line</th>
<th title="Item holds / Total holds">Holds</th>
<th>Summary</th>
<th>More</th>
<th class="NoSort">More</th>
<th>Replacement price</th>
<th>Quantity</th>
<th>Fund</th>
<th>Est cost</th>
<th>Actual cost</th>
<th>TOTAL</th>
<th></th>
<th class="NoSort"></th>
</tr>
</thead>
<tfoot>
@ -376,7 +376,6 @@
[5, 10, 20, 50, 100, -1],
[5, 10, 20, 50, 100, _("All")],
],
columnDefs: [{ targets: [5, -1], orderable: false, searchable: false }],
columns: [
{ type: "html" },
{ type: "html" },

View File

@ -190,9 +190,9 @@
<th>ISBN</th>
<th>LCCN</th>
[% IF ( Koha.Preference('AdditionalFieldsInZ3950ResultSearch') != '' ) %]
<th>Additional fields</th>
<th class="NoSort">Additional fields</th>
[% END %]
<th>Actions</th>
<th class="NoSort">Actions</th>
</tr></thead
>
<tbody
@ -334,10 +334,7 @@
<script>
$(document).ready(function () {
var resultst = $("#resultst").kohaTable({
columnDefs: [
{ targets: [-1, -2], orderable: false, searchable: false },
{ targets: [1], type: "nsb-nse" },
],
columnDefs: [{ targets: [1], type: "nsb-nse" }],
order: [[1, "asc"]],
paginate: false,
searching: false,

View File

@ -484,7 +484,7 @@
<th>End date</th>
<th>Locked</th>
<th>Total</th>
<th class="noExport">Actions</th>
<th class="noExport NoSort">Actions</th>
</tr>
</thead>
<tbody>
@ -524,7 +524,7 @@
<th>End date</th>
<th>Locked</th>
<th>Total</th>
<th class="noExport">Actions</th>
<th class="noExport NoSort">Actions</th>
</tr>
</thead>
<tbody>
@ -568,7 +568,6 @@
[% END %]
let dt_params = {
columnDefs: [{ targets: [-1], orderable: false, searchable: false }],
pagingType: "full",
autoWidth: false,
};

View File

@ -248,7 +248,7 @@
<th>Repeatable</th>
<th>Mandatory</th>
<th>Authorized<br />value</th>
<th>&nbsp;</th>
<th class="NoSort">&nbsp;</th>
</tr>
</thead>
<tbody>
@ -290,7 +290,6 @@
<script>
$(document).ready(function () {
$("#table_authtagstructure").kohaTable({
columnDefs: [{ targets: [-1], orderable: false, searchable: false }],
pagingType: "full",
});
});

View File

@ -83,7 +83,7 @@
<thead>
<tr>
<th>Library</th>
<th>Allow transfer?</th>
<th class="NoSort">Allow transfer?</th>
</tr>
</thead>
@ -180,7 +180,6 @@
[% FOREACH codes_loo IN codes_loop %]
$("#[% codes_loo.code | html %]table").kohaTable({
columnDefs: [{ targets: [-1], orderable: false, searchable: false }],
paginate: false,
});
[% END %]

View File

@ -171,8 +171,8 @@
<th>Description</th>
<th>Library</th>
<th>Library default</th>
<th>Initial float</th>
<th class="noExport">Actions</th>
<th class="NoSort">Initial float</th>
<th class="noExport NoSort">Actions</th>
</thead>
<tbody>
[% FOREACH cash_register IN cash_registers %]
@ -237,7 +237,6 @@
<script>
$(document).ready(function () {
var crtable = $("#table_cash_registers").kohaTable({
columnDefs: [{ targets: [-1, -2], orderable: false, searchable: false }],
order: [[1, "asc"]],
paginationType: "full",
});

View File

@ -48,7 +48,7 @@
<th>Tag</th>
<th>Subfield</th>
<th>Lib</th>
<th>&nbsp;</th>
<th class="NoSort">&nbsp;</th>
</tr></thead
>
<tbody>
@ -109,7 +109,6 @@
}
$(document).ready(function () {
$("#kohafields").kohaTable({
columnDefs: [{ targets: [-1], orderable: false, searchable: false }],
paging: false,
});

View File

@ -257,7 +257,7 @@
<th>Auth value</th>
<th>Indicator 1</th>
<th>Indicator 2</th>
<th>&nbsp;</th>
<th class="NoSort">&nbsp;</th>
</tr>
</thead>
<tbody>
@ -326,7 +326,6 @@
<script>
$(document).ready(function () {
$("#table_marctagstructure").kohaTable({
columnDefs: [{ targets: [-1], orderable: false, searchable: false }],
pagingType: "full",
});
$("#select_display").on("change", function () {

View File

@ -43,7 +43,7 @@
<thead>
<tr>
<th>Library</th>
<th>Authname</th>
<th class="NoSort">Authname</th>
</tr>
</thead>
<tbody>
@ -73,7 +73,6 @@
<script>
$(document).ready(function () {
$("#od_info").kohaTable({
columnDefs: [{ targets: [-1], orderable: false, searchable: false }],
pagingType: "full",
});
});

View File

@ -334,9 +334,9 @@
<thead
><tr>
<th>Preference</th>
<th>Explanation</th>
<th>Value</th>
<th class="noExport">Actions</th>
<th class="NoSort">Explanation</th>
<th class="NoSort">Value</th>
<th class="noExport NoSort">Actions</th>
</tr></thead
>
<tbody
@ -498,7 +498,6 @@
[% IF ( loop ) %]
$("#sysprefst").kohaTable({
dom: '<"top pager"ilf>t',
columnDefs: [{ targets: [-1, -2, -3], orderable: false }],
paginate: false,
});
[% END %]

View File

@ -220,7 +220,7 @@
<thead
><tr
><th>Target</th><th>Hostname/Port</th><th>Database</th><th>Userid</th><th>Password</th><th>Preselected</th><th>Rank</th><th>Syntax</th><th>Encoding</th><th>Timeout</th><th>Record type</th><th>Attributes</th
><th class="noExport">Actions</th>
><th class="noExport NoSort">Actions</th>
</tr></thead
>
<tbody>
@ -319,7 +319,6 @@
[% ELSE %]
$(document).ready(function() {
$("#serverst").kohaTable({
columnDefs: [{ targets: [-1], orderable: false, searchable: false }],
pagingType: "full",
});
$(".delete").on("click",function(e){

View File

@ -60,7 +60,7 @@
<table class="historyt">
<thead>
<tr>
<th></th>
<th class="NoSort"></th>
<th>Date</th>
<th>Search</th>
<th>Results</th>
@ -102,7 +102,7 @@
<table class="historyt">
<thead>
<tr>
<th></th>
<th class="NoSort"></th>
<th>Date</th>
<th>Search</th>
<th>Results</th>
@ -146,7 +146,7 @@
<table class="historyt">
<thead>
<tr>
<th></th>
<th class="NoSort"></th>
<th>Date</th>
<th>Search</th>
<th>Results</th>
@ -188,7 +188,7 @@
<table class="historyt">
<thead>
<tr>
<th></th>
<th class="NoSort"></th>
<th>Date</th>
<th>Search</th>
<th>Results</th>
@ -224,7 +224,6 @@
// (so that the more recent query is shown first)
$(".historyt").kohaTable({
order: [[1, "desc"]],
columnDefs: [{ targets: [0], orderable: false, searchable: false }],
pagingType: "full_numbers",
});

View File

@ -100,7 +100,7 @@
[% IF Koha.Preference('AdditionalFieldsInZ3950ResultAuthSearch') %]
<th>Additional fields</th>
[% END %]
<th class="noExport">Actions</th>
<th class="noExport NoSort">Actions</th>
</tr></thead
>
<tbody
@ -267,7 +267,6 @@
$(document).ready(function () {
$("#resultst").kohaTable({
dom: "t",
columnDefs: [{ targets: [-1], orderable: false, searchable: false }],
order: [[1, "asc"]],
paginate: false,
});

View File

@ -221,7 +221,7 @@
<th class="ar-urls">URLs</th>
<th class="ar-patron">Patron</th>
<th class="ar-date">Date</th>
<th class="ar-actions noExport">Actions</th>
<th class="ar-actions noExport NoSort">Actions</th>
</tr>
</thead>
@ -328,7 +328,7 @@
<th class="ar-urls">URLs</th>
<th class="ar-patron">Patron</th>
<th class="ar-date">Date</th>
<th class="ar-actions noExport">Actions</th>
<th class="ar-actions noExport NoSort">Actions</th>
</tr>
</thead>
@ -434,7 +434,7 @@
<th class="ar-urls">URLs</th>
<th class="ar-patron">Patron</th>
<th class="ar-date">Date</th>
<th class="ar-actions noExport">Actions</th>
<th class="ar-actions noExport NoSort">Actions</th>
</tr>
</thead>
@ -574,15 +574,9 @@
if( link.length > 0 ) link[0].focus();
});
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 }],
});
requested_datatable = $("#article-requests-requested-table").kohaTable();
pending_datatable = $("#article-requests-pending-table").kohaTable();
processing_datatable = $("#article-requests-processing-table").kohaTable();
active_datatable = requested_datatable;
activateBatchActions( active_tab );
});

View File

@ -53,7 +53,7 @@
<th>On loan</th>
<th>Home library</th>
<th>Call number</th>
<th>Actions</th>
<th class="NoSort">Actions</th>
</tr>
</thead>
<tbody>
@ -100,9 +100,6 @@
$(document).ready(function() {
[% FOREACH library IN libraries %]
$("#transferst[% library.branchcode | html %]").kohaTable({
columnDefs: [
{ targets: [-1], orderable: false, searchable: false },
],
dom: "t",
paginate: false,
});

View File

@ -50,7 +50,7 @@
<th>On hold for</th>
<th>Home library</th>
<th>Call number</th>
<th>&nbsp;</th>
<th class="NoSort">&nbsp;</th>
</tr></thead
>
<tbody
@ -115,9 +115,6 @@
$(document).ready(function() {
[% FOREACH branchesloo IN branchesloop %]
$("#transferst[% branchesloo.branchcode | html %]").kohaTable({
columnDefs: [
{ targets: [-1], orderable: false, searchable: false },
],
dom: "t",
paginate: false,
});

View File

@ -73,7 +73,7 @@
<th>Public enrollment</th>
<th>Email required</th>
<th>Library</th>
<th class="noExport">Actions</th>
<th class="noExport NoSort">Actions</th>
</tr>
</thead>
<tbody>
@ -151,13 +151,11 @@
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) {

View File

@ -91,7 +91,7 @@
[% CASE 'Description' %]
<th>Description</th>
[% CASE 'Actions' %]
<th class="noExport">Actions</th>
<th class="noExport NoSort">Actions</th>
[% CASE 'Profile ID' %]
<th>Profile ID</th>
[% CASE 'Printer Name' %]
@ -219,7 +219,6 @@
$("#labels-table").kohaTable({
pagingType: "full",
order: [[1, "asc"]],
columnDefs: [{ targets: [-1], orderable: false, searchable: false }],
});
});
</script>

View File

@ -41,7 +41,7 @@
<th>Patron</th>
<th>Library</th>
<th>Date requested</th>
<th>Allow</th>
<th class="NoSort">Allow</th>
</tr>
</thead>
<tbody>
@ -77,7 +77,6 @@
info: true,
searching: true,
order: [[2, "asc"]],
columnDefs: [{ targets: -1, orderable: false }],
});
});
</script>

View File

@ -24,7 +24,7 @@
<table id="catst">
<thead>
<tr>
<th>&nbsp;</th>
<th class="NoSort">&nbsp;</th>
<th>Code</th>
<th>Description</th>
</tr>
@ -68,7 +68,6 @@
$("#catst").kohaTable({
dom: "t",
order: [[2, "asc"]],
columnDefs: [{ targets: [0], orderable: false, searchable: false }],
paginate: false,
});
$("#updatechildf").validate({

View File

@ -114,9 +114,9 @@
[% CASE "Borrower Number" %]
<th>Borrower number</th>
[% CASE "Actions " %]
<th class="noExport">Actions</th>
<th class="noExport NoSort">Actions</th>
[% CASE "Select" -%]
<th>Select</th>
<th class="NoSort">Select</th>
[% CASE %]
<th>[% header_field.field_label | html %]</th>
[% END -%]
@ -310,7 +310,6 @@
$("#description").hide();
[% END %]
$("#batcht").kohaTable({
columnDefs: [{ targets: [-2, -1], orderable: false, searchable: false }],
order: [[0, "asc"]],
pagingType: "full",
lengthMenu: [aLengthMenu, aLengthMenuLabel],

View File

@ -221,7 +221,7 @@
<thead>
<tr>
[% IF ( CAN_user_serials_receive_serials ) %]
<th>Edit</th>
<th class="NoSort">Edit</th>
[% END %]
[% IF ( subscriptions.size > 1 ) %]
<th># Subs</th>
@ -234,7 +234,7 @@
<th>Notes</th>
<th>Library</th>
[% IF ( routing ) %]
<th>Routing</th>
<th class="NoSort">Routing</th>
[% END %]
</tr>
</thead>
@ -360,7 +360,6 @@
$("#subscription_years a:first").tab("show");
}
$(".subscription-year-table").kohaTable({
columnDefs: [{ targets: [0, -1], orderable: false, searchable: false }],
order: [[0, "desc"]],
dom: "t",
autoWidth: false,

View File

@ -295,7 +295,7 @@
<th>Description</th>
<th>Numbering formula</th>
<th>Display order</th>
<th class="noExport">Actions</th>
<th class="noExport NoSort">Actions</th>
</tr>
</thead>
<tbody>
@ -391,7 +391,6 @@
$(document).ready(function(){
$("#numberpatternst").kohaTable({
columnDefs: [{ targets: [-1], orderable: false, searchable: false }],
pagingType: "full",
});

View File

@ -56,8 +56,8 @@
<thead
><tr>
<th>Title</th>
<th>Location</th>
<th>&nbsp;</th>
<th class="NoSort">Location</th>
<th class="NoSort">&nbsp;</th>
</tr></thead
>
@ -162,7 +162,6 @@
}
});
$("#itemst").kohaTable({
columnDefs: [{ targets: [-1, -2], orderable: false, searchable: false }],
order: [[0, "asc"]],
pagingType: "full",
});

View File

@ -173,7 +173,7 @@
<table id="biblios" class="records">
<thead>
<tr>
<th></th>
<th class="NoSort"></th>
<th>Biblionumber</th>
<th>Title</th>
<th>Items</th>
@ -217,7 +217,7 @@
<table id="authorities" class="records">
<thead>
<tr>
<th></th>
<th class="NoSort"></th>
<th>AuthID</th>
<th>Summary</th>
<th>Used in</th>
@ -348,7 +348,6 @@
$("#biblios").kohaTable({
columnDefs: [
{ targets: [0], orderable: false, searchable: false },
{ targets: [3, 4], type: "num-html" },
],
dom: "t",
@ -358,7 +357,6 @@
$("#authorities").kohaTable({
columnDefs: [
{ targets: [0], orderable: false, searchable: false },
{ targets: [3], type: "num-html" },
],
dom: "t",

View File

@ -210,10 +210,10 @@
<table id="biblios" class="records">
<thead>
<tr>
<th>&nbsp;</th>
<th class="NoSort">&nbsp;</th>
<th>Biblionumber</th>
<th>Title</th>
<th>&nbsp;</th>
<th class="NoSort">&nbsp;</th>
</tr>
</thead>
<tbody>
@ -249,10 +249,10 @@
<table id="authorities" class="records">
<thead>
<tr>
<th></th>
<th class="NoSort">&nbsp;</th>
<th>AuthID</th>
<th>Summary</th>
<th>&nbsp;</th>
<th class="NoSort">&nbsp;</th>
</tr>
</thead>
<tbody>
@ -355,7 +355,6 @@
$("#biblios").kohaTable({
columnDefs: [
{ targets: [0, 3], orderable: false, searchable: false },
{ targets: [1], type: "num-html" },
],
dom: "t",
@ -365,7 +364,6 @@
$("#authorities").kohaTable({
columnDefs: [
{ targets: [0, 3], orderable: false, searchable: false },
{ targets: [1], type: "num-html" },
],
dom: "t",

View File

@ -314,11 +314,11 @@
<caption class="sr-only">Items in your cart</caption>
<thead>
<tr>
<th class="noprint">&nbsp;</th>
<th class="noprint NoSort">&nbsp;</th>
<th>Title</th>
<th>Author</th>
<th>Year</th>
<th>Location (Status)</th>
<th class="NoSort">Location (Status)</th>
</tr>
</thead>
<tbody>
@ -546,7 +546,6 @@
if( $("#itemst").length > 0 ){
var itemst = $("#itemst").kohaTable({
order: [[1, "asc"]],
columnDefs: [{ targets: [0, -1], orderable: false, searchable: false }],
});
var buttons = new $.fn.dataTable.Buttons(itemst, {

View File

@ -29,8 +29,8 @@
<thead>
<tr>
<th>Citation</th>
<th>Koha</th>
<th>Sudoc</th>
<th class="NoSort">Koha</th>
<th class="NoSort">Sudoc</th>
</tr>
</thead>
<tbody>
@ -54,7 +54,6 @@
$(document).ready(function () {
$("table").kohaTable({
filter: false,
columnDefs: [{ targets: [-1, -2], orderable: false }],
});
$(".role").click(function () {

View File

@ -148,7 +148,7 @@
<th>Status</th>
<th>Request placed</th>
<th>Last updated</th>
<th></th>
<th class="NoSort"></th>
</tr>
</thead>
<tbody>
@ -370,7 +370,6 @@
[% INCLUDE 'datatables.inc' %]
<script>
$("#illrequestlist").kohaTable({
columnDefs: [{ targets: [-1], orderable: false, searchable: false }],
order: [[3, "desc"]],
});
$("#backend-dropdown-options").removeClass("nojs");

View File

@ -241,7 +241,6 @@
columnDefs: [
{ className: "dtr-control", orderable: false, targets: [-1] },
{ visible: false, targets: [0] },
{ orderable: false, targets: [1] },
],
},
);

View File

@ -91,7 +91,7 @@
<caption class="sr-only">Current session</caption>
<thead>
<tr>
<th></th>
<th class="NoSort"></th>
<th>Date</th>
<th>Search</th>
<th>Results</th>
@ -297,10 +297,7 @@
let history_tables = $(".historyt").kohaTable({
order: [[1, "desc"]],
dom: '<"top"<"table_entries"><"table_controls"fB>>t',
columnDefs: [
{ targets: [0], orderable: false, searchable: false },
{ className: "dtr-control", orderable: false, targets: -1 },
],
columnDefs: [{ className: "dtr-control", orderable: false, targets: -1 }],
language: {
search: "_INPUT_",
searchPlaceholder: _("Search"),

View File

@ -164,7 +164,7 @@
<caption>Your tags</caption>
<thead>
<tr>
<th>&nbsp;</th>
<th class="NoSort">&nbsp;</th>
<th>Term</th>
<th class="all anti-the">Title</th>
<th>Date added</th>
@ -298,7 +298,6 @@
$("#mytagst").kohaTable({
sorting: [[2, "asc"]],
columnDefs: [
{ targets: [0], orderable: false, searchable: false },
{ className: "dtr-control", orderable: false, targets: -1 },
{ responsivePriority: 1, targets: 2 },
],