From ba23348db60fdf026723deef6e2907f6fc8093e6 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Thu, 3 Jun 2021 06:57:52 -0400 Subject: [PATCH] Bug 28510: Remove marking of closed branches as 'disable_transfer' We no longer need to act as if closed branches were marked as disable_transfer. This allows us to clean up a nice bit of code. Signed-off-by: David Nind Signed-off-by: Martin Renvoize Bug 28510: Remove unused variable Signed-off-by: Martin Renvoize Signed-off-by: Jonathan Druart --- C4/HoldsQueue.pm | 10 +--------- admin/transport-cost-matrix.pl | 2 +- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/C4/HoldsQueue.pm b/C4/HoldsQueue.pm index f5743ceddf..b4d2b026f2 100644 --- a/C4/HoldsQueue.pm +++ b/C4/HoldsQueue.pm @@ -60,13 +60,11 @@ Returns Transport Cost Matrix as a hashref => {ignore_holds_queue_skip_closed}; my $dbh = C4::Context->dbh; my $transport_costs = $dbh->selectall_arrayref("SELECT * FROM transport_cost",{ Slice => {} }); my $today = dt_from_string(); - my $calendars; my %transport_cost_matrix; foreach (@$transport_costs) { my $from = $_->{frombranch}; @@ -77,14 +75,8 @@ sub TransportCostMatrix { cost => $cost, disable_transfer => $disabled }; - - if ( !$ignore_holds_queue_skip_closed && C4::Context->preference("HoldsQueueSkipClosed") ) { - $calendars->{$from} ||= Koha::Calendar->new( branchcode => $from ); - $transport_cost_matrix{$to}{$from}{disable_transfer} ||= - $calendars->{$from}->is_holiday( $today ); - } - } + return \%transport_cost_matrix; } diff --git a/admin/transport-cost-matrix.pl b/admin/transport-cost-matrix.pl index 29452ca581..c138093c74 100755 --- a/admin/transport-cost-matrix.pl +++ b/admin/transport-cost-matrix.pl @@ -41,7 +41,7 @@ my $update = ( $input->param('op') // '' ) eq 'set-cost-matrix'; my ($cost_matrix, $have_matrix); unless ($update) { - $cost_matrix = TransportCostMatrix({ ignore_holds_queue_skip_closed => 1 }); + $cost_matrix = TransportCostMatrix(); $have_matrix = keys %$cost_matrix if $cost_matrix; } -- 2.39.5