Bugzilla – Attachment 72607 Details for
Bug 18626
Add ability to track cardnumber changes for patrons
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 18626 - Add ability to track cardnumber changes for patrons
Bug-18626---Add-ability-to-track-cardnumber-change.patch (text/plain), 2.81 KB, created by
Kyle M Hall (khall)
on 2018-03-09 14:52:11 UTC
(
hide
)
Description:
Bug 18626 - Add ability to track cardnumber changes for patrons
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2018-03-09 14:52:11 UTC
Size:
2.81 KB
patch
obsolete
>From 6de28b9027bd31a01fc896d5a4c815287327fe0b Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Thu, 11 May 2017 00:44:12 +0000 >Subject: [PATCH] Bug 18626 - Add ability to track cardnumber changes for > patrons >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >Some libraries want to keep a history of cardnumber changes for a >patron. This is a feature that another ILS has. > >Test Plan: >1) Apply this patch >2) Enable the BorrowersLog >3) Modify a patron, update his or her cardnumber >4) Notice the entry in the action log containing the old and new cardnumbers >5) Edit a patron, leave the cardnumber the same >6) Note there is no cardnumber change entry in the action logs >7) Disable BorrowersLog, modify a patron cardnumber >8) Note there is no cardnumber change entry in teh action logs > >Followed test plan, works as expected >Signed-off-by: Marc Véron <veron@veron.ch> > >Signed-off-by: Josef Moravec <josef.moravec@gmail.com> >--- > C4/Members.pm | 22 +++++++++++++++++++++- > 1 file changed, 21 insertions(+), 1 deletion(-) > >diff --git a/C4/Members.pm b/C4/Members.pm >index 58f6e8a..229ac76 100644 >--- a/C4/Members.pm >+++ b/C4/Members.pm >@@ -27,6 +27,7 @@ use String::Random qw( random_string ); > use Scalar::Util qw( looks_like_number ); > use Date::Calc qw/Today check_date Date_to_Days/; > use List::MoreUtils qw( uniq ); >+use JSON qw(to_json); > use C4::Log; # logaction > use C4::Overdues; > use C4::Reserves; >@@ -324,6 +325,25 @@ sub ModMember { > > my $patron = Koha::Patrons->find( $new_borrower->{borrowernumber} ); > >+ my $borrowers_log = C4::Context->preference("BorrowersLog"); >+ if ( $borrowers_log && $patron->cardnumber ne $new_borrower->{cardnumber} ) >+ { >+ logaction( >+ "MEMBERS", >+ "MODIFY", >+ $data{'borrowernumber'}, >+ to_json( >+ { >+ cardnumber_replaced => { >+ previous_cardnumber => $patron->cardnumber, >+ new_cardnumber => $new_borrower->{cardnumber}, >+ } >+ }, >+ { utf8 => 1, pretty => 1 } >+ ) >+ ); >+ } >+ > delete $new_borrower->{userid} if exists $new_borrower->{userid} and not $new_borrower->{userid}; > > my $execute_success = $patron->store if $patron->set($new_borrower); >@@ -355,7 +375,7 @@ sub ModMember { > Koha::NorwegianPatronDB::NLSync({ 'borrowernumber' => $data{'borrowernumber'} }); > } > >- logaction("MEMBERS", "MODIFY", $data{'borrowernumber'}, "UPDATE (executed w/ arg: $data{'borrowernumber'})") if C4::Context->preference("BorrowersLog"); >+ logaction("MEMBERS", "MODIFY", $data{'borrowernumber'}, "UPDATE (executed w/ arg: $data{'borrowernumber'})") if $borrowers_log; > } > return $execute_success; > } >-- >2.10.2
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 18626
:
63532
|
63560
|
69467
| 72607 |
72608
|
72609