From 462e5a7528e81ffa61af191982a8b1689691f2da Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Tue, 11 Jun 2019 07:42:56 -0400 Subject: [PATCH] Bug 23057: (QA Follow-up) [ALT PATCH] Handle new ReturnOfLostItemBlocked message in returns.pl --- C4/Circulation.pm | 13 ++++++------- circ/returns.pl | 5 ++++- .../prog/en/modules/circ/returns.tt | 16 +++++++--------- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/C4/Circulation.pm b/C4/Circulation.pm index 45da90dd2d..f64329ab19 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -1944,11 +1944,6 @@ sub AddReturn { $doreturn = 0 if C4::Context->preference("BlockReturnOfWithdrawnItems"); } - if ( $item->itemlost and C4::Context->preference("BlockReturnOfLostItems") ) { - $messages->{'ReturnOfLostItemBlocked'}; - $doreturn = 0; - } - # case of a return of document (deal with issues and holdingbranch) if ($doreturn) { my $is_overdue; @@ -2011,8 +2006,12 @@ sub AddReturn { # fix up the accounts..... if ( $item->itemlost ) { - $messages->{'WasLost'} = 1; - unless ( C4::Context->preference("BlockReturnOfLostItems") ) { + if ( C4::Context->preference("BlockReturnOfLostItems") ) { + $messages->{'ReturnOfLostItemBlocked'} = 1; + $doreturn = 0; + } + else { + $messages->{'WasLost'} = 1; if ( Koha::RefundLostItemFeeRules->should_refund( { diff --git a/circ/returns.pl b/circ/returns.pl index 657229a10e..bcb6574db2 100755 --- a/circ/returns.pl +++ b/circ/returns.pl @@ -493,7 +493,10 @@ foreach my $code ( keys %$messages ) { } elsif ( $code eq 'WasLost' ) { $err{waslost} = 1; - $exit_required_p = 1 if C4::Context->preference("BlockReturnOfLostItems"); + } + elsif ( $code eq 'ReturnOfLostItemBlocked' ) { + $err{ReturnOfLostItemBlocked} = 1; + $exit_required_p = 1; } elsif ( $code eq 'LostItemFeeRefunded' ) { $template->param( LostItemFeeRefunded => 1 ); diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt index 6277ed8123..c4b3fcb7ef 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt @@ -621,20 +621,18 @@

Local use recorded

[% END %] [% IF ( errmsgloo.waslost ) %] - [% IF Koha.Preference('BlockReturnOfLostItems') %] -

Item is lost, cannot be checked in.

- [% ELSE %] -

Item was lost, now found.

- [% END %] - [% IF LostItemFeeRefunded and not Koha.Preference('BlockReturnOfLostItems') %] +

Item was lost, now found.

+ [% IF LostItemFeeRefunded %]

A refund has been applied to the borrowing patron's account.

- [% ELSIF Koha.Preference('BlockReturnOfLostItems') %] -
Cannot check in
-

NOT CHECKED IN

[% ELSE %]

Any lost item fees for this item will remain on the patron's account.

[% END %] [% END %] + [% IF ( errmsgloo.ReturnOfLostItemBlocked ) %] +
Cannot check in
+

NOT CHECKED IN

+

Item is lost.

+ [% END %] [% IF ( errmsgloo.withdrawn ) %] [% IF Koha.Preference('BlockReturnOfWithdrawnItems') %]
Cannot check in
-- 2.20.1 (Apple Git-117)