Bugzilla – Attachment 181108 Details for
Bug 30301
Add a system preference to allow specifying the patron expiration notices as mandatory
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 30301: Allow for forcing of print notices
Bug-30301-Allow-for-forcing-of-print-notices.patch (text/plain), 3.62 KB, created by
Matt Blenkinsop
on 2025-04-17 15:23:18 UTC
(
hide
)
Description:
Bug 30301: Allow for forcing of print notices
Filename:
MIME Type:
Creator:
Matt Blenkinsop
Created:
2025-04-17 15:23:18 UTC
Size:
3.62 KB
patch
obsolete
>From 6b54dad9781c660b27eba7ee9661d3b8ac825836 Mon Sep 17 00:00:00 2001 >From: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> >Date: Thu, 17 Apr 2025 16:16:39 +0100 >Subject: [PATCH] Bug 30301: Allow for forcing of print notices > >Although we're reverting 32216, we still want to be able to force print notices as per the original intent. >This patch adds that into queue_notices, rather than in the cronjob > >Co-authored-by: Jake Deery <jake.deery@openfifth.co.uk> >--- > Koha/Patron.pm | 1 + > misc/cronjobs/membership_expiry.pl | 15 ++++++++++++++- > 2 files changed, 15 insertions(+), 1 deletion(-) > >diff --git a/Koha/Patron.pm b/Koha/Patron.pm >index b2aa1925a8e..6858f8b6915 100644 >--- a/Koha/Patron.pm >+++ b/Koha/Patron.pm >@@ -2800,6 +2800,7 @@ sub queue_notice { > if ( $params->{expiry_notice_mandatory} ) { > push( @message_transports, $params->{primary_contact_method} || 'print' ) if scalar(@message_transports) == 0; > } >+ push @message_transports, 'print' if $params->{forceprint}; > > $letter_params->{letter_code} = $letter_code; > my $print_sent = 0; >diff --git a/misc/cronjobs/membership_expiry.pl b/misc/cronjobs/membership_expiry.pl >index 043e4dcdb97..ebcc3ac8a5c 100755 >--- a/misc/cronjobs/membership_expiry.pl >+++ b/misc/cronjobs/membership_expiry.pl >@@ -57,6 +57,12 @@ Verbose. Without this flag set, only fatal errors are reported. > Do not send any email. Membership expire notices that would have been sent to > the patrons are printed to standard out. > >+ >+=item B<-p> >+ >+Force the generation of print notices, even if the borrower has an email address. >+Note that this flag cannot be used in combination with -n >+ > =item B<-c> > > Confirm flag: Add this option. The script will only print a usage >@@ -132,6 +138,10 @@ In the event that the C<-n> flag is passed to this program, no emails > are sent. Instead, messages are sent on standard output from this > program. > >+When using the C<-p> flag, print notices are generated regardless of whether or >+not the borrower has an email address. This can be useful for libraries that >+prefer to deal with print notices. >+ > Notices can contain variables enclosed in double angle brackets like > E<lt>E<lt>thisE<gt>E<gt>. Those variables will be replaced with values > specific to the soon expiring members. >@@ -165,6 +175,7 @@ use Koha::Patrons; > # These are defaults for command line options. > my $confirm; # -c: Confirm that the user has read and configured this script. > my $nomail; # -n: No mail. Will not send any emails. >+my $forceprint; # -p: Force print notices, even if email is found > my $verbose = 0; # -v: verbose > my $help = 0; > my $man = 0; >@@ -186,6 +197,7 @@ GetOptions( > 'man' => \$man, > 'c' => \$confirm, > 'n' => \$nomail, >+ 'p' => \$forceprint, > 'v' => \$verbose, > 'branch:s' => \$branch, > 'before:i' => \$before, >@@ -289,12 +301,13 @@ while ( my $expiring_patron = $upcoming_mem_expires->next ) { > my $sending_params = { > letter_params => $letter_params, > message_name => 'Patron_Expiry', >+ forceprint => $forceprint > }; > > my $is_notice_mandatory = grep( $expiring_patron->categorycode, @mandatory_expiry_notice_categories ); > if ($is_notice_mandatory) { > $sending_params->{expiry_notice_mandatory} = 1; >- $sending_params->{primary_contact_method} = $expiring_patron->primary_contact_method; >+ $sending_params->{primary_contact_method} = $forceprint ? 'print' : $expiring_patron->primary_contact_method; > } > > my $result = $expiring_patron->queue_notice($sending_params); >-- >2.48.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 30301
:
175086
|
175087
|
175088
|
175089
|
175526
|
175527
|
175528
|
175529
|
181102
|
181103
|
181104
|
181105
|
181106
|
181107
|
181108
|
182152
|
182153
|
182154
|
182155
|
182156
|
182157
|
182158
|
182527
|
182529
|
182530
|
182531
|
182532
|
182533
|
182534
|
182535
|
182536
|
182537
|
182538