- my $records = GetImportRecordsRange($import_batch_id, $offset, $results_per_page);
- my @list = ();
- foreach my $record (@$records) {
- my $citation = $record->{'title'} || $record->{'authorized_heading'};
- $citation .= " $record->{'author'}" if $record->{'author'};
- $citation .= " (" if $record->{'issn'} or $record->{'isbn'};
- $citation .= $record->{'isbn'} if $record->{'isbn'};
- $citation .= ", " if $record->{'issn'} and $record->{'isbn'};
- $citation .= $record->{'issn'} if $record->{'issn'};
- $citation .= ")" if $record->{'issn'} or $record->{'isbn'};
-
- my $match = GetImportRecordMatches($record->{'import_record_id'}, 1);
- my $match_citation = '';
- 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'});
- } elsif ($match->[0]->{'record_type'} eq 'auth') {
- $match_citation .= $match->[0]->{'authorized_heading'} if defined($match->[0]->{'authorized_heading'});
- }
- }
-
- push @list,
- { import_record_id => $record->{'import_record_id'},
- final_match_id => $record->{'matched_biblionumber'} || $record->{'matched_authid'},
- citation => $citation,
- status => $record->{'status'},
- record_sequence => $record->{'record_sequence'},
- 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_citation => $match_citation,
- match_score => $#$match > -1 ? $match->[0]->{'score'} : 0,
- record_type => $record->{'record_type'},
- };
- }
- my $num_records = $batch->{'num_records'};
- $template->param(record_list => \@list);
- add_page_numbers($template, $offset, $results_per_page, $num_records);
- $template->param(offset => $offset);
- $template->param(range_top => $offset + $results_per_page - 1);
- $template->param(num_results => $num_records);
- $template->param(results_per_page => $results_per_page);