Bugzilla – Attachment 157037 Details for
Bug 35001
Simplify patron->is_active in light of TrackLastPatronActivityTriggers
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 35001: Add some checks to membership_expiry
Bug-35001-Add-some-checks-to-membershipexpiry.patch (text/plain), 2.78 KB, created by
Martin Renvoize (ashimema)
on 2023-10-13 08:58:16 UTC
(
hide
)
Description:
Bug 35001: Add some checks to membership_expiry
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2023-10-13 08:58:16 UTC
Size:
2.78 KB
patch
obsolete
>From da26e6bfc7d15d9ac42c06c02d5ba50fbb31f6d2 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Fri, 13 Oct 2023 08:26:46 +0000 >Subject: [PATCH] Bug 35001: Add some checks to membership_expiry > >Test plan: >Toggle pref TrackLastPatronActivityTriggers (clear it). >And try variations of --active, --inactive to see the warnings. > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > misc/cronjobs/membership_expiry.pl | 36 +++++++++++++++++++++++++----- > 1 file changed, 31 insertions(+), 5 deletions(-) > >diff --git a/misc/cronjobs/membership_expiry.pl b/misc/cronjobs/membership_expiry.pl >index 697572e0704..3d0a53a05e1 100755 >--- a/misc/cronjobs/membership_expiry.pl >+++ b/misc/cronjobs/membership_expiry.pl >@@ -95,11 +95,19 @@ Optional parameter to use another renewal notice than the default: MEMBERSHIP_RE > =item B<-active> > > Optional parameter to include active patrons only (active within passed number of months). >+This parameter needs the preference TrackLastPatronActivityTriggers. >+ >+IMPORTANT: You should be using those triggers already for the period that you >+consider a user to be (in)active. > > =item B<-inactive> > > Optional parameter to include inactive patrons only (inactive within passed number of months). > This allows you to e.g. send expiry warnings only to inactive patrons. >+This parameter needs the preference TrackLastPatronActivityTriggers. >+ >+IMPORTANT: You should be using those triggers already for the period that you >+consider a user to be (in)active. > > =item B<-renew> > >@@ -194,11 +202,29 @@ $letter_renew = 'MEMBERSHIP_RENEWED' if !$letter_renew; > pod2usage( -verbose => 2 ) if $man; > pod2usage(1) if $help || !$confirm; > >-pod2usage( >- -verbose => 1, >- -msg => q{The --active and --inactive flags are mutually exclusive}, >- -exitval => 1 >-) if defined $active && defined $inactive; >+# Check active/inactive. Note that passing no value or zero is a no-op. >+if ( !C4::Context->preference('TrackLastPatronActivityTriggers') >+ && ( $active || $inactive ) ) >+{ >+ pod2usage( >+ -verbose => 1, >+ -msg => >+ q{Exiting membership_expiry.pl: Using --active or --inactive needs use of TrackLastPatronActivityTriggers over specified period}, >+ -exitval => 1 >+ ); >+} elsif ( $active && $inactive ) { >+ pod2usage( >+ -verbose => 1, >+ -msg => q{The --active and --inactive flags are mutually exclusive}, >+ -exitval => 1 >+ ); >+} elsif ( ( defined $active && !$active ) || ( defined $inactive && !$inactive ) ) { >+ pod2usage( >+ -verbose => 1, >+ -msg => q{Options --active and --inactive need a number of months}, >+ -exitval => 1 >+ ); >+} > > cronlogaction({ info => $command_line_options }); > >-- >2.41.0
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 35001
:
156971
|
157016
|
157034
|
157035
|
157036
|
157037
|
157743
|
157744