Bugzilla – Attachment 87778 Details for
Bug 22632
Add logging of merged patrons
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
without this patch , when patrons are merged , you can't see the merge in the log viewer.
without-this-patch--when-patrons-are-merged--you-c.patch (text/plain), 2.05 KB, created by
axel
on 2019-04-11 15:32:57 UTC
(
hide
)
Description:
without this patch , when patrons are merged , you can't see the merge in the log viewer.
Filename:
MIME Type:
Creator:
axel
Created:
2019-04-11 15:32:57 UTC
Size:
2.05 KB
patch
obsolete
>From 51d9a475e21bbb5c509b94591b5e92827422714f Mon Sep 17 00:00:00 2001 >From: Axel Amghar <axel.amghar@gmail.com> >Date: Thu, 11 Apr 2019 17:20:51 +0200 >Subject: [PATCH] without this patch , when patrons are merged , you can't see > the merge in the log viewer. > >To test: >-Apply the patch >-Make sure you have "BorrowersLog" on in you System Preference >-Search patrons >-Check two ore more patrons >-Merge selected patrons >-Merge patrons >-Go to log viewer >- Make sure there is the line with the action : "Merge" > >https://bugs.koha-community.org/show_bug.cgi?id=22632 >--- > Koha/Patron.pm | 14 ++++++++++---- > 1 file changed, 10 insertions(+), 4 deletions(-) > >diff --git a/Koha/Patron.pm b/Koha/Patron.pm >index cc1892b..2d8bd11 100644 >--- a/Koha/Patron.pm >+++ b/Koha/Patron.pm >@@ -465,9 +465,10 @@ sub siblings { > =cut > > sub merge_with { >- my ( $self, $patron_ids ) = @_; >+ my ( $self, $patron_ids, $interface ) = @_; > > my @patron_ids = @{ $patron_ids }; >+ my @interface = @{ $interface }; > > # Ensure the keeper isn't in the list of patrons to merge > @patron_ids = grep { $_ ne $self->id } @patron_ids; >@@ -475,6 +476,8 @@ sub merge_with { > my $schema = Koha::Database->new()->schema(); > > my $results; >+ my $patron_merged; >+ my $info; > > $self->_result->result_source->schema->txn_do( sub { > foreach my $patron_id (@patron_ids) { >@@ -493,9 +496,13 @@ sub merge_with { > > $patron->move_to_deleted(); > $patron->delete(); >- } >- }); > >+ if (C4::Context->preference("BorrowersLog")){ >+ $info = $patron->firstname. " " . $patron->surname . " ( ".$patron->cardnumber . ")". " has been merged into " . $self->firstname . " " . $self->surname . " ( ".$self->cardnumber . ")" ; >+ logaction("Patrons", "Merge", $patron_id, $info ,@interface); >+ } >+ } >+ }); > return $results; > } > >@@ -506,7 +513,6 @@ sub merge_with { > $wants_check = $patron->wants_check_for_previous_checkout; > > Return 1 if Koha needs to perform PrevIssue checking, else 0. >- > =cut > > sub wants_check_for_previous_checkout { >-- >2.7.4
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 22632
:
87778
|
87920
|
87921
|
87922
|
87923
|
87926
|
87995
|
87996
|
87997
|
87998
|
87999
|
88043
|
88044
|
88045
|
88046
|
89728
|
89729
|
89730
|
89731
|
157260
|
157261
|
157262
|
157263
|
157264
|
157265
|
157266
|
157267
|
157268
|
157269
|
157270
|
157271
|
157278
|
157281
|
157286
|
159553
|
159554
|
159555
|
159556
|
159557
|
159558