Bug 30055: Don't hardcode the default sort column

At this point it does not change anything, all calls to
members/search.pl has "name" in second column, but that will be helpful
in follow-up bugs.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Séverine Queune <severine.queune@bulac.fr>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
This commit is contained in:
Jonathan Druart 2022-02-17 10:57:25 +01:00 committed by Fridolin Somers
parent 4a38660680
commit a4366b0b45

View file

@ -182,6 +182,8 @@
];
},
};
[% SET default_sort_column = "name" %]
[% SET order_column_index = 0 %]
patrons_table = $("#memberresultst").kohaTable({
"ajax": {
[% SWITCH filter %]
@ -198,10 +200,12 @@
[% END %]
},
embed: ['extended_attributes'],
"order": [[ 1, "asc" ]],
"iDeferLoading": 0,
"columns": [
[% FOR column IN columns %]
[% IF default_sort_column == column %]
[% order_column_index = loop.count - 1%]
[% END %]
[% SWITCH column %]
[% CASE 'cardnumber' %]
{
@ -289,6 +293,7 @@
[% UNLESS loop.last %],[% END %]
[% END %]
],
"order": [[ [% order_column_index %], "asc" ]],
'bAutoWidth': false,
'sPaginationType': 'full_numbers',
"iDisplayLength": [% Koha.Preference('PatronsPerPage') | html %],