Bugzilla – Attachment 70950 Details for
Bug 14769
Authorities merge: Set correct indicators in biblio field
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 14769: Add Koha::Authority::controlled_biblio_indicators
Bug-14769-Add-KohaAuthoritycontrolledbiblioindicat.patch (text/plain), 2.46 KB, created by
Marcel de Rooy
on 2018-01-26 11:17:34 UTC
(
hide
)
Description:
Bug 14769: Add Koha::Authority::controlled_biblio_indicators
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2018-01-26 11:17:34 UTC
Size:
2.46 KB
patch
obsolete
>From 0fd441c6507ba3fe85c926314da5c7af861ed4a5 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Fri, 26 Jan 2018 10:17:33 +0100 >Subject: [PATCH] Bug 14769: Add Koha::Authority::controlled_biblio_indicators >Content-Type: text/plain; charset=utf-8 > >--- > Koha/Authority.pm | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 50 insertions(+) > >diff --git a/Koha/Authority.pm b/Koha/Authority.pm >index ac2b25c..8c0211a 100644 >--- a/Koha/Authority.pm >+++ b/Koha/Authority.pm >@@ -20,6 +20,8 @@ package Koha::Authority; > use Modern::Perl; > > use base qw(Koha::Object); >+ >+use Koha::Authority::BiblioIndicators; > use Koha::SearchEngine::Search; > > =head1 NAME >@@ -59,6 +61,54 @@ sub linked_biblionumbers { > return Koha::Authorities->linked_biblionumbers( $params ); > } > >+=head3 controlled_biblio_indicators >+ >+ Some authority types control the indicators of some corresponding >+ biblio fields (especially in MARC21). >+ For example, if you have a PERSO_NAME authority (report tag 100), the >+ first indicator of biblio field 600 directly comes from the authority, >+ and the second indicator depends on thesaurus settings in the authority >+ record. Use this method to obtain such controlled values. In this example >+ you should pass 600 in the biblio_tag parameter. >+ >+ my $result = $self->controlled_biblio_indicators({ >+ record => $auth_marc, biblio_tag => $bib_tag >+ }); >+ my $ind1 = $result->{ind1}; >+ my $ind2 = $result->{ind2}; >+ >+ If an indicator is not controlled, the result hash does not contain a key >+ for its value. >+ >+ Note: The record parameter is a temporary bypass in order to prevent >+ needless conversion of $self->marcxml. >+ >+=cut >+ >+sub controlled_biblio_indicators { >+ my ( $self, $params ) = @_; >+ my $tag = $params->{biblio_tag} // q{}; >+ my $record = $params->{record}; >+ >+ my $flavour = C4::Context->preference('marcflavour') eq 'UNIMARC' >+ ? 'UNIMARCAUTH' >+ : 'MARC21'; >+ if( !$record ) { >+ $record = MARC::Record->new_from_xml( >+ $self->marcxml, 'UTF-8', $flavour ); >+ } >+ >+ my $authtype = Koha::Authority::Types->find( $self->authtypecode ); >+ return {} if !$authtype; >+ >+ return Koha::Authority::BiblioIndicators->new->get({ >+ auth_record => $record, >+ report_tag => $authtype->auth_tag_to_report, >+ biblio_tag => $tag, >+ flavour => $flavour, >+ }); >+} >+ > =head2 Class Methods > > =head3 type >-- >2.1.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 14769
:
42197
|
69343
|
70948
|
70949
|
70950
|
70951
|
71338
|
71339
|
71340
|
71341
|
71342
|
71343
|
71351
|
71352
|
71353
|
71354
|
71355
|
71366
|
71374
|
71375
|
71376
|
71377
|
71378
|
71379
|
71380
|
71381
|
72398
|
72399
|
72400
|
72401
|
72402
|
72403
|
72404
|
73389
|
73773
|
73774
|
73775
|
73776
|
73777
|
73778
|
73779
|
74052