From 06af34ec9f41ec6e6b8e7cca51af4dd448818d9f 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 c306bf6b8cc..c3fdc404274 100755 --- a/circ/pendingreserves.pl +++ b/circ/pendingreserves.pl @@ -300,14 +300,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 3f4d741fabb..aff4c8be87c 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/pendingreserves.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/pendingreserves.tt @@ -221,8 +221,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.39.3 (Apple Git-146)