Bug 16735: Remove use of get_categories
authorKyle M Hall <kyle@bywatersolutions.com>
Tue, 21 Feb 2017 12:26:25 +0000 (12:26 +0000)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Mon, 12 Feb 2018 18:41:25 +0000 (15:41 -0300)
Feature using it is completely undocumented as far as my research has
shown.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

C4/Circulation.pm
C4/SIP/ILS/Transaction/Checkin.pm
circ/branchtransfers.pl
circ/returns.pl

index 2b7722c..6b4ae91 100644 (file)
@@ -278,10 +278,6 @@ is a reference-to-hash which may have any of the following keys:
 
 There is no item in the catalog with the given barcode. The value is C<$barcode>.
 
-=item C<IsPermanent>
-
-The item's home branch is permanent. This doesn't prevent the item from being transferred, though. The value is the code of the item's home branch.
-
 =item C<DestinationEqualsHolding>
 
 The item is already at the branch to which it is being transferred. The transfer is nonetheless considered to have failed. The value should be ignored.
@@ -336,15 +332,6 @@ sub transferbook {
         }
     }
 
-    # if is permanent...
-    # FIXME Is this still used by someone?
-    # See other FIXME in AddReturn
-    my $library = Koha::Libraries->find($hbr);
-    if ( $library and $library->get_categories->search({'me.categorycode' => 'PE'})->count ) {
-        $messages->{'IsPermanent'} = $hbr;
-        $dotransfer = 0;
-    }
-
     # can't transfer book if is already there....
     if ( $fbr eq $tbr ) {
         $messages->{'DestinationEqualsHolding'} = 1;
@@ -1768,12 +1755,6 @@ No item with this barcode exists. The value is C<$barcode>.
 
 The book is not currently on loan. The value is C<$barcode>.
 
-=item C<IsPermanent>
-
-The book's home branch is a permanent collection. If you have borrowed
-this book, you are not allowed to return it. The value is the code for
-the book's home branch.
-
 =item C<withdrawn>
 
 This book has been withdrawn/cancelled. The value should be ignored.
@@ -1888,16 +1869,6 @@ sub AddReturn {
         }
     }
 
-
-    # check if the book is in a permanent collection....
-    # FIXME -- This 'PE' attribute is largely undocumented.  afaict, there's no user interface that reflects this functionality.
-    if ( $returnbranch ) {
-        my $library = Koha::Libraries->find($returnbranch);
-        if ( $library and $library->get_categories->search({'me.categorycode' => 'PE'})->count ) {
-            $messages->{'IsPermanent'} = $returnbranch;
-        }
-    }
-
     # check if the return is allowed at this branch
     my ($returnallowed, $message) = CanBookBeReturned($item, $branch);
     unless ($returnallowed){
index 1e138bc..2ad3df5 100644 (file)
@@ -67,7 +67,7 @@ sub do_checkin {
     $debug and warn "do_checkin() calling AddReturn($barcode, $branch)";
     my ($return, $messages, $iteminformation, $borrower) = AddReturn($barcode, $branch, undef, undef, $return_date);
     $self->alert(!$return);
-    # ignoring messages: NotIssued, IsPermanent, WasLost, WasTransfered
+    # ignoring messages: NotIssued, WasLost, WasTransfered
 
     # biblionumber, biblioitemnumber, itemnumber
     # borrowernumber, reservedate, branchcode
index c9791cc..1305c82 100755 (executable)
@@ -205,10 +205,6 @@ foreach my $code ( keys %$messages ) {
             $err{tbr}      = $tbr;
             $err{code}     = $typecode;
         }
-        elsif ( $code eq 'IsPermanent' ) {
-            $err{errispermanent} = 1;
-            $err{msg} = $messages->{'IsPermanent'};
-        }
         elsif ( $code eq 'WasReturned' ) {
             $err{errwasreturned} = 1;
             $err{borrowernumber} = $messages->{'WasReturned'};
index 9e02fee..bd30f5c 100755 (executable)
@@ -493,7 +493,6 @@ foreach my $code ( keys %$messages ) {
     elsif ( $code eq 'NotIssued' ) {
         $err{notissued} = 1;
         $err{msg} = '';
-        $err{msg} = $messages->{'IsPermanent'} if $messages->{'IsPermanent'};
     }
     elsif ( $code eq 'LocalUse' ) {
         $err{localuse} = 1;
@@ -518,12 +517,6 @@ foreach my $code ( keys %$messages ) {
         $err{withdrawn} = 1;
         $exit_required_p = 1 if C4::Context->preference("BlockReturnOfWithdrawnItems");
     }
-    elsif ( ( $code eq 'IsPermanent' ) && ( not $messages->{'ResFound'} ) ) {
-        if ( $messages->{'IsPermanent'} ne $userenv_branch ) {
-            $err{ispermanent} = 1;
-            $err{msg}         = $messages->{'IsPermanent'};
-        }
-    }
     elsif ( $code eq 'WrongTransfer' ) {
         ;    # FIXME... anything to do here?
     }