Bugzilla – Attachment 35164 Details for
Bug 13572
Add not-expired parameter to borrowers-force-messaging-defaults script
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 13572 - Add onlyactives parameter to force_borrower_messaging_defaults script
Bug-13572---Add-onlyactives-parameter-to-forceborr.patch (text/plain), 2.04 KB, created by
simith.doliveira
on 2015-01-13 15:21:47 UTC
(
hide
)
Description:
Bug 13572 - Add onlyactives parameter to force_borrower_messaging_defaults script
Filename:
MIME Type:
Creator:
simith.doliveira
Created:
2015-01-13 15:21:47 UTC
Size:
2.04 KB
patch
obsolete
>From 4fc2b66c8901308b78b1bd175c92c3f4591dcb4f Mon Sep 17 00:00:00 2001 >From: simith <simith@inlibro.com> >Date: Tue, 13 Jan 2015 10:18:36 -0500 >Subject: [PATCH] Bug 13572 - Add onlyactives parameter to > force_borrower_messaging_defaults script > >--- > misc/maintenance/borrowers-force-messaging-defaults | 21 +++++++++++++-------- > 1 file changed, 13 insertions(+), 8 deletions(-) > >diff --git a/misc/maintenance/borrowers-force-messaging-defaults b/misc/maintenance/borrowers-force-messaging-defaults >index ff35e08..1612cd0 100755 >--- a/misc/maintenance/borrowers-force-messaging-defaults >+++ b/misc/maintenance/borrowers-force-messaging-defaults >@@ -39,7 +39,7 @@ sub usage { > > > sub force_borrower_messaging_defaults { >- my ($doit, $truncate, $since) = @_; >+ my ($doit, $truncate, $since, $onlyactives) = @_; > > $since = '0000-00-00' if (!$since); > print $since; >@@ -52,7 +52,11 @@ sub force_borrower_messaging_defaults { > $sth->execute(); > } > >- my $sth = $dbh->prepare("SELECT borrowernumber, categorycode FROM borrowers WHERE dateenrolled >= ?"); >+ my $sql = "SELECT borrowernumber, categorycode FROM borrowers WHERE dateenrolled >= ?"; >+ if ($onlyactives) { >+ $sql .= " AND dateexpiry > NOW()" >+ } >+ my $sth = $dbh->prepare($sql); > $sth->execute($since); > while ( my ($borrowernumber, $categorycode) = $sth->fetchrow ) { > print "$borrowernumber: $categorycode\n"; >@@ -66,17 +70,18 @@ sub force_borrower_messaging_defaults { > } > > >-my ($doit, $truncate, $since, $help); >+my ($doit, $truncate, $since, $help, $onlyactives); > my $result = GetOptions( >- 'doit' => \$doit, >- 'truncate' => \$truncate, >- 'since:s' => \$since, >- 'help|h' => \$help, >+ 'doit' => \$doit, >+ 'truncate' => \$truncate, >+ 'since:s' => \$since, >+ 'onlyactives' => \$onlyactives, >+ 'help|h' => \$help, > ); > > usage() if $help; > >-force_borrower_messaging_defaults( $doit, $truncate, $since ); >+force_borrower_messaging_defaults( $doit, $truncate, $since, $onlyactives ); > > =head1 NAME > >-- >1.9.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 13572
:
35164
|
41235
|
46179
|
46180
|
58206
|
67959
|
67960
|
67961
|
68059
|
68060
|
68061
|
68183