X-Git-Url: http://koha-dev.rot13.org:8081/gitweb/?a=blobdiff_plain;f=tools%2Fmanage-marc-import.pl;h=f1a6c834289b1cf240e58174e777c77241b55f15;hb=2249ee1216ed004e61a34bc821d216f3471ef87b;hp=32d3645ab55d62f128e1acdd71ce9f434cb96cea;hpb=3e131101911fda60580b1dd757d078c172f19c3b;p=koha_fer diff --git a/tools/manage-marc-import.pl b/tools/manage-marc-import.pl index 32d3645ab5..f1a6c83428 100755 --- a/tools/manage-marc-import.pl +++ b/tools/manage-marc-import.pl @@ -36,7 +36,6 @@ use C4::ImportBatch; use C4::Matcher; use C4::BackgroundJob; use C4::Labels::Batch; -use C4::Branch qw(get_branch_code_from_name); my $script_name = "/cgi-bin/koha/tools/manage-marc-import.pl"; @@ -241,7 +240,7 @@ sub commit_batch { $job = put_in_background($import_batch_id); $callback = progress_callback($job, $dbh); } - my ($num_added, $num_updated, $num_items_added, $num_items_errored, $num_ignored) = + my ($num_added, $num_updated, $num_items_added, $num_items_replaced, $num_items_errored, $num_ignored) = BatchCommitRecords($import_batch_id, $framework, 50, $callback); $dbh->commit(); @@ -250,6 +249,7 @@ sub commit_batch { num_added => $num_added, num_updated => $num_updated, num_items_added => $num_items_added, + num_items_replaced => $num_items_replaced, num_items_errored => $num_items_errored, num_ignored => $num_ignored }; @@ -365,12 +365,17 @@ sub import_records_list { my $match = GetImportRecordMatches($record->{'import_record_id'}, 1); my $match_citation = ''; + my $match_id; if ($#$match > -1) { if ($match->[0]->{'record_type'} eq 'biblio') { $match_citation .= $match->[0]->{'title'} if defined($match->[0]->{'title'}); $match_citation .= ' ' . $match->[0]->{'author'} if defined($match->[0]->{'author'}); + $match_id = $match->[0]->{'biblionumber'}; } elsif ($match->[0]->{'record_type'} eq 'auth') { - $match_citation .= $match->[0]->{'authorized_heading'} if defined($match->[0]->{'authorized_heading'}); + if (defined($match->[0]->{'authorized_heading'})) { + $match_citation .= $match->[0]->{'authorized_heading'}; + $match_id = $match->[0]->{'candidate_match_id'}; + } } } @@ -383,7 +388,7 @@ sub import_records_list { overlay_status => $record->{'overlay_status'}, # Sorry about the match_id being from the "biblionumber" field; # as it turns out, any match id will go in biblionumber - match_id => $#$match > -1 ? $match->[0]->{'biblionumber'} : 0, + match_id => $match_id, match_citation => $match_citation, match_score => $#$match > -1 ? $match->[0]->{'score'} : 0, record_type => $record->{'record_type'},