From 8340c478fac12897e7a53f5701fd01747f7b5a61 Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Fri, 4 Jan 2008 16:59:38 -0600 Subject: [PATCH] start of big MARC21 authorities work * Defined local field 942$a to store the authority type for MARC21 instead of 152$b * Added 942$b to MARC21 authority framework. * Added auth_header.authid and auth_header.authtypecode to appropriate subfields in MARC21 authority framework. * Started work on two new modules: C4::AuthoritiesMarc::MARC21 C4::AuthoritiesMarc::UNIMARC These modules will be used to extract MARC-format-specific behavior out of C4::AuthoritiesMarc * Updated Zebra config for MARC21 to use only the 942$a for the authority type. * For MARC21, added logic to move 152$b to 942$a for existing authority records. Specifically, AddAuthority now does this move when a record is saved, while GetAuthority and GetAuthorityXML do this when extracting a record for other use. This logic is temporary, and can hopefully be removed later, once use of 152$b in MARC21 authorities is confirmed to be absent for Koha users. I will also create a batch job to do this update in one fell swoop. Signed-off-by: Joshua Ferraro --- C4/AuthoritiesMarc.pm | 84 ++++++++++++++++--- .../marc_defs/marc21/authorities/record.abs | 3 +- .../mandatory/authorities_normal_marc21.sql | 72 ++++++++++------ 3 files changed, 120 insertions(+), 39 deletions(-) diff --git a/C4/AuthoritiesMarc.pm b/C4/AuthoritiesMarc.pm index 02b801c58e..5abc39c802 100644 --- a/C4/AuthoritiesMarc.pm +++ b/C4/AuthoritiesMarc.pm @@ -23,6 +23,8 @@ use C4::Koha; use MARC::Record; use C4::Biblio; use C4::Search; +use C4::AuthoritiesMarc::MARC21; +use C4::AuthoritiesMarc::UNIMARC; use vars qw($VERSION @ISA @EXPORT); @@ -523,7 +525,17 @@ sub AddAuthority { ); } } - $record->add_fields('152','','','b'=>$authtypecode) unless ($record->field('152') && $record->subfield('152','b')); + + my ($auth_type_tag, $auth_type_subfield) = get_auth_type_location($authtypecode); + if (!$authid and $format eq "MARC21") { + # only need to do this fix when modifying an existing authority + C4::AuthoritiesMarc::MARC21::fix_marc21_auth_type_location($record, $auth_type_tag, $auth_type_subfield); + } + + unless ($record->field($auth_type_tag) && $record->subfield($auth_type_tag, $auth_type_subfield)) { + $record->add_fields($auth_type_tag,'','', $auth_type_subfield=>$authtypecode); + } + if (!$authid) { my $sth=$dbh->prepare("select max(authid) from auth_header"); $sth->execute; @@ -592,6 +604,7 @@ sub ModAuthority { my $cgidir = C4::Context->intranetdir ."/cgi-bin"; unless (opendir(DIR,"$cgidir")) { $cgidir = C4::Context->intranetdir."/"; + closedir(DIR); } my $filename = $cgidir."/tmp/modified_authorities/$authid.authid"; @@ -617,13 +630,24 @@ returns xml form of record $authid sub GetAuthorityXML { # Returns MARC::XML of the authority passed in parameter. my ( $authid ) = @_; - my $dbh=C4::Context->dbh; - my $sth = - $dbh->prepare("select marcxml from auth_header where authid=? " ); - $sth->execute($authid); - my ($marcxml)=$sth->fetchrow; - return $marcxml; - + my $format= 'UNIMARCAUTH' if (uc(C4::Context->preference('marcflavour')) eq 'UNIMARC'); + $format= 'MARC21' if (uc(C4::Context->preference('marcflavour')) ne 'UNIMARC'); + if ($format eq "MARC21") { + # for MARC21, call GetAuthority instead of + # getting the XML directly since we may + # need to fix up the location of the authority + # code -- note that this is reasonably safe + # because GetAuthorityXML is used only by the + # indexing processes like zebraqueue_start.pl + my $record = GetAuthority($authid); + return $record->as_xml_record($format); + } else { + my $dbh=C4::Context->dbh; + my $sth = $dbh->prepare("select marcxml from auth_header where authid=? " ); + $sth->execute($authid); + my ($marcxml)=$sth->fetchrow; + return $marcxml; + } } =head2 GetAuthority @@ -639,11 +663,15 @@ Returns MARC::Record of the authority passed in parameter. sub GetAuthority { my ($authid)=@_; my $dbh=C4::Context->dbh; - my $sth=$dbh->prepare("select marcxml from auth_header where authid=?"); + my $sth=$dbh->prepare("select authtypecode, marcxml from auth_header where authid=?"); $sth->execute($authid); - my ($marcxml) = $sth->fetchrow; + my ($authtypecode, $marcxml) = $sth->fetchrow; my $record=MARC::Record->new_from_xml($marcxml,'UTF-8',(C4::Context->preference("marcflavour") eq "UNIMARC"?"UNIMARCAUTH":C4::Context->preference("marcflavour"))); $record->encoding('UTF-8'); + if (C4::Context->preference("marcflavour") eq "MARC21") { + my ($auth_type_tag, $auth_type_subfield) = get_auth_type_location($authtypecode); + C4::AuthoritiesMarc::MARC21::fix_marc21_auth_type_location($record, $auth_type_tag, $auth_type_subfield); + } return ($record); } @@ -1224,6 +1252,42 @@ sub merge { # # }#foreach $marc }#sub + +=head2 get_auth_type_location + +=over 4 + +my ($tag, $subfield) = get_auth_type_location($auth_type_code); + +=back + +Get the tag and subfield used to store the heading type +for indexing purposes. The C<$auth_type> parameter is +optional; if it is not supplied, assume ''. + +This routine searches the MARC authority framework +for the tag and subfield whose kohafield is +C; if no such field is +defined in the framework, default to the hardcoded value +specific to the MARC format. + +=cut + +sub get_auth_type_location { + my $auth_type_code = @_ ? shift : ''; + + my ($tag, $subfield) = GetAuthMARCFromKohaField('auth_header.authtypecode', $auth_type_code); + if (defined $tag and defined $subfield and $tag != 0 and $subfield != 0) { + return ($tag, $subfield); + } else { + if (C4::Context->preference('marcflavour') eq "MARC21") { + return C4::AuthoritiesMarc::MARC21::default_auth_type_location(); + } else { + return C4::AuthoritiesMarc::UNIMARC::default_auth_type_location(); + } + } +} + END { } # module clean-up code here (global destructor) =head1 AUTHOR diff --git a/etc/zebradb/marc_defs/marc21/authorities/record.abs b/etc/zebradb/marc_defs/marc21/authorities/record.abs index 4377122d33..9e048eb706 100644 --- a/etc/zebradb/marc_defs/marc21/authorities/record.abs +++ b/etc/zebradb/marc_defs/marc21/authorities/record.abs @@ -12,8 +12,7 @@ xpath enable all any melm 001 Local-Number -#melm 942$a authtype -melm 152$b authtype +melm 942$a authtype # Personal Name melm 100 Personal-name:w,Personal-name:p,Personal-name:s,Heading:w,Heading:p,Heading:s diff --git a/installer/data/mysql/en/marcflavour/marc21/mandatory/authorities_normal_marc21.sql b/installer/data/mysql/en/marcflavour/marc21/mandatory/authorities_normal_marc21.sql index 4c6397d96d..f7042db09e 100644 --- a/installer/data/mysql/en/marcflavour/marc21/mandatory/authorities_normal_marc21.sql +++ b/installer/data/mysql/en/marcflavour/marc21/mandatory/authorities_normal_marc21.sql @@ -261,13 +261,14 @@ INSERT INTO `auth_tag_structure` (`authtypecode`, `tagfield`, `liblibrarian`, `l ('', '785', 'SUBDIVISION LINKING ENTRY--FORM SUBDIVISION', 'SUBDIVISION LINKING ENTRY--FORM SUBDIVISION', 1, 0, NULL), ('', '788', 'COMPLEX LINKING ENTRY DATA', 'COMPLEX LINKING ENTRY DATA', 0, 0, NULL), ('', '856', 'ELECTRONIC LOCATION AND ACCESS', 'ELECTRONIC LOCATION AND ACCESS', 1, 0, NULL), - ('', '880', 'ALTERNATE GRAPHIC REPRESENTATION', 'ALTERNATE GRAPHIC REPRESENTATION', 1, 0, NULL); + ('', '880', 'ALTERNATE GRAPHIC REPRESENTATION', 'ALTERNATE GRAPHIC REPRESENTATION', 1, 0, NULL), + ('', '942', 'KOHA INTERNAL USE', 'KOHA INTERNAL USE', 0, 1, NULL); INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `tab`, `authorised_value`, `value_builder`, `seealso`, `isurl`, `hidden`, `linkid`, `kohafield`, `frameworkcode`) VALUES ('', '000', '@', 'fixed length control field', 'fixed length control field', 0, 1, 0, NULL, 'marc21_leader_authorities.pl', NULL, 0, 0, '', '', ''), - ('', '001', '@', 'control field', 'control field', 0, 0, 0, NULL, NULL, NULL, 0, 0, '', '', ''), + ('', '001', '@', 'control field', 'control field', 0, 0, 0, NULL, NULL, NULL, 0, 0, '', 'auth_header.authid', ''), ('', '003', '@', 'control field', 'control field', 0, 1, 0, NULL, 'marc21_field_003.pl', NULL, 0, 0, '', '', ''), ('', '005', '@', 'control field', 'control field', 0, 1, 0, NULL, 'marc21_field_005.pl', NULL, 0, 0, '', '', ''), ('', '008', '@', 'fixed length control field', 'fixed length control field', 0, 1, 0, NULL, 'marc21_field_008_authorities.pl', NULL, 0, 0, '', '', ''), @@ -1643,7 +1644,8 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield` ('', '880', '6', '6', '6', 1, 0, 8, NULL, NULL, NULL, 0, 0, '', '', ''), ('', '880', '7', '7', '7', 1, 0, 8, NULL, NULL, NULL, 0, 0, '', '', ''), ('', '880', '8', '8', '8', 1, 0, 8, NULL, NULL, NULL, 0, 0, '', '', ''), - ('', '880', '9', '9', '9', 1, 0, 8, NULL, NULL, NULL, 0, 0, '', '', ''); + ('', '880', '9', '9', '9', 1, 0, 8, NULL, NULL, NULL, 0, 0, '', '', ''), + ('', '942', 'a', 'Koha auth type', 'Koha auth type', 0, 1, 9, NULL, NULL, NULL, 0, 8, '', 'auth_header.authtypecode', ''); -- ****************************************************** @@ -1745,12 +1747,13 @@ INSERT INTO `auth_tag_structure` (`authtypecode`, `tagfield`, `liblibrarian`, `l ('PERSO_NAME', '700', 'ESTABLISHED HEADING LINKING ENTRY--PERSONAL NAME', 'ESTABLISHED HEADING LINKING ENTRY--PERSONAL NAME', 1, 0, NULL), ('PERSO_NAME', '788', 'COMPLEX LINKING ENTRY DATA', 'COMPLEX LINKING ENTRY DATA', 0, 0, NULL), ('PERSO_NAME', '856', 'ELECTRONIC LOCATION AND ACCESS', 'ELECTRONIC LOCATION AND ACCESS', 1, 0, NULL), - ('PERSO_NAME', '880', 'ALTERNATE GRAPHIC REPRESENTATION', 'ALTERNATE GRAPHIC REPRESENTATION', 1, 0, NULL); + ('PERSO_NAME', '880', 'ALTERNATE GRAPHIC REPRESENTATION', 'ALTERNATE GRAPHIC REPRESENTATION', 1, 0, NULL), + ('PERSO_NAME', '942', 'KOHA INTERNAL USE', 'KOHA INTERNAL USE', 0, 1, NULL); INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `tab`, `authorised_value`, `value_builder`, `seealso`, `isurl`, `hidden`, `linkid`, `kohafield`, `frameworkcode`) VALUES ('PERSO_NAME', '000', '@', 'fixed length control field', 'fixed length control field', 0, 1, 0, NULL, 'marc21_leader_authorities.pl', NULL, 0, 0, '', '', ''), - ('PERSO_NAME', '001', '@', 'control field', 'control field', 0, 0, 0, NULL, NULL, NULL, 0, 0, '', '', ''), + ('PERSO_NAME', '001', '@', 'control field', 'control field', 0, 0, 0, NULL, NULL, NULL, 0, 0, '', 'auth_header.authid', ''), ('PERSO_NAME', '003', '@', 'control field', 'control field', 0, 1, 0, NULL, 'marc21_field_003.pl', NULL, 0, 0, '', '', ''), ('PERSO_NAME', '005', '@', 'control field', 'control field', 0, 1, 0, NULL, 'marc21_field_005.pl', NULL, 0, 0, '', '', ''), ('PERSO_NAME', '008', '@', 'fixed length control field', 'fixed length control field', 0, 1, 0, NULL, 'marc21_field_008_authorities.pl', NULL, 0, 0, '', '', ''), @@ -2554,7 +2557,8 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield` ('PERSO_NAME', '880', '6', '6', '6', 1, 0, 8, NULL, NULL, NULL, 0, 0, '', '', ''), ('PERSO_NAME', '880', '7', '7', '7', 1, 0, 8, NULL, NULL, NULL, 0, 0, '', '', ''), ('PERSO_NAME', '880', '8', '8', '8', 1, 0, 8, NULL, NULL, NULL, 0, 0, '', '', ''), - ('PERSO_NAME', '880', '9', '9', '9', 1, 0, 8, NULL, NULL, NULL, 0, 0, '', '', ''); + ('PERSO_NAME', '880', '9', '9', '9', 1, 0, 8, NULL, NULL, NULL, 0, 0, '', '', ''), + ('PERSO_NAME', '942', 'a', 'Koha auth type', 'Koha auth type', 0, 1, 9, NULL, NULL, NULL, 0, 8, '', 'auth_header.authtypecode', ''); -- ****************************************************** @@ -2667,12 +2671,13 @@ INSERT INTO `auth_tag_structure` (`authtypecode`, `tagfield`, `liblibrarian`, `l ('CORPO_NAME', '785', 'SUBDIVISION LINKING ENTRY--FORM SUBDIVISION', 'SUBDIVISION LINKING ENTRY--FORM SUBDIVISION', 1, 0, NULL), ('CORPO_NAME', '788', 'COMPLEX LINKING ENTRY DATA', 'COMPLEX LINKING ENTRY DATA', 0, 0, NULL), ('CORPO_NAME', '856', 'ELECTRONIC LOCATION AND ACCESS', 'ELECTRONIC LOCATION AND ACCESS', 1, 0, NULL), - ('CORPO_NAME', '880', 'ALTERNATE GRAPHIC REPRESENTATION', 'ALTERNATE GRAPHIC REPRESENTATION', 1, 0, NULL); + ('CORPO_NAME', '880', 'ALTERNATE GRAPHIC REPRESENTATION', 'ALTERNATE GRAPHIC REPRESENTATION', 1, 0, NULL), + ('CORPO_NAME', '942', 'KOHA INTERNAL USE', 'KOHA INTERNAL USE', 0, 1, NULL); INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `tab`, `authorised_value`, `value_builder`, `seealso`, `isurl`, `hidden`, `linkid`, `kohafield`, `frameworkcode`) VALUES ('CORPO_NAME', '000', '@', 'fixed length control field', 'fixed length control field', 0, 1, 0, NULL, 'marc21_leader_authorities.pl', NULL, 0, 0, '', '', ''), - ('CORPO_NAME', '001', '@', 'control field', 'control field', 0, 0, 0, NULL, NULL, NULL, 0, 0, '', '', ''), + ('CORPO_NAME', '001', '@', 'control field', 'control field', 0, 0, 0, NULL, NULL, NULL, 0, 0, '', 'auth_header.authid', ''), ('CORPO_NAME', '003', '@', 'control field', 'control field', 0, 1, 0, NULL, 'marc21_field_003.pl', NULL, 0, 0, '', '', ''), ('CORPO_NAME', '005', '@', 'control field', 'control field', 0, 1, 0, NULL, 'marc21_field_005.pl', NULL, 0, 0, '', '', ''), ('CORPO_NAME', '008', '@', 'fixed length control field', 'fixed length control field', 0, 1, 0, NULL, 'marc21_field_008_authorities.pl', NULL, 0, 0, '', '', ''), @@ -3462,7 +3467,8 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield` ('CORPO_NAME', '880', '6', '6', '6', 1, 0, 8, NULL, NULL, NULL, 0, 0, '', '', ''), ('CORPO_NAME', '880', '7', '7', '7', 1, 0, 8, NULL, NULL, NULL, 0, 0, '', '', ''), ('CORPO_NAME', '880', '8', '8', '8', 1, 0, 8, NULL, NULL, NULL, 0, 0, '', '', ''), - ('CORPO_NAME', '880', '9', '9', '9', 1, 0, 8, NULL, NULL, NULL, 0, 0, '', '', ''); + ('CORPO_NAME', '880', '9', '9', '9', 1, 0, 8, NULL, NULL, NULL, 0, 0, '', '', ''), + ('CORPO_NAME', '942', 'a', 'Koha auth type', 'Koha auth type', 0, 1, 9, NULL, NULL, NULL, 0, 8, '', 'auth_header.authtypecode', ''); -- ****************************************************** @@ -3565,12 +3571,13 @@ INSERT INTO `auth_tag_structure` (`authtypecode`, `tagfield`, `liblibrarian`, `l ('MEETI_NAME', '711', 'ESTABLISHED HEADING LINKING ENTRY--MEETING NAME', 'ESTABLISHED HEADING LINKING ENTRY--MEETING NAME', 1, 0, NULL), ('MEETI_NAME', '788', 'COMPLEX LINKING ENTRY DATA', 'COMPLEX LINKING ENTRY DATA', 0, 0, NULL), ('MEETI_NAME', '856', 'ELECTRONIC LOCATION AND ACCESS', 'ELECTRONIC LOCATION AND ACCESS', 1, 0, NULL), - ('MEETI_NAME', '880', 'ALTERNATE GRAPHIC REPRESENTATION', 'ALTERNATE GRAPHIC REPRESENTATION', 1, 0, NULL); + ('MEETI_NAME', '880', 'ALTERNATE GRAPHIC REPRESENTATION', 'ALTERNATE GRAPHIC REPRESENTATION', 1, 0, NULL), + ('MEETI_NAME', '942', 'KOHA INTERNAL USE', 'KOHA INTERNAL USE', 0, 1, NULL); INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `tab`, `authorised_value`, `value_builder`, `seealso`, `isurl`, `hidden`, `linkid`, `kohafield`, `frameworkcode`) VALUES ('MEETI_NAME', '000', '@', 'fixed length control field', 'fixed length control field', 0, 1, 0, NULL, 'marc21_leader_authorities.pl', NULL, 0, 0, '', '', ''), - ('MEETI_NAME', '001', '@', 'control field', 'control field', 0, 0, 0, NULL, NULL, NULL, 0, 0, '', '', ''), + ('MEETI_NAME', '001', '@', 'control field', 'control field', 0, 0, 0, NULL, NULL, NULL, 0, 0, '', 'auth_header.authid', ''), ('MEETI_NAME', '003', '@', 'control field', 'control field', 0, 1, 0, NULL, 'marc21_field_003.pl', NULL, 0, 0, '', '', ''), ('MEETI_NAME', '005', '@', 'control field', 'control field', 0, 1, 0, NULL, 'marc21_field_005.pl', NULL, 0, 0, '', '', ''), ('MEETI_NAME', '008', '@', 'fixed length control field', 'fixed length control field', 0, 1, 0, NULL, 'marc21_field_008_authorities.pl', NULL, 0, 0, '', '', ''), @@ -4375,7 +4382,8 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield` ('MEETI_NAME', '880', '6', '6', '6', 1, 0, 8, NULL, NULL, NULL, 0, 0, '', '', ''), ('MEETI_NAME', '880', '7', '7', '7', 1, 0, 8, NULL, NULL, NULL, 0, 0, '', '', ''), ('MEETI_NAME', '880', '8', '8', '8', 1, 0, 8, NULL, NULL, NULL, 0, 0, '', '', ''), - ('MEETI_NAME', '880', '9', '9', '9', 1, 0, 8, NULL, NULL, NULL, 0, 0, '', '', ''); + ('MEETI_NAME', '880', '9', '9', '9', 1, 0, 8, NULL, NULL, NULL, 0, 0, '', '', ''), + ('MEETI_NAME', '942', 'a', 'Koha auth type', 'Koha auth type', 0, 1, 9, NULL, NULL, NULL, 0, 8, '', 'auth_header.authtypecode', ''); -- ****************************************************** @@ -4485,12 +4493,13 @@ INSERT INTO `auth_tag_structure` (`authtypecode`, `tagfield`, `liblibrarian`, `l ('UNIF_TITLE', '730', 'ESTABLISHED HEADING LINKING ENTRY--UNIFORM TITLE', 'ESTABLISHED HEADING LINKING ENTRY--UNIFORM TITLE', 1, 0, NULL), ('UNIF_TITLE', '788', 'COMPLEX LINKING ENTRY DATA', 'COMPLEX LINKING ENTRY DATA', 0, 0, NULL), ('UNIF_TITLE', '856', 'ELECTRONIC LOCATION AND ACCESS', 'ELECTRONIC LOCATION AND ACCESS', 1, 0, NULL), - ('UNIF_TITLE', '880', 'ALTERNATE GRAPHIC REPRESENTATION', 'ALTERNATE GRAPHIC REPRESENTATION', 1, 0, NULL); + ('UNIF_TITLE', '880', 'ALTERNATE GRAPHIC REPRESENTATION', 'ALTERNATE GRAPHIC REPRESENTATION', 1, 0, NULL), + ('UNIF_TITLE', '942', 'KOHA INTERNAL USE', 'KOHA INTERNAL USE', 0, 1, NULL); INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `tab`, `authorised_value`, `value_builder`, `seealso`, `isurl`, `hidden`, `linkid`, `kohafield`, `frameworkcode`) VALUES ('UNIF_TITLE', '000', '@', 'fixed length control field', 'fixed length control field', 0, 1, 0, NULL, 'marc21_leader_authorities.pl', NULL, 0, 0, '', '', ''), - ('UNIF_TITLE', '001', '@', 'control field', 'control field', 0, 0, 0, NULL, NULL, NULL, 0, 0, '', '', ''), + ('UNIF_TITLE', '001', '@', 'control field', 'control field', 0, 0, 0, NULL, NULL, NULL, 0, 0, '', 'auth_header.authid', ''), ('UNIF_TITLE', '003', '@', 'control field', 'control field', 0, 1, 0, NULL, 'marc21_field_003.pl', NULL, 0, 0, '', '', ''), ('UNIF_TITLE', '005', '@', 'control field', 'control field', 0, 1, 0, NULL, 'marc21_field_005.pl', NULL, 0, 0, '', '', ''), ('UNIF_TITLE', '008', '@', 'fixed length control field', 'fixed length control field', 0, 1, 0, NULL, 'marc21_field_008_authorities.pl', NULL, 0, 0, '', '', ''), @@ -5326,7 +5335,8 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield` ('UNIF_TITLE', '880', '6', '6', '6', 1, 0, 8, NULL, NULL, NULL, 0, 0, '', '', ''), ('UNIF_TITLE', '880', '7', '7', '7', 1, 0, 8, NULL, NULL, NULL, 0, 0, '', '', ''), ('UNIF_TITLE', '880', '8', '8', '8', 1, 0, 8, NULL, NULL, NULL, 0, 0, '', '', ''), - ('UNIF_TITLE', '880', '9', '9', '9', 1, 0, 8, NULL, NULL, NULL, 0, 0, '', '', ''); + ('UNIF_TITLE', '880', '9', '9', '9', 1, 0, 8, NULL, NULL, NULL, 0, 0, '', '', ''), + ('UNIF_TITLE', '942', 'a', 'Koha auth type', 'Koha auth type', 0, 1, 9, NULL, NULL, NULL, 0, 8, '', 'auth_header.authtypecode', ''); -- ****************************************************** @@ -5427,12 +5437,13 @@ INSERT INTO `auth_tag_structure` (`authtypecode`, `tagfield`, `liblibrarian`, `l ('CHRON_TERM', '782', 'SUBDIVISION LINKING ENTRY--CHRONOLOGICAL SUBDIVISION', 'SUBDIVISION LINKING ENTRY--CHRONOLOGICAL SUBDIVISION', 1, 0, NULL), ('CHRON_TERM', '788', 'COMPLEX LINKING ENTRY DATA', 'COMPLEX LINKING ENTRY DATA', 0, 0, NULL), ('CHRON_TERM', '856', 'ELECTRONIC LOCATION AND ACCESS', 'ELECTRONIC LOCATION AND ACCESS', 1, 0, NULL), - ('CHRON_TERM', '880', 'ALTERNATE GRAPHIC REPRESENTATION', 'ALTERNATE GRAPHIC REPRESENTATION', 1, 0, NULL); + ('CHRON_TERM', '880', 'ALTERNATE GRAPHIC REPRESENTATION', 'ALTERNATE GRAPHIC REPRESENTATION', 1, 0, NULL), + ('CHRON_TERM', '942', 'KOHA INTERNAL USE', 'KOHA INTERNAL USE', 0, 1, NULL); INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `tab`, `authorised_value`, `value_builder`, `seealso`, `isurl`, `hidden`, `linkid`, `kohafield`, `frameworkcode`) VALUES ('CHRON_TERM', '000', '@', 'fixed length control field', 'fixed length control field', 0, 1, 0, NULL, 'marc21_leader_authorities.pl', NULL, 0, 0, '', '', ''), - ('CHRON_TERM', '001', '@', 'control field', 'control field', 0, 0, 0, NULL, NULL, NULL, 0, 0, '', '', ''), + ('CHRON_TERM', '001', '@', 'control field', 'control field', 0, 0, 0, NULL, NULL, NULL, 0, 0, '', 'auth_header.authid', ''), ('CHRON_TERM', '003', '@', 'control field', 'control field', 0, 1, 0, NULL, 'marc21_field_003.pl', NULL, 0, 0, '', '', ''), ('CHRON_TERM', '005', '@', 'control field', 'control field', 0, 1, 0, NULL, 'marc21_field_005.pl', NULL, 0, 0, '', '', ''), ('CHRON_TERM', '008', '@', 'fixed length control field', 'fixed length control field', 0, 1, 0, NULL, 'marc21_field_008_authorities.pl', NULL, 0, 0, '', '', ''), @@ -6192,7 +6203,8 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield` ('CHRON_TERM', '880', '6', '6', '6', 1, 0, 8, NULL, NULL, NULL, 0, 0, '', '', ''), ('CHRON_TERM', '880', '7', '7', '7', 1, 0, 8, NULL, NULL, NULL, 0, 0, '', '', ''), ('CHRON_TERM', '880', '8', '8', '8', 1, 0, 8, NULL, NULL, NULL, 0, 0, '', '', ''), - ('CHRON_TERM', '880', '9', '9', '9', 1, 0, 8, NULL, NULL, NULL, 0, 0, '', '', ''); + ('CHRON_TERM', '880', '9', '9', '9', 1, 0, 8, NULL, NULL, NULL, 0, 0, '', '', ''), + ('CHRON_TERM', '942', 'a', 'Koha auth type', 'Koha auth type', 0, 1, 9, NULL, NULL, NULL, 0, 8, '', 'auth_header.authtypecode', ''); -- ****************************************************** @@ -6293,12 +6305,13 @@ INSERT INTO `auth_tag_structure` (`authtypecode`, `tagfield`, `liblibrarian`, `l ('TOPIC_TERM', '780', 'SUBDIVISION LINKING ENTRY--GENERAL SUBDIVISION', 'SUBDIVISION LINKING ENTRY--GENERAL SUBDIVISION', 1, 0, NULL), ('TOPIC_TERM', '788', 'COMPLEX LINKING ENTRY DATA', 'COMPLEX LINKING ENTRY DATA', 0, 0, NULL), ('TOPIC_TERM', '856', 'ELECTRONIC LOCATION AND ACCESS', 'ELECTRONIC LOCATION AND ACCESS', 1, 0, NULL), - ('TOPIC_TERM', '880', 'ALTERNATE GRAPHIC REPRESENTATION', 'ALTERNATE GRAPHIC REPRESENTATION', 1, 0, NULL); + ('TOPIC_TERM', '880', 'ALTERNATE GRAPHIC REPRESENTATION', 'ALTERNATE GRAPHIC REPRESENTATION', 1, 0, NULL), + ('TOPIC_TERM', '942', 'KOHA INTERNAL USE', 'KOHA INTERNAL USE', 0, 1, NULL); INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `tab`, `authorised_value`, `value_builder`, `seealso`, `isurl`, `hidden`, `linkid`, `kohafield`, `frameworkcode`) VALUES ('TOPIC_TERM', '000', '@', 'fixed length control field', 'fixed length control field', 0, 1, 0, NULL, 'marc21_leader_authorities.pl', NULL, 0, 0, '', '', ''), - ('TOPIC_TERM', '001', '@', 'control field', 'control field', 0, 0, 0, NULL, NULL, NULL, 0, 0, '', '', ''), + ('TOPIC_TERM', '001', '@', 'control field', 'control field', 0, 0, 0, NULL, NULL, NULL, 0, 0, '', 'auth_header.authid', ''), ('TOPIC_TERM', '003', '@', 'control field', 'control field', 0, 1, 0, NULL, 'marc21_field_003.pl', NULL, 0, 0, '', '', ''), ('TOPIC_TERM', '005', '@', 'control field', 'control field', 0, 1, 0, NULL, 'marc21_field_005.pl', NULL, 0, 0, '', '', ''), ('TOPIC_TERM', '008', '@', 'fixed length control field', 'fixed length control field', 0, 1, 0, NULL, 'marc21_field_008_authorities.pl', NULL, 0, 0, '', '', ''), @@ -7062,7 +7075,8 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield` ('TOPIC_TERM', '880', '6', '6', '6', 1, 0, 8, NULL, NULL, NULL, 0, 0, '', '', ''), ('TOPIC_TERM', '880', '7', '7', '7', 1, 0, 8, NULL, NULL, NULL, 0, 0, '', '', ''), ('TOPIC_TERM', '880', '8', '8', '8', 1, 0, 8, NULL, NULL, NULL, 0, 0, '', '', ''), - ('TOPIC_TERM', '880', '9', '9', '9', 1, 0, 8, NULL, NULL, NULL, 0, 0, '', '', ''); + ('TOPIC_TERM', '880', '9', '9', '9', 1, 0, 8, NULL, NULL, NULL, 0, 0, '', '', ''), + ('TOPIC_TERM', '942', 'a', 'Koha auth type', 'Koha auth type', 0, 1, 9, NULL, NULL, NULL, 0, 8, '', 'auth_header.authtypecode', ''); -- ****************************************************** @@ -7163,12 +7177,13 @@ INSERT INTO `auth_tag_structure` (`authtypecode`, `tagfield`, `liblibrarian`, `l ('GEOGR_NAME', '781', 'SUBDIVISION LINKING ENTRY--GEOGRAPHIC SUBDIVISION', 'SUBDIVISION LINKING ENTRY--GEOGRAPHIC SUBDIVISION', 1, 0, NULL), ('GEOGR_NAME', '788', 'COMPLEX LINKING ENTRY DATA', 'COMPLEX LINKING ENTRY DATA', 0, 0, NULL), ('GEOGR_NAME', '856', 'ELECTRONIC LOCATION AND ACCESS', 'ELECTRONIC LOCATION AND ACCESS', 1, 0, NULL), - ('GEOGR_NAME', '880', 'ALTERNATE GRAPHIC REPRESENTATION', 'ALTERNATE GRAPHIC REPRESENTATION', 1, 0, NULL); + ('GEOGR_NAME', '880', 'ALTERNATE GRAPHIC REPRESENTATION', 'ALTERNATE GRAPHIC REPRESENTATION', 1, 0, NULL), + ('GEOGR_NAME', '942', 'KOHA INTERNAL USE', 'KOHA INTERNAL USE', 0, 1, NULL); INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `tab`, `authorised_value`, `value_builder`, `seealso`, `isurl`, `hidden`, `linkid`, `kohafield`, `frameworkcode`) VALUES ('GEOGR_NAME', '000', '@', 'fixed length control field', 'fixed length control field', 0, 1, 0, NULL, 'marc21_leader_authorities.pl', NULL, 0, 0, '', '', ''), - ('GEOGR_NAME', '001', '@', 'control field', 'control field', 0, 0, 0, NULL, NULL, NULL, 0, 0, '', '', ''), + ('GEOGR_NAME', '001', '@', 'control field', 'control field', 0, 0, 0, NULL, NULL, NULL, 0, 0, '', 'auth_header.authid', ''), ('GEOGR_NAME', '003', '@', 'control field', 'control field', 0, 1, 0, NULL, 'marc21_field_003.pl', NULL, 0, 0, '', '', ''), ('GEOGR_NAME', '005', '@', 'control field', 'control field', 0, 1, 0, NULL, 'marc21_field_005.pl', NULL, 0, 0, '', '', ''), ('GEOGR_NAME', '008', '@', 'fixed length control field', 'fixed length control field', 0, 1, 0, NULL, 'marc21_field_008_authorities.pl', NULL, 0, 0, '', '', ''), @@ -7930,7 +7945,8 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield` ('GEOGR_NAME', '880', '6', '6', '6', 1, 0, 8, NULL, NULL, NULL, 0, 0, '', '', ''), ('GEOGR_NAME', '880', '7', '7', '7', 1, 0, 8, NULL, NULL, NULL, 0, 0, '', '', ''), ('GEOGR_NAME', '880', '8', '8', '8', 1, 0, 8, NULL, NULL, NULL, 0, 0, '', '', ''), - ('GEOGR_NAME', '880', '9', '9', '9', 1, 0, 8, NULL, NULL, NULL, 0, 0, '', '', ''); + ('GEOGR_NAME', '880', '9', '9', '9', 1, 0, 8, NULL, NULL, NULL, 0, 0, '', '', ''), + ('GEOGR_NAME', '942', 'a', 'Koha auth type', 'Koha auth type', 0, 1, 9, NULL, NULL, NULL, 0, 8, '', 'auth_header.authtypecode', ''); -- ****************************************************** @@ -8032,12 +8048,13 @@ INSERT INTO `auth_tag_structure` (`authtypecode`, `tagfield`, `liblibrarian`, `l ('GENRE/FORM', '785', 'SUBDIVISION LINKING ENTRY--FORM SUBDIVISION', 'SUBDIVISION LINKING ENTRY--FORM SUBDIVISION', 1, 0, NULL), ('GENRE/FORM', '788', 'COMPLEX LINKING ENTRY DATA', 'COMPLEX LINKING ENTRY DATA', 0, 0, NULL), ('GENRE/FORM', '856', 'ELECTRONIC LOCATION AND ACCESS', 'ELECTRONIC LOCATION AND ACCESS', 1, 0, NULL), - ('GENRE/FORM', '880', 'ALTERNATE GRAPHIC REPRESENTATION', 'ALTERNATE GRAPHIC REPRESENTATION', 1, 0, NULL); + ('GENRE/FORM', '880', 'ALTERNATE GRAPHIC REPRESENTATION', 'ALTERNATE GRAPHIC REPRESENTATION', 1, 0, NULL), + ('GENRE/FORM', '942', 'KOHA INTERNAL USE', 'KOHA INTERNAL USE', 0, 1, NULL); INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `tab`, `authorised_value`, `value_builder`, `seealso`, `isurl`, `hidden`, `linkid`, `kohafield`, `frameworkcode`) VALUES ('GENRE/FORM', '000', '@', 'fixed length control field', 'fixed length control field', 0, 1, 0, NULL, 'marc21_leader_authorities.pl', NULL, 0, 0, '', '', ''), - ('GENRE/FORM', '001', '@', 'control field', 'control field', 0, 0, 0, NULL, NULL, NULL, 0, 0, '', '', ''), + ('GENRE/FORM', '001', '@', 'control field', 'control field', 0, 0, 0, NULL, NULL, NULL, 0, 0, '', 'auth_header.authid', ''), ('GENRE/FORM', '003', '@', 'control field', 'control field', 0, 1, 0, NULL, 'marc21_field_003.pl', NULL, 0, 0, '', '', ''), ('GENRE/FORM', '005', '@', 'control field', 'control field', 0, 1, 0, NULL, 'marc21_field_005.pl', NULL, 0, 0, '', '', ''), ('GENRE/FORM', '008', '@', 'fixed length control field', 'fixed length control field', 0, 1, 0, NULL, 'marc21_field_008_authorities.pl', NULL, 0, 0, '', '', ''), @@ -8803,6 +8820,7 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield` ('GENRE/FORM', '880', '6', '6', '6', 1, 0, 8, NULL, NULL, NULL, 0, 0, '', '', ''), ('GENRE/FORM', '880', '7', '7', '7', 1, 0, 8, NULL, NULL, NULL, 0, 0, '', '', ''), ('GENRE/FORM', '880', '8', '8', '8', 1, 0, 8, NULL, NULL, NULL, 0, 0, '', '', ''), - ('GENRE/FORM', '880', '9', '9', '9', 1, 0, 8, NULL, NULL, NULL, 0, 0, '', '', ''); + ('GENRE/FORM', '880', '9', '9', '9', 1, 0, 8, NULL, NULL, NULL, 0, 0, '', '', ''), + ('GENRE/FORM', '942', 'a', 'Koha auth type', 'Koha auth type', 0, 1, 9, NULL, NULL, NULL, 0, 8, '', 'auth_header.authtypecode', ''); -- 2.39.5