|
Lines 51-56
use Koha::Acquisition::Baskets;
Link Here
|
| 51 |
use Koha::Acquisition::Currencies; |
51 |
use Koha::Acquisition::Currencies; |
| 52 |
use Koha::Acquisition::Orders; |
52 |
use Koha::Acquisition::Orders; |
| 53 |
use Koha::Acquisition::Booksellers; |
53 |
use Koha::Acquisition::Booksellers; |
|
|
54 |
use Koha::Import::Records; |
| 54 |
use Koha::Patrons; |
55 |
use Koha::Patrons; |
| 55 |
|
56 |
|
| 56 |
my $input = CGI->new; |
57 |
my $input = CGI->new; |
|
Lines 442-448
sub import_biblios_list {
Link Here
|
| 442 |
my ($template, $import_batch_id) = @_; |
443 |
my ($template, $import_batch_id) = @_; |
| 443 |
my $batch = GetImportBatch($import_batch_id,'staged'); |
444 |
my $batch = GetImportBatch($import_batch_id,'staged'); |
| 444 |
return () unless $batch and $batch->{import_status} =~ /^staged$|^reverted$/; |
445 |
return () unless $batch and $batch->{import_status} =~ /^staged$|^reverted$/; |
| 445 |
my $biblios = GetImportRecordsRange($import_batch_id,'','',$batch->{import_status}); |
446 |
my $import_records = Koha::Import::Records->search({ |
|
|
447 |
import_batch_id => $import_batch_id, |
| 448 |
status => $batch->{import_status} |
| 449 |
}); |
| 446 |
my @list = (); |
450 |
my @list = (); |
| 447 |
my $item_error = 0; |
451 |
my $item_error = 0; |
| 448 |
|
452 |
|
|
Lines 464-493
sub import_biblios_list {
Link Here
|
| 464 |
} |
468 |
} |
| 465 |
|
469 |
|
| 466 |
my $biblio_count = 0; |
470 |
my $biblio_count = 0; |
| 467 |
foreach my $biblio (@$biblios) { |
471 |
while ( my $import_record = $import_records->next ) { |
| 468 |
my $item_id = 1; |
472 |
my $item_id = 1; |
| 469 |
$biblio_count++; |
473 |
$biblio_count++; |
| 470 |
my $citation = $biblio->{'title'}; |
474 |
my $match = GetImportRecordMatches($import_record->import_record_id, 1); |
| 471 |
$citation .= " $biblio->{'author'}" if $biblio->{'author'}; |
|
|
| 472 |
$citation .= " (" if $biblio->{'issn'} or $biblio->{'isbn'}; |
| 473 |
$citation .= $biblio->{'isbn'} if $biblio->{'isbn'}; |
| 474 |
$citation .= ", " if $biblio->{'issn'} and $biblio->{'isbn'}; |
| 475 |
$citation .= $biblio->{'issn'} if $biblio->{'issn'}; |
| 476 |
$citation .= ")" if $biblio->{'issn'} or $biblio->{'isbn'}; |
| 477 |
my $match = GetImportRecordMatches($biblio->{'import_record_id'}, 1); |
| 478 |
my %cellrecord = ( |
475 |
my %cellrecord = ( |
| 479 |
import_record_id => $biblio->{'import_record_id'}, |
476 |
import_record_id => $import_record->import_record_id, |
| 480 |
citation => $citation, |
477 |
import_biblio => $import_record->import_biblio, |
| 481 |
import => 1, |
478 |
import => 1, |
| 482 |
status => $biblio->{'status'}, |
479 |
status => $import_record->status, |
| 483 |
record_sequence => $biblio->{'record_sequence'}, |
480 |
record_sequence => $import_record->record_sequence, |
| 484 |
overlay_status => $biblio->{'overlay_status'}, |
481 |
overlay_status => $import_record->overlay_status, |
| 485 |
match_biblionumber => $#$match > -1 ? $match->[0]->{'biblionumber'} : 0, |
482 |
match_biblionumber => $#$match > -1 ? $match->[0]->{'biblionumber'} : 0, |
| 486 |
match_citation => $#$match > -1 ? $match->[0]->{'title'} || '' . ' ' . $match->[0]->{'author'} || '': '', |
483 |
match_citation => $#$match > -1 ? $match->[0]->{'title'} || '' . ' ' . $match->[0]->{'author'} || '': '', |
| 487 |
match_score => $#$match > -1 ? $match->[0]->{'score'} : 0, |
484 |
match_score => $#$match > -1 ? $match->[0]->{'score'} : 0, |
| 488 |
); |
485 |
); |
| 489 |
my ( $marcblob, $encoding ) = GetImportRecordMarc( $biblio->{'import_record_id'} ); |
486 |
my $marcrecord = $import_record->get_marc_record || die "couldn't translate marc information"; |
| 490 |
my $marcrecord = MARC::Record->new_from_usmarc($marcblob) || die "couldn't translate marc information"; |
|
|
| 491 |
|
487 |
|
| 492 |
my $infos = get_infos_syspref('MarcFieldsToOrder', $marcrecord, ['price', 'quantity', 'budget_code', 'discount', 'sort1', 'sort2','replacementprice']); |
488 |
my $infos = get_infos_syspref('MarcFieldsToOrder', $marcrecord, ['price', 'quantity', 'budget_code', 'discount', 'sort1', 'sort2','replacementprice']); |
| 493 |
my $price = $infos->{price}; |
489 |
my $price = $infos->{price}; |
|
Lines 584-590
sub import_biblios_list {
Link Here
|
| 584 |
my $overlay_action = GetImportBatchOverlayAction($import_batch_id); |
580 |
my $overlay_action = GetImportBatchOverlayAction($import_batch_id); |
| 585 |
my $nomatch_action = GetImportBatchNoMatchAction($import_batch_id); |
581 |
my $nomatch_action = GetImportBatchNoMatchAction($import_batch_id); |
| 586 |
my $item_action = GetImportBatchItemAction($import_batch_id); |
582 |
my $item_action = GetImportBatchItemAction($import_batch_id); |
| 587 |
$template->param(biblio_list => \@list, |
583 |
$template->param(import_biblio_list => \@list, |
| 588 |
num_results => $num_records, |
584 |
num_results => $num_records, |
| 589 |
import_batch_id => $import_batch_id, |
585 |
import_batch_id => $import_batch_id, |
| 590 |
"overlay_action_${overlay_action}" => 1, |
586 |
"overlay_action_${overlay_action}" => 1, |