View | Details | Raw Unified | Return to bug 9274
Collapse All | Expand All

(-)a/C4/Record.pm (-6 / +27 lines)
Lines 647-664 C<$id> - an id for the BibTex record (might be the biblionumber) Link Here
647
sub marc2bibtex {
647
sub marc2bibtex {
648
    my ($record, $id) = @_;
648
    my ($record, $id) = @_;
649
    my $tex;
649
    my $tex;
650
    my $marcflavour = C4::Context->preference("marcflavour");
650
651
651
    # Authors
652
    # Authors
652
    my $marcauthors = GetMarcAuthors($record,C4::Context->preference("marcflavour"));
653
    my $author;
653
    my $author;
654
    for my $authors ( map { map { @$_ } values %$_  } @$marcauthors  ) {  
654
    my @texauthors;
655
	$author .= " and " if ($author && $$authors{value});
655
    my ( $mintag, $maxtag, $fields_filter );
656
	$author .= $$authors{value} if ($$authors{value}); 
656
    if ( $marcflavour eq "UNIMARC" ) {
657
        $mintag        = "700";
658
        $maxtag        = "712";
659
        $fields_filter = '7..';
657
    }
660
    }
661
    else {
662
        $mintag        = "700";
663
        $maxtag        = "720";
664
        $fields_filter = '7..';
665
    }
666
    foreach my $field ( $record->field($fields_filter) ) {
667
        next unless $field->tag() >= $mintag && $field->tag() <= $maxtag;
668
        # author formatted surname, firstname
669
        my $texauthor = '';
670
        if ( $marcflavour eq "UNIMARC" ) {
671
            $texauthor = join ', ',
672
              ( $field->subfield('a'), $field->subfield('b') );
673
        }
674
        else {
675
            $texauthor = $field->subfield('a');
676
        }
677
        push @texauthors, $texauthor if $texauthor;
678
    }
679
    $author = join ' and ', @texauthors;
658
680
659
    # Defining the conversion hash according to the marcflavour
681
    # Defining the conversion hash according to the marcflavour
660
    my %bh;
682
    my %bh;
661
    if (C4::Context->preference("marcflavour") eq "UNIMARC") {
683
    if ( $marcflavour eq "UNIMARC" ) {
662
	
684
	
663
	# FIXME, TODO : handle repeatable fields
685
	# FIXME, TODO : handle repeatable fields
664
	# TODO : handle more types of documents
686
	# TODO : handle more types of documents
665
- 

Return to bug 9274