Bugzilla – Attachment 157036 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.75 KB, created by
Marcel de Rooy
on 2023-10-13 08:32:43 UTC
(
hide
)
Description:
Bug 35001: Add some checks to membership_expiry
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2023-10-13 08:32:43 UTC
Size:
2.75 KB
patch
obsolete
>From 9072965f7b34d75aee814ea7934379ef884a1ff3 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 >Content-Type: text/plain; charset=utf-8 > >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> >--- > 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 697572e070..3d0a53a05e 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.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 35001
:
156971
|
157016
|
157034
|
157035
|
157036
|
157037
|
157743
|
157744