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

(-)a/misc/stage_file.pl (-34 / +36 lines)
Lines 52-69 my $marc_mod_template = ''; Link Here
52
my $marc_mod_template_id = undef;
52
my $marc_mod_template_id = undef;
53
53
54
my $result = GetOptions(
54
my $result = GetOptions(
55
    'encoding:s'    => \$encoding,
55
    'encoding:s'         => \$encoding,
56
    'file:s'        => \$input_file,
56
    'file:s'             => \$input_file,
57
    'format:s'      => \$format,
57
    'format:s'           => \$format,
58
    'match|match-bibs:s'  => \$match,
58
    'match|match-bibs:s' => \$match,
59
    'add-items'     => \$add_items,
59
    'add-items'          => \$add_items,
60
    'item-action:s' => \$item_action,
60
    'item-action:s'      => \$item_action,
61
    'no-replace'    => \$no_replace,
61
    'no-replace'         => \$no_replace,
62
    'no-create'     => \$no_create,
62
    'no-create'          => \$no_create,
63
    'comment:s'     => \$batch_comment,
63
    'comment:s'          => \$batch_comment,
64
    'authorities'   => \$authorities,
64
    'authorities'        => \$authorities,
65
    'marcmodtemplate:s' => \$marc_mod_template,
65
    'marcmodtemplate:s'  => \$marc_mod_template,
66
    'h|help'        => \$want_help
66
    'h|help'             => \$want_help
67
);
67
);
68
68
69
if($marc_mod_template ne '') {
69
if($marc_mod_template ne '') {
Lines 104-122 unless (-r $input_file) { Link Here
104
104
105
my $dbh = C4::Context->dbh;
105
my $dbh = C4::Context->dbh;
106
$dbh->{AutoCommit} = 0;
106
$dbh->{AutoCommit} = 0;
107
process_batch({
107
process_batch(
108
    format        => $format,
108
    {
109
    input_file    => $input_file,
109
        format               => $format,
110
    record_type   => $record_type,
110
        input_file           => $input_file,
111
    match         => $match,
111
        record_type          => $record_type,
112
    add_items     => $add_items,
112
        match                => $match,
113
    batch_comment => $batch_comment,
113
        add_items            => $add_items,
114
    encoding      => $encoding,
114
        batch_comment        => $batch_comment,
115
    no_replace    => $no_replace,
115
        encoding             => $encoding,
116
    no_create     => $no_create,
116
        no_replace           => $no_replace,
117
    item_action   => $item_action,
117
        no_create            => $no_create,
118
    marc_mod_template_id => $marc_mod_template_id,
118
        item_action          => $item_action,
119
});
119
        marc_mod_template_id => $marc_mod_template_id,
120
    }
121
);
120
$dbh->commit();
122
$dbh->commit();
121
123
122
exit 0;
124
exit 0;
Lines 139-152 sub process_batch { Link Here
139
141
140
    print "... staging MARC records -- please wait\n";
142
    print "... staging MARC records -- please wait\n";
141
    #FIXME: We should really allow the use of marc modification frameworks and to_marc plugins here if possible
143
    #FIXME: We should really allow the use of marc modification frameworks and to_marc plugins here if possible
142
    my ($batch_id, $num_valid_records, $num_items, @import_errors) =
144
    my ( $batch_id, $num_valid_records, $num_items, @import_errors ) =
143
        BatchStageMarcRecords(
145
      BatchStageMarcRecords(
144
            $record_type, $params->{encoding},
146
        $record_type,                      $params->{encoding},
145
            $marc_records, $params->{input_file},
147
        $marc_records,                     $params->{input_file},
146
            $params->{'marc_mod_template_id'},
148
        $params->{'marc_mod_template_id'}, $params->{batch_comment},
147
            $params->{batch_comment}, '',
149
        '',                                $params->{add_items},
148
            $params->{add_items}, 0,
150
        0,                                 100,
149
            100, \&print_progress_and_commit);
151
        \&print_progress_and_commit
152
      );
150
    print "... finished staging MARC records\n";
153
    print "... finished staging MARC records\n";
151
154
152
    my $num_with_matches = 0;
155
    my $num_with_matches = 0;
153
- 

Return to bug 19164