Bug 28786: Two-factor authentication for staff client - TOTP
[koha-ffzg.git] / circ / transferstoreceive.pl
index b9123f6..9398912 100755 (executable)
 use Modern::Perl;
 use CGI qw ( -utf8 );
 use C4::Context;
-use C4::Output;
-use C4::Auth;
-use C4::Biblio;
-use C4::Circulation;
+use C4::Output qw( output_html_with_http_headers );
+use C4::Auth qw( get_template_and_user );
+use C4::Circulation qw( GetTransfers GetTransfersFromTo );
 use C4::Members;
-use Date::Calc qw(
-  Today
-  Add_Delta_Days
-  Date_to_Days
-);
+use Date::Calc qw( Add_Delta_Days Date_to_Days Today );
 
-use C4::Koha;
 use C4::Reserves;
 use Koha::Items;
 use Koha::ItemTypes;
 use Koha::Libraries;
-use Koha::DateUtils;
+use Koha::DateUtils qw( dt_from_string output_pref );
 use Koha::BiblioFrameworks;
 use Koha::Patrons;
 
-my $input = new CGI;
+my $input = CGI->new;
 my $itemnumber = $input->param('itemnumber');
 
 my ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user(
@@ -49,9 +43,7 @@ my ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user(
         template_name   => "circ/transferstoreceive.tt",
         query           => $input,
         type            => "intranet",
-        authnotrequired => 0,
         flagsrequired   => { circulate => "circulate_remaining_permissions" },
-        debug           => 1,
     }
 );
 
@@ -117,6 +109,15 @@ while ( my $library = $libraries->next ) {
             if ( my $first_hold = $holds->next ) {
                 $getransf{patron} = Koha::Patrons->find( $first_hold->borrowernumber );
             }
+
+            # check for a recall for this transfer
+            if ( C4::Context->preference('UseRecalls') ) {
+                my $recall = $item->recall;
+                if ( defined $recall ) {
+                    $getransf{recall} = $recall;
+                }
+            }
+
             push( @transferloop, \%getransf );
         }