|
Lines 352-406
sub import_records_list {
Link Here
|
| 352 |
my ($template, $import_batch_id, $offset, $results_per_page) = @_; |
352 |
my ($template, $import_batch_id, $offset, $results_per_page) = @_; |
| 353 |
|
353 |
|
| 354 |
my $batch = GetImportBatch($import_batch_id); |
354 |
my $batch = GetImportBatch($import_batch_id); |
| 355 |
my $records = GetImportRecordsRange($import_batch_id, $offset, $results_per_page); |
355 |
# my $records = GetImportRecordsRange($import_batch_id); |
| 356 |
my @list = (); |
356 |
# my @list = (); |
| 357 |
foreach my $record (@$records) { |
357 |
# foreach my $record (@$records) { |
| 358 |
my $citation = $record->{'title'} || $record->{'authorized_heading'}; |
358 |
# my $citation = $record->{'title'} || $record->{'authorized_heading'}; |
| 359 |
$citation .= " $record->{'author'}" if $record->{'author'}; |
359 |
# $citation .= " $record->{'author'}" if $record->{'author'}; |
| 360 |
$citation .= " (" if $record->{'issn'} or $record->{'isbn'}; |
360 |
# $citation .= " (" if $record->{'issn'} or $record->{'isbn'}; |
| 361 |
$citation .= $record->{'isbn'} if $record->{'isbn'}; |
361 |
# $citation .= $record->{'isbn'} if $record->{'isbn'}; |
| 362 |
$citation .= ", " if $record->{'issn'} and $record->{'isbn'}; |
362 |
# $citation .= ", " if $record->{'issn'} and $record->{'isbn'}; |
| 363 |
$citation .= $record->{'issn'} if $record->{'issn'}; |
363 |
# $citation .= $record->{'issn'} if $record->{'issn'}; |
| 364 |
$citation .= ")" if $record->{'issn'} or $record->{'isbn'}; |
364 |
# $citation .= ")" if $record->{'issn'} or $record->{'isbn'}; |
| 365 |
|
365 |
# |
| 366 |
my $match = GetImportRecordMatches($record->{'import_record_id'}, 1); |
366 |
# my $match = GetImportRecordMatches($record->{'import_record_id'}, 1); |
| 367 |
my $match_citation = ''; |
367 |
# my $match_citation = ''; |
| 368 |
my $match_id; |
368 |
# my $match_id; |
| 369 |
if ($#$match > -1) { |
369 |
# if ($#$match > -1) { |
| 370 |
if ($match->[0]->{'record_type'} eq 'biblio') { |
370 |
# if ($match->[0]->{'record_type'} eq 'biblio') { |
| 371 |
$match_citation .= $match->[0]->{'title'} if defined($match->[0]->{'title'}); |
371 |
# $match_citation .= $match->[0]->{'title'} if defined($match->[0]->{'title'}); |
| 372 |
$match_citation .= ' ' . $match->[0]->{'author'} if defined($match->[0]->{'author'}); |
372 |
# $match_citation .= ' ' . $match->[0]->{'author'} if defined($match->[0]->{'author'}); |
| 373 |
$match_id = $match->[0]->{'biblionumber'}; |
373 |
# $match_id = $match->[0]->{'biblionumber'}; |
| 374 |
} elsif ($match->[0]->{'record_type'} eq 'auth') { |
374 |
# } elsif ($match->[0]->{'record_type'} eq 'auth') { |
| 375 |
if (defined($match->[0]->{'authorized_heading'})) { |
375 |
# if (defined($match->[0]->{'authorized_heading'})) { |
| 376 |
$match_citation .= $match->[0]->{'authorized_heading'}; |
376 |
# $match_citation .= $match->[0]->{'authorized_heading'}; |
| 377 |
$match_id = $match->[0]->{'candidate_match_id'}; |
377 |
# $match_id = $match->[0]->{'candidate_match_id'}; |
| 378 |
} |
378 |
# } |
| 379 |
} |
379 |
# } |
| 380 |
} |
380 |
# } |
| 381 |
|
381 |
# |
| 382 |
push @list, |
382 |
# push @list, |
| 383 |
{ import_record_id => $record->{'import_record_id'}, |
383 |
# { import_record_id => $record->{'import_record_id'}, |
| 384 |
final_match_id => $record->{'matched_biblionumber'} || $record->{'matched_authid'}, |
384 |
# final_match_id => $record->{'matched_biblionumber'} || $record->{'matched_authid'}, |
| 385 |
citation => $citation, |
385 |
# citation => $citation, |
| 386 |
status => $record->{'status'}, |
386 |
# status => $record->{'status'}, |
| 387 |
record_sequence => $record->{'record_sequence'}, |
387 |
# record_sequence => $record->{'record_sequence'}, |
| 388 |
overlay_status => $record->{'overlay_status'}, |
388 |
# overlay_status => $record->{'overlay_status'}, |
| 389 |
# Sorry about the match_id being from the "biblionumber" field; |
389 |
# # Sorry about the match_id being from the "biblionumber" field; |
| 390 |
# as it turns out, any match id will go in biblionumber |
390 |
# # as it turns out, any match id will go in biblionumber |
| 391 |
match_id => $match_id, |
391 |
# match_id => $match_id, |
| 392 |
match_citation => $match_citation, |
392 |
# match_citation => $match_citation, |
| 393 |
match_score => $#$match > -1 ? $match->[0]->{'score'} : 0, |
393 |
# match_score => $#$match > -1 ? $match->[0]->{'score'} : 0, |
| 394 |
record_type => $record->{'record_type'}, |
394 |
# record_type => $record->{'record_type'}, |
| 395 |
}; |
395 |
# }; |
| 396 |
} |
396 |
# } |
| 397 |
my $num_records = $batch->{'num_records'}; |
397 |
# my $num_records = $batch->{'num_records'}; |
| 398 |
$template->param(record_list => \@list); |
398 |
# $template->param(record_list => \@list); |
| 399 |
add_page_numbers($template, $offset, $results_per_page, $num_records); |
399 |
# add_page_numbers($template, $offset, $results_per_page, $num_records); |
| 400 |
$template->param(offset => $offset); |
400 |
# $template->param(offset => $offset); |
| 401 |
$template->param(range_top => $offset + $results_per_page - 1); |
401 |
# $template->param(range_top => $offset + $results_per_page - 1); |
| 402 |
$template->param(num_results => $num_records); |
402 |
# $template->param(num_results => $num_records); |
| 403 |
$template->param(results_per_page => $results_per_page); |
403 |
# $template->param(results_per_page => $results_per_page); |
| 404 |
$template->param(import_batch_id => $import_batch_id); |
404 |
$template->param(import_batch_id => $import_batch_id); |
| 405 |
my $overlay_action = GetImportBatchOverlayAction($import_batch_id); |
405 |
my $overlay_action = GetImportBatchOverlayAction($import_batch_id); |
| 406 |
$template->param("overlay_action_${overlay_action}" => 1); |
406 |
$template->param("overlay_action_${overlay_action}" => 1); |
| 407 |
- |
|
|