View | Details | Raw Unified | Return to bug 18823
Collapse All | Expand All

(-)a/C4/ImportBatch.pm (+23 lines)
Lines 1608-1613 sub _create_import_record { Link Here
1608
    return $import_record_id;
1608
    return $import_record_id;
1609
}
1609
}
1610
1610
1611
sub _get_import_record_timestamp {
1612
    my ( $marc_record ) = @_;
1613
1614
    my $upload_timestamp = DateTime->now();
1615
1616
    # Attempt to parse the 005 timestamp. This is a bit weird because we have to parse the
1617
    # tenth-of-a-second ourselves.
1618
    my $f005 = $marc_record->field('005');
1619
    if ($f005 && $f005->data =~ /(\d{8}\d{6})\.(\d)/ ) {
1620
        my $parser = DateTime::Format::Strptime->new( pattern => '%Y%m%d%H%M%S' );
1621
        my $parsed_timestamp = $parser->parse_datetime($1);
1622
1623
        # We still check for success because we only did enough validation above to extract the
1624
        # tenth-of-a-second; the timestamp could still be some nonsense like the 50th of Jantober.
1625
        if ( $parsed_timestamp ) {
1626
            $parsed_timestamp->set_nanosecond( $2 * 100_000_000 );
1627
            $upload_timestamp = $parsed_timestamp;
1628
        }
1629
    }
1630
1631
    return $upload_timestamp;
1632
}
1633
1611
sub _update_import_record_marc {
1634
sub _update_import_record_marc {
1612
    my ($import_record_id, $marc_record, $marc_type) = @_;
1635
    my ($import_record_id, $marc_record, $marc_type) = @_;
1613
1636
(-)a/Koha/MetaSearcher.pm (-1 / +1 lines)
Lines 273-279 sub _batch_db_query_from_terms { Link Here
273
            push @db_terms, $_batch_db_mapping->{$index} => [ -and => _db_query_get_match_conditions( $index, $value ) ];
273
            push @db_terms, $_batch_db_mapping->{$index} => [ -and => _db_query_get_match_conditions( $index, $value ) ];
274
        } else {
274
        } else {
275
            # No such index, we should fail
275
            # No such index, we should fail
276
            return undef;
276
            die("No such index");
277
        }
277
        }
278
    }
278
    }
279
279
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/cateditor-ui.inc (-3 / +3 lines)
Lines 42-48 require( [ 'koha-backend', 'search', 'macros', 'marc-editor', 'marc-record', 'pr Link Here
42
        },
42
        },
43
        [%- FOREACH batch = editable_batches -%]
43
        [%- FOREACH batch = editable_batches -%]
44
            'batch:[% batch.import_batch_id %]': {
44
            'batch:[% batch.import_batch_id %]': {
45
                name: _("Batch: ") + '[% batch.file_name %]',
45
                name: _("Batch: ") + `[% batch.file_name %]`,
46
                recordtype: 'biblio',
46
                recordtype: 'biblio',
47
                checked: false,
47
                checked: false,
48
            },
48
            },
Lines 314-320 require( [ 'koha-backend', 'search', 'macros', 'marc-editor', 'marc-record', 'pr Link Here
314
    var editable_batches = {
314
    var editable_batches = {
315
        [%- FOREACH batch = editable_batches -%]
315
        [%- FOREACH batch = editable_batches -%]
316
            [% batch.import_batch_id %]: {
316
            [% batch.import_batch_id %]: {
317
                'name': '[% batch.file_name %]',
317
                'name': `[% batch.file_name %]`,
318
            },
318
            },
319
        [%- END -%]
319
        [%- END -%]
320
    };
320
    };
Lines 339-345 require( [ 'koha-backend', 'search', 'macros', 'marc-editor', 'marc-record', 'pr Link Here
339
339
340
        $.each( target_list, function( i, target ) {
340
        $.each( target_list, function( i, target ) {
341
            var $new_target = $(
341
            var $new_target = $(
342
                '<li><input type="checkbox" class="save-toggle-target" data-target-id="' + target.id + '" id="save-target-' + i + '"' + ( target.checked ? ' checked="checked"' : '' ) + '> <label for="save-target-' + i + '">' + target.label + '</label></li>'
342
                '<li><input type="checkbox" class="save-toggle-target" data-target-id="' + target.id + '" id="save-target-' + i + '"' + ( target.checked ? ' checked="checked"' : '' ) + `> <label for="save-target-` + i + `">` + target.label + `</label></li>`
343
            );
343
            );
344
344
345
            $new_target.find('input').change( function() {
345
            $new_target.find('input').change( function() {
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/editor.tt (-3 / +4 lines)
Lines 263-268 Link Here
263
263
264
<div id="batches-ui" class="ui-modal modal fade" tabindex="-1" role="dialog" aria-labelledby="batches-title" aria-hidden="true">
264
<div id="batches-ui" class="ui-modal modal fade" tabindex="-1" role="dialog" aria-labelledby="batches-title" aria-hidden="true">
265
265
266
<div class="modal-content">
266
<div class="modal-header">
267
<div class="modal-header">
267
    <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
268
    <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
268
    <h3 id="batches-title">Import batch settings</h3>
269
    <h3 id="batches-title">Import batch settings</h3>
Lines 271-278 Link Here
271
<div class="modal-body row-fluid">
272
<div class="modal-body row-fluid">
272
    <div class="span9">
273
    <div class="span9">
273
        <div id="toolbar" class="btn-toolbar">
274
        <div id="toolbar" class="btn-toolbar">
274
            <button class="btn btn-small" type="submit" id="create-batch"><i class="icon-plus"></i> <span>Create new batch...</span></button>
275
            <button class="btn btn-sm" type="submit" id="create-batch"><i class="icon-plus"></i> <span>Create new batch...</span></button>
275
            <button class="btn btn-small" type="submit" id="manage-batches"><i class="icon-list"></i> <span>Manage import batches...</span></button>
276
            <button class="btn btn-sm" type="submit" id="manage-batches"><i class="icon-list"></i> <span>Manage import batches...</span></button>
276
        </div>
277
        </div>
277
        <table id="batches-table">
278
        <table id="batches-table">
278
            <thead>
279
            <thead>
Lines 290-296 Link Here
290
    <div class="span3">
291
    <div class="span3">
291
    </div>
292
    </div>
292
</div>
293
</div>
293
294
</div>
294
</div>
295
</div>
295
296
296
<div id="shortcuts-contents" style="display: none">
297
<div id="shortcuts-contents" style="display: none">
(-)a/svc/cataloguing/import_batches (-2 / +2 lines)
Lines 195-201 sub create_batch { Link Here
195
195
196
    my $batch_id = AddImportBatch({
196
    my $batch_id = AddImportBatch({
197
        file_name => $batch_name,
197
        file_name => $batch_name,
198
        record_type => 'biblio'
198
        record_type => 'biblio',
199
        import_status => 'staged'
199
    });
200
    });
200
201
201
    $response->param( batch_id => $batch_id );
202
    $response->param( batch_id => $batch_id );
202
- 

Return to bug 18823