Bugzilla – Attachment 21503 Details for
Bug 6201
BibTeX export does not incude MARC21 main entry
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
BibTeX export now includes MARC21 main entry
Fixed-bibtex-export-by-including-1xx-fields-when-exp.patch (text/plain), 2.48 KB, created by
Blou
on 2013-09-26 19:01:50 UTC
(
hide
)
Description:
BibTeX export now includes MARC21 main entry
Filename:
MIME Type:
Creator:
Blou
Created:
2013-09-26 19:01:50 UTC
Size:
2.48 KB
patch
obsolete
>From 923b42be57579a7d29c9afd3c214187582d76c81 Mon Sep 17 00:00:00 2001 >From: Blou <philippe.blouin@inlibro.com> >Date: Thu, 26 Sep 2013 14:58:40 -0400 >Subject: [PATCH] Fixed bibtex export by including 1xx fields when exporting > MARC21 records. > >--- > C4/Record.pm | 36 +++++++++++++----------------------- > validation | 1 + > 2 files changed, 14 insertions(+), 23 deletions(-) > create mode 100644 validation > >diff --git a/C4/Record.pm b/C4/Record.pm >index be1912c..bb830b0 100644 >--- a/C4/Record.pm >+++ b/C4/Record.pm >@@ -651,33 +651,23 @@ sub marc2bibtex { > > # Authors > my $author; >- my @texauthors; >- my ( $mintag, $maxtag, $fields_filter ); >- if ( $marcflavour eq "UNIMARC" ) { >- $mintag = "700"; >- $maxtag = "712"; >- $fields_filter = '7..'; >- } >- else { >- $mintag = "700"; >- $maxtag = "720"; >- $fields_filter = '7..'; >- } >- foreach my $field ( $record->field($fields_filter) ) { >- next unless $field->tag() >= $mintag && $field->tag() <= $maxtag; >+ my @texauthors; >+ my @authorFields = ('100','110','111','700','710','711'); >+ @authorFields = ('700','701','702','710','711','721') if ( $marcflavour eq "UNIMARC" ); >+ >+ foreach my $field ( @authorFields ) { > # author formatted surname, firstname > my $texauthor = ''; > if ( $marcflavour eq "UNIMARC" ) { >- $texauthor = join ', ', >- ( $field->subfield('a'), $field->subfield('b') ); >- } >- else { >- $texauthor = $field->subfield('a'); >- } >- push @texauthors, $texauthor if $texauthor; >+ $texauthor = join ', ', >+ ( $record->subfield($field,"a"), $record->subfield($field,"b") ); >+ } else { >+ $texauthor = $record->subfield($field,"a"); >+ } >+ push @texauthors, $texauthor if $texauthor; > } > $author = join ' and ', @texauthors; >- >+ > # Defining the conversion hash according to the marcflavour > my %bh; > if ( $marcflavour eq "UNIMARC" ) { >@@ -726,7 +716,7 @@ sub marc2bibtex { > } > > $tex .= "\@book{"; >- $tex .= join(",\n", $id, map { $bh{$_} ? qq(\t$_ = "$bh{$_}") : () } keys %bh); >+ $tex .= join(",\n", $id, map { $bh{$_} ? qq(\t$_ = {$bh{$_}}) : () } keys %bh); > $tex .= "\n}\n"; > > return $tex; >diff --git a/validation b/validation >new file mode 100644 >index 0000000..1cd909e >--- /dev/null >+++ b/validation >@@ -0,0 +1 @@ >+bonjour >-- >1.7.10.4 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 6201
:
21503
|
21504
|
21511
|
21525
|
21571
|
21604