Bugzilla – Attachment 46179 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.73 KB, created by
Chris Cormack
on 2016-01-04 03:08:21 UTC
(
hide
)
Description:
Bug 13572 - Add onlyactives parameter to force_borrower_messaging_defaults script
Filename:
MIME Type:
Creator:
Chris Cormack
Created:
2016-01-04 03:08:21 UTC
Size:
2.73 KB
patch
obsolete
>From 4e751711b033b91c9b2bc74c5db904b2965e9cb9 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 >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >1) Apply both patches >2) Create a new patron with random values, except for it expiration date, make it expired (Patrons > New Patron > Student) >3) Enable the system preference called âEnhancedMessagingPreferencesâ >4) In âAdministration" > "Patron categories" > Student, modify the "days in advance", then click "Save" >5) run the script "./misc/maintenance/borrowers-force-messaging-defaults --doit --onlyactives" >6) Validate that the student created in step 2 hasn't changed (Patrons > search) >7) Validate that any other student that isn't expired has changed. > >Signed-off-by: Chris <chris@bigballofwax.co.nz> >--- > .../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 b0630e1..c41129a 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.7.10.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 13572
:
35164
|
41235
|
46179
|
46180
|
58206
|
67959
|
67960
|
67961
|
68059
|
68060
|
68061
|
68183