Bugzilla – Attachment 156918 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: Update track_login_daily to accept triggers
Bug-15504-Update-tracklogindaily-to-accept-trigger.patch (text/plain), 1.58 KB, created by
Marcel de Rooy
on 2023-10-12 09:13:33 UTC
(
hide
)
Description:
Bug 15504: Update track_login_daily to accept triggers
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2023-10-12 09:13:33 UTC
Size:
1.58 KB
patch
obsolete
>From ef4bc9e54ccce5f8f6b7b08aa10944cc299a78cb Mon Sep 17 00:00:00 2001 >From: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> >Date: Wed, 14 Jun 2023 14:11:08 +0000 >Subject: [PATCH] Bug 15504: Update track_login_daily to accept triggers >Content-Type: text/plain; charset=utf-8 > >This patch adds triggers to track_login_daily so that it only tracks activity when that trigger is active > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Signed-off-by: David Nind <david@davidnind.com> > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > C4/Auth.pm | 7 ++++++- > 1 file changed, 6 insertions(+), 1 deletion(-) > >diff --git a/C4/Auth.pm b/C4/Auth.pm >index cdc4ba8012..dcaac1dbc2 100644 >--- a/C4/Auth.pm >+++ b/C4/Auth.pm >@@ -2355,7 +2355,8 @@ Wraps the call to $patron->track_login, the method used to update borrowers.last > > sub track_login_daily { > my $userid = shift; >- return if !$userid || !C4::Context->preference('TrackLastPatronActivity'); >+ my $activity = shift; >+ return if !$userid || !$activity || !C4::Context->preference('TrackLastPatronActivity'); > > my $cache = Koha::Caches->get_instance(); > my $cache_key = "track_login_" . $userid; >@@ -2365,6 +2366,10 @@ 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}; >+ > $patron->track_login; > $cache->set_in_cache( $cache_key, $today ); > } >-- >2.30.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 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