Bug 21747: (follow-up) Intelligent rename of offsets
[koha.git] / C4 / Heading / MARC21.pm
index 964e5fd..fc4d576 100644 (file)
@@ -4,25 +4,24 @@ package C4::Heading::MARC21;
 #
 # This file is part of Koha.
 #
-# Koha is free software; you can redistribute it and/or modify it under the
-# terms of the GNU General Public License as published by the Free Software
-# Foundation; either version 2 of the License, or (at your option) any later
-# version.
+# Koha is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
 #
-# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
-# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
-# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
+# Koha is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
 #
-# You should have received a copy of the GNU General Public License along
-# with Koha; if not, write to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+# You should have received a copy of the GNU General Public License
+# along with Koha; if not, see <http://www.gnu.org/licenses>.
 
 use strict;
 use warnings;
 use MARC::Record;
 use MARC::Field;
 
-our $VERSION = 3.07.00.049;
 
 =head1 NAME
 
@@ -94,6 +93,12 @@ my $bib_heading_fields = {
     '650' => { auth_type => 'TOPIC_TERM', subfields => 'abvxyz', subject => 1 },
     '651' => { auth_type => 'GEOGR_NAME', subfields => 'avxyz',  subject => 1 },
     '655' => { auth_type => 'GENRE/FORM', subfields => 'avxyz',  subject => 1 },
+    '690' => { auth_type => 'TOPIC_TERM', subfields => 'abvxyz', subject => 1 },
+    '691' => { auth_type => 'GEOGR_NAME', subfields => 'avxyz',  subject => 1 },
+    '696' => { auth_type => 'PERSO_NAME', subfields => 'abcdfghjklmnopqrst' },
+    '697' => { auth_type => 'CORPO_NAME', subfields => 'abcdfghklmnoprst' },
+    '698' => { auth_type => 'MEETI_NAME', subfields => 'acdfghjklnpqst' },
+    '699' => { auth_type => 'UNIF_TITLE', subfields => 'adfghklmnoprst' },
     '700' => { auth_type => 'PERSO_NAME', subfields => 'abcdfghjklmnopqrst' },
     '710' => { auth_type => 'CORPO_NAME', subfields => 'abcdfghklmnoprst' },
     '711' => { auth_type => 'MEETI_NAME', subfields => 'acdfghjklnpqst' },
@@ -156,6 +161,21 @@ sub valid_bib_heading_tag {
 
 }
 
+=head2 valid_bib_heading_subfield
+
+=cut
+
+sub valid_bib_heading_subfield {
+    my $self          = shift;
+    my $tag           = shift;
+    my $subfield      = shift;
+
+    if ( exists $bib_heading_fields->{$tag} ) {
+        return 1 if ($bib_heading_fields->{$tag}->{subfields} =~ /$subfield/);
+    }
+    return 0;
+}
+
 =head2 parse_heading
 
 =cut