Bugzilla – Attachment 85269 Details for
Bug 3820
More detailed patron record changes log
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 3820: Add changes to MEMBERS MODIFY logaction
Bug-3820-Add-changes-to-MEMBERS-MODIFY-logaction.patch (text/plain), 3.13 KB, created by
Martin Renvoize (ashimema)
on 2019-02-19 12:40:31 UTC
(
hide
)
Description:
Bug 3820: Add changes to MEMBERS MODIFY logaction
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2019-02-19 12:40:31 UTC
Size:
3.13 KB
patch
obsolete
>From d0108ab9b6319ba29517b96605f7395774d81e02 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Thu, 14 Feb 2019 10:45:26 +0000 >Subject: [PATCH] Bug 3820: Add changes to MEMBERS MODIFY logaction > >This patch attemps to add a more refined and detailed info structure >detailing what fields were changed and what they were changed from and >to. > >Test Plan: Enable BorrowersLog in the system preferences and undertake a >series of borrower detail changes. Go to view the actionlogs and note >that MEMBER MODIFY logs now detail what fields you have changed using >the following form: > > { FIELD1: { before: BEFORE_VALUE, after: AFTER_VALUE } } > >Signed-off-by: Owen Leonard <oleonard@myacpl.org> >Signed-off-by: Charles Farmer <charles.farmer@inLibro.com> > >Signed-off-by: Josef Moravec <josef.moravec@gmail.com> >--- > Koha/Patron.pm | 40 +++++++++++++++------------------------- > 1 file changed, 15 insertions(+), 25 deletions(-) > >diff --git a/Koha/Patron.pm b/Koha/Patron.pm >index dff9320084..ad99c2c804 100644 >--- a/Koha/Patron.pm >+++ b/Koha/Patron.pm >@@ -255,33 +255,23 @@ sub store { > $self->add_enrolment_fee_if_needed; > } > >- my $borrowers_log = C4::Context->preference("BorrowersLog"); >- my $previous_cardnumber = $self_from_storage->cardnumber; >- if ($borrowers_log >- && ( !defined $previous_cardnumber >- || $previous_cardnumber ne $self->cardnumber ) >- ) >- { >- logaction( >- "MEMBERS", >- "MODIFY", >- $self->borrowernumber, >- to_json( >- { >- cardnumber_replaced => { >- previous_cardnumber => $previous_cardnumber, >- new_cardnumber => $self->cardnumber, >- } >- }, >- { utf8 => 1, pretty => 1 } >- ) >- ); >- } >+ # Actionlogs >+ if ( C4::Context->preference("BorrowersLog") ) { >+ my $info; >+ for my $key ( keys %{ $self_from_storage->unblessed } ) { >+ if ( $self_from_storage->$key ne $self->$key ) { >+ $info->{$key} = { >+ before => $self_from_storage->$key, >+ after => $self->$key >+ }; >+ } >+ } > >- logaction( "MEMBERS", "MODIFY", $self->borrowernumber, >- "UPDATE (executed w/ arg: " . $self->borrowernumber . ")" ) >- if $borrowers_log; >+ logaction( "MEMBERS", "MODIFY", $self->borrowernumber, >+ to_json( $info, { utf8 => 1, pretty => 1, canonical => 1 } ) ); >+ } > >+ # Final store > $self = $self->SUPER::store; > } > } >-- >2.20.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 3820
:
1584
|
1585
|
85100
|
85102
|
85103
|
85104
|
85161
|
85162
|
85196
|
85197
|
85243
|
85244
|
85245
|
85246
|
85256
|
85257
|
85258
|
85259
|
85260
| 85269 |
85270
|
85271
|
85272
|
85273
|
85274
|
85276
|
85277