Bug 14321: Integrate Upload.pm into Koha
[koha-equinox.git] / offline_circ / process_koc.pl
index d7e5606..21462ef 100755 (executable)
@@ -32,7 +32,7 @@ use C4::Circulation;
 use C4::Items;
 use C4::Members;
 use C4::Stats;
-use C4::UploadedFile;
+use Koha::Upload;
 use C4::BackgroundJob;
 
 use Date::Calc qw( Add_Delta_Days Date_to_Days );
@@ -69,11 +69,11 @@ if ($completedJobID) {
     $template->param(transactions_loaded => 1);
     $template->param(messages => $results->{results});
 } elsif ($fileID) {
-    my $uploaded_file = C4::UploadedFile->fetch($sessionID, $fileID);
-    my $fh = $uploaded_file->fh();
+    my $upload = Koha::Upload->new->get({ id => $fileID, filehandle => 1 });
+    my $fh = $upload->{fh};
+    my $filename = $upload->{name};
     my @input_lines = <$fh>;
 
-    my $filename = $uploaded_file->name();
     my $job = undef;
 
     if ($runinbackground) {