- push @list, {
- import_batch_id => $batch->{'import_batch_id'},
- num_biblios => $batch->{'num_biblios'},
- num_items => $batch->{'num_items'},
- upload_timestamp => $batch->{'upload_timestamp'},
- import_status => $batch->{'import_status'},
- file_name => $batch->{'file_name'},
- comments => $batch->{'comments'},
- };
+ # check if there is at least 1 line still staged
+ my $stagedList=GetImportBibliosRange($batch->{'import_batch_id'}, undef, undef, 'staged');
+ if (scalar @$stagedList) {
+ my ($staged_date, $staged_hour) = split (/ /, $batch->{'upload_timestamp'});
+ push @list, {
+ import_batch_id => $batch->{'import_batch_id'},
+ num_biblios => $batch->{'num_biblios'},
+ num_items => $batch->{'num_items'},
+ staged_date => $staged_date,
+ staged_hour => $staged_hour,
+ import_status => $batch->{'import_status'},
+ file_name => $batch->{'file_name'},
+ comments => $batch->{'comments'},
+ };
+ } else {
+ # if there are no more line to includes, set the status to imported
+ SetImportBatchStatus( $batch->{'import_batch_id'}, 'imported' );
+ }