Bugzilla – Attachment 43609 Details for
Bug 13409
Add ability to purge old special holidays using cleanup_database.pl
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 13409 [QA Followup] - Remove MySQLism
Bug-13409-QA-Followup---Remove-MySQLism.patch (text/plain), 2.11 KB, created by
Kyle M Hall
on 2015-10-19 18:27:05 UTC
(
hide
)
Description:
Bug 13409 [QA Followup] - Remove MySQLism
Filename:
MIME Type:
Creator:
Kyle M Hall
Created:
2015-10-19 18:27:05 UTC
Size:
2.11 KB
patch
obsolete
>From c2c3ee37a6af44664a8341bf801b0ec3b7e34be9 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Mon, 19 Oct 2015 14:26:16 -0400 >Subject: [PATCH] Bug 13409 [QA Followup] - Remove MySQLism > >--- > misc/cronjobs/cleanup_database.pl | 15 ++++++++++----- > 1 files changed, 10 insertions(+), 5 deletions(-) > >diff --git a/misc/cronjobs/cleanup_database.pl b/misc/cronjobs/cleanup_database.pl >index 423b0ac..cb56d5a 100755 >--- a/misc/cronjobs/cleanup_database.pl >+++ b/misc/cronjobs/cleanup_database.pl >@@ -35,11 +35,13 @@ BEGIN { > eval { require "$FindBin::Bin/../kohalib.pl" }; > } > >+use Getopt::Long; >+ > use C4::Context; > use C4::Dates; > use C4::Search; >-use Getopt::Long; > use C4::Log; >+use Koha::DateUtils; > > sub usage { > print STDERR <<USAGE; >@@ -69,8 +71,8 @@ Usage: $0 [-h|--help] [--sessions] [--sessdays DAYS] [-v|--verbose] [--zebraqueu > days. Defaults to 14 days if no days specified. > --restrictions DAYS purge patrons restrictions expired since more than DAYS days. > Defaults to 30 days if no days specified. >- --all-restrictions purge all expired patrons restrictions. >- --del-exp-selfreg Delete expired self registration accounts >+ --all-restrictions purge all expired patrons restrictions. >+ --del-exp-selfreg Delete expired self registration accounts > --del-unv-selfreg DAYS Delete unverified self registrations older than DAYS > --holidays DAYS purge special holidays that passed more then DAYS days ago. > Defaults to 30 days of no days specified. >@@ -391,11 +393,14 @@ sub DeleteUnverifiedSelfRegs { > } > > sub PurgeHolidays { >+ my $date = dt_from_string(); >+ $date->subtract( days => $pHolidays ); >+ > $sth = $dbh->prepare( > q{ > DELETE FROM special_holidays >- WHERE DATE( CONCAT( year, '-', month, '-', day ) ) < DATE_SUB( CURDATE(), INTERVAL ? DAY ) >+ WHERE DATE( CONCAT( year, '-', month, '-', day ) ) < ? > } > ); >- $sth->execute( $pHolidays ) or die $dbh->errstr; >+ $sth->execute( $date->ymd ) or die $dbh->errstr; > } >-- >1.7.2.5
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 13409
:
34177
|
43588
|
43608
| 43609 |
43693
|
43694
|
43695