Lines 422-457
sub _handle_one_result {
Link Here
|
422 |
} |
422 |
} |
423 |
|
423 |
|
424 |
sub _add_rowdata { |
424 |
sub _add_rowdata { |
425 |
my ($rowref, $marcrecord)=@_; |
425 |
my ($row, $record)=@_; |
426 |
if(C4::Context->preference("marcflavour") ne 'UNIMARC') { #MARC21, NORMARC |
426 |
my %fetch= ( |
427 |
$rowref->{isbn}= _isbn_show($marcrecord, '020'); |
427 |
title => 'biblio.title', |
428 |
$rowref->{title}= $marcrecord->subfield('245','a')||''; |
428 |
author => 'biblio.author', |
429 |
$rowref->{author}= $marcrecord->subfield('100','a')||''; |
429 |
isbn =>'biblioitems.isbn', |
430 |
$rowref->{date}= $marcrecord->subfield('260','c')||''; |
430 |
lccn =>'biblioitems.lccn', #LC control number (not call number) |
431 |
$rowref->{edition}= $marcrecord->subfield('250','a')||''; |
431 |
edition =>'biblioitems.editionstatement', |
432 |
$rowref->{lccn}= $marcrecord->subfield('050','a')||''; |
432 |
date => 'biblio.copyrightdate', #MARC21 |
433 |
} |
433 |
date2 => 'biblioitems.publicationyear', #UNIMARC |
434 |
else { #UNIMARC |
434 |
); |
435 |
$rowref->{isbn}= _isbn_show($marcrecord, '010'); |
435 |
foreach my $k (keys %fetch) { |
436 |
$rowref->{title}= $marcrecord->subfield('200','a')||''; |
436 |
my ($t, $f)= split '\.', $fetch{$k}; |
437 |
$rowref->{author}= $marcrecord->subfield('200','f')||''; |
437 |
$row= C4::Biblio::TransformMarcToKohaOneField($t, $f, $record, $row); |
438 |
$rowref->{date}= $marcrecord->subfield('210','d')||''; |
438 |
$row->{$k}= $row->{$f} if $k ne $f; |
439 |
$rowref->{edition}= $marcrecord->subfield('205','a')||''; |
|
|
440 |
$rowref->{lccn}= ''; |
441 |
} |
439 |
} |
442 |
return $rowref; |
440 |
$row->{date}//= $row->{date2}; |
|
|
441 |
$row->{isbn}=_isbn_replace($row->{isbn}); |
442 |
return $row; |
443 |
} |
443 |
} |
444 |
|
444 |
|
445 |
sub _isbn_show { |
445 |
sub _isbn_replace { |
446 |
my ($record, $fieldno)= @_; #both marc21 and unimarc possible |
446 |
my ($isbn)= @_; |
447 |
my $isbn= ''; |
447 |
$isbn =~ s/ |-|\.//g; |
448 |
foreach my $f ( $record->field($fieldno) ) { |
448 |
$isbn =~ s/\|/ \| /g; |
449 |
my $a= $f->subfield('a'); |
449 |
$isbn =~ s/\(/ \(/g; |
450 |
$a =~ s/ |-|\.//g; |
|
|
451 |
$a =~ s/\|/ \| /g; |
452 |
$a =~ s/\(/ \(/g; |
453 |
$isbn= $isbn? ($isbn.' | '. $a): $a; |
454 |
} |
455 |
return $isbn; |
450 |
return $isbn; |
456 |
} |
451 |
} |
457 |
|
452 |
|
458 |
- |
|
|