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 157-164
if ($op eq ""){
Link Here
|
157 |
# Check if this import_record_id was selected |
157 |
# Check if this import_record_id was selected |
158 |
next if not grep { $_ eq $import_record->import_record_id } @import_record_id_selected; |
158 |
next if not grep { $_ eq $import_record->import_record_id } @import_record_id_selected; |
159 |
my $marcrecord = $import_record->get_marc_record || die "couldn't translate marc information"; |
159 |
my $marcrecord = $import_record->get_marc_record || die "couldn't translate marc information"; |
160 |
my $match = GetImportRecordMatches( $import_record->import_record_id, 1 ); |
160 |
my $matches = $import_record->get_import_record_matches({ chosen => 1 }); |
161 |
my $biblionumber=$#$match > -1?$match->[0]->{'biblionumber'}:0; |
161 |
my $match = $matches->count ? $matches->next : undef; |
|
|
162 |
my $biblionumber = $match ? $match->candidate_match_id : 0; |
162 |
my $c_quantity = shift( @quantities ) || GetMarcQuantity($marcrecord, C4::Context->preference('marcflavour') ) || 1; |
163 |
my $c_quantity = shift( @quantities ) || GetMarcQuantity($marcrecord, C4::Context->preference('marcflavour') ) || 1; |
163 |
my $c_budget_id = shift( @budgets_id ) || $input->param('all_budget_id') || $budget_id; |
164 |
my $c_budget_id = shift( @budgets_id ) || $input->param('all_budget_id') || $budget_id; |
164 |
my $c_discount = shift ( @discount); |
165 |
my $c_discount = shift ( @discount); |
Lines 472-478
sub import_biblios_list {
Link Here
|
472 |
while ( my $import_record = $import_records->next ) { |
473 |
while ( my $import_record = $import_records->next ) { |
473 |
my $item_id = 1; |
474 |
my $item_id = 1; |
474 |
$biblio_count++; |
475 |
$biblio_count++; |
475 |
my $match = GetImportRecordMatches($import_record->import_record_id, 1); |
476 |
my $matches = $import_record->get_import_record_matches({ chosen => 1 }); |
|
|
477 |
my $match = $matches->count ? $matches->next : undef; |
478 |
my $match_biblio = $match ? Koha::Biblios->find({ biblionumber => $match->candidate_match_id }) : undef; |
476 |
my %cellrecord = ( |
479 |
my %cellrecord = ( |
477 |
import_record_id => $import_record->import_record_id, |
480 |
import_record_id => $import_record->import_record_id, |
478 |
import_biblio => $import_record->import_biblio, |
481 |
import_biblio => $import_record->import_biblio, |
Lines 480-488
sub import_biblios_list {
Link Here
|
480 |
status => $import_record->status, |
483 |
status => $import_record->status, |
481 |
record_sequence => $import_record->record_sequence, |
484 |
record_sequence => $import_record->record_sequence, |
482 |
overlay_status => $import_record->overlay_status, |
485 |
overlay_status => $import_record->overlay_status, |
483 |
match_biblionumber => $#$match > -1 ? $match->[0]->{'biblionumber'} : 0, |
486 |
match_biblionumber => $match ? $match->candidate_match_id : 0, |
484 |
match_citation => $#$match > -1 ? $match->[0]->{'title'} || '' . ' ' . $match->[0]->{'author'} || '': '', |
487 |
match_citation => $match_biblio ? ($match_biblio->title || '') . ' ' .( $match_biblio->author || ''): '', |
485 |
match_score => $#$match > -1 ? $match->[0]->{'score'} : 0, |
488 |
match_score => $match ? $match->score : 0, |
486 |
); |
489 |
); |
487 |
my $marcrecord = $import_record->get_marc_record || die "couldn't translate marc information"; |
490 |
my $marcrecord = $import_record->get_marc_record || die "couldn't translate marc information"; |
488 |
|
491 |
|