On the suggestions management page the table has a column called "Suggested by - on". Some librarians would like to be able to sort by both patron name and suggestion date and they currently cannot since it is a single column. This should be 2 columns. The same is true for the "Managed by - on" column.
Created attachment 96642 [details] [review] Bug 24308: Suggestions table on suggestions.pl should have separate columns for dates This patch sepearetes the "Suggested by - on" and "Managed by - on" columns into sepearte columns for the names and dates for better sortability. It adds a data-order class to the <td> so it will sort the dates correctly.$ TEST PLAN: 1. Have multiple suggestions with multiple dates. Make sure some are Pending, Accepted, Checked, Rejected, Available, and Ordered 2. Notice the 'Suggested by - on' and 'Managed by - on' are a single column and you cannot sort by date. 3. Apply patch 4. The tables should now have seprate columns "Suggested on" and "Managed on" that are sortable by date. 5. Make sure you can sort in the "Pending", "Accepted", and "Rejected" columns. 6. Sign off
Hi Lucas, this already looks nice, but I think we need a little magic for the dates to sort correctly in all date formats. At the moment it appears to only sort alphabetically.
I think this sorts correctly with the attribute data-order, which is the unformatted date. ie (2019-11-11). I can't make it sort wrong. Owen, any advice here? Thanks
I think I must have missed the data-order attribute looking at it the first time (sorry!). Not sure if that's the standard way, but it makes sense at first glance.
Just for reference, here is the method we've used most commonly: https://wiki.koha-community.org/wiki/DataTables_HowTo#Sorting_dates_regardless_of_date_format_preference We added the "title-string" sorting method when we were on DataTables 1.9.x. The use of HTML5 data attributes was introduced with DataTables v1.10.5, after the other method had become our standard. There's no reason not to switch to this more up-to-date sorting configuration especially since it's built into DataTables instead of relying on an addition.
Created attachment 96745 [details] [review] Bug 24308: Suggestions table on suggestions.pl should have separate columns for dates Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Created attachment 96774 [details] [review] Bug 24308: Suggestions table on suggestions.pl should have separate columns for dates Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Nice work everyone! Pushed to master for 20.05
Pushed to 19.11.x branch for 19.11.02
backported to 19.05.x for 19.05.07
Enhancement will not be backported to 18.11.x series