Browse Source

Bug 26664: Fix sorting for date last seen in inventory tool

This adds the standard datatable sorting for dates to the inventory
table as described here:
https://wiki.koha-community.org/wiki/DataTables_HowTo#Sorting_dates_regardless_of_date_format_preference

To test:
- Go to the inventory tool
- Search for a big sample list of items with different date last seen
- Sort the table now by "date last seen" by clicking on the table header cell
- Try different settings of the DateFormat system preferences
- Verify sorting is incorrect (alphabetic, not by date)
- Apply patch
- Repeat testing and very all is sorting correctly now

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
20.11.x
Katrin Fischer 12 months ago
committed by Jonathan Druart
parent
commit
9adafd6404
  1. 5
      koha-tmpl/intranet-tmpl/prog/en/modules/tools/inventory.tt

5
koha-tmpl/intranet-tmpl/prog/en/modules/tools/inventory.tt

@ -200,7 +200,7 @@
<th>Lost</th>
<th>Damaged</th>
<th>Withdrawn</th>
<th>Last seen</th>
<th class="title-string">Last seen</th>
<th>Problems</th>
</tr>
</thead>
@ -239,7 +239,7 @@
[% result.withdrawn | html %]
</td>
<td>
[% result.datelastseen | $KohaDates %]
<span title="[% result.datelastseen %]">[% result.datelastseen | $KohaDates%]</span>
</td>
<td>
[% FOREACH problem IN result.problems %]
@ -350,6 +350,7 @@
"aoColumnDefs": [
{ "sType": "anti-the", "aTargets" : [ "anti-the" ] },
{ "bSortable": false, "bSearchable": false, "aTargets": [ 0 ] },
{ "sType": "title-string", "aTargets" : [ "title-string" ] },
],
// 3rd column is callnumber
"aaSorting": [[ 2, "asc" ]],

Loading…
Cancel
Save