Bug 32279: Add GetAuthorizedHeading method export C4::AuthoritiesMarc
[srvgit] / C4 / ImportBatch.pm
index 5f276ac..f9e248b 100644 (file)
@@ -32,7 +32,7 @@ use C4::Biblio qw(
 );
 use C4::Items qw( AddItemFromMarc ModItemFromMarc );
 use C4::Charset qw( MarcToUTF8Record SetUTF8Flag StripNonXmlChars );
-use C4::AuthoritiesMarc qw( AddAuthority GuessAuthTypeCode GetAuthorityXML ModAuthority DelAuthority );
+use C4::AuthoritiesMarc qw( AddAuthority GuessAuthTypeCode GetAuthorityXML ModAuthority DelAuthority GetAuthorizedHeading );
 use C4::MarcModificationTemplates qw( ModifyRecordWithTemplate );
 use Koha::Items;
 use Koha::SearchEngine;
@@ -1508,7 +1508,7 @@ sub GetImportRecordMatches {
     $sth->execute();
     while (my $row = $sth->fetchrow_hashref) {
         if ($row->{'record_type'} eq 'auth') {
-            $row->{'authorized_heading'} = C4::AuthoritiesMarc::GetAuthorizedHeading( { authid => $row->{'candidate_match_id'} } );
+            $row->{'authorized_heading'} = GetAuthorizedHeading( { authid => $row->{'candidate_match_id'} } );
         }
         next if ($row->{'record_type'} eq 'biblio' && not $row->{'biblionumber'});
         push @$results, $row;
@@ -1675,7 +1675,7 @@ sub _add_auth_fields {
     if ($marc_record->field('001')) {
         $controlnumber = $marc_record->field('001')->data();
     }
-    my $authorized_heading = C4::AuthoritiesMarc::GetAuthorizedHeading({ record => $marc_record });
+    my $authorized_heading = GetAuthorizedHeading({ record => $marc_record });
     my $dbh = C4::Context->dbh;
     my $sth = $dbh->prepare("INSERT INTO import_auths (import_record_id, control_number, authorized_heading) VALUES (?, ?, ?)");
     $sth->execute($import_record_id, $controlnumber, $authorized_heading);