Bug 11529: Remove duplicate column name from select query
[koha-ffzg.git] / circ / branchtransfers.pl
index 7de588c..d5b8e9e 100755 (executable)
@@ -35,7 +35,6 @@ use Koha::AuthorisedValues;
 use Koha::Holds;
 use Koha::Items;
 use Koha::Patrons;
-use Koha::Checkouts;
 
 ###############################################
 #  Getting state
@@ -65,6 +64,12 @@ my ($template, $user, $cookie, $flags ) = get_template_and_user(
     }
 );
 
+# Check transfers is allowed from system preference
+if ( C4::Context->preference("IndependentBranchesTransfers") && !C4::Context->IsSuperLibrarian() ) {
+    print $query->redirect("/cgi-bin/koha/errors/403.pl");
+    exit;
+}
+
 my $messages;
 my $found;
 my $reserved;
@@ -112,20 +117,20 @@ elsif ( $request eq 'KillReserved' ) {
     } # FIXME else?
 }
 
-# collect the stack of books already transfered so they can printed...
+# collect the stack of books already transferred so they can printed...
 my @trsfitemloop;
-my $transfered;
+my $transferred;
 my $barcode = $query->param('barcode');
 # remove leading/trailing whitespace
 defined $barcode and $barcode =~ s/^\s*|\s*$//g;  # FIXME: barcodeInputFilter
 # warn "barcode : $barcode";
 if ($barcode) {
 
-    ( $transfered, $messages ) =
+    ( $transferred, $messages ) =
       transferbook( $tobranchcd, $barcode, $ignoreRs );
     my $item = Koha::Items->find({ barcode => $barcode });
     $found = $messages->{'ResFound'};
-    if ($transfered) {
+    if ($transferred) {
         my %item;
         my $biblio = $item->biblio;
         my $frbranchcd =  C4::Context->userenv->{'branch'};
@@ -222,8 +227,6 @@ foreach my $code ( keys %$messages ) {
 # use Data::Dumper;
 # warn "FINAL ============= ".Dumper(@trsfitemloop);
 
-my $pending_checkout_notes = Koha::Checkouts->search({ noteseen => 0 })->count;
-
 $template->param(
     found                   => $found,
     reserved                => $reserved,
@@ -239,7 +242,6 @@ $template->param(
     trsfitemloop            => \@trsfitemloop,
     errmsgloop              => \@errmsgloop,
     CircAutocompl           => C4::Context->preference("CircAutocompl"),
-    pending_checkout_notes  => $pending_checkout_notes,
 );
 
 # Checking if there is a Fast Cataloging Framework