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

(-)a/C4/ImportBatch.pm (-2 / +3 lines)
Lines 567-572 sub BatchFindDuplicates { Link Here
567
sub BatchCommitRecords {
567
sub BatchCommitRecords {
568
    my $batch_id = shift;
568
    my $batch_id = shift;
569
    my $framework = shift;
569
    my $framework = shift;
570
    my $overlay_framework = shift;
570
571
571
    # optional callback to monitor status 
572
    # optional callback to monitor status 
572
    # of job
573
    # of job
Lines 673-680 sub BatchCommitRecords { Link Here
673
                    $old_marc->delete_field($item_field);
674
                    $old_marc->delete_field($item_field);
674
                }
675
                }
675
                $oldxml = $old_marc->as_xml($marc_type);
676
                $oldxml = $old_marc->as_xml($marc_type);
676
677
                if ($overlay_framework == '_USE_ORIG_') { $overlay_framework = $oldbiblio->{'frameworkcode'}; }
677
                ModBiblio($marc_record, $recordid, $oldbiblio->{'frameworkcode'});
678
                ModBiblio($marc_record, $recordid, $overlay_framework);
678
                $query = "UPDATE import_biblios SET matched_biblionumber = ? WHERE import_record_id = ?";
679
                $query = "UPDATE import_biblios SET matched_biblionumber = ? WHERE import_record_id = ?";
679
680
680
                if ($item_result eq 'create_new' || $item_result eq 'replace') {
681
                if ($item_result eq 'create_new' || $item_result eq 'replace') {
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/manage-marc-import.tt (+9 lines)
Lines 364-369 $(document).ready(function(){ Link Here
364
          <option value="[% framework.value %]">[% framework.label %]</option>
364
          <option value="[% framework.value %]">[% framework.label %]</option>
365
      [% END %]
365
      [% END %]
366
    </select>
366
    </select>
367
    <br/>
368
    When replacing records use this framework:
369
    <select name="overlay_framework" id="overlay_frameworks">
370
      <option value="_USE_ORIG_">Keep original framework</option>
371
      <option value="">Default</option>
372
      [% FOREACH framework IN frameworks %]
373
          <option value="[% framework.value %]">[% framework.label %]</option>
374
      [% END %]
375
    </select>
367
    [% END %]
376
    [% END %]
368
    </fieldset>
377
    </fieldset>
369
  </form>
378
  </form>
(-)a/tools/manage-marc-import.pl (-4 / +4 lines)
Lines 106-112 if ($op eq "") { Link Here
106
        add_saved_job_results_to_template($template, $completedJobID);
106
        add_saved_job_results_to_template($template, $completedJobID);
107
    } else {
107
    } else {
108
        my $framework = $input->param('framework');
108
        my $framework = $input->param('framework');
109
        commit_batch($template, $import_batch_id, $framework);
109
        my $overlay_framework = $input->param('overlay_framework');
110
        commit_batch($template, $import_batch_id, $framework, $overlay_framework);
110
    }
111
    }
111
    import_records_list($template, $import_batch_id, $offset, $results_per_page);
112
    import_records_list($template, $import_batch_id, $offset, $results_per_page);
112
} elsif ($op eq "revert-batch") {
113
} elsif ($op eq "revert-batch") {
Lines 237-243 sub import_batches_list { Link Here
237
}
238
}
238
239
239
sub commit_batch {
240
sub commit_batch {
240
    my ($template, $import_batch_id, $framework) = @_;
241
    my ($template, $import_batch_id, $framework, $overlay_framework) = @_;
241
242
242
    my $job = undef;
243
    my $job = undef;
243
    $dbh->{AutoCommit} = 0;
244
    $dbh->{AutoCommit} = 0;
Lines 247-253 sub commit_batch { Link Here
247
        $callback = progress_callback($job, $dbh);
248
        $callback = progress_callback($job, $dbh);
248
    }
249
    }
249
    my ($num_added, $num_updated, $num_items_added, $num_items_replaced, $num_items_errored, $num_ignored) =
250
    my ($num_added, $num_updated, $num_items_added, $num_items_replaced, $num_items_errored, $num_ignored) =
250
        BatchCommitRecords($import_batch_id, $framework, 50, $callback);
251
        BatchCommitRecords($import_batch_id, $framework, $overlay_framework, 50, $callback);
251
    $dbh->commit();
252
    $dbh->commit();
252
253
253
    my $results = {
254
    my $results = {
254
- 

Return to bug 15869