Bugzilla – Attachment 54296 Details for
Bug 16829
action_logs should have an 'interface' column
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 16829: Add 'interface' to the log viewer
Bug-16829-Add-interface-to-the-log-viewer.patch (text/plain), 5.46 KB, created by
Jonathan Druart
on 2016-08-11 10:28:16 UTC
(
hide
)
Description:
Bug 16829: Add 'interface' to the log viewer
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2016-08-11 10:28:16 UTC
Size:
5.46 KB
patch
obsolete
>From f4b50ce46f0d2ab496a5e6b9945dbb4133de4e34 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Fri, 1 Jul 2016 18:27:03 -0300 >Subject: [PATCH] Bug 16829: Add 'interface' to the log viewer > >This patch introduces the 'interface' filter to the log viewer. > >To test: >- Apply the patch >- Open the log viewer >=> SUCCESS: As default, 'All' interfaces are chosen. OPAC, Intranet and SIP are presented >- Do a lot of log searches, verify that the interface column shows what is expected. >=> SUCCESS: The chosen 'interfaces' are kept when rendering results. > >Sponsored-by: NEKLS > >Signed-off-by: Nicole C Engard <nengard@bywatersolutions.com> > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >--- > .../intranet-tmpl/prog/en/modules/tools/viewlog.tt | 30 ++++++++++++++++++++++ > tools/viewlog.pl | 7 +++-- > 2 files changed, 35 insertions(+), 2 deletions(-) > >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 472d87c..e6e2bdc 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tt >@@ -50,6 +50,16 @@ > [% END %] > [% END %] > >+[% BLOCK translate_log_interface %] >+[% SWITCH interface %] >+[% CASE 'INTRANET' %]Intranet >+[% CASE 'OPAC' %]OPAC >+[% CASE 'SIP' %]SIP >+[% CASE 'COMMANDLINE' %]Command-line >+[% CASE %][% interface %] >+[% END %] >+[% END %] >+ > <div id="breadcrumbs"> > <a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> › > [% IF ( do_it ) %] >@@ -119,6 +129,24 @@ > <label for="info">Info:</label> > <input type="text" id="info" name="info" value="[% info | html %]" /> > </li> >+ <li> >+ <label for="interfaces">Interface:</label> >+ <select name="interfaces" id="interfaces" multiple="multiple"> >+ [% UNLESS interfaces %] >+ <option value="" selected="selected">All</option> >+ [% ELSE %] >+ <option value="">All</option> >+ [% END %] >+ >+ [% FOREACH interf IN [ 'INTRANET' 'OPAC' 'SIP' 'COMMANDLINE' ] %] >+ [% IF interfaces.grep(interf).size %] >+ <option value="[% interf %]" selected="selected">[% PROCESS translate_log_interface interface=interf %]</option> >+ [% ELSE %] >+ <option value="[% interf %]">[% PROCESS translate_log_interface interface=interf %]</option> >+ [% END %] >+ [% END %] >+ </select> >+ </li> > <li> > <label for="from"> Display from: </label> <input type="text" size="10" id="from" name="from" value="[% datefrom | html %]" class="datepickerfrom" /> > <div class="hint">[% INCLUDE 'date-format.inc' %]</div> >@@ -167,6 +195,7 @@ > <th>Action</th> > <th>Object</th> > <th>Info</th> >+ <th>Interface</th> > </tr> > </thead> > <tbody> >@@ -210,6 +239,7 @@ > [% loopro.info |html %] > [% END %] > </td> >+ <td>[% PROCESS translate_log_interface interface=loopro.interface %]</td> > </tr> > [% END %] > </tbody> >diff --git a/tools/viewlog.pl b/tools/viewlog.pl >index d0dc7cd..13ea2ab 100755 >--- a/tools/viewlog.pl >+++ b/tools/viewlog.pl >@@ -48,6 +48,7 @@ my $do_it = $input->param('do_it'); > my @modules = $input->multi_param("modules"); > my $user = $input->param("user") // ''; > my @actions = $input->multi_param("actions"); >+my @interfaces = $input->multi_param("interfaces"); > my $object = $input->param("object"); > my $info = $input->param("info"); > my $datefrom = $input->param("from"); >@@ -105,10 +106,11 @@ $template->param( > if ($do_it) { > > my @data; >- my ( $results, $modules, $actions ); >+ my ( $results, $modules, $actions, $interfaces ); > if ( defined $actions[0] && $actions[0] ne '' ) { $actions = \@actions; } # match All means no limit > if ( $modules[0] ne '' ) { $modules = \@modules; } # match All means no limit >- $results = GetLogs( $datefrom, $dateto, $user, $modules, $actions, $object, $info ); >+ if ( defined $interfaces[0] && $interfaces[0] ne '' ) { $interfaces = \@interfaces; } # match All means no limit >+ $results = GetLogs( $datefrom, $dateto, $user, $modules, $actions, $object, $info, $interfaces ); > @data = @$results; > foreach my $result (@data) { > >@@ -170,6 +172,7 @@ if ($do_it) { > src => $src, > modules => \@modules, > actions => \@actions, >+ interfaces => \@interfaces > ); > > # Used modules >-- >2.8.1
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 16829
:
53060
|
53061
|
53062
|
53063
|
53064
|
53199
|
53200
|
53201
|
53202
|
53203
|
54294
|
54295
| 54296 |
54297
|
54298