Bug 25968

Summary: Make logs sort by date descending as a default and add column configuration options
Product: Koha Reporter: Barbara Johnson <barbara.johnson>
Component: TemplatesAssignee: Owen Leonard <oleonard>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: aleisha, jonathan.druart, lucas, martin.renvoize
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
20.11.00
Attachments: Bug 25968: Make logs sort by date descending as a default
Bug 25968: Make logs sort by date descending as a default
Bug 25968: Make logs sort by date descending as a default
Bug 25968: Make logs sort by date descending as a default

Description Barbara Johnson 2020-07-09 17:14:26 UTC
It would be helpful to have the logs sort by date descending so that you can view the newest items at the top of the page rather than having to scroll to the bottom.
Comment 1 Owen Leonard 2020-07-10 13:33:35 UTC Comment hidden (obsolete)
Comment 2 ByWater Sandboxes 2020-07-16 19:27:42 UTC
Created attachment 106967 [details] [review]
Bug 25968: Make logs sort by date descending as a default

This patch adds DataTables with columns configuration to the log viewer.
The table of log entries is now sorted by default by date descending.

To test, apply the patch and go to Administration -> Table settings.

 - Expand the "Tools" section and confirm that there is a section for
   "logviewer."
 - Go to Tools -> Log viewer.
 - Perform a search which will return multiple results.
 - Confirm that the results are sorted by date descending.
 - Test that the table controls work correctly: Paging, columns, export.
 - Return to the Table settings administration page and test that
   changes to those settings are correctly reflected in the log viewer
   table.

Signed-off-by: barbara <barbara.johnson@bedfordtx.gov>
Comment 3 Owen Leonard 2020-07-28 19:28:49 UTC
*** Bug 24251 has been marked as a duplicate of this bug. ***
Comment 4 Katrin Fischer 2020-07-29 22:35:35 UTC
Created attachment 107552 [details] [review]
Bug 25968: Make logs sort by date descending as a default

This patch adds DataTables with columns configuration to the log viewer.
The table of log entries is now sorted by default by date descending.

To test, apply the patch and go to Administration -> Table settings.

 - Expand the "Tools" section and confirm that there is a section for
   "logviewer."
 - Go to Tools -> Log viewer.
 - Perform a search which will return multiple results.
 - Confirm that the results are sorted by date descending.
 - Test that the table controls work correctly: Paging, columns, export.
 - Return to the Table settings administration page and test that
   changes to those settings are correctly reflected in the log viewer
   table.

Signed-off-by: barbara <barbara.johnson@bedfordtx.gov>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 5 Katrin Fischer 2020-07-29 22:35:56 UTC
Extended the bug description a bit and it looks like this also fixed the date sorting for different formats?
Comment 6 Jonathan Druart 2020-07-30 14:17:48 UTC
Created attachment 107593 [details] [review]
Bug 25968: Make logs sort by date descending as a default

This patch adds DataTables with columns configuration to the log viewer.
The table of log entries is now sorted by default by date descending.

To test, apply the patch and go to Administration -> Table settings.

 - Expand the "Tools" section and confirm that there is a section for
   "logviewer."
 - Go to Tools -> Log viewer.
 - Perform a search which will return multiple results.
 - Confirm that the results are sorted by date descending.
 - Test that the table controls work correctly: Paging, columns, export.
 - Return to the Table settings administration page and test that
   changes to those settings are correctly reflected in the log viewer
   table.

Signed-off-by: barbara <barbara.johnson@bedfordtx.gov>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

JD amended patch: Fix indentation in .yml to match other entries
Comment 7 Jonathan Druart 2020-07-30 15:47:21 UTC
Pushed to master for 20.11, thanks to everybody involved!
Comment 8 Lucas Gass 2020-08-06 20:22:15 UTC
Handy and small enhancement, choosing to backport to 20.05.x for 20.05.03
Comment 9 Aleisha Amohia 2020-08-07 02:11:57 UTC
enhancement, not backported to 19.11.x (even though I agree, it is a handy one)
Comment 10 Jonathan Druart 2020-08-07 14:38:21 UTC
(In reply to Lucas Gass from comment #8)
> Handy and small enhancement, choosing to backport to 20.05.x for 20.05.03

Lucas, there is a failure coming from this backport:

23:25:27 koha_1       | #   Failed test '/kohadevbox/koha/koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tt'
23:25:27 koha_1       | #   at xt/author/valid-templates.t line 141.
23:25:27 koha_1       | # plugin error - TablesSettings: plugin not found

ColumnsSettings has been replaced by TablesSettings.
Comment 11 Lucas Gass 2020-08-13 14:34:41 UTC
While handy, this patch does cause some problems in 20.05 as Jonathan mentions. Since it is an enhancement I am reverting it from the 20.05.x series.

no 20.05.x backport
Comment 12 Katrin Fischer 2022-07-02 21:44:27 UTC
*** Bug 27809 has been marked as a duplicate of this bug. ***