From 63949d851c9bbc355264b1a487d7a38547f325c3 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Fri, 2 Jul 2021 11:07:46 -0400 Subject: [PATCH] Bug 26282: Update Holds to pull Rebased-by: Victor Grousset/tuxayo --- circ/pendingreserves.pl | 21 ++++++++++++------- .../prog/en/modules/circ/pendingreserves.tt | 10 +++++++-- 2 files changed, 22 insertions(+), 9 deletions(-) diff --git a/circ/pendingreserves.pl b/circ/pendingreserves.pl index 06330d0cea..2c304a1f6c 100755 --- a/circ/pendingreserves.pl +++ b/circ/pendingreserves.pl @@ -302,14 +302,21 @@ foreach my $bibnum ( @biblionumbers ){ push @holds_info, $hold_info; } +my $cancel_notify_templates = Koha::Notice::Templates->search({ module => 'reserves', code => 'HOLD_CANCELLATION' }); +my $cancel_notice_branches; +while ( my $notice = $cancel_notify_templates->next ) { + $cancel_notice_branches->{$notice->branchcode} = 1; +} + $template->param( - todaysdate => $today, - from => $startdate, - to => $enddate, - holds_info => \@holds_info, - HoldsToPullStartDate => C4::Context->preference('HoldsToPullStartDate') || PULL_INTERVAL, - HoldsToPullEndDate => C4::Context->preference('ConfirmFutureHolds') || 0, - messages => \@messages, + cancel_notice_branches => $cancel_notice_branches, + todaysdate => $today, + from => $startdate, + to => $enddate, + holds_info => \@holds_info, + HoldsToPullStartDate => C4::Context->preference('HoldsToPullStartDate') || PULL_INTERVAL, + messages => \@messages, + HoldsToPullEndDate => C4::Context->preference('ConfirmFutureHolds') || 0, ); output_html_with_http_headers $input, $cookie, $template->output; diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/pendingreserves.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/pendingreserves.tt index 5dea37f7bc..12405729a7 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/pendingreserves.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/pendingreserves.tt @@ -199,8 +199,14 @@ [% END %] - - + [% IF cancel_notice_branches.size %] + [% SET bc = hold.patron.branchcode %] + [% SET all_bc = "" %] + [% IF cancel_notice_branches.$bc || cancel_notice_branches.$all_bc %] + + + [% END %] + [% END %] [% END %] -- 2.37.1