Bugzilla – Attachment 155135 Details for
Bug 33204
Add the ability to filter on patron library for borrowers-force-messaging-defaults.pl
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 33204: Add the ability to filter on patron library for borrowers-force-messaging-defaults.pl
Bug-33204-Add-the-ability-to-filter-on-patron-libr.patch (text/plain), 3.22 KB, created by
Kyle M Hall (khall)
on 2023-09-01 16:52:13 UTC
(
hide
)
Description:
Bug 33204: Add the ability to filter on patron library for borrowers-force-messaging-defaults.pl
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2023-09-01 16:52:13 UTC
Size:
3.22 KB
patch
obsolete
>From e5e7fe46ec2643b644689ffd00701bc5a83e6788 Mon Sep 17 00:00:00 2001 >From: Fridolin Somers <fridolin.somers@biblibre.com> >Date: Fri, 10 Mar 2023 20:32:56 -1000 >Subject: [PATCH] Bug 33204: Add the ability to filter on patron library for > borrowers-force-messaging-defaults.pl > >Like filter on category Bug 19454, it would be helpful to filter on a specified library for misc/maintenance/borrowers-force-messaging-defaults.pl > >Test plan: >1) Select two patrons A and B in say libraries L1 and L2. >2) Change the msg prefs for A and B away from defaults. >3) Run misc/maintenance/borrowers-force-messaging-defaults.pl -doit -library L1 > Verify that patron A changed and patron B did not. >4) Run with both category and library filters > >Signed-off-by: Sam Lau <samalau@gmail.com> >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > .../borrowers-force-messaging-defaults.pl | 15 +++++++++++---- > 1 file changed, 11 insertions(+), 4 deletions(-) > >diff --git a/misc/maintenance/borrowers-force-messaging-defaults.pl b/misc/maintenance/borrowers-force-messaging-defaults.pl >index 22cb01a706d..ee5125e24af 100755 >--- a/misc/maintenance/borrowers-force-messaging-defaults.pl >+++ b/misc/maintenance/borrowers-force-messaging-defaults.pl >@@ -34,7 +34,7 @@ sub usage { > > > sub force_borrower_messaging_defaults { >- my ($doit, $since, $not_expired, $no_overwrite, $category ) = @_; >+ my ($doit, $since, $not_expired, $no_overwrite, $category, $branchcode ) = @_; > > print "Since: $since\n" if $since; > >@@ -56,8 +56,9 @@ WHERE 1|; > $sql .= " AND mp.borrowernumber IS NULL"; > } > $sql .= " AND bo.categorycode = ?" if $category; >+ $sql .= " AND bo.branchcode = ?" if $branchcode; > my $sth = $dbh->prepare($sql); >- $sth->execute($since || (), $category || () ); >+ $sth->execute($since || (), $category || (), $branchcode || () ); > my $cnt = 0; > while ( my ($borrowernumber, $categorycode) = $sth->fetchrow ) { > print "$borrowernumber: $categorycode\n"; >@@ -73,19 +74,20 @@ WHERE 1|; > } > > >-my ( $doit, $since, $help, $not_expired, $no_overwrite, $category ); >+my ( $doit, $since, $help, $not_expired, $no_overwrite, $category, $branchcode ); > my $result = GetOptions( > 'doit' => \$doit, > 'since:s' => \$since, > 'not-expired' => \$not_expired, > 'no-overwrite' => \$no_overwrite, > 'category:s' => \$category, >+ 'library:s' => \$branchcode, > 'help|h' => \$help, > ); > > usage() if $help; > >-force_borrower_messaging_defaults( $doit, $since, $not_expired, $no_overwrite, $category ); >+force_borrower_messaging_defaults( $doit, $since, $not_expired, $no_overwrite, $category, $branchcode ); > > =head1 NAME > >@@ -98,6 +100,7 @@ borrowers-force-messaging-defaults.pl > borrowers-force-messaging-defaults.pl --doit > borrowers-force-messaging-defaults.pl --doit --not-expired > borrowers-force-messaging-defaults.pl --doit --category PT >+ borrowers-force-messaging-defaults.pl --doit --library CPL > > =head1 DESCRIPTION > >@@ -134,6 +137,10 @@ already set their preferences. > > Will only update patrons in the category specified. > >+=item B<--library> >+ >+Will only update patrons in the library specified. >+ > =item B<--since> > > Will only update borrowers enrolled since the specified date. >-- >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 33204
:
148102
|
151655
| 155135 |
155136