Bugzilla – Attachment 85842 Details for
Bug 20750
Allow timestamped auditing of ILL request events
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 20750: (follow-up) Use Koha::ActionLogs
Bug-20750-follow-up-Use-KohaActionLogs.patch (text/plain), 2.41 KB, created by
Josef Moravec
on 2019-02-28 11:21:29 UTC
(
hide
)
Description:
Bug 20750: (follow-up) Use Koha::ActionLogs
Filename:
MIME Type:
Creator:
Josef Moravec
Created:
2019-02-28 11:21:29 UTC
Size:
2.41 KB
patch
obsolete
>From 73c0886ac162a5f23fcddd61e87fff7875889663 Mon Sep 17 00:00:00 2001 >From: Andrew Isherwood <andrew.isherwood@ptfs-europe.com> >Date: Tue, 19 Feb 2019 11:36:49 +0000 >Subject: [PATCH] Bug 20750: (follow-up) Use Koha::ActionLogs > >We now use Koha::ActionLogs in favour of C4::Log::GetLogs. This enables >us to deprecate Koha::Illrequest::Logger::get_epoch > >This adds a dependency on Bug 22363. > >Signed-off-by: Josef Moravec <josef.moravec@gmail.com> >--- > Koha/Illrequest/Logger.pm | 46 +++++++++++----------------------------------- > 1 file changed, 11 insertions(+), 35 deletions(-) > >diff --git a/Koha/Illrequest/Logger.pm b/Koha/Illrequest/Logger.pm >index e855e39309..da4f65947b 100644 >--- a/Koha/Illrequest/Logger.pm >+++ b/Koha/Illrequest/Logger.pm >@@ -24,7 +24,8 @@ use Time::Local; > use C4::Koha; > use C4::Context; > use C4::Templates; >-use C4::Log qw( logaction GetLogs ); >+use C4::Log qw( logaction ); >+use Koha::ActionLogs; > > =head1 NAME > >@@ -198,26 +199,6 @@ sub get_log_template { > } > } > >-=head3 get_epoch >- >- $epoch = Koha::Illrequest::Logger->get_epoch($timestamp); >- >-Given a timestamp string returned from GetLogs, get the epoch >- >-=cut >- >-sub get_epoch { >- my $timestamp = shift; >- >- return if !$timestamp=~/\d{4}-\d{2}-\d{2}\s\d{2}:\d{2}:\d{2}/; >- >- my ($date, $time) = split(/\s/, $timestamp); >- my ($y, $mon, $d) = split(/-/, $date); >- my ($h, $min, $s) = split(/:/, $time); >- >- return timelocal($s, $min, $h, $d, $mon-1, $y); >-} >- > =head3 get_request_logs > > $requestlogs = Koha::IllRequest::Logger->get_request_logs($request_id); >@@ -229,16 +210,14 @@ Get all logged actions for a given request > sub get_request_logs { > my ( $self, $request ) = @_; > >- my $logs = GetLogs( >- undef, >- undef, >- undef, >- ['ILL'], >- undef, >- $request->id, >- undef, >- undef >- ); >+ my $logs = Koha::ActionLogs->search( >+ { >+ module => 'ILL', >+ object => $request->id >+ }, >+ { order_by => { -desc => "timestamp" } } >+ )->unblessed; >+ > # Populate a lookup table for status aliases > my $aliases = GetAuthorisedValues('ILLSTATUS'); > my $alias_hash; >@@ -257,10 +236,7 @@ sub get_request_logs { > ); > } > >- my $format = '%Y-%m-%d %H:%M:%S'; >- my @sorted = sort { get_epoch($$b{'timestamp'}) <=> get_epoch($$a{'timestamp'}) } @{$logs}; >- >- return \@sorted; >+ return $logs; > } > > =head1 AUTHOR >-- >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 20750
:
75304
|
75326
|
75329
|
75330
|
77757
|
77816
|
77817
|
77818
|
77931
|
79822
|
79823
|
79824
|
80860
|
82082
|
82083
|
82085
|
82096
|
82097
|
82098
|
82099
|
82500
|
82501
|
82502
|
84193
|
84194
|
84195
|
84203
|
84266
|
84497
|
84498
|
84821
|
84823
|
84824
|
84825
|
84826
|
84827
|
84973
|
84974
|
84975
|
84976
|
84977
|
84978
|
84979
|
85097
|
85098
|
85099
|
85101
|
85113
|
85238
|
85266
|
85697
|
85698
|
85699
|
85700
|
85701
|
85702
|
85703
|
85704
|
85705
|
85706
|
85707
|
85708
|
85709
|
85710
|
85756
|
85757
|
85765
|
85826
|
85827
|
85829
|
85830
|
85831
|
85832
|
85833
|
85834
|
85835
|
85836
|
85837
|
85838
|
85839
|
85840
|
85841
|
85842
|
85843
|
85844
|
85845
|
85846
|
85847
|
85848
|
86434
|
86435
|
86436
|
86534
|
86535
|
86536