Bugzilla – Attachment 24599 Details for
Bug 8735
Expire holds waiting only on days the library is open
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 8735 - Expire holds waiting only on days the library is open - Followup - Switch from C4::Calendar to Koha::Calendar
Bug-8735---Expire-holds-waiting-only-on-days-the-l.patch (text/plain), 2.27 KB, created by
Kyle M Hall (khall)
on 2014-01-21 20:52:13 UTC
(
hide
)
Description:
Bug 8735 - Expire holds waiting only on days the library is open - Followup - Switch from C4::Calendar to Koha::Calendar
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2014-01-21 20:52:13 UTC
Size:
2.27 KB
patch
obsolete
>From 542d1bec073ca24442ee8ef541d5c0ca75446f11 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Tue, 23 Apr 2013 12:32:03 -0400 >Subject: [PATCH] Bug 8735 - Expire holds waiting only on days the library is open - Followup - Switch from C4::Calendar to Koha::Calendar > >Test Plan: > 1) Set ExpireReservesMaxPickUpDelay > 2) Set ReservesMaxPickUpDelay to 1 > 3) Place a hold, set it to waiting > 4) Using the MySQL console, modify the waiting date and set it to the > day before yesterday. > 5) Set today as a holiday for the pickup branch in question. > 6) Run misc/cronjobs/holds/cancel_expired_holds.pl > 7) The hold should remain unchanged > 8) Remove today as a holiday > 9) Run misc/cronjobs/holds/cancel_expired_holds.pl again >10) The hold should now be canceled >--- > C4/Reserves.pm | 8 ++++---- > 1 files changed, 4 insertions(+), 4 deletions(-) > >diff --git a/C4/Reserves.pm b/C4/Reserves.pm >index 8862a99..0e5674e 100644 >--- a/C4/Reserves.pm >+++ b/C4/Reserves.pm >@@ -36,9 +36,9 @@ use C4::Members qw(); > use C4::Letters; > use C4::Branch qw( GetBranchDetail ); > use C4::Dates qw( format_date_in_iso ); >-use C4::Calendar; > > use Koha::DateUtils; >+use Koha::Calendar; > > use List::MoreUtils qw( firstidx ); > >@@ -961,7 +961,7 @@ sub CancelExpiredReserves { > my $charge = C4::Context->preference("ExpireReservesMaxPickUpDelayCharge"); > my $cancel_on_holidays = C4::Context->preference('ExpireReservesOnHolidays'); > >- my $today = C4::Dates->new(); >+ my $today = dt_from_string(); > > my $query = "SELECT * FROM reserves WHERE TO_DAYS( NOW() ) - TO_DAYS( waitingdate ) > ? AND found = 'W' AND priority = 0"; > $sth = $dbh->prepare( $query ); >@@ -970,8 +970,8 @@ sub CancelExpiredReserves { > while ( my $res = $sth->fetchrow_hashref ) { > my $do_cancel = 1; > unless ( $cancel_on_holidays ) { >- my $calendar = C4::Calendar->new( branchcode => $res->{'branchcode'} ); >- my $is_holiday = $calendar->isHoliday( split( '/', $today->output('metric') ) ); >+ my $calendar = Koha::Calendar->new( branchcode => $res->{'branchcode'} ); >+ my $is_holiday = $calendar->is_holiday( $today ); > > if ( $is_holiday ) { > $do_cancel = 0; >-- >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 8735
:
12019
|
12020
|
13364
|
13365
|
15074
|
15075
|
15096
|
15097
|
15098
|
16508
|
17625
|
17892
|
17893
|
24598
|
24599
|
24898
|
24899
|
27268
|
28660
|
28661
|
28662
|
28663
|
30395
|
30396
|
30397
|
30398
|
30399
|
30400
|
30401
|
30402