Bugzilla – Attachment 73067 Details for
Bug 19454
Add the ability to filter on patron category for borrowers-force-messaging-defaults.pl
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 19454: Add -category parameter to borrowers-force-messaging-defaults.pl
Bug-19454-Add--category-parameter-to-borrowers-for.patch (text/plain), 3.15 KB, created by
Katrin Fischer
on 2018-03-18 07:34:01 UTC
(
hide
)
Description:
Bug 19454: Add -category parameter to borrowers-force-messaging-defaults.pl
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2018-03-18 07:34:01 UTC
Size:
3.15 KB
patch
obsolete
>From 42721f4c8f15366478036097f42bc76436c5c933 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Thu, 12 Oct 2017 15:36:10 +0200 >Subject: [PATCH] Bug 19454: Add -category parameter to > borrowers-force-messaging-defaults.pl > >Instead of updating patrons over all patron categories, it would be >helpful if we could filter on a specified category. > >Test plan: >[1] Select two patrons A and B in say categories C1 and C2. >[2] Change the msg prefs for A and B away from defaults. >[3] Run borrowers-force-messaging-defaults.pl -doit -cat C1 > Verify that patron A changed and patron B did not. > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Signed-off-by: Charles Farmer <charles.farmer@inLibro.com> > >Amended: Replace -category by --category. (marcelr 20180314) > >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> >--- > misc/maintenance/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 bd7a00f..897f5df 100755 >--- a/misc/maintenance/borrowers-force-messaging-defaults.pl >+++ b/misc/maintenance/borrowers-force-messaging-defaults.pl >@@ -39,7 +39,7 @@ sub usage { > > > sub force_borrower_messaging_defaults { >- my ($doit, $since, $not_expired, $no_overwrite) = @_; >+ my ($doit, $since, $not_expired, $no_overwrite, $category ) = @_; > > $since = '0000-00-00' if (!$since); > print "Since: $since\n"; >@@ -57,8 +57,9 @@ WHERE bo.dateenrolled >= ?|; > if( $no_overwrite ) { > $sql .= " AND mp.borrowernumber IS NULL"; > } >+ $sql .= " AND categorycode = ?" if $category; > my $sth = $dbh->prepare($sql); >- $sth->execute($since); >+ $sth->execute($since, $category || () ); > while ( my ($borrowernumber, $categorycode) = $sth->fetchrow ) { > print "$borrowernumber: $categorycode\n"; > next unless $doit; >@@ -71,18 +72,19 @@ WHERE bo.dateenrolled >= ?|; > } > > >-my ( $doit, $since, $help, $not_expired, $no_overwrite ); >+my ( $doit, $since, $help, $not_expired, $no_overwrite, $category ); > my $result = GetOptions( > 'doit' => \$doit, > 'since:s' => \$since, > 'not-expired' => \$not_expired, > 'no-overwrite' => \$no_overwrite, >+ 'category:s' => \$category, > 'help|h' => \$help, > ); > > usage() if $help; > >-force_borrower_messaging_defaults( $doit, $since, $not_expired, $no_overwrite ); >+force_borrower_messaging_defaults( $doit, $since, $not_expired, $no_overwrite, $category ); > > =head1 NAME > >@@ -94,6 +96,7 @@ borrowers-force-messaging-defaults.pl > borrowers-force-messaging-defaults.pl --help > borrowers-force-messaging-defaults.pl --doit > borrowers-force-messaging-defaults.pl --doit --not-expired >+ borrowers-force-messaging-defaults.pl --doit --category PT > > =head1 DESCRIPTION > >@@ -126,6 +129,10 @@ Will only update active borrowers (borrowers who didn't pass their expiration da > Will only update patrons without messaging preferences and skip patrons that > already set their preferences. > >+=item B<--category> >+ >+Will only update patrons in the category specified. >+ > =back > > =cut >-- >2.1.4
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 19454
:
68176
|
68177
|
68202
|
68203
|
69205
|
69206
|
71654
|
71655
|
72849
|
72850
|
72851
|
72852
|
72853
|
72854
| 73067 |
73068
|
73069