Bugzilla – Attachment 106967 Details for
Bug 25968
Make logs sort by date descending as a default and add column configuration options
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 25968: Make logs sort by date descending as a default
Bug-25968-Make-logs-sort-by-date-descending-as-a-d.patch (text/plain), 4.88 KB, created by
ByWater Sandboxes
on 2020-07-16 19:27:42 UTC
(
hide
)
Description:
Bug 25968: Make logs sort by date descending as a default
Filename:
MIME Type:
Creator:
ByWater Sandboxes
Created:
2020-07-16 19:27:42 UTC
Size:
4.88 KB
patch
obsolete
>From b23ea0810d84f5c08d2cacb8b9cfad5f7b4364b5 Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Fri, 10 Jul 2020 13:19:14 +0000 >Subject: [PATCH] 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> >--- > admin/columns_settings.yml | 17 +++++++++++++++++ > .../intranet-tmpl/prog/en/modules/tools/viewlog.tt | 12 +++++++++--- > koha-tmpl/intranet-tmpl/prog/js/viewlog.js | 6 ++++++ > 3 files changed, 32 insertions(+), 3 deletions(-) > >diff --git a/admin/columns_settings.yml b/admin/columns_settings.yml >index 05308af99d..a4c65fbad9 100644 >--- a/admin/columns_settings.yml >+++ b/admin/columns_settings.yml >@@ -1361,6 +1361,23 @@ modules: > columnname: spent > > tools: >+ logviewer: >+ logst: >+ columns: >+ - >+ columnname: date >+ - >+ columnname: librarian >+ - >+ columnname: module >+ - >+ columnname: action >+ - >+ columnname: object >+ - >+ columnname: info >+ - >+ columnname: interface > notices: > lettert: > columns: >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tt >index 259d36d32b..6700f30fe4 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tt >@@ -4,6 +4,7 @@ > [% USE AuthorisedValues %] > [% USE Branches %] > [% USE KohaDates %] >+[% USE TablesSettings %] > [% SET footerjs = 1 %] > [% INCLUDE 'doc-head-open.inc' %] > <title> >@@ -221,8 +222,8 @@ fieldset.rows label.viewlog { > </form> > [% IF ( do_it ) %] > [% IF ( total ) %] >- <h4>[% total | html %] lines found.</h4> >- <table> >+ <h3>Log entries</h3> >+ <table id="logst"> > <thead> > <tr> > <th>Date</th> >@@ -237,7 +238,7 @@ fieldset.rows label.viewlog { > <tbody> > [% FOREACH loopro IN looprow %] > <tr> >- <td>[% loopro.timestamp | $KohaDates with_hours=1 %]</td> >+ <td data-order="[% loopro.timestamp | html %]">[% loopro.timestamp | $KohaDates with_hours=1 %]</td> > <td> > [% IF loopro.librarian %] > <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% loopro.librarian.borrowernumber | uri %]" title="display detail for this librarian."> [% IF ( loopro.librarian.firstname ) || ( loopro.librarian.surname ) %][% loopro.librarian.firstname | html %] [% loopro.librarian.surname | html %] ([% loopro.librarian.borrowernumber | html %]) [% ELSE %][% loopro.librarian.borrowernumber | html %][% END %]</a> >@@ -324,11 +325,16 @@ fieldset.rows label.viewlog { > > [% MACRO jsinclude BLOCK %] > [% INCLUDE 'calendar.inc' %] >+ [% INCLUDE 'datatables.inc' %] >+ [% INCLUDE 'columns_settings.inc' %] > [% Asset.js("js/tools-menu.js") | $raw %] > [% IF ( circulation ) %] > [% INCLUDE 'str/members-menu.inc' %] > [% Asset.js("js/members-menu.js") | $raw %] > [% END %] >+ <script> >+ var columns_settings = [% TablesSettings.GetColumns('tools', 'logviewer', 'logst', 'json') | $raw %]; >+ </script> > [% Asset.js("js/viewlog.js") | $raw %] > [% END %] > >diff --git a/koha-tmpl/intranet-tmpl/prog/js/viewlog.js b/koha-tmpl/intranet-tmpl/prog/js/viewlog.js >index ca7f5a3aa3..1354c95e0a 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/viewlog.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/viewlog.js >@@ -61,4 +61,10 @@ $(document).ready(function(){ > tickAll('interfaces'); > } > }); >+ >+ var logst = KohaTable("logst", { >+ "autoWidth": false, >+ "order": [[0, "desc"]], >+ "pagingType" : "full" >+ }, columns_settings); > }); >-- >2.11.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 25968
:
106769
|
106967
|
107552
|
107593