BZ4376 Minor change in GetMarcAuthor
authorPaul Poulain <paul.poulain@biblibre.com>
Tue, 2 Aug 2011 14:54:38 +0000 (16:54 +0200)
committerPaul Poulain <paul.poulain@biblibre.com>
Wed, 18 Jan 2012 11:07:12 +0000 (12:07 +0100)
A minor change in the GetMarcAuthors function of C4/Biblio.pm allow differentiate the type of authors in the templates

This change allow doing things like this in the templates:
<TMPL_IF EXPR="tag == 700" && code eq 'a' >
 <strong>Author:</strong>
<!-- TMPL_ELSE -->
 <TMPL_IF EXPR="tag == 710" && code eq 'a' >
  <strong>Corpotation Author:</strong>
<!-- /TMPL_IF -->
<!-- /TMPL_IF -->

(html template syntax, but also applicable to template toolkit)

Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Works as claimed and doesn't break existing functionality.

C4/Biblio.pm

index 9e84ffd..ad559fa 100644 (file)
@@ -1612,7 +1612,8 @@ sub GetMarcAuthors {
                 $separator = C4::Context->preference('authoritysep');
             }
             push @subfields_loop,
-              { code      => $subfieldcode,
+              { tag       => $field->tag(),
+                code      => $subfieldcode,
                 value     => $value,
                 link_loop => \@this_link_loop,
                 separator => $separator