Bug 4376 - A minor change in the “GetMarcAuthors” function of C4/Biblio.pm would allow differentiate the type of authors in the templates
Summary: A minor change in the “GetMarcAuthors” function of C4/Biblio.pm would allow ...
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Staff interface (show other bugs)
Version: 3.8
Hardware: All All
: P4 enhancement
Assignee: Paul Poulain
QA Contact: Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-04-07 04:39 UTC by Chris Cormack
Modified: 2013-12-05 20:04 UTC (History)
3 users (show)

See Also:
Change sponsored?: Sponsored
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
proposed patch (1.35 KB, patch)
2011-08-02 14:55 UTC, Paul Poulain
Details | Diff | Splinter Review
BZ4376 Minor change in GetMarcAuthor (1.51 KB, patch)
2012-01-09 19:35 UTC, Jared Camins-Esakov
Details | Diff | Splinter Review
BZ4376 Minor change in GetMarcAuthor (1.38 KB, patch)
2012-01-18 11:07 UTC, Paul Poulain
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Cormack 2010-05-21 01:26:26 UTC


---- Reported by toni.rosa@gmail.com 2010-04-07 16:39:50 ----

A change in this line (1472) would suffice...
Current Line:
push @subfields_loop, {value => $value, link_loop => \@this_link_loop, separator => $separator} unless ($authors_subfield->[0] eq '9' );

New proposed line:
push @subfields_loop, {tag=> $field->tag(),code => $subfieldcode, value => $value, link_loop => \@this_link_loop, separator => $separator} unless ($authors_subfield->[0] eq '9' ); 

This change would 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 -->



---- Additional Comments From paul.poulain@biblibre.com 2010-04-07 16:54:30 ----

pls note that for UNIMARC ppl, such a behaviour is correct too.
70x is "physical author" and 71x is "corporation author"

( note that I don't know what is a "corpotation author" :D )



--- Bug imported by chris@bigballofwax.co.nz 2010-05-21 01:26 UTC  ---

This bug was previously known as _bug_ 4376 at http://bugs.koha.org/cgi-bin/bugzilla3/show_bug.cgi?id=4376

Actual time not defined. Setting to 0.0
The original reporter of this bug does not have
   an account here. Reassigning to the person who moved
   it here: chris@bigballofwax.co.nz.
   Previous reporter was toni.rosa@gmail.com.
Setting qa contact to the default for this product.
   This bug either had no qa contact or an invalid one.

Comment 1 Paul Poulain 2011-08-02 14:55:43 UTC Comment hidden (obsolete)
Comment 2 Owen Leonard 2011-08-02 16:39:37 UTC
The change seems like a good idea, but are there instances where we need to make use of this? XSLT gives us an alternate tool for it in most cases. Paul's comment suggests that to make this work we have to create new sections in the template for each MARC flavor.
Comment 3 Paul Poulain 2011-08-03 07:29:11 UTC
Owen:
I agree that with XSLT this feature will be less and less used, and will probably be deprecated soon. In the meantime, a library that want to have local templates can have a good use of this feature.
So I propose to add it for now, and when XSLT is used everywhere we will completly remove the GetMarcAuthor anyway (and GetMarcSubject, and many other things in Biblio.pm)
Comment 4 Paul Poulain 2011-10-24 11:38:22 UTC
Updating Version : This ENH will be for Koha 3.8
Comment 5 Paul Poulain 2011-10-25 15:05:59 UTC
Bug versionned for master. entries will be made against rel_3_8 once the patch has been applied (see thread about that on koha-devel yesterday)
Comment 6 Jared Camins-Esakov 2012-01-09 19:35:39 UTC Comment hidden (obsolete)
Comment 7 Paul Poulain 2012-01-16 17:24:16 UTC
QA comment: trivial change
Comment 8 Paul Poulain 2012-01-18 11:07:55 UTC
Created attachment 7214 [details] [review]
BZ4376 Minor change in GetMarcAuthor

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.
Comment 9 Paul Poulain 2012-01-18 11:08:28 UTC
Comment on attachment 7097 [details] [review]
BZ4376 Minor change in GetMarcAuthor

obsoleted by my patch, there is an encoding problem with this one
Comment 10 Jared Camins-Esakov 2012-12-31 00:32:14 UTC
There have been no further reports of problems so I am marking this bug resolved.