From cc5d9f5c5abc1a711bb87f0989a455d2717168b5 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Tue, 7 Oct 2014 11:54:51 -0400 Subject: [PATCH] Bug 12803 [QA Followup] - Use Koha::Calendar --- C4/HoldsQueue.pm | 10 +++++----- t/db_dependent/HoldsQueue.t | 1 + 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/C4/HoldsQueue.pm b/C4/HoldsQueue.pm index 7090c08..2a53975 100755 --- a/C4/HoldsQueue.pm +++ b/C4/HoldsQueue.pm @@ -30,7 +30,7 @@ use C4::Circulation; use C4::Members; use C4::Biblio; use C4::Dates qw/format_date/; -use C4::Calendar; +use Koha::Calendar; use Koha::Database; use Koha::DateUtils; @@ -81,9 +81,9 @@ sub TransportCostMatrix { }; if ( C4::Context->preference("HoldsQueueSkipClosed") ) { - $calendars->{$from} ||= C4::Calendar->new( branchcode => $from ); + $calendars->{$from} ||= Koha::Calendar->new( branchcode => $from ); $transport_cost_matrix{$to}{$from}{disable_transfer} ||= - $calendars->{$from}->isHoliday( $today->day(), $today->month(), $today->year() ); + $calendars->{$from}->is_holiday( $today ); } } @@ -614,8 +614,8 @@ sub load_branches_to_pull_from { my $today = dt_from_string(); if ( C4::Context->preference('HoldsQueueSkipClosed') ) { @branches_to_use = grep { - !C4::Calendar->new( branchcode => $_ ) - ->isHoliday( $today->day(), $today->month(), $today->year() ) + !Koha::Calendar->new( branchcode => $_ ) + ->is_holiday( $today ) } @branches_to_use; } diff --git a/t/db_dependent/HoldsQueue.t b/t/db_dependent/HoldsQueue.t index c9aa435..6fc6771 100755 --- a/t/db_dependent/HoldsQueue.t +++ b/t/db_dependent/HoldsQueue.t @@ -11,6 +11,7 @@ use Modern::Perl; use Test::More tests => 23; use Data::Dumper; +use C4::Calendar; use C4::Context; use C4::Branch; use C4::ItemType; -- 1.7.2.5