Bug 34356: Make sort order always default to correct column

To test:
1- Check out an item to a patron
2- View checkout history, default sort is on 'Date due'
3- Enable RecordStaffUserOnCheckout
4- View checkout history, default sort is on 'Checked out by'
5- Apply patch
6- Table should sort to 'Date due' no matter what the sys pref is set to

Signed-off-by: Jason <jrobb@sekls.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit edad82662c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 80cc0c03aa)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
This commit is contained in:
Lucas Gass 2023-08-17 17:25:56 +00:00 committed by Matt Blenkinsop
parent 63337f2c52
commit 722ce8a403

View file

@ -174,10 +174,15 @@
[% Asset.js("js/checkout_renewals_modal.js") | $raw %]
<script id="js">
$(document).ready(function() {
[% IF Koha.Preference('RecordStaffUserOnCheckout') %]
var column_sort = 11;
[% ELSE %]
var column_sort = 10;
[% END %]
var table_settings = [% TablesSettings.GetTableSettings('members', 'checkouthistory', 'checkouthistory-table', 'json') | $raw %];
var table = KohaTable("table_readingrec", {
"sPaginationType": "full",
"aaSorting": [[10, 'desc']]
"aaSorting": [[column_sort, 'desc']]
}, table_settings);
$("#tabs a[data-toggle='tab']").on("shown.bs.tab", function (e) {