diff --git a/C4/Circulation.pm b/C4/Circulation.pm index fd64f5bf3f..2fd7cdfc54 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -394,7 +394,7 @@ sub transferbook { } # find recall - if ( C4::Context->preference('UseRecalls') ) { + if ( C4::Context->preference('UseRecalls') ne "off" ) { my $recall = Koha::Recalls->find( { item_id => $itemnumber, status => 'in_transit' } ); if ( defined $recall ) { @@ -1236,7 +1236,7 @@ sub CanBookBeIssued { # CHECK IF ITEM HAS BEEN RECALLED BY ANOTHER PATRON # Only bother doing this if UseRecalls is enabled and the item is recallable # Don't look at recalls that are in transit - if ( C4::Context->preference('UseRecalls') and $item_object->can_be_waiting_recall ) { + if ( C4::Context->preference('UseRecalls') ne "off" and $item_object->can_be_waiting_recall ) { my @recalls = $biblio->recalls( {}, { order_by => { -asc => 'created_date' } } )->filter_by_current->as_list; foreach my $r (@recalls) { @@ -1802,7 +1802,7 @@ sub AddIssue { $item_object->discard_changes; } - if ( C4::Context->preference('UseRecalls') ) { + if ( C4::Context->preference('UseRecalls') ne "off" ) { Koha::Recalls->move_recall( { action => $cancel_recall, @@ -2768,7 +2768,7 @@ sub AddReturn { } # find recalls... - if ( C4::Context->preference('UseRecalls') ) { + if ( C4::Context->preference('UseRecalls') ne "off" ) { # check if this item is recallable first, which includes checking if UseRecalls syspref is enabled my $recall = undef; @@ -2859,7 +2859,7 @@ sub AddReturn { $request->status('RET') if $request; } - if ( C4::Context->preference('UseRecalls') ) { + if ( C4::Context->preference('UseRecalls') ne "off" ) { # all recalls that have triggered a transfer will have an allocated itemnumber my $transfer_recall = Koha::Recalls->find( { item_id => $item->itemnumber, status => 'in_transit' } ); @@ -3493,7 +3493,7 @@ sub CanBookBeRenewed { } - if ( C4::Context->preference('UseRecalls') ) { + if ( C4::Context->preference('UseRecalls') ne "off" ) { my $recall = undef; $recall = $item->check_recalls if $item->can_be_waiting_recall; if ( defined $recall ) { diff --git a/C4/Search.pm b/C4/Search.pm index 0ff6798617..80814e5b6b 100644 --- a/C4/Search.pm +++ b/C4/Search.pm @@ -1980,7 +1980,7 @@ sub searchResults { ) : ( '', '', '' ); $reservestatus = C4::Reserves::GetReserveStatus( $item->{itemnumber} ); - if ( C4::Context->preference('UseRecalls') ) { + if ( C4::Context->preference('UseRecalls') ne "off" ) { if ( Koha::Recalls->search( { item_id => $item->{itemnumber}, status => 'waiting' } )->count ) { $recallstatus = 'Waiting'; } diff --git a/C4/XSLT.pm b/C4/XSLT.pm index babfd2cd07..cb2e6d1a86 100644 --- a/C4/XSLT.pm +++ b/C4/XSLT.pm @@ -385,7 +385,7 @@ sub buildKohaItemsNamespace { my $substatus = ''; my $recalls_count; - if ( C4::Context->preference('UseRecalls') ) { + if ( C4::Context->preference('UseRecalls') ne "off" ) { $recalls_count = Koha::Recalls->search( { item_id => $item->itemnumber, status => 'waiting' } )->count; } diff --git a/Koha/Biblio.pm b/Koha/Biblio.pm index d1a19170c4..d8bf30c219 100644 --- a/Koha/Biblio.pm +++ b/Koha/Biblio.pm @@ -2244,7 +2244,7 @@ Does biblio-level checks and returns the items attached to this biblio that are sub can_be_recalled { my ( $self, $params ) = @_; - return 0 if !( C4::Context->preference('UseRecalls') ); + return 0 if ( C4::Context->preference('UseRecalls') eq "off" ); my $patron = $params->{patron}; diff --git a/Koha/Item.pm b/Koha/Item.pm index 2017604f80..d8f314a8b7 100644 --- a/Koha/Item.pm +++ b/Koha/Item.pm @@ -1777,7 +1777,7 @@ sub _status { if ( $self->first_hold ) { push @statuses, 'on_hold'; } - if ( C4::Context->preference('UseRecalls') && $self->recall ) { + if ( C4::Context->preference('UseRecalls') ne "off" && $self->recall ) { push @statuses, 'recalled'; } @@ -2648,7 +2648,7 @@ Does item-level checks and returns if items can be recalled by this borrower sub can_be_recalled { my ( $self, $params ) = @_; - return 0 if !( C4::Context->preference('UseRecalls') ); + return 0 if ( C4::Context->preference('UseRecalls') eq "off" ); # check if this item is not for loan, withdrawn or lost return 0 if ( $self->notforloan != 0 ); @@ -2745,7 +2745,7 @@ At this point the item has already been recalled. We are now at the checkin and sub can_be_waiting_recall { my ($self) = @_; - return 0 if !( C4::Context->preference('UseRecalls') ); + return 0 if ( C4::Context->preference('UseRecalls') eq "off" ); # check if this item is not for loan, withdrawn or lost return 0 if ( $self->notforloan != 0 );