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

(-)a/C4/Record.pm (-21 / +21 lines)
Lines 326-352 sub marc2endnote { Link Here
326
    if ($f500) {
326
    if ($f500) {
327
        $abstract = $f500->subfield('a');
327
        $abstract = $f500->subfield('a');
328
    }
328
    }
329
	my $fields = {
329
    my $fields = {
330
		DB => C4::Context->preference("LibraryName"),
330
        DB => C4::Context->preference("LibraryName"),
331
		Title => $marc_rec_obj->title(),
331
        Title => $marc_rec_obj->title(),
332
		Author => $marc_rec_obj->author(),
332
        Author => $marc_rec_obj->author(),
333
		Publisher => $f710a,
333
        Publisher => $f710a,
334
		City => $f260a,
334
        City => $f260a,
335
		Year => $marc_rec_obj->publication_date,
335
        Year => $marc_rec_obj->publication_date,
336
		Abstract => $abstract,
336
        Abstract => $abstract,
337
	};
337
    };
338
	my $endnote;
338
    my $endnote;
339
	my $style = new Biblio::EndnoteStyle();
339
    my $style = new Biblio::EndnoteStyle();
340
	my $template;
340
    my $template;
341
	$template.= "DB - DB\n" if C4::Context->preference("LibraryName");
341
    $template.= "DB - DB\n" if C4::Context->preference("LibraryName");
342
	$template.="T1 - Title\n" if $marc_rec_obj->title();
342
    $template.="T1 - Title\n" if $marc_rec_obj->title();
343
	$template.="A1 - Author\n" if $marc_rec_obj->author();
343
    $template.="A1 - Author\n" if $marc_rec_obj->author();
344
	$template.="PB - Publisher\n" if  $f710a;
344
    $template.="PB - Publisher\n" if  $f710a;
345
	$template.="CY - City\n" if $f260a;
345
    $template.="CY - City\n" if $f260a;
346
	$template.="Y1 - Year\n" if $marc_rec_obj->publication_date;
346
    $template.="Y1 - Year\n" if $marc_rec_obj->publication_date;
347
	$template.="AB - Abstract\n" if $abstract;
347
    $template.="AB - Abstract\n" if $abstract;
348
	my ($text, $errmsg) = $style->format($template, $fields);
348
    my ($text, $errmsg) = $style->format($template, $fields);
349
	return ($text);
349
    return ($text);
350
350
351
}
351
}
352
352
(-)a/C4/Ris.pm (-52 / +52 lines)
Lines 817-852 sub get_keywords { Link Here
817
817
818
    ## loop over all 6XX fields
818
    ## loop over all 6XX fields
819
    foreach my $kwfield (@keywords) {
819
    foreach my $kwfield (@keywords) {
820
	if ($kwfield != undef) {
820
        if ($kwfield != undef) {
821
	    ## authornames get special treatment
821
            ## authornames get special treatment
822
	    if ($fieldname eq "600") {
822
            if ($fieldname eq "600") {
823
		my $val = normalize_author($kwfield->subfield('a'), $kwfield->subfield('b'), $kwfield->subfield('c'), $kwfield->indicator('1'));
823
                my $val = normalize_author($kwfield->subfield('a'), $kwfield->subfield('b'), $kwfield->subfield('c'), $kwfield->indicator('1'));
824
        push @kw, $val;
824
                push @kw, $val;
825
		print "<marc>Field $kwfield subfield a:", $kwfield->subfield('a'), "\r\n<marc>Field $kwfield subfield b:", $kwfield->subfield('b'), "\r\n<marc>Field $kwfield subfield c:", $kwfield->subfield('c'), "\r\n" if $marcprint;
825
                print "<marc>Field $kwfield subfield a:", $kwfield->subfield('a'), "\r\n<marc>Field $kwfield subfield b:", $kwfield->subfield('b'), "\r\n<marc>Field $kwfield subfield c:", $kwfield->subfield('c'), "\r\n" if $marcprint;
826
	    }
826
            }
827
	    else {
827
            else {
828
		## retrieve all available subfields
828
                ## retrieve all available subfields
829
		my @kwsubfields = $kwfield->subfields();
829
                my @kwsubfields = $kwfield->subfields();
830
		
830
831
		## loop over all available subfield tuples
831
                ## loop over all available subfield tuples
832
        foreach my $kwtuple (@kwsubfields) {
832
                foreach my $kwtuple (@kwsubfields) {
833
		    ## loop over all subfields to check
833
                    ## loop over all subfields to check
834
            foreach my $subfield (@subfields) {
834
                    foreach my $subfield (@subfields) {
835
			## [0] contains subfield code
835
                        ## [0] contains subfield code
836
			if (@$kwtuple[0] eq $subfield) {
836
                        if (@$kwtuple[0] eq $subfield) {
837
			    ## [1] contains value, remove trailing separators
837
                            ## [1] contains value, remove trailing separators
838
			    @$kwtuple[1] =~ s% *[,;.:/]*$%%;
838
                            @$kwtuple[1] =~ s% *[,;.:/]*$%%;
839
			    if (length(@$kwtuple[1]) > 0) {
839
                            if (length(@$kwtuple[1]) > 0) {
840
                push @kw, @$kwtuple[1];
840
                                push @kw, @$kwtuple[1];
841
				print "<marc>Field $fieldname subfield $subfield:", @$kwtuple[1], "\r\n" if $marcprint;
841
                                print "<marc>Field $fieldname subfield $subfield:", @$kwtuple[1], "\r\n" if $marcprint;
842
			    }
842
                            }
843
			    ## we can leave the subfields loop here
843
                            ## we can leave the subfields loop here
844
			    last;
844
                            last;
845
			}
845
                        }
846
		    }
846
                    }
847
		}
847
                }
848
	    }
848
            }
849
	}
849
        }
850
    }
850
    }
851
    return @kw;
851
    return @kw;
852
}
852
}
Lines 940-967 sub pool_subx { Link Here
940
940
941
    ## loop over all notefields
941
    ## loop over all notefields
942
    foreach my $notefield (@notefields) {
942
    foreach my $notefield (@notefields) {
943
	if (defined $notefield) {
943
        if (defined $notefield) {
944
	    ## retrieve all available subfield tuples
944
            ## retrieve all available subfield tuples
945
	    my @notesubfields = $notefield->subfields();
945
            my @notesubfields = $notefield->subfields();
946
946
947
	    ## loop over all subfield tuples
947
            ## loop over all subfield tuples
948
        foreach my $notetuple (@notesubfields) {
948
            foreach my $notetuple (@notesubfields) {
949
		## loop over all subfields to check
949
                ## loop over all subfields to check
950
        foreach my $subfield (@subfields) {
950
                foreach my $subfield (@subfields) {
951
		    ## [0] contains subfield code
951
                    ## [0] contains subfield code
952
		    if (@$notetuple[0] eq $subfield) {
952
                    if (@$notetuple[0] eq $subfield) {
953
			## [1] contains value, remove trailing separators
953
                        ## [1] contains value, remove trailing separators
954
			print "<marc>field $fieldname subfield $subfield: ", @$notetuple[1], "\r\n" if $marcprint;
954
                        print "<marc>field $fieldname subfield $subfield: ", @$notetuple[1], "\r\n" if $marcprint;
955
			@$notetuple[1] =~ s% *[,;.:/]*$%%;
955
                        @$notetuple[1] =~ s% *[,;.:/]*$%%;
956
			if (length(@$notetuple[1]) > 0) {
956
                        if (length(@$notetuple[1]) > 0) {
957
			    ## add to list
957
                            ## add to list
958
			    push @{$aref}, @$notetuple[1];
958
                            push @{$aref}, @$notetuple[1];
959
			}
959
                        }
960
			last;
960
                        last;
961
		    }
961
                    }
962
		}
962
                }
963
	    }
963
            }
964
	}
964
        }
965
    }
965
    }
966
}
966
}
967
967
(-)a/t/db_dependent/Record.t (-6 / +5 lines)
Lines 113-123 is ($bibtex, $test5xml, "testing bibtex"); Link Here
113
C4::Context->set_preference( "BibtexExportAdditionalFields", "'\@': 260\$b\ntest: 260\$b" );
113
C4::Context->set_preference( "BibtexExportAdditionalFields", "'\@': 260\$b\ntest: 260\$b" );
114
$bibtex = marc2bibtex( $marc, 'testID' );
114
$bibtex = marc2bibtex( $marc, 'testID' );
115
my $test6xml = qq(\@Scholastic{testID,
115
my $test6xml = qq(\@Scholastic{testID,
116
	author = {Rowling, J.K.},
116
\tauthor = {Rowling, J.K.},
117
	title = {Harry potter},
117
\ttitle = {Harry potter},
118
	publisher = {Scholastic},
118
\tpublisher = {Scholastic},
119
	year = {2001},
119
\tyear = {2001},
120
	test = {Scholastic}
120
\ttest = {Scholastic}
121
}
121
}
122
);
122
);
123
is( $bibtex, $test6xml, "testing bibtex" );
123
is( $bibtex, $test6xml, "testing bibtex" );
124
- 

Return to bug 12357