Bugzilla – Attachment 58206 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 --actives parameter to force_borrower_messaging_defaults script
Bug-13572---Add---actives-parameter-to-forceborrow.patch (text/plain), 3.45 KB, created by
Charles Farmer
on 2016-12-15 15:59:39 UTC
(
hide
)
Description:
Bug 13572 - Add --actives parameter to force_borrower_messaging_defaults script
Filename:
MIME Type:
Creator:
Charles Farmer
Created:
2016-12-15 15:59:39 UTC
Size:
3.45 KB
patch
obsolete
>From 02858fb5d6782eaf32b51bd9cfbaf5ab2f6649cd Mon Sep 17 00:00:00 2001 >From: charles <charles.farmer@inlibro.com> >Date: Thu, 15 Dec 2016 10:58:23 -0500 >Subject: [PATCH] Bug 13572 - Add --actives parameter to > force_borrower_messaging_defaults script >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >1) Apply the patch >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 --actives" >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. > >--- > >This patch is a squashed version of the two previous ones, rebased on the current master, plus the changes asked in comment #7 >--- > .../maintenance/borrowers-force-messaging-defaults | 28 +++++++++++++++------- > 1 file changed, 19 insertions(+), 9 deletions(-) > >diff --git a/misc/maintenance/borrowers-force-messaging-defaults b/misc/maintenance/borrowers-force-messaging-defaults >index b0630e1..136c9d9 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, $actives) = @_; > > $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 ($actives) { >+ $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, $actives); > my $result = GetOptions( >- 'doit' => \$doit, >- 'truncate' => \$truncate, >- 'since:s' => \$since, >- 'help|h' => \$help, >+ 'doit' => \$doit, >+ 'truncate' => \$truncate, >+ 'since:s' => \$since, >+ 'actives' => \$actives, >+ 'help|h' => \$help, > ); > > usage() if $help; > >-force_borrower_messaging_defaults( $doit, $truncate, $since ); >+force_borrower_messaging_defaults( $doit, $truncate, $since, $actives ); > > =head1 NAME > >@@ -88,6 +93,7 @@ force-borrower-messaging-defaults > force-borrower-messaging-defaults --help > force-borrower-messaging-defaults --doit > force-borrower-messaging-defaults --doit --truncate >+ force-borrower-messaging-defaults --doit --actives > > =head1 DESCRIPTION > >@@ -108,13 +114,17 @@ Prints this help > > =item B<--doit> > >-Process actually the borrowers. >+Actually update the borrowers. > > =item B<--truncate> > > Truncate all borrowers transport preferences before (re-)creating them. It > affects borrower_message_preferences table. > >+=item B<--actives> >+ >+Will only update active borrowers (borrowers who didn't pass their expiration date). >+ > =back > > =cut >-- >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