Bugzilla – Attachment 152334 Details for
Bug 15504
Track Patron's Last Activity
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 15504: Add triggers to instances of track_login_daily
Bug-15504-Add-triggers-to-instances-of-tracklogind.patch (text/plain), 3.91 KB, created by
Matt Blenkinsop
on 2023-06-14 14:21:34 UTC
(
hide
)
Description:
Bug 15504: Add triggers to instances of track_login_daily
Filename:
MIME Type:
Creator:
Matt Blenkinsop
Created:
2023-06-14 14:21:34 UTC
Size:
3.91 KB
patch
obsolete
>From b9f4c5f4be00cfb8a407b0760b4bb18b7255095e Mon Sep 17 00:00:00 2001 >From: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> >Date: Wed, 14 Jun 2023 14:14:53 +0000 >Subject: [PATCH] Bug 15504: Add triggers to instances of track_login_daily > >This patch adds a trigger to every instance of track_login_daily >--- > C4/Auth.pm | 4 ++-- > C4/Circulation.pm | 9 +++++++-- > C4/ILSDI/Services.pm | 2 +- > C4/SIP/Sip/MsgType.pm | 2 +- > 4 files changed, 11 insertions(+), 6 deletions(-) > >diff --git a/C4/Auth.pm b/C4/Auth.pm >index de9393d16c..53244cb8e5 100644 >--- a/C4/Auth.pm >+++ b/C4/Auth.pm >@@ -1306,7 +1306,7 @@ sub checkauth { > )); > } > >- track_login_daily( $userid ); >+ track_login_daily( $userid, 'login' ); > > # In case, that this request was a login attempt, we want to prevent that users can repost the opac login > # request. We therefore redirect the user to the requested page again without the login parameters. >@@ -2318,7 +2318,7 @@ sub track_login_daily { > > my $patron = Koha::Patrons->find({ userid => $userid }); > return unless $patron; >- >+ > my $tracked_activities = { map { (lc $_, 1); } split /\s*\,\s*/, C4::Context->preference('TrackLastPatronActivityTriggers') }; > return unless $tracked_activities->{$activity}; > >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index 4fdc525330..114ec32e7c 100644 >--- a/C4/Circulation.pm >+++ b/C4/Circulation.pm >@@ -1676,7 +1676,7 @@ sub AddIssue { > )->store; > } > $issue->discard_changes; >- C4::Auth::track_login_daily( $borrower->{userid} ); >+ C4::Auth::track_login_daily( $borrower->{userid}, 'check_out' ); > if ( $item_object->location && $item_object->location eq 'CART' > && ( !$item_object->permanent_location || $item_object->permanent_location ne 'CART' ) ) { > ## Item was moved to cart via UpdateItemLocationOnCheckin, anything issued should be taken off the cart. >@@ -2469,7 +2469,10 @@ sub AddReturn { > > logaction("CIRCULATION", "RETURN", $borrowernumber, $item->itemnumber) > if C4::Context->preference("ReturnLog"); >- } >+ >+ #Update borrowers.lastseen >+ C4::Auth::track_login_daily( $patron->userid, 'check_in' ); >+ } > > # Check if this item belongs to a biblio record that is attached to an > # ILL request, if it is we need to update the ILL request's status >@@ -3307,6 +3310,8 @@ sub AddRenewal { > interface => C4::Context->interface, > } > ); >+ #Update borrowers.lastseen >+ C4::Auth::track_login_daily( $patron_unblessed->{userid}, 'renewal' ); > > #Log the renewal > logaction("CIRCULATION", "RENEWAL", $borrowernumber, $itemnumber) if C4::Context->preference("RenewalLog"); >diff --git a/C4/ILSDI/Services.pm b/C4/ILSDI/Services.pm >index 9327e3bafd..36cad1269f 100644 >--- a/C4/ILSDI/Services.pm >+++ b/C4/ILSDI/Services.pm >@@ -397,7 +397,7 @@ sub AuthenticatePatron { > my ($status, $cardnumber, $userid) = C4::Auth::checkpw( $username, $password ); > if ( $status == 1 ) { > # Track the login >- C4::Auth::track_login_daily( $userid ); >+ C4::Auth::track_login_daily( $userid, 'connection' ); > # Get the borrower > my $patron = Koha::Patrons->find( { userid => $userid } ); > return { id => $patron->borrowernumber }; >diff --git a/C4/SIP/Sip/MsgType.pm b/C4/SIP/Sip/MsgType.pm >index 09034a7f86..6645fcf7ef 100644 >--- a/C4/SIP/Sip/MsgType.pm >+++ b/C4/SIP/Sip/MsgType.pm >@@ -993,7 +993,7 @@ sub handle_patron_info { > > $resp = (PATRON_INFO_RESP); > if ($patron) { >- $patron->update_lastseen(); >+ C4::Auth::track_login_daily( $patron->userid, 'connection' ); > $resp .= patron_status_string( $patron, $server ); > $resp .= ( defined($lang) and length($lang) == 3 ) ? $lang : $patron->language; > $resp .= timestamp(); >-- >2.37.1 (Apple Git-137.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 15504
:
152332
|
152333
|
152334
|
152335
|
152336
|
152500
|
152501
|
152502
|
152503
|
152504
|
152505
|
152506
|
155290
|
155291
|
155292
|
155293
|
155294
|
155295
|
155296
|
155534
|
155535
|
155536
|
155537
|
155538
|
155539
|
155540
|
156598
|
156599
|
156600
|
156601
|
156602
|
156603
|
156604
|
156605
|
156606
|
156607
|
156608
|
156742
|
156855
|
156856
|
156857
|
156858
|
156859
|
156860
|
156861
|
156862
|
156863
|
156864
|
156865
|
156866
|
156867
|
156868
|
156869
|
156870
|
156875
|
156879
|
156898
|
156899
|
156900
|
156901
|
156902
|
156903
|
156904
|
156905
|
156906
|
156907
|
156908
|
156909
|
156910
|
156911
|
156912
|
156913
|
156914
|
156915
|
156917
|
156918
|
156919
|
156920
|
156921
|
156922
|
156923
|
156924
|
156925
|
156926
|
156927
|
156928
|
156929
|
156930
|
156931
|
156932
|
156933
|
156934
|
156935
|
157602
|
157603
|
157604
|
157605
|
157606
|
157607
|
157608
|
157609
|
157610
|
157611
|
157612
|
157613
|
157614
|
157615
|
157616
|
157617
|
157618
|
157619
|
157620
|
157624