X-Git-Url: http://koha-dev.rot13.org:8081/gitweb/?a=blobdiff_plain;f=tools%2Fmanage-marc-import.pl;h=c0584c93695a9e085bed4ba58a0657351d68e832;hb=acdf8df3709c0c9c3e5cf0dae463b39071dfe6d0;hp=6f78d50b961cbeaa581ca28aa967b10912e85deb;hpb=7ad5e203da0a7aa5436366b0735ea24dc0ac2d41;p=koha_fer diff --git a/tools/manage-marc-import.pl b/tools/manage-marc-import.pl index 6f78d50b96..c0584c9369 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"; @@ -60,7 +59,7 @@ my ($template, $loggedinuser, $cookie) }); my %cookies = parse CGI::Cookie($cookie); -my $sessionID = $cookies{'CGISESSID'}->value; +our $sessionID = $cookies{'CGISESSID'}->value; our $dbh = C4::Context->dbh; # Frameworks selection loop @@ -365,12 +364,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 +387,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'},