@@ -, +, @@ record 3.a) not that import batches for saving appear on the left side as targets to save searching again, or through the Staged MARC management in Tools) --- C4/ImportBatch.pm | 23 ++++++++++++++++++++++ Koha/MetaSearcher.pm | 2 +- .../prog/en/includes/cateditor-ui.inc | 6 +++--- .../prog/en/modules/cataloguing/editor.tt | 7 ++++--- svc/cataloguing/import_batches | 3 ++- 5 files changed, 33 insertions(+), 8 deletions(-) --- a/C4/ImportBatch.pm +++ a/C4/ImportBatch.pm @@ -1608,6 +1608,29 @@ sub _create_import_record { return $import_record_id; } +sub _get_import_record_timestamp { + my ( $marc_record ) = @_; + + my $upload_timestamp = DateTime->now(); + + # Attempt to parse the 005 timestamp. This is a bit weird because we have to parse the + # tenth-of-a-second ourselves. + my $f005 = $marc_record->field('005'); + if ($f005 && $f005->data =~ /(\d{8}\d{6})\.(\d)/ ) { + my $parser = DateTime::Format::Strptime->new( pattern => '%Y%m%d%H%M%S' ); + my $parsed_timestamp = $parser->parse_datetime($1); + + # We still check for success because we only did enough validation above to extract the + # tenth-of-a-second; the timestamp could still be some nonsense like the 50th of Jantober. + if ( $parsed_timestamp ) { + $parsed_timestamp->set_nanosecond( $2 * 100_000_000 ); + $upload_timestamp = $parsed_timestamp; + } + } + + return $upload_timestamp; +} + sub _update_import_record_marc { my ($import_record_id, $marc_record, $marc_type) = @_; --- a/Koha/MetaSearcher.pm +++ a/Koha/MetaSearcher.pm @@ -273,7 +273,7 @@ sub _batch_db_query_from_terms { push @db_terms, $_batch_db_mapping->{$index} => [ -and => _db_query_get_match_conditions( $index, $value ) ]; } else { # No such index, we should fail - return undef; + die("No such index"); } } --- a/koha-tmpl/intranet-tmpl/prog/en/includes/cateditor-ui.inc +++ a/koha-tmpl/intranet-tmpl/prog/en/includes/cateditor-ui.inc @@ -42,7 +42,7 @@ require( [ 'koha-backend', 'search', 'macros', 'marc-editor', 'marc-record', 'pr }, [%- FOREACH batch = editable_batches -%] 'batch:[% batch.import_batch_id %]': { - name: _("Batch: ") + '[% batch.file_name %]', + name: _("Batch: ") + `[% batch.file_name %]`, recordtype: 'biblio', checked: false, }, @@ -314,7 +314,7 @@ require( [ 'koha-backend', 'search', 'macros', 'marc-editor', 'marc-record', 'pr var editable_batches = { [%- FOREACH batch = editable_batches -%] [% batch.import_batch_id %]: { - 'name': '[% batch.file_name %]', + 'name': `[% batch.file_name %]`, }, [%- END -%] }; @@ -339,7 +339,7 @@ require( [ 'koha-backend', 'search', 'macros', 'marc-editor', 'marc-record', 'pr $.each( target_list, function( i, target ) { var $new_target = $( - '
  • ' + '
  • ` ); $new_target.find('input').change( function() { --- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/editor.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/editor.tt @@ -263,6 +263,7 @@