Lines 30-36
use Encode;
Link Here
|
30 |
use C4::Context; |
30 |
use C4::Context; |
31 |
use C4::Auth qw( get_template_and_user ); |
31 |
use C4::Auth qw( get_template_and_user ); |
32 |
use C4::Output qw( output_html_with_http_headers ); |
32 |
use C4::Output qw( output_html_with_http_headers ); |
33 |
use C4::ImportBatch qw( GetImportRecordMatches SetImportBatchStatus GetImportBatch GetImportBatchRangeDesc GetNumberOfNonZ3950ImportBatches GetImportBatchOverlayAction GetImportBatchNoMatchAction GetImportBatchItemAction ); |
33 |
use C4::ImportBatch qw( SetImportBatchStatus GetImportBatch GetImportBatchRangeDesc GetNumberOfNonZ3950ImportBatches GetImportBatchOverlayAction GetImportBatchNoMatchAction GetImportBatchItemAction ); |
34 |
use C4::Matcher; |
34 |
use C4::Matcher; |
35 |
use C4::Search qw( FindDuplicate ); |
35 |
use C4::Search qw( FindDuplicate ); |
36 |
use C4::Biblio qw( |
36 |
use C4::Biblio qw( |
Lines 160-167
if ($op eq ""){
Link Here
|
160 |
# Check if this import_record_id was selected |
160 |
# Check if this import_record_id was selected |
161 |
next if not grep { $_ eq $import_record->import_record_id } @import_record_id_selected; |
161 |
next if not grep { $_ eq $import_record->import_record_id } @import_record_id_selected; |
162 |
my $marcrecord = $import_record->get_marc_record || die "couldn't translate marc information"; |
162 |
my $marcrecord = $import_record->get_marc_record || die "couldn't translate marc information"; |
163 |
my $match = GetImportRecordMatches( $import_record->import_record_id, 1 ); |
163 |
my $matches = $import_record->get_import_record_matches({ chosen => 1 }); |
164 |
my $biblionumber=$#$match > -1?$match->[0]->{'biblionumber'}:0; |
164 |
my $match = $matches->count ? $matches->next : undef; |
|
|
165 |
my $biblionumber = $match ? $match->candidate_match_id : 0; |
165 |
my $c_quantity = shift( @quantities ) || GetMarcQuantity($marcrecord, C4::Context->preference('marcflavour') ) || 1; |
166 |
my $c_quantity = shift( @quantities ) || GetMarcQuantity($marcrecord, C4::Context->preference('marcflavour') ) || 1; |
166 |
my $c_budget_id = shift( @budgets_id ) || $input->param('all_budget_id') || $budget_id; |
167 |
my $c_budget_id = shift( @budgets_id ) || $input->param('all_budget_id') || $budget_id; |
167 |
my $c_discount = shift ( @discount); |
168 |
my $c_discount = shift ( @discount); |
Lines 478-484
sub import_biblios_list {
Link Here
|
478 |
while ( my $import_record = $import_records->next ) { |
479 |
while ( my $import_record = $import_records->next ) { |
479 |
my $item_id = 1; |
480 |
my $item_id = 1; |
480 |
$biblio_count++; |
481 |
$biblio_count++; |
481 |
my $match = GetImportRecordMatches($import_record->import_record_id, 1); |
482 |
my $matches = $import_record->get_import_record_matches({ chosen => 1 }); |
|
|
483 |
my $match = $matches->count ? $matches->next : undef; |
484 |
my $match_biblio = $match ? Koha::Biblios->find({ biblionumber => $match->candidate_match_id }) : undef; |
482 |
my %cellrecord = ( |
485 |
my %cellrecord = ( |
483 |
import_record_id => $import_record->import_record_id, |
486 |
import_record_id => $import_record->import_record_id, |
484 |
import_biblio => $import_record->import_biblio, |
487 |
import_biblio => $import_record->import_biblio, |
Lines 486-494
sub import_biblios_list {
Link Here
|
486 |
status => $import_record->status, |
489 |
status => $import_record->status, |
487 |
record_sequence => $import_record->record_sequence, |
490 |
record_sequence => $import_record->record_sequence, |
488 |
overlay_status => $import_record->overlay_status, |
491 |
overlay_status => $import_record->overlay_status, |
489 |
match_biblionumber => $#$match > -1 ? $match->[0]->{'biblionumber'} : 0, |
492 |
match_biblionumber => $match ? $match->candidate_match_id : 0, |
490 |
match_citation => $#$match > -1 ? $match->[0]->{'title'} || '' . ' ' . $match->[0]->{'author'} || '': '', |
493 |
match_citation => $match_biblio ? ($match_biblio->title || '') . ' ' .( $match_biblio->author || ''): '', |
491 |
match_score => $#$match > -1 ? $match->[0]->{'score'} : 0, |
494 |
match_score => $match ? $match->score : 0, |
492 |
); |
495 |
); |
493 |
my $marcrecord = $import_record->get_marc_record || die "couldn't translate marc information"; |
496 |
my $marcrecord = $import_record->get_marc_record || die "couldn't translate marc information"; |
494 |
|
497 |
|