Bug 16829

Summary: action_logs should have an 'interface' column
Product: Koha Reporter: Tomás Cohen Arazi (tcohen) <tomascohen>
Component: Transaction logsAssignee: Tomás Cohen Arazi (tcohen) <tomascohen>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: jonathan.druart, josef.moravec, kyle, tomascohen, veron
Version: Main   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12235
Change sponsored?: Sponsored Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Bug Depends on:    
Bug Blocks: 14642    
Attachments: Bug 16829: Add 'interface' column to action_logs
Bug 16829: make logaction and GetLogs aware of the interface column
Bug 16829: Add 'interface' to the log viewer
Bug 16829: DBIx update
Bug 16829: Unit tests for logaction's 'interface parameter'
Bug 16829: Add 'interface' column to action_logs
Bug 16829: make logaction and GetLogs aware of the interface column
Bug 16829: Add 'interface' to the log viewer
Bug 16829: DBIx update
Bug 16829: Unit tests for logaction's 'interface parameter'
Bug 16829: Add 'interface' column to action_logs
Bug 16829: make logaction and GetLogs aware of the interface column
Bug 16829: Add 'interface' to the log viewer
Bug 16829: DBIx update
Bug 16829: Unit tests for logaction's 'interface parameter'

Description Tomás Cohen Arazi (tcohen) 2016-06-28 22:13:38 UTC
This will be handy for further developments.
Comment 1 Tomás Cohen Arazi (tcohen) 2016-07-03 23:48:27 UTC Comment hidden (obsolete)
Comment 2 Tomás Cohen Arazi (tcohen) 2016-07-03 23:48:30 UTC Comment hidden (obsolete)
Comment 3 Tomás Cohen Arazi (tcohen) 2016-07-03 23:48:34 UTC Comment hidden (obsolete)
Comment 4 Tomás Cohen Arazi (tcohen) 2016-07-03 23:48:36 UTC Comment hidden (obsolete)
Comment 5 Tomás Cohen Arazi (tcohen) 2016-07-03 23:48:39 UTC Comment hidden (obsolete)
Comment 6 Nicole C. Engard 2016-07-07 19:19:25 UTC Comment hidden (obsolete)
Comment 7 Nicole C. Engard 2016-07-07 19:19:30 UTC Comment hidden (obsolete)
Comment 8 Nicole C. Engard 2016-07-07 19:19:33 UTC Comment hidden (obsolete)
Comment 9 Nicole C. Engard 2016-07-07 19:19:37 UTC Comment hidden (obsolete)
Comment 10 Nicole C. Engard 2016-07-07 19:19:41 UTC Comment hidden (obsolete)
Comment 11 Jonathan Druart 2016-08-02 12:07:57 UTC
Tomás, don't you think we should try and fill the interface column for existing values?
Comment 12 Tomás Cohen Arazi (tcohen) 2016-08-09 19:20:31 UTC
(In reply to Jonathan Druart from comment #11)
> Tomás, don't you think we should try and fill the interface column for
> existing values?

It could be done. I'm wondering how can we determine the source of the log. For example regarding holds, or renewals. We should (maybe) have a cli script that can be run anytime t ofix previous logs.

This should go to a separate bug IMHO.
Comment 13 Kyle M Hall (khall) 2016-08-10 13:33:27 UTC
> This should go to a separate bug IMHO.

I agree, it would make more sense as a separate bug and patch.
Comment 14 Jonathan Druart 2016-08-11 10:28:08 UTC
Created attachment 54294 [details] [review]
Bug 16829: Add 'interface' column to action_logs

This patch introduces a new column for the action_logs table. It is
called 'interface' and it is intended to store the interface in which
the action was performed.

Sponsored-by: NEKLS

Signed-off-by: Nicole C Engard <nengard@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 15 Jonathan Druart 2016-08-11 10:28:12 UTC
Created attachment 54295 [details] [review]
Bug 16829: make logaction and GetLogs aware of the interface column

This patch changes the logaction API so it accepts a new 'interface' param.
Current code calling logaction is not changed, and this parameter can be ommited
in most contexts, and it will correctly fall-back to C4::Context->interface.

Unit tests are provided on a different patch.

GetLogs gets patched as well, so it can be required to filter by 'interface' param.

Sponsored-by: NEKLS

Signed-off-by: Nicole C Engard <nengard@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 16 Jonathan Druart 2016-08-11 10:28:16 UTC
Created attachment 54296 [details] [review]
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>
Comment 17 Jonathan Druart 2016-08-11 10:28:19 UTC
Created attachment 54297 [details] [review]
Bug 16829: DBIx update

Sponsored-by: NEKLS

Signed-off-by: Nicole C Engard <nengard@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 18 Jonathan Druart 2016-08-11 10:28:23 UTC
Created attachment 54298 [details] [review]
Bug 16829: Unit tests for logaction's 'interface parameter'

This patch introduces tests for the new 'interface' parameter for the
C4::Log::logaction and C4::Log::GetLogs functions.

In logaction, it falls back to C4::Context->interface if ommited.

To test:
- Run
  $ prove t/db_dependent/Log.t
=> SUCCESS: Tests pass
- Sign off

Sponsored-by: NEKLS

Signed-off-by: Nicole C Engard <nengard@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 19 Kyle M Hall (khall) 2016-08-17 18:09:45 UTC
Pushed to master for 16.11, thanks Tomas!