Bugzilla – Attachment 156935 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: (QA follow-up) Final changes
Bug-15504-QA-follow-up-Final-changes.patch (text/plain), 6.16 KB, created by
Marcel de Rooy
on 2023-10-12 09:14:50 UTC
(
hide
)
Description:
Bug 15504: (QA follow-up) Final changes
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2023-10-12 09:14:50 UTC
Size:
6.16 KB
patch
obsolete
>From e1274a1884575c8eff595605d98d222420516f53 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Thu, 12 Oct 2023 07:35:58 +0000 >Subject: [PATCH] Bug 15504: (QA follow-up) Final changes >Content-Type: text/plain; charset=utf-8 > >[1] Comment in Patron->is_active sharpened. >[2] Patron->update_lastseen > return if $cached && $cached eq $now->ymd; > Should be > return $self if $cached && $cached eq $now->ymd; > Consistent return value. >[3] Typo if there are not TrackLastPatronActivityTriggers enabled >[4] Typo TrackLastPatronActivityTriggers must be contain >[5] Typo patron is does .. option => performs an action >[6] Tidy on dbrev to fix > The file is less tidy than before (bad/messy lines before: 0, now: 4) > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > Koha/Patron.pm | 4 ++-- > ...bug_15504-add-tracklastpatronactivityoptions.pl | 14 +++++++++----- > installer/data/mysql/mandatory/sysprefs.sql | 2 +- > misc/cronjobs/delete_patrons.pl | 4 ++-- > 4 files changed, 14 insertions(+), 10 deletions(-) > >diff --git a/Koha/Patron.pm b/Koha/Patron.pm >index ac87e66674..5918e456af 100644 >--- a/Koha/Patron.pm >+++ b/Koha/Patron.pm >@@ -842,7 +842,7 @@ sub is_active { > # Enrollment within this period? > return 1 if DateTime->compare( dt_from_string( $self->dateenrolled ), $dt ) > -1; > >- # Last seen? Updated each login when you track patron activity >+ # Last seen? Updated for tracked patron activities > if ( C4::Context->preference('TrackLastPatronActivityTriggers') ) { > return 1 if DateTime->compare( dt_from_string( $self->lastseen ), $dt ) > -1; > } >@@ -1189,7 +1189,7 @@ sub update_lastseen { > my $cache_key = "track_activity_" . $self->borrowernumber; > my $cached = $cache->get_from_cache($cache_key); > my $now = dt_from_string(); >- return if $cached && $cached eq $now->ymd; >+ return $self if $cached && $cached eq $now->ymd; > > $self->lastseen($now)->store; > $cache->set_in_cache( $cache_key, $now->ymd ); >diff --git a/installer/data/mysql/atomicupdate/bug_15504-add-tracklastpatronactivityoptions.pl b/installer/data/mysql/atomicupdate/bug_15504-add-tracklastpatronactivityoptions.pl >index 4064a2ed11..fa2b8d22d3 100755 >--- a/installer/data/mysql/atomicupdate/bug_15504-add-tracklastpatronactivityoptions.pl >+++ b/installer/data/mysql/atomicupdate/bug_15504-add-tracklastpatronactivityoptions.pl >@@ -8,21 +8,25 @@ return { > my ( $dbh, $out ) = @$args{qw(dbh out)}; > > # Get existing value from the TrackLastPatronActivity system preference >- my ($tracklastactivity) = $dbh->selectrow_array( q| >+ my ($tracklastactivity) = $dbh->selectrow_array( >+ q| > SELECT value FROM systempreferences WHERE variable='TrackLastPatronActivity'; >- |); >+ | >+ ); > > my $triggers = $tracklastactivity ? 'check_out,connection,login' : ''; > $dbh->do( >- qq{INSERT IGNORE INTO systempreferences (variable,value,options,explanation,type) VALUES ('TrackLastPatronActivityTriggers',?,NULL,'If set, the field borrowers.lastseen will be updated every time a patron is does a selected option','multiple') }, >+ qq{INSERT IGNORE INTO systempreferences (variable,value,options,explanation,type) VALUES ('TrackLastPatronActivityTriggers',?,NULL,'If set, the field borrowers.lastseen will be updated every time a patron performs a selected action','multiple') }, > undef, $triggers, > ); > > say $out "Added system preference 'TrackLastPatronActivityTriggers'"; > >- $dbh->do(q{ >+ $dbh->do( >+ q{ > DELETE FROM systempreferences WHERE variable='TrackLastPatronActivity' >- }); >+ } >+ ); > > say $out "Removed system preference 'TrackLastPatronActivity'"; > }, >diff --git a/installer/data/mysql/mandatory/sysprefs.sql b/installer/data/mysql/mandatory/sysprefs.sql >index 17a86c11b6..23ab7d0017 100644 >--- a/installer/data/mysql/mandatory/sysprefs.sql >+++ b/installer/data/mysql/mandatory/sysprefs.sql >@@ -747,7 +747,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` > ('TraceCompleteSubfields','0','0','Force subject tracings to only match complete subfields.','YesNo'), > ('TraceSubjectSubdivisions','0','1','Create searches on all subdivisions for subject tracings.','YesNo'), > ('TrackClicks','0',NULL,'Track links clicked','Integer'), >-('TrackLastPatronActivityTriggers','',NULL,'If set, the field borrowers.lastseen will be updated everytime a patron is does a selected option','multiple'), >+('TrackLastPatronActivityTriggers','',NULL,'If set, the field borrowers.lastseen will be updated everytime a patron performs a selected action','multiple'), > ('TransfersBlockCirc','1',NULL,'Should the transfer modal block circulation staff from continuing scanning items','YesNo'), > ('TransfersMaxDaysWarning','3',NULL,'Define the days before a transfer is suspected of having a problem','Integer'), > ('TransferWhenCancelAllWaitingHolds','0',NULL,'Transfer items when cancelling all waiting holds','YesNo'), >diff --git a/misc/cronjobs/delete_patrons.pl b/misc/cronjobs/delete_patrons.pl >index b9e54f8328..7962233efa 100755 >--- a/misc/cronjobs/delete_patrons.pl >+++ b/misc/cronjobs/delete_patrons.pl >@@ -39,7 +39,7 @@ $expired_before = dt_from_string( $expired_before, 'iso' ) > if $expired_before; > > if ( $last_seen and not C4::Context->preference('TrackLastPatronActivityTriggers') ) { >- pod2usage(q{The --last_seen will be ineffective if there are not TrackLastPatronActivityTriggers enabled}); >+ pod2usage(q{The option --last_seen will be ineffective if preference TrackLastPatronActivityTriggers is empty}); > } > > unless ( $not_borrowed_since or $expired_before or $last_seen or @category_code or $branchcode or $file ) { >@@ -185,7 +185,7 @@ Delete patrons with an account expired before this date. > > Delete patrons who have not been active since this date. > >-The system preference TrackLastPatronActivityTriggers must be contain least trigger to use this option. >+The system preference TrackLastPatronActivityTriggers must contain at least one trigger to use this option. > > =item B<--category_code> > >-- >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