From ddf79eac3a0088f82cd8871d3e5a71c8267329ae Mon Sep 17 00:00:00 2001 From: Ere Maijala Date: Mon, 19 Mar 2018 15:11:05 +0200 Subject: [PATCH] Initial holdings support https://bugs.koha-community.org/show_bug.cgi?id=20447 --- C4/Biblio.pm | 17 + C4/Holdings.pm | 746 +++++++++++++++++++++ C4/Items.pm | 4 +- C4/Search.pm | 8 + C4/XSLT.pm | 33 +- Koha/Holding.pm | 71 ++ Koha/Holdings.pm | 63 ++ Koha/Holdings/Metadata.pm | 44 ++ Koha/Holdings/Metadatas.pm | 50 ++ Koha/Schema/Result/BiblioFramework.pm | 18 +- Koha/Schema/Result/Deleteditem.pm | 15 +- Koha/Schema/Result/Holding.pm | 242 +++++++ Koha/Schema/Result/HoldingsMetadata.pm | 138 ++++ Koha/Schema/Result/Item.pm | 36 +- Koha/Template/Plugin/Holdings.pm | 90 +++ acqui/z3950_search.pl | 2 +- admin/biblio_framework.pl | 5 +- catalogue/detail.pl | 10 +- cataloguing/addbiblio.pl | 2 +- cataloguing/addbooks.pl | 2 +- cataloguing/addholding.pl | 728 ++++++++++++++++++++ cataloguing/additem.pl | 11 + .../value_builder/marc21_field_008_holdings.pl | 120 ++++ .../value_builder/marc21_leader_holdings.pl | 85 +++ .../atomicupdate/bug_20447-add_holdings_tables.sql | 400 +++++++++++ .../optional/marc21_sample_fastadd_framework.sql | 2 +- .../optional/marc21_simple_bib_frameworks.sql | 18 +- .../marc21/mandatory/marc21_framework_DEFAULT.sql | 327 ++++++++- .../optional/marc21_sample_fastadd_framework.sql | 2 +- .../optional/marc21_simple_bib_frameworks.sql | 16 +- .../optional/marc21_sample_fastadd_framework.sql | 2 +- .../optional/marc21_simple_bib_frameworks.sql | 18 +- .../marc21/facultatif/marc21_grille_simple.sql | 2 +- .../obligatoire/marc21_sample_acq_framework.sql | 2 +- .../marc21_sample_fastadd_framework.sql | 2 +- .../Optionnel/marc21_simple_bib_frameworks.sql | 2 +- .../Obligatoire/framework_DEFAULT.sql | 2 +- .../Obligatoire/framework_DEFAULT.sql | 2 +- .../optional/marc21_sample_fastadd_framework.sql | 2 +- .../optional/marc21_simple_bib_frameworks.sql | 18 +- installer/data/mysql/kohastructure.sql | 53 +- installer/data/mysql/mandatory/auth_val_cat.sql | 1 + .../optional/marc21_sample_fastadd_framework.sql | 2 +- .../optional/marc21_simple_bib_frameworks.sql | 2 +- .../Valgfritt/normarc_fastadd_framework.sql | 2 +- .../optional/marc21_sample_fastadd_framework.sql | 2 +- .../unimarc_bibliographic_DEFAULT_general.sql | 2 +- .../marc21_bibliographic_DEFAULT_general.sql | 2 +- .../unimarc_bibliographic_DEFAULT_general.sql | 2 +- koha-tmpl/intranet-tmpl/prog/css/addholding.css | 171 +++++ .../intranet-tmpl/prog/en/includes/cat-toolbar.inc | 4 + .../prog/en/modules/admin/biblio_framework.tt | 22 +- .../en/modules/admin/preferences/cataloguing.pref | 7 + .../prog/en/modules/catalogue/detail.tt | 73 +- .../prog/en/modules/catalogue/moredetail.tt | 2 + .../prog/en/modules/catalogue/results.tt | 14 + .../prog/en/modules/cataloguing/addholding.tt | 616 +++++++++++++++++ .../value_builder/marc21_field_008_holdings.tt | 193 ++++++ .../value_builder/marc21_leader_holdings.tt | 105 +++ .../opac-tmpl/bootstrap/en/modules/opac-detail.tt | 28 + .../opac-tmpl/bootstrap/en/modules/opac-results.tt | 10 + .../bootstrap/en/xslt/MARC21slim2OPACResults.xsl | 19 +- opac/opac-detail.pl | 7 + t/db_dependent/Koha/BiblioFrameworks.t | 2 + 64 files changed, 4613 insertions(+), 85 deletions(-) create mode 100644 C4/Holdings.pm create mode 100644 Koha/Holding.pm create mode 100644 Koha/Holdings.pm create mode 100644 Koha/Holdings/Metadata.pm create mode 100644 Koha/Holdings/Metadatas.pm create mode 100644 Koha/Schema/Result/Holding.pm create mode 100644 Koha/Schema/Result/HoldingsMetadata.pm create mode 100644 Koha/Template/Plugin/Holdings.pm create mode 100755 cataloguing/addholding.pl create mode 100755 cataloguing/value_builder/marc21_field_008_holdings.pl create mode 100755 cataloguing/value_builder/marc21_leader_holdings.pl create mode 100644 installer/data/mysql/atomicupdate/bug_20447-add_holdings_tables.sql create mode 100644 koha-tmpl/intranet-tmpl/prog/css/addholding.css create mode 100644 koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addholding.tt create mode 100644 koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_008_holdings.tt create mode 100644 koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_leader_holdings.tt diff --git a/C4/Biblio.pm b/C4/Biblio.pm index 91707fd..c233304 100644 --- a/C4/Biblio.pm +++ b/C4/Biblio.pm @@ -44,6 +44,7 @@ use Koha::Authority::Types; use Koha::Acquisition::Currencies; use Koha::Biblio::Metadata; use Koha::Biblio::Metadatas; +use Koha::Holdings; use Koha::Holds; use Koha::ItemTypes; use Koha::SearchEngine; @@ -1523,6 +1524,22 @@ sub GetAuthorisedValueDesc { return $itemtype ? $itemtype->translated_description : q||; } + #---- holdings + if ( $tagslib->{$tag}->{$subfield}->{'authorised_value'} eq "holdings" ) { + my $holding = Koha::Holdings->find( $value ); + if ( $holding ) { + my @parts; + + push @parts, $value; + push @parts, $holding->holdingbranch() if $holding->holdingbranch(); + push @parts, $holding->location() if $holding->location(); + push @parts, $holding->callnumber() if $holding->callnumber(); + + return join(' ', @parts); + } + return q||; + } + #---- "true" authorized value $category = $tagslib->{$tag}->{$subfield}->{'authorised_value'}; } diff --git a/C4/Holdings.pm b/C4/Holdings.pm new file mode 100644 index 0000000..60a04af --- /dev/null +++ b/C4/Holdings.pm @@ -0,0 +1,746 @@ +package C4::Holdings; + +# Copyright 2000-2002 Katipo Communications +# Copyright 2010 BibLibre +# Copyright 2011 Equinox Software, Inc. +# +# 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 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. +# +# You should have received a copy of the GNU General Public License +# along with Koha; if not, see . + +use Modern::Perl; +use Carp; + +# TODO check which use's are really necessary + +use Encode qw( decode is_utf8 ); +use List::MoreUtils qw( uniq ); +use MARC::Record; +use MARC::File::USMARC; +use MARC::File::XML; +use POSIX qw(strftime); + +use C4::Koha; +use C4::Log; # logaction +use C4::ClassSource; +use C4::Charset; +use C4::Debug; + +use Koha::Caches; +use Koha::Holdings::Metadata; +use Koha::Holdings::Metadatas; +use Koha::Libraries; + +use vars qw(@ISA @EXPORT); +use vars qw($debug $cgi_debug); + +BEGIN { + + require Exporter; + @ISA = qw( Exporter ); + + # to add holdings + # EXPORTED FUNCTIONS. + push @EXPORT, qw( + &AddHolding + ); + + # to get something + push @EXPORT, qw( + GetHolding + ); + + # To modify something + push @EXPORT, qw( + &ModHolding + ); + + # To delete something + push @EXPORT, qw( + &DelHolding + ); +} + +=head1 NAME + +C4::Holding - cataloging management functions + +=head1 DESCRIPTION + +Holding.pm contains functions for managing storage and editing of holdings data within Koha. Most of the functions in this module are used for cataloging holdings records: adding, editing, or removing holdings. Koha stores holdings information in two places: + +=over 4 + +=item 1. in the holdings table which is limited to a one-to-one mapping to underlying MARC data + +=item 2. as MARC XML in holdings_metadata.metadata + +=back + +In the 3.0 version of Koha, the authoritative record-level information is in holdings_metadata.metadata + +Because the data isn't completely normalized there's a chance for information to get out of sync. The design choice to go with a un-normalized schema was driven by performance and stability concerns. However, if this occur, it can be considered as a bug : The API is (or should be) complete & the only entry point for all holdings management. + +=over 4 + +=item 1. Add*/Mod*/Del*/ - high-level external functions suitable for being called from external scripts to manage the collection + +=back + +The MARC record (in holdings_metadata.metadata) contains the MARC holdings record. It also contains the holding_id. That is the reason why it is not stored directly by AddHolding, with all other fields. To save a holding, we need to: + +=over 4 + +=item 1. save data in holdings table, that gives us a holding_id + +=item 2. add the holding_id into the MARC record + +=item 3. save the marc record + +=back + +=head1 EXPORTED FUNCTIONS + +=head2 AddHolding + + $holding_id = AddHolding($record, $frameworkcode, $biblionumber); + +Exported function (core API) for adding a new holding to koha. + +The first argument is a C object containing the +holding to add, while the second argument is the desired MARC +framework code and third the biblionumber to link to. + +=cut + +sub AddHolding { + my $record = shift; + my $frameworkcode = shift; + my $biblionumber = shift; + if (!$record) { + carp('AddHolding called with undefined record'); + return; + } + + my $dbh = C4::Context->dbh; + + my $biblio = Koha::Biblios->find( $biblionumber ); + my $biblioitemnumber = $biblio->biblioitem->biblioitemnumber; + + # transform the data into koha-table style data + SetUTF8Flag($record); + my $rowData = TransformMarcHoldingToKoha( $record ); + my ($holding_id) = _koha_add_holding( $dbh, $rowData, $frameworkcode, $biblionumber, $biblioitemnumber ); + + _koha_marc_update_ids( $record, $frameworkcode, $holding_id, $biblionumber, $biblioitemnumber ); + + # now add the record + ModHoldingMarc( $record, $holding_id, $frameworkcode ); + + logaction( "CATALOGUING", "ADD", $holding_id, "holding" ) if C4::Context->preference("CataloguingLog"); + return $holding_id; +} + +=head2 ModHolding + + ModHolding($record, $holding_id, $frameworkcode); + +Replace an existing holding record identified by C<$holding_id> +with one supplied by the MARC::Record object C<$record>. + +C<$frameworkcode> specifies the MARC framework to use +when storing the modified holdings record. + +Returns 1 on success 0 on failure + +=cut + +sub ModHolding { + my ( $record, $holding_id, $frameworkcode ) = @_; + if (!$record) { + carp 'No record passed to ModHolding'; + return 0; + } + + if ( C4::Context->preference("CataloguingLog") ) { + my $newrecord = GetMarcHolding($holding_id); + logaction( "CATALOGUING", "MODIFY", $holding_id, "holding BEFORE=>" . $newrecord->as_formatted ); + } + + # Cleaning up invalid fields must be done early or SetUTF8Flag is liable to + # throw an exception which probably won't be handled. + foreach my $field ($record->fields()) { + if (! $field->is_control_field()) { + if (scalar($field->subfields()) == 0 || (scalar($field->subfields()) == 1 && $field->subfield('9'))) { + $record->delete_field($field); + } + } + } + + SetUTF8Flag($record); + my $dbh = C4::Context->dbh; + + $frameworkcode = C4::Context->preference('DefaultSummaryHoldingsFrameworkCode') if !$frameworkcode || $frameworkcode eq "Default"; + + # update holding_id in MARC + _koha_marc_update_ids( $record, $frameworkcode, $holding_id ); + + # load the koha-table data object + my $rowData = TransformMarcHoldingToKoha( $record ); + # update the MARC record (that now contains biblio and items) with the new record data + &ModHoldingMarc( $record, $holding_id, $frameworkcode ); + + # modify the other koha tables + _koha_modify_holding( $dbh, $holding_id, $rowData, $frameworkcode ); + + return 1; +} + +=head2 DelHolding + + my $error = &DelHolding($holding_id); + +Exported function (core API) for deleting a holding in koha. +Deletes holding record from Koha tables (holdings, holdings_metadata) +Also backs it up to deleted* tables. +Checks to make sure that the holding has no items attached. +return: +C<$error> : undef unless an error occurs + +=cut + +sub DelHolding { + my ($holding_id) = @_; + my $dbh = C4::Context->dbh; + my $error; # for error handling + + # First make sure this holding has no items attached + my $sth = $dbh->prepare("SELECT itemnumber FROM items WHERE holding_id=?"); + $sth->execute($holding_id); + if ( my $itemnumber = $sth->fetchrow ) { + + # Fix this to use a status the template can understand + $error .= "This holding record has items attached, please delete them first before deleting this holding record "; + } + + return $error if $error; + + # delete holding + _koha_delete_holding( $dbh, $holding_id ); + + logaction( "CATALOGUING", "DELETE", $holding_id, "holding" ) if C4::Context->preference("CataloguingLog"); + + return; +} + +=head2 GetHolding + + my $holding = &GetHolding($holding_id); + +=cut + +sub GetHolding { + my ($holding_id) = @_; + my $dbh = C4::Context->dbh; + my $sth = $dbh->prepare("SELECT * FROM holding WHERE holding_id = ? AND deleted_at IS NULL"); + my $count = 0; + my @results; + $sth->execute($holding_id); + if ( my $data = $sth->fetchrow_hashref ) { + return $data; + } + return; +} + +=head2 GetHoldingsByBiblionumber + + GetHoldingsByBiblionumber($biblionumber); + +Returns an arrayref of hashrefs suitable for use in a TMPL_LOOP +Called by C + +=cut + +sub GetHoldingsByBiblionumber { + my ( $bib ) = @_; + my $dbh = C4::Context->dbh; + my $sth = $dbh->prepare("SELECT * FROM holdings WHERE holdings.biblionumber = ? AND deleted_at IS NULL") || die $dbh->errstr; + # Get all holdings attached to a biblioitem + my $i = 0; + my @results; + $sth->execute($bib) || die $sth->errstr; + while ( my $data = $sth->fetchrow_hashref ) { + push(@results, $data); + } + return (\@results); +} + +=head2 GetMarcHolding + + my $record = GetMarcHolding(holding_id, [$opac]); + +Returns MARC::Record representing a holding record, or C if the +record doesn't exist. + +=over 4 + +=item C<$holding_id> + +the holding_id + +=item C<$opac> + +set to true to make the result suited for OPAC view. This causes things like +OpacHiddenItems to be applied. + +=back + +=cut + +sub GetMarcHolding { + my $holding_id = shift; + my $opac = shift || 0; + + if (not defined $holding_id) { + carp 'GetMarcHolding called with undefined holding_id'; + return; + } + + # Use state to speed up repeated calls in batch processes + state $marcflavour = C4::Context->preference('marcflavour'); + + my $marcxml = GetXmlHolding( $holding_id ); + $marcxml = StripNonXmlChars( $marcxml ); + my $frameworkcode = GetHoldingFrameworkCode( $holding_id ); + MARC::File::XML->default_record_format( $marcflavour ); + + if ($marcxml) { + my $record = eval { + MARC::Record::new_from_xml( $marcxml, "utf8", $marcflavour ); + }; + if ($@) { warn " problem with holding $holding_id : $@ \n$marcxml"; } + return unless $record; + + _koha_marc_update_ids( $record, $frameworkcode, $holding_id ); + + return $record; + } + return; +} + +=head2 GetXmlHolding + + my $marcxml = GetXmlHolding($holding_id); + +Returns holdings_metadata.metadata/marcxml of the holding_id passed in parameter. + +=cut + +sub GetXmlHolding { + my ($holding_id) = @_; + return unless $holding_id; + + # Use state to speed up repeated calls in batch processes + state $marcflavour = C4::Context->preference('marcflavour'); + state $sth = C4::Context->dbh->prepare( + q| + SELECT metadata + FROM holdings_metadata + WHERE holding_id=? + AND format='marcxml' + AND marcflavour=? + | + ); + + $sth->execute( $holding_id, $marcflavour ); + my ($marcxml) = $sth->fetchrow(); + $sth->finish(); + return $marcxml; +} + +=head2 GetHoldingFrameworkCode + + $frameworkcode = GetFrameworkCode( $holding_id ) + +=cut + +sub GetHoldingFrameworkCode { + my ($holding_id) = @_; + # Use state to speed up repeated calls in batch processes + state $sth = C4::Context->dbh->prepare("SELECT frameworkcode FROM holdings WHERE holding_id=?"); + $sth->execute($holding_id); + my ($frameworkcode) = $sth->fetchrow; + $sth->finish(); + return $frameworkcode; +} + +=head1 INTERNAL FUNCTIONS + +=head2 _koha_add_holding + + my ($holding_id,$error) = _koha_add_hodings($dbh, $holding, $frameworkcode, $biblionumber, $biblioitemnumber); + +Internal function to add a holding ($holding is a hash with the values) + +=cut + +sub _koha_add_holding { + my ( $dbh, $holding, $frameworkcode, $biblionumber, $biblioitemnumber ) = @_; + + my $error; + + my $query = "INSERT INTO holdings + SET biblionumber = ?, + biblioitemnumber = ?, + frameworkcode = ?, + holdingbranch = ?, + location = ?, + callnumber = ?, + suppress = ?, + datecreated = NOW() + "; + + my $sth = $dbh->prepare($query); + $sth->execute( + $biblionumber, $biblioitemnumber, $frameworkcode, + $holding->{holdingbranch}, $holding->{location}, $holding->{callnumber}, $holding->{suppress} + ); + + my $holding_id = $dbh->{'mysql_insertid'}; + if ( $dbh->errstr ) { + $error .= "ERROR in _koha_add_holding $query" . $dbh->errstr; + warn $error; + } + + $sth->finish(); + + return ( $holding_id, $error ); +} + +=head2 _koha_modify_holding + + my ($biblionumber,$error) == _koha_modify_holding($dbh, $holding, $frameworkcode); + +Internal function for updating the holdings table + +=cut + +sub _koha_modify_holding { + my ( $dbh, $holding_id, $holding, $frameworkcode ) = @_; + my $error; + + my $query = " + UPDATE holdings + SET frameworkcode = ?, + holdingbranch = ?, + location = ?, + callnumber = ?, + suppress = ? + WHERE holding_id = ? + " + ; + my $sth = $dbh->prepare($query); + + $sth->execute( + $frameworkcode, $holding->{holdingbranch}, $holding->{location}, $holding->{callnumber}, $holding->{suppress}, $holding_id + ) if $holding_id; + + if ( $dbh->errstr || !$holding_id ) { + die "ERROR in _koha_modify_holding for holding $holding_id: " . $dbh->errstr; + } + return ( $holding_id, $error ); +} + +=head2 _koha_delete_holding + + $error = _koha_delete_holding($dbh, $holding_id); + +Internal sub for deleting from holdings table + +C<$dbh> - the database handle + +C<$holding_id> - the holding_id of the holding to be deleted + +=cut + +sub _koha_delete_holding { + my ( $dbh, $holding_id ) = @_; + + my $schema = Koha::Database->new->schema; + $schema->txn_do( + sub { + $dbh->do('UPDATE holdings_metadata SET deleted_at = NOW() WHERE holding_id=?', undef, $holding_id); + $dbh->do('UPDATE holdings SET deleted_at = NOW() WHERE holding_id=?', undef, $holding_id); + } + ); + return; +} + +=head1 INTERNAL FUNCTIONS + +=head2 _koha_marc_update_ids + + + _koha_marc_update_ids($record, $frameworkcode, $holding_id[, $biblionumber, $biblioitemnumber]); + +Internal function to add or update holding_id, biblionumber and biblioitemnumber to +the MARC XML. + +=cut + +sub _koha_marc_update_ids { + my ( $record, $frameworkcode, $holding_id, $biblionumber, $biblioitemnumber ) = @_; + + my ( $holding_tag, $holding_subfield ) = GetMarcHoldingFromKohaField( "holdings.holding_id" ); + die qq{No holding_id tag for framework "$frameworkcode"} unless $holding_tag; + + if ( $holding_tag < 10 ) { + C4::Biblio::UpsertMarcControlField( $record, $holding_tag, $holding_id ); + } else { + C4::Biblio::UpsertMarcSubfield($record, $holding_tag, $holding_subfield, $holding_id); + } + + if ( defined $biblionumber ) { + my ( $biblio_tag, $biblio_subfield ) = GetMarcHoldingFromKohaField( "biblio.biblionumber" ); + die qq{No biblionumber tag for framework "$frameworkcode"} unless $biblio_tag; + if ( $biblio_tag < 10 ) { + C4::Biblio::UpsertMarcControlField( $record, $biblio_tag, $biblionumber ); + } else { + C4::Biblio::UpsertMarcSubfield($record, $biblio_tag, $biblio_subfield, $biblionumber); + } + } + if ( defined $biblioitemnumber ) { + my ( $biblioitem_tag, $biblioitem_subfield ) = GetMarcHoldingFromKohaField( "biblioitems.biblioitemnumber" ); + die qq{No biblioitemnumber tag for framework "$frameworkcode"} unless $biblioitem_tag; + if ( $biblioitem_tag < 10 ) { + C4::Biblio::UpsertMarcControlField( $record, $biblioitem_tag, $biblioitemnumber ); + } else { + C4::Biblio::UpsertMarcSubfield($record, $biblioitem_tag, $biblioitem_subfield, $biblioitemnumber); + } + } +} + +=head1 UNEXPORTED FUNCTIONS + +=head2 ModHoldingMarc + + &ModHoldingMarc($newrec,$holding_id,$frameworkcode); + +Add MARC XML data for a holding to koha + +Function exported, but should NOT be used, unless you really know what you're doing + +=cut + +sub ModHoldingMarc { + # pass the MARC::Record to this function, and it will create the records in + # the marcxml field + my ( $record, $holding_id, $frameworkcode ) = @_; + if ( !$record ) { + carp 'ModHoldingMarc passed an undefined record'; + return; + } + + # Clone record as it gets modified + $record = $record->clone(); + my $dbh = C4::Context->dbh; + my @fields = $record->fields(); + if ( !$frameworkcode ) { + $frameworkcode = ""; + } + my $sth = $dbh->prepare("UPDATE holdings SET frameworkcode=? WHERE holding_id=?"); + $sth->execute( $frameworkcode, $holding_id ); + $sth->finish; + my $encoding = C4::Context->preference("marcflavour"); + + # deal with UNIMARC field 100 (encoding) : create it if needed & set encoding to unicode + if ( $encoding eq "UNIMARC" ) { + my $defaultlanguage = C4::Context->preference("UNIMARCField100Language"); + $defaultlanguage = "fre" if (!$defaultlanguage || length($defaultlanguage) != 3); + my $string = $record->subfield( 100, "a" ); + if ( ($string) && ( length( $record->subfield( 100, "a" ) ) == 36 ) ) { + my $f100 = $record->field(100); + $record->delete_field($f100); + } else { + $string = POSIX::strftime( "%Y%m%d", localtime ); + $string =~ s/\-//g; + $string = sprintf( "%-*s", 35, $string ); + substr ( $string, 22, 3, $defaultlanguage); + } + substr( $string, 25, 3, "y50" ); + unless ( $record->subfield( 100, "a" ) ) { + $record->insert_fields_ordered( MARC::Field->new( 100, "", "", "a" => $string ) ); + } + } + + #enhancement 5374: update transaction date (005) for marc21/unimarc + if($encoding =~ /MARC21|UNIMARC/) { + my @a= (localtime) [5,4,3,2,1,0]; $a[0]+=1900; $a[1]++; + # YY MM DD HH MM SS (update year and month) + my $f005= $record->field('005'); + $f005->update(sprintf("%4d%02d%02d%02d%02d%04.1f",@a)) if $f005; + } + + my $metadata = { + holding_id => $holding_id, + format => 'marcxml', + marcflavour => C4::Context->preference('marcflavour'), + }; + # FIXME To replace with ->find_or_create? + if ( my $m_rs = Koha::Holdings::Metadatas->find($metadata) ) { + $m_rs->metadata( $record->as_xml_record($encoding) ); + $m_rs->store; + } else { + my $m_rs = Koha::Holdings::Metadata->new($metadata); + $m_rs->metadata( $record->as_xml_record($encoding) ); + $m_rs->store; + } + return $holding_id; +} + +=head2 GetMarcHoldingFromKohaField + + ( $field,$subfield ) = GetMarcHoldingFromKohaField( $kohafield ); + @fields = GetMarcHoldingFromKohaField( $kohafield ); + $field = GetMarcHoldingFromKohaField( $kohafield ); + + Returns the MARC fields & subfields mapped to $kohafield. + Uses the HLD framework that is considered as authoritative. + + In list context all mappings are returned; there can be multiple + mappings. Note that in the above example you could miss a second + mappings in the first call. + In scalar context only the field tag of the first mapping is returned. + +=cut + +sub GetMarcHoldingFromKohaField { + my ( $kohafield ) = @_; + return unless $kohafield; + # The next call uses the Default framework since it is AUTHORITATIVE + # for all Koha to MARC mappings. + my $mss = C4::Biblio::GetMarcSubfieldStructure( 'HLD' ); # Do not change framework + my @retval; + foreach( @{ $mss->{$kohafield} } ) { + push @retval, $_->{tagfield}, $_->{tagsubfield}; + } + return wantarray ? @retval : ( @retval ? $retval[0] : undef ); +} + +=head2 GetMarcHoldingSubfieldStructureFromKohaField + + my $str = GetMarcHoldingSubfieldStructureFromKohaField( $kohafield ); + + Returns marc subfield structure information for $kohafield. + Uses the HLD framework that is considered as authoritative. + + In list context returns a list of all hashrefs, since there may be + multiple mappings. In scalar context the first hashref is returned. + +=cut + +sub GetMarcHoldingSubfieldStructureFromKohaField { + my ( $kohafield ) = @_; + + return unless $kohafield; + + # The next call uses the Default framework since it is AUTHORITATIVE + # for all Koha to MARC mappings. + my $mss = C4::Biblio::GetMarcSubfieldStructure( 'HLD' ); # Do not change framework + return unless $mss->{$kohafield}; + return wantarray ? @{$mss->{$kohafield}} : $mss->{$kohafield}->[0]; +} + +=head2 TransformMarcHoldingToKoha + + $result = TransformMarcHoldingToKoha( $record, undef ) + +Extract data from a MARC holdings record into a hashref representing +Koha holdings fields. + +If passed an undefined record will log the error and return an empty +hash_ref. + +=cut + +sub TransformMarcHoldingToKoha { + my ( $record ) = @_; + + my $result = {}; + if (!defined $record) { + carp('TransformMarcToKoha called with undefined record'); + return $result; + } + + my %tables = ( holdings => 1 ); + + # The next call acknowledges HLD as the authoritative framework + # for holdings to MARC mappings. + my $mss = C4::Biblio::GetMarcSubfieldStructure( 'HLD' ); # Do not change framework + foreach my $kohafield ( keys %{ $mss } ) { + my ( $table, $column ) = split /[.]/, $kohafield, 2; + next unless $tables{$table}; + my $val = TransformMarcHoldingToKohaOneField( $kohafield, $record ); + next if !defined $val; + $result->{$column} = $val; + } + return $result; +} + +=head2 TransformMarcHoldingToKohaOneField + + $val = TransformMarcHoldingToKohaOneField( 'biblio.title', $marc ); + + Note: The authoritative Default framework is used implicitly. + +=cut + +sub TransformMarcHoldingToKohaOneField { + my ( $kohafield, $marc ) = @_; + + my ( @rv, $retval ); + my @mss = GetMarcHoldingSubfieldStructureFromKohaField($kohafield); + foreach my $fldhash ( @mss ) { + my $tag = $fldhash->{tagfield}; + my $sub = $fldhash->{tagsubfield}; + foreach my $fld ( $marc->field($tag) ) { + if( $sub eq '@' || $fld->is_control_field ) { + push @rv, $fld->data if $fld->data; + } else { + push @rv, grep { $_ } $fld->subfield($sub); + } + } + } + return unless @rv; + $retval = join ' | ', uniq(@rv); + + return $retval; +} + +1; + + +__END__ + +=head1 AUTHOR + +Koha Development Team + +Paul POULAIN paul.poulain@free.fr + +Joshua Ferraro jmf@liblime.com + +Ere Maijala ere.maijala@helsinki.fi + +=cut diff --git a/C4/Items.pm b/C4/Items.pm index a3ecd87..daf7ef1 100644 --- a/C4/Items.pm +++ b/C4/Items.pm @@ -1795,7 +1795,8 @@ sub _koha_new_item { more_subfields_xml = ?, copynumber = ?, stocknumber = ?, - new_status = ? + new_status = ?, + holding_id = ? "; my $sth = $dbh->prepare($query); my $today = output_pref({ dt => dt_from_string, dateformat => 'iso', dateonly => 1 }); @@ -1840,6 +1841,7 @@ sub _koha_new_item { $item->{'copynumber'}, $item->{'stocknumber'}, $item->{'new_status'}, + $item->{'holding_id'}, ); my $itemnumber; diff --git a/C4/Search.pm b/C4/Search.pm index 1723212..485cdf3 100644 --- a/C4/Search.pm +++ b/C4/Search.pm @@ -20,6 +20,7 @@ use strict; require Exporter; use C4::Context; use C4::Biblio; # GetMarcFromKohaField, GetBiblioData +use C4::Holdings; # GetHoldingsByBiblionumber use C4::Koha; # getFacets use Koha::DateUtils; use Koha::Libraries; @@ -2053,6 +2054,7 @@ sub searchResults { my $maxitems_pref = C4::Context->preference('maxItemsinSearchResults'); my $maxitems = $maxitems_pref ? $maxitems_pref - 1 : 1; my @hiddenitems; # hidden itemnumbers based on OpacHiddenItems syspref + my $summary_holdings; # loop through every item foreach my $field (@fields) { @@ -2236,6 +2238,11 @@ sub searchResults { push @available_items_loop, $available_items->{$key} } + # Fetch summary holdings + if (C4::Context->preference('SummaryHoldings')) { + $summary_holdings = C4::Holdings::GetHoldingsByBiblionumber($oldbiblio->{biblionumber}); + } + # XSLT processing of some stuff # we fetched the sysprefs already before the loop through all retrieved record! if (!$scan && $xslfile) { @@ -2268,6 +2275,7 @@ sub searchResults { $oldbiblio->{onholdcount} = $item_onhold_count; $oldbiblio->{orderedcount} = $ordered_count; $oldbiblio->{notforloancount} = $notforloan_count; + $oldbiblio->{summary_holdings} = $summary_holdings; if (C4::Context->preference("AlternateHoldingsField") && $items_count == 0) { my $fieldspec = C4::Context->preference("AlternateHoldingsField"); diff --git a/C4/XSLT.pm b/C4/XSLT.pm index bf2647a..22a0e6c 100644 --- a/C4/XSLT.pm +++ b/C4/XSLT.pm @@ -241,9 +241,10 @@ sub XSLTParse4Display { # grab the XML, run it through our stylesheet, push it out to the browser my $record = transformMARCXML4XSLT($biblionumber, $orig_record); my $itemsxml = buildKohaItemsNamespace($biblionumber, $hidden_items); + my $holdingsxml = buildKohaHoldingsNamespace($biblionumber); my $xmlrecord = $record->as_xml(C4::Context->preference('marcflavour')); - $xmlrecord =~ s/\<\/record\>/$itemsxml$sysxml\<\/record\>/; + $xmlrecord =~ s/\<\/record\>/$itemsxml$holdingsxml$sysxml\<\/record\>/; if ($fixamps) { # We need to correct the HTML entities that Zebra outputs $xmlrecord =~ s/\&amp;/\&/g; $xmlrecord =~ s/\&\;lt\;/\<\;/g; @@ -342,6 +343,36 @@ sub buildKohaItemsNamespace { return $xml; } +sub buildKohaHoldingsNamespace { + my ($biblionumber) = @_; + + my $holdings = C4::Holdings::GetHoldingsByBiblionumber( $biblionumber ); + + my $shelflocations = + { map { $_->{authorised_value} => $_->{opac_description} } Koha::AuthorisedValues->get_descriptions_by_koha_field( { frameworkcode => 'HLD', kohafield => 'holdings.location' } ) }; + + my %branches = map { $_->branchcode => $_->branchname } Koha::Libraries->search({}, { order_by => 'branchname' }); + + my $location = ""; + my $ccode = ""; + my $xml = ''; + for my $holding ( @{$holdings} ) { + my $holdingbranch = $holding->{holdingbranch} ? xml_escape($branches{$holding->{holdingbranch}}) : ''; + my $location = $holding->{location} ? xml_escape($shelflocations->{$holding->{location}} || $holding->{location}) : ''; + my $callnumber = xml_escape($holding->{callnumber}); + my $suppress = $holding->{suppress} || '0'; + $xml .= + "" + . "$holdingbranch" + . "$location" + . "$callnumber" + . "$suppress" + . ""; + } + $xml = "$xml"; + return $xml; +} + =head2 engine Returns reference to XSLT handler object. diff --git a/Koha/Holding.pm b/Koha/Holding.pm new file mode 100644 index 0000000..1901718 --- /dev/null +++ b/Koha/Holding.pm @@ -0,0 +1,71 @@ +package Koha::Holding; + +# Copyright ByWater Solutions 2014 +# +# 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 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. +# +# 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. + +use Modern::Perl; + +use Carp; + +use Koha::Database; + +use base qw(Koha::Object); + +=head1 NAME + +Koha::Holding - Koha Holding Object class + +=head1 API + +=head2 Class Methods + +=cut + +=head3 items + +my @items = $holding->items(); +my $items = $holding->items(); + +Returns the related Koha::Items object for this holding in scalar context, +or list of Koha::Item objects in list context. + +=cut + +sub items { + my ($self) = @_; + + $self->{_items} ||= Koha::Items->search( { holding_id => $self->holding_id() } ); + + return wantarray ? $self->{_items}->as_list : $self->{_items}; +} + +=head3 type + +=cut + +sub _type { + return 'Holding'; +} + +=head1 AUTHOR + +Kyle M Hall +Ere Maijala + +=cut + +1; diff --git a/Koha/Holdings.pm b/Koha/Holdings.pm new file mode 100644 index 0000000..388aeae --- /dev/null +++ b/Koha/Holdings.pm @@ -0,0 +1,63 @@ +package Koha::Holdings; + +# Copyright ByWater Solutions 2015 +# +# 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 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. +# +# 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. + +use Modern::Perl; + +use Carp; + +use Koha::Database; + +use Koha::Holding; + +use base qw(Koha::Objects); + +=head1 NAME + +Koha::Holdings - Koha Holdings object set class + +=head1 API + +=head2 Class Methods + +=cut + +=head3 type + +=cut + +sub _type { + return 'Holding'; +} + +=head3 object_class + +=cut + +sub object_class { + return 'Koha::Holding'; +} + +=head1 AUTHOR + +Kyle M Hall +Ere Maijala + +=cut + +1; diff --git a/Koha/Holdings/Metadata.pm b/Koha/Holdings/Metadata.pm new file mode 100644 index 0000000..e4ca5bd --- /dev/null +++ b/Koha/Holdings/Metadata.pm @@ -0,0 +1,44 @@ +package Koha::Holdings::Metadata; + +# 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 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. +# +# 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. + +use Modern::Perl; + +use Carp; + +use Koha::Database; + +use base qw(Koha::Object); + +=head1 NAME + +Koha::Metadata - Koha Metadata Object class + +=head1 API + +=head2 Class Methods + +=cut + +=head3 type + +=cut + +sub _type { + return 'HoldingsMetadata'; +} + +1; diff --git a/Koha/Holdings/Metadatas.pm b/Koha/Holdings/Metadatas.pm new file mode 100644 index 0000000..12c2c4b --- /dev/null +++ b/Koha/Holdings/Metadatas.pm @@ -0,0 +1,50 @@ +package Koha::Holdings::Metadatas; + +# 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 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. +# +# 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. + +use Modern::Perl; + +use Carp; + +use Koha::Database; + +use Koha::Biblio::Metadata; + +use base qw(Koha::Objects); + +=head1 NAME + +Koha::Biblio::Metadatas - Koha Metadata Object set class + +=head1 API + +=head2 Class Methods + +=cut + +=head3 type + +=cut + +sub _type { + return 'HoldingsMetadata'; +} + +sub object_class { + return 'Koha::Holdings::Metadata'; +} + +1; diff --git a/Koha/Schema/Result/BiblioFramework.pm b/Koha/Schema/Result/BiblioFramework.pm index 93ed473..839f301 100644 --- a/Koha/Schema/Result/BiblioFramework.pm +++ b/Koha/Schema/Result/BiblioFramework.pm @@ -37,6 +37,13 @@ __PACKAGE__->table("biblio_framework"); is_nullable: 0 size: 255 +=head2 frameworktype + + data_type: 'enum' + default_value: 'bib' + extra: {list => ["bib","hld"]} + is_nullable: 0 + =cut __PACKAGE__->add_columns( @@ -44,6 +51,13 @@ __PACKAGE__->add_columns( { data_type => "varchar", default_value => "", is_nullable => 0, size => 4 }, "frameworktext", { data_type => "varchar", default_value => "", is_nullable => 0, size => 255 }, + "frameworktype", + { + data_type => "enum", + default_value => "bib", + extra => { list => ["bib", "hld"] }, + is_nullable => 0, + }, ); =head1 PRIMARY KEY @@ -59,8 +73,8 @@ __PACKAGE__->add_columns( __PACKAGE__->set_primary_key("frameworkcode"); -# Created by DBIx::Class::Schema::Loader v0.07025 @ 2013-10-14 20:56:21 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:KY1w7J/5cBsz9VV7QEBKPw +# Created by DBIx::Class::Schema::Loader v0.07048 @ 2018-04-03 15:37:39 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:DD+ImqvVMYuKRnDvdXVq5w # FIXME This should not be needed, we need to add the FK at DB level # It cannot be done now because the default framework (frameworkcode=='') diff --git a/Koha/Schema/Result/Deleteditem.pm b/Koha/Schema/Result/Deleteditem.pm index 2eff4e9..b97b2d3 100644 --- a/Koha/Schema/Result/Deleteditem.pm +++ b/Koha/Schema/Result/Deleteditem.pm @@ -198,7 +198,7 @@ __PACKAGE__->table("deleteditems"); data_type: 'timestamp' datetime_undef_if_invalid: 1 - default_value: current_timestamp + default_value: 'current_timestamp()' is_nullable: 0 =head2 location @@ -282,6 +282,11 @@ __PACKAGE__->table("deleteditems"); is_nullable: 1 size: 32 +=head2 holdingnumber + + data_type: 'integer' + is_nullable: 1 + =cut __PACKAGE__->add_columns( @@ -361,7 +366,7 @@ __PACKAGE__->add_columns( { data_type => "timestamp", datetime_undef_if_invalid => 1, - default_value => \"current_timestamp", + default_value => "current_timestamp()", is_nullable => 0, }, "location", @@ -392,6 +397,8 @@ __PACKAGE__->add_columns( { data_type => "varchar", is_nullable => 1, size => 32 }, "new_status", { data_type => "varchar", is_nullable => 1, size => 32 }, + "holdingnumber", + { data_type => "integer", is_nullable => 1 }, ); =head1 PRIMARY KEY @@ -407,8 +414,8 @@ __PACKAGE__->add_columns( __PACKAGE__->set_primary_key("itemnumber"); -# Created by DBIx::Class::Schema::Loader v0.07042 @ 2018-02-18 16:41:11 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:xb11fPjp5PyXU7yfFWHycw +# Created by DBIx::Class::Schema::Loader v0.07048 @ 2018-03-27 18:01:32 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:4Wn3TX+QZrVviNlZDtKymA # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/Koha/Schema/Result/Holding.pm b/Koha/Schema/Result/Holding.pm new file mode 100644 index 0000000..87c3a7d --- /dev/null +++ b/Koha/Schema/Result/Holding.pm @@ -0,0 +1,242 @@ +use utf8; +package Koha::Schema::Result::Holding; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY THE FIRST PART OF THIS FILE + +=head1 NAME + +Koha::Schema::Result::Holding + +=cut + +use strict; +use warnings; + +use base 'DBIx::Class::Core'; + +=head1 TABLE: C + +=cut + +__PACKAGE__->table("holdings"); + +=head1 ACCESSORS + +=head2 holdingnumber + + data_type: 'integer' + is_auto_increment: 1 + is_nullable: 0 + +=head2 biblionumber + + data_type: 'integer' + default_value: 0 + is_foreign_key: 1 + is_nullable: 0 + +=head2 biblioitemnumber + + data_type: 'integer' + default_value: 0 + is_foreign_key: 1 + is_nullable: 0 + +=head2 frameworkcode + + data_type: 'varchar' + default_value: (empty string) + is_nullable: 0 + size: 4 + +=head2 holdingbranch + + data_type: 'varchar' + is_foreign_key: 1 + is_nullable: 1 + size: 10 + +=head2 location + + data_type: 'varchar' + is_nullable: 1 + size: 80 + +=head2 callnumber + + data_type: 'varchar' + is_nullable: 1 + size: 255 + +=head2 suppress + + data_type: 'tinyint' + is_nullable: 1 + +=head2 timestamp + + data_type: 'timestamp' + datetime_undef_if_invalid: 1 + default_value: 'current_timestamp()' + is_nullable: 0 + +=head2 datecreated + + data_type: 'date' + datetime_undef_if_invalid: 1 + is_nullable: 0 + +=head2 deleted_at + + data_type: 'datetime' + datetime_undef_if_invalid: 1 + is_nullable: 1 + +=cut + +__PACKAGE__->add_columns( + "holdingnumber", + { data_type => "integer", is_auto_increment => 1, is_nullable => 0 }, + "biblionumber", + { + data_type => "integer", + default_value => 0, + is_foreign_key => 1, + is_nullable => 0, + }, + "biblioitemnumber", + { + data_type => "integer", + default_value => 0, + is_foreign_key => 1, + is_nullable => 0, + }, + "frameworkcode", + { data_type => "varchar", default_value => "", is_nullable => 0, size => 4 }, + "holdingbranch", + { data_type => "varchar", is_foreign_key => 1, is_nullable => 1, size => 10 }, + "location", + { data_type => "varchar", is_nullable => 1, size => 80 }, + "callnumber", + { data_type => "varchar", is_nullable => 1, size => 255 }, + "suppress", + { data_type => "tinyint", is_nullable => 1 }, + "timestamp", + { + data_type => "timestamp", + datetime_undef_if_invalid => 1, + default_value => "current_timestamp()", + is_nullable => 0, + }, + "datecreated", + { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 0 }, + "deleted_at", + { + data_type => "datetime", + datetime_undef_if_invalid => 1, + is_nullable => 1, + }, +); + +=head1 PRIMARY KEY + +=over 4 + +=item * L + +=back + +=cut + +__PACKAGE__->set_primary_key("holdingnumber"); + +=head1 RELATIONS + +=head2 biblioitemnumber + +Type: belongs_to + +Related object: L + +=cut + +__PACKAGE__->belongs_to( + "biblioitemnumber", + "Koha::Schema::Result::Biblioitem", + { biblioitemnumber => "biblioitemnumber" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, +); + +=head2 biblionumber + +Type: belongs_to + +Related object: L + +=cut + +__PACKAGE__->belongs_to( + "biblionumber", + "Koha::Schema::Result::Biblio", + { biblionumber => "biblionumber" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, +); + +=head2 holdingbranch + +Type: belongs_to + +Related object: L + +=cut + +__PACKAGE__->belongs_to( + "holdingbranch", + "Koha::Schema::Result::Branch", + { branchcode => "holdingbranch" }, + { + is_deferrable => 1, + join_type => "LEFT", + on_delete => "RESTRICT", + on_update => "CASCADE", + }, +); + +=head2 holdings_metadatas + +Type: has_many + +Related object: L + +=cut + +__PACKAGE__->has_many( + "holdings_metadatas", + "Koha::Schema::Result::HoldingsMetadata", + { "foreign.holdingnumber" => "self.holdingnumber" }, + { cascade_copy => 0, cascade_delete => 0 }, +); + +=head2 items + +Type: has_many + +Related object: L + +=cut + +__PACKAGE__->has_many( + "items", + "Koha::Schema::Result::Item", + { "foreign.holdingnumber" => "self.holdingnumber" }, + { cascade_copy => 0, cascade_delete => 0 }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07048 @ 2018-03-27 18:01:32 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:IeRYmSgY1Lj0/tl4rM4IVg + + +# You can replace this text with custom code or comments, and it will be preserved on regeneration +1; diff --git a/Koha/Schema/Result/HoldingsMetadata.pm b/Koha/Schema/Result/HoldingsMetadata.pm new file mode 100644 index 0000000..f18ccde --- /dev/null +++ b/Koha/Schema/Result/HoldingsMetadata.pm @@ -0,0 +1,138 @@ +use utf8; +package Koha::Schema::Result::HoldingsMetadata; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY THE FIRST PART OF THIS FILE + +=head1 NAME + +Koha::Schema::Result::HoldingsMetadata + +=cut + +use strict; +use warnings; + +use base 'DBIx::Class::Core'; + +=head1 TABLE: C + +=cut + +__PACKAGE__->table("holdings_metadata"); + +=head1 ACCESSORS + +=head2 id + + data_type: 'integer' + is_auto_increment: 1 + is_nullable: 0 + +=head2 holdingnumber + + data_type: 'integer' + is_foreign_key: 1 + is_nullable: 0 + +=head2 format + + data_type: 'varchar' + is_nullable: 0 + size: 16 + +=head2 marcflavour + + data_type: 'varchar' + is_nullable: 0 + size: 16 + +=head2 metadata + + data_type: 'longtext' + is_nullable: 0 + +=head2 deleted_at + + data_type: 'datetime' + datetime_undef_if_invalid: 1 + is_nullable: 1 + +=cut + +__PACKAGE__->add_columns( + "id", + { data_type => "integer", is_auto_increment => 1, is_nullable => 0 }, + "holdingnumber", + { data_type => "integer", is_foreign_key => 1, is_nullable => 0 }, + "format", + { data_type => "varchar", is_nullable => 0, size => 16 }, + "marcflavour", + { data_type => "varchar", is_nullable => 0, size => 16 }, + "metadata", + { data_type => "longtext", is_nullable => 0 }, + "deleted_at", + { + data_type => "datetime", + datetime_undef_if_invalid => 1, + is_nullable => 1, + }, +); + +=head1 PRIMARY KEY + +=over 4 + +=item * L + +=back + +=cut + +__PACKAGE__->set_primary_key("id"); + +=head1 UNIQUE CONSTRAINTS + +=head2 C + +=over 4 + +=item * L + +=item * L + +=item * L + +=back + +=cut + +__PACKAGE__->add_unique_constraint( + "holdings_metadata_uniq_key", + ["holdingnumber", "format", "marcflavour"], +); + +=head1 RELATIONS + +=head2 holdingnumber + +Type: belongs_to + +Related object: L + +=cut + +__PACKAGE__->belongs_to( + "holdingnumber", + "Koha::Schema::Result::Holding", + { holdingnumber => "holdingnumber" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07048 @ 2018-03-27 18:01:32 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:LsMBBA9g7uGuPXiXQ94npw + + +# You can replace this text with custom code or comments, and it will be preserved on regeneration +1; diff --git a/Koha/Schema/Result/Item.pm b/Koha/Schema/Result/Item.pm index cee2552..8de9e73 100644 --- a/Koha/Schema/Result/Item.pm +++ b/Koha/Schema/Result/Item.pm @@ -202,7 +202,7 @@ __PACKAGE__->table("items"); data_type: 'timestamp' datetime_undef_if_invalid: 1 - default_value: current_timestamp + default_value: 'current_timestamp()' is_nullable: 0 =head2 location @@ -286,6 +286,12 @@ __PACKAGE__->table("items"); is_nullable: 1 size: 32 +=head2 holding_id + + data_type: 'integer' + is_foreign_key: 1 + is_nullable: 1 + =cut __PACKAGE__->add_columns( @@ -375,7 +381,7 @@ __PACKAGE__->add_columns( { data_type => "timestamp", datetime_undef_if_invalid => 1, - default_value => \"current_timestamp", + default_value => "current_timestamp()", is_nullable => 0, }, "location", @@ -406,6 +412,8 @@ __PACKAGE__->add_columns( { data_type => "varchar", is_nullable => 1, size => 32 }, "new_status", { data_type => "varchar", is_nullable => 1, size => 32 }, + "holding_id", + { data_type => "integer", is_foreign_key => 1, is_nullable => 1 }, ); =head1 PRIMARY KEY @@ -576,6 +584,26 @@ __PACKAGE__->belongs_to( }, ); +=head2 holding_id + +Type: belongs_to + +Related object: L + +=cut + +__PACKAGE__->belongs_to( + "holding_id", + "Koha::Schema::Result::Holding", + { holding_id => "holding_id" }, + { + is_deferrable => 1, + join_type => "LEFT", + on_delete => "CASCADE", + on_update => "CASCADE", + }, +); + =head2 homebranch Type: belongs_to @@ -687,8 +715,8 @@ __PACKAGE__->might_have( ); -# Created by DBIx::Class::Schema::Loader v0.07042 @ 2018-02-18 16:41:12 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:CrNXvpDUvvcuPZK2Gfzs/Q +# Created by DBIx::Class::Schema::Loader v0.07048 @ 2018-03-27 18:01:32 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:2by51tQSbBWys0cwsoqyMg __PACKAGE__->belongs_to( biblioitem => "Koha::Schema::Result::Biblioitem", "biblioitemnumber" ); diff --git a/Koha/Template/Plugin/Holdings.pm b/Koha/Template/Plugin/Holdings.pm new file mode 100644 index 0000000..0c74906 --- /dev/null +++ b/Koha/Template/Plugin/Holdings.pm @@ -0,0 +1,90 @@ +package Koha::Template::Plugin::Holdings; + +# Copyright ByWater Solutions 2012 +# Copyright BibLibre 2014 +# Copyright University of Helsinki 2017 + +# 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 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. +# +# You should have received a copy of the GNU General Public License +# along with Koha; if not, see . + +use Modern::Perl; + +use Template::Plugin; +use base qw( Template::Plugin ); + +use C4::Context; +use C4::Holdings; + +use Koha::Holdings; + +sub GetLocation { + my ( $self, $holding ) = @_; + my $opac = shift || 0; + + if ( !$holding ) { + return ''; + } + + if ( ref($holding) ne 'HASH' ) { + $holding = Koha::Holdings->find( $holding )->unblessed; + if ( !$holding ) { + return ''; + } + } + + my @parts; + + if ( $opac ) { + if ( $holding->{'holdingbranch'}) { + my $query = "SELECT branchname FROM branches WHERE branchcode = ?"; + my $sth = C4::Context->dbh->prepare( $query ); + $sth->execute( $holding->{'holdingbranch'} ); + my $b = $sth->fetchrow_hashref(); + push @parts, $b->{'branchname'} if $b; + $sth->finish(); + } + if ( $holding->{'location'} ) { + my $av = Koha::AuthorisedValues->search({ category => 'LOC', authorised_value => $holding->{'location'} }); + push @parts, $av->next->opac_description if $av->count; + } + push @parts, $holding->{'callnumber'} if $holding->{'callnumber'}; + return join(' - ', @parts); + } + + push @parts, $holding->{'holding_id'}; + push @parts, $holding->{'holdingbranch'} if $holding->{'holdingbranch'}; + push @parts, $holding->{'location'} if $holding->{'location'}; + push @parts, $holding->{'callnumber'} if $holding->{'callnumber'}; + return join(' ', @parts); +} + +sub GetDetails { + my ( $self, $holding ) = @_; + my $opac = shift || 0; + + if ( !$holding ) { + return ''; + } + + if ( ref($holding) eq 'HASH' ) { + $holding = $holding->{'holding_id'}; + } + + my $marcHolding = C4::Holdings::GetMarcHolding( $holding, $opac ); + + return C4::Holdings::TransformMarcHoldingToKoha( $marcHolding ); +} + +1; diff --git a/acqui/z3950_search.pl b/acqui/z3950_search.pl index 4e53186..5412733 100755 --- a/acqui/z3950_search.pl +++ b/acqui/z3950_search.pl @@ -52,7 +52,7 @@ my $page = $input->param('current_page') || 1; $page = $input->param('goto_page') if $input->param('changepage_goto'); # get framework list -my $frameworks = Koha::BiblioFrameworks->search({}, { order_by => ['frameworktext'] }); +my $frameworks = Koha::BiblioFrameworks->search({frameworktype => 'bib'}, { order_by => ['frameworktext'] }); my $vendor = Koha::Acquisition::Booksellers->find( $booksellerid ); diff --git a/admin/biblio_framework.pl b/admin/biblio_framework.pl index d99351b..ddbfcf4 100755 --- a/admin/biblio_framework.pl +++ b/admin/biblio_framework.pl @@ -54,11 +54,13 @@ if ( $op eq 'add_form' ) { } elsif ( $op eq 'add_validate' ) { my $frameworkcode = $input->param('frameworkcode'); my $frameworktext = $input->param('frameworktext'); + my $frameworktype = $input->param('frameworktype'); my $is_a_modif = $input->param('is_a_modif'); if ($is_a_modif) { my $framework = Koha::BiblioFrameworks->find($frameworkcode); $framework->frameworktext($frameworktext); + $framework->frameworktype($frameworktype); eval { $framework->store; }; if ($@) { push @messages, { type => 'error', code => 'error_on_update' }; @@ -69,6 +71,7 @@ if ( $op eq 'add_form' ) { my $framework = Koha::BiblioFramework->new( { frameworkcode => $frameworkcode, frameworktext => $frameworktext, + frameworktype => $frameworktype, } ); eval { $framework->store; }; @@ -117,7 +120,7 @@ if ( $op eq 'add_form' ) { } if ( $op eq 'list' ) { - my $frameworks = Koha::BiblioFrameworks->search( {}, { order_by => ['frameworktext'], } ); + my $frameworks = Koha::BiblioFrameworks->search( undef, { order_by => ['frameworktype', 'frameworktext'] } ); $template->param( frameworks => $frameworks, ); } diff --git a/catalogue/detail.pl b/catalogue/detail.pl index 86a0698..3be574a 100755 --- a/catalogue/detail.pl +++ b/catalogue/detail.pl @@ -26,6 +26,7 @@ use C4::Koha; use C4::Serials; #uses getsubscriptionfrom biblionumber use C4::Output; use C4::Biblio; +use C4::Holdings; use C4::Items; use C4::Circulation; use C4::Reserves; @@ -177,6 +178,11 @@ foreach my $subscription (@subscriptions) { push @subs, \%cell; } +# Summary holdings +my $summary_holdings; +if (C4::Context->preference('SummaryHoldings')) { + $summary_holdings = C4::Holdings::GetHoldingsByBiblionumber($biblionumber); +} # Get acquisition details if ( C4::Context->preference('AcquisitionDetails') ) { @@ -365,7 +371,9 @@ $template->param( hostrecords => $hostrecords, analytics_flag => $analytics_flag, C4::Search::enabled_staff_search_views, - materials => $materials_flag, + materials => $materials_flag, + show_summary_holdings => C4::Context->preference('SummaryHoldings') ? 1 : 0, + summary_holdings => $summary_holdings, ); if (C4::Context->preference("AlternateHoldingsField") && scalar @items == 0) { diff --git a/cataloguing/addbiblio.pl b/cataloguing/addbiblio.pl index 4ecaf69..9c3f6fa 100755 --- a/cataloguing/addbiblio.pl +++ b/cataloguing/addbiblio.pl @@ -749,7 +749,7 @@ if ($frameworkcode eq 'FA'){ exit; } -my $frameworks = Koha::BiblioFrameworks->search({}, { order_by => ['frameworktext'] }); +my $frameworks = Koha::BiblioFrameworks->search({frameworktype => 'bib'}, { order_by => ['frameworktext'] }); $template->param( frameworks => $frameworks, breedingid => $breedingid, diff --git a/cataloguing/addbooks.pl b/cataloguing/addbooks.pl index ae4d7ac..9980bf2 100755 --- a/cataloguing/addbooks.pl +++ b/cataloguing/addbooks.pl @@ -144,7 +144,7 @@ my $servers = $schema->resultset('Z3950server')->search( }, ); -my $frameworks = Koha::BiblioFrameworks->search({}, { order_by => ['frameworktext'] }); +my $frameworks = Koha::BiblioFrameworks->search({frameworktype => 'bib'}, { order_by => ['frameworktext'] }); $template->param( servers => $servers, frameworks => $frameworks, diff --git a/cataloguing/addholding.pl b/cataloguing/addholding.pl new file mode 100755 index 0000000..089b325 --- /dev/null +++ b/cataloguing/addholding.pl @@ -0,0 +1,728 @@ +#!/usr/bin/perl + + +# Copyright 2000-2002 Katipo Communications +# Copyright 2004-2010 BibLibre +# +# 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 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. +# +# You should have received a copy of the GNU General Public License +# along with Koha; if not, see . + +# TODO: refactor to avoid duplication from addbiblio + +use strict; +#use warnings; FIXME - Bug 2505 +use CGI q(-utf8); +use C4::Output; +use C4::Auth; +use C4::Holdings; +use C4::Search; +use C4::Biblio; +use C4::Context; +use MARC::Record; +use C4::Log; +use C4::Koha; +use C4::ClassSource; +use C4::ImportBatch; +use C4::Charset; +use Koha::BiblioFrameworks; +use Koha::DateUtils; +use C4::Matcher; + +use Koha::ItemTypes; +use Koha::Libraries; + +use Koha::BiblioFrameworks; + +use Date::Calc qw(Today); +use MARC::File::USMARC; +use MARC::File::XML; +use URI::Escape; + +if ( C4::Context->preference('marcflavour') eq 'UNIMARC' ) { + MARC::File::XML->default_record_format('UNIMARC'); +} + +our($tagslib,$authorised_values_sth,$is_a_modif,$usedTagsLib,$mandatory_z3950); + +=head1 FUNCTIONS + +=head2 build_authorized_values_list + +=cut + +sub build_authorized_values_list { + my ( $tag, $subfield, $value, $dbh, $authorised_values_sth,$index_tag,$index_subfield ) = @_; + + my @authorised_values; + my %authorised_lib; + + # builds list, depending on authorised value... + + #---- branch + if ( $tagslib->{$tag}->{$subfield}->{'authorised_value'} eq "branches" ) { + my $libraries = Koha::Libraries->search_filtered({}, {order_by => ['branchname']}); + while ( my $l = $libraries->next ) { + push @authorised_values, $l->branchcode; + $authorised_lib{$l->branchcode} = $l->branchname; + } + } + elsif ( $tagslib->{$tag}->{$subfield}->{authorised_value} eq "LOC" ) { + push @authorised_values, "" + unless ( $tagslib->{$tag}->{$subfield}->{mandatory} + && ( $value || $tagslib->{$tag}->{$subfield}->{defaultvalue} ) ); + + + my $branch_limit = C4::Context->userenv ? C4::Context->userenv->{"branch"} : ""; + my $avs = Koha::AuthorisedValues->search( + { + branchcode => $branch_limit, + category => $tagslib->{$tag}->{$subfield}->{authorised_value}, + }, + { + order_by => [ 'category', 'lib', 'lib_opac' ], + } + ); + + while ( my $av = $avs->next ) { + push @authorised_values, $av->authorised_value; + $authorised_lib{$av->authorised_value} = $av->lib; + } + } + elsif ( $tagslib->{$tag}->{$subfield}->{authorised_value} eq "cn_source" ) { + push @authorised_values, "" + unless ( $tagslib->{$tag}->{$subfield}->{mandatory} ); + + my $class_sources = GetClassSources(); + + my $default_source = C4::Context->preference("DefaultClassificationSource"); + + foreach my $class_source (sort keys %$class_sources) { + next unless $class_sources->{$class_source}->{'used'} or + ($value and $class_source eq $value) or + ($class_source eq $default_source); + push @authorised_values, $class_source; + $authorised_lib{$class_source} = $class_sources->{$class_source}->{'description'}; + } + $value = $default_source unless $value; + } + else { + my $branch_limit = C4::Context->userenv ? C4::Context->userenv->{"branch"} : ""; + $authorised_values_sth->execute( + $tagslib->{$tag}->{$subfield}->{authorised_value}, + $branch_limit ? $branch_limit : (), + ); + + push @authorised_values, "" + unless ( $tagslib->{$tag}->{$subfield}->{mandatory} + && ( $value || $tagslib->{$tag}->{$subfield}->{defaultvalue} ) ); + + while ( my ( $value, $lib ) = $authorised_values_sth->fetchrow_array ) { + push @authorised_values, $value; + $authorised_lib{$value} = $lib; + } + } + $authorised_values_sth->finish; + return { + type => 'select', + id => "tag_".$tag."_subfield_".$subfield."_".$index_tag."_".$index_subfield, + name => "tag_".$tag."_subfield_".$subfield."_".$index_tag."_".$index_subfield, + default => $value, + values => \@authorised_values, + labels => \%authorised_lib, + }; + +} + +=head2 CreateKey + + Create a random value to set it into the input name + +=cut + +sub CreateKey { + return int(rand(1000000)); +} + +=head2 create_input + + builds the entry for a subfield. + +=cut + +sub create_input { + my ( $tag, $subfield, $value, $index_tag, $tabloop, $rec, $authorised_values_sth,$cgi ) = @_; + + my $index_subfield = CreateKey(); # create a specific key for each subfield + + $value =~ s/"/"/g; + + # if there is no value provided but a default value in parameters, get it + if ( $value eq '' ) { + $value = $tagslib->{$tag}->{$subfield}->{defaultvalue}; + + # get today date & replace <>, <>, <
> if provided in the default value + my $today_dt = dt_from_string; + my $year = $today_dt->strftime('%Y'); + my $month = $today_dt->strftime('%m'); + my $day = $today_dt->strftime('%d'); + $value =~ s/<>/$year/g; + $value =~ s/<>/$month/g; + $value =~ s/<
>/$day/g; + # And <> with surname (?) + my $username=(C4::Context->userenv?C4::Context->userenv->{'surname'}:"superlibrarian"); + $value=~s/<>/$username/g; + + } + my $dbh = C4::Context->dbh; + + # map '@' as "subfield" label for fixed fields + # to something that's allowed in a div id. + my $id_subfield = $subfield; + $id_subfield = "00" if $id_subfield eq "@"; + + my %subfield_data = ( + tag => $tag, + subfield => $id_subfield, + marc_lib => $tagslib->{$tag}->{$subfield}->{lib}, + tag_mandatory => $tagslib->{$tag}->{mandatory}, + mandatory => $tagslib->{$tag}->{$subfield}->{mandatory}, + repeatable => $tagslib->{$tag}->{$subfield}->{repeatable}, + kohafield => $tagslib->{$tag}->{$subfield}->{kohafield}, + index => $index_tag, + id => "tag_".$tag."_subfield_".$id_subfield."_".$index_tag."_".$index_subfield, + value => $value, + maxlength => $tagslib->{$tag}->{$subfield}->{maxlength}, + random => CreateKey(), + ); + + if(exists $mandatory_z3950->{$tag.$subfield}){ + $subfield_data{z3950_mandatory} = $mandatory_z3950->{$tag.$subfield}; + } + # Subfield is hidden depending of hidden and mandatory flag, and is always + # shown if it contains anything or if its field is mandatory. + my $tdef = $tagslib->{$tag}; + $subfield_data{visibility} = "display:none;" + if $tdef->{$subfield}->{hidden} % 2 == 1 && + $value eq '' && + !$tdef->{$subfield}->{mandatory} && + !$tdef->{mandatory}; + # expand all subfields of 773 if there is a host item provided in the input + $subfield_data{visibility} ="" if ($tag eq 773 and $cgi->param('hostitemnumber')); + + + # it's an authorised field + if ( $tagslib->{$tag}->{$subfield}->{authorised_value} ) { + $subfield_data{marc_value} = + build_authorized_values_list( $tag, $subfield, $value, $dbh, + $authorised_values_sth,$index_tag,$index_subfield ); + + # it's a subfield $9 linking to an authority record - see bug 2206 + } + elsif ($subfield eq "9" and + exists($tagslib->{$tag}->{'a'}->{authtypecode}) and + defined($tagslib->{$tag}->{'a'}->{authtypecode}) and + $tagslib->{$tag}->{'a'}->{authtypecode} ne '') { + + $subfield_data{marc_value} = { + type => 'text', + id => $subfield_data{id}, + name => $subfield_data{id}, + value => $value, + size => 5, + maxlength => $subfield_data{maxlength}, + readonly => 1, + }; + + # it's a thesaurus / authority field + } + elsif ( $tagslib->{$tag}->{$subfield}->{authtypecode} ) { + # when authorities auto-creation is allowed, do not set readonly + my $is_readonly = !C4::Context->preference("BiblioAddsAuthorities"); + + $subfield_data{marc_value} = { + type => 'text', + id => $subfield_data{id}, + name => $subfield_data{id}, + value => $value, + size => 67, + maxlength => $subfield_data{maxlength}, + readonly => ($is_readonly) ? 1 : 0, + authtype => $tagslib->{$tag}->{$subfield}->{authtypecode}, + }; + + # it's a plugin field + } elsif ( $tagslib->{$tag}->{$subfield}->{'value_builder'} ) { + require Koha::FrameworkPlugin; + my $plugin = Koha::FrameworkPlugin->new( { + name => $tagslib->{$tag}->{$subfield}->{'value_builder'}, + }); + my $pars= { dbh => $dbh, record => $rec, tagslib => $tagslib, + id => $subfield_data{id}, tabloop => $tabloop }; + $plugin->build( $pars ); + if( !$plugin->errstr ) { + $subfield_data{marc_value} = { + type => 'text_complex', + id => $subfield_data{id}, + name => $subfield_data{id}, + value => $value, + size => 67, + maxlength => $subfield_data{maxlength}, + javascript => $plugin->javascript, + noclick => $plugin->noclick, + }; + } else { + warn $plugin->errstr; + # supply default input form + $subfield_data{marc_value} = { + type => 'text', + id => $subfield_data{id}, + name => $subfield_data{id}, + value => $value, + size => 67, + maxlength => $subfield_data{maxlength}, + readonly => 0, + }; + } + + # it's an hidden field + } elsif ( $tag eq '' ) { + $subfield_data{marc_value} = { + type => 'hidden', + id => $subfield_data{id}, + name => $subfield_data{id}, + value => $value, + size => 67, + maxlength => $subfield_data{maxlength}, + }; + + } + else { + # it's a standard field + if ( + length($value) > 100 + or + ( C4::Context->preference("marcflavour") eq "UNIMARC" && $tag >= 300 + and $tag < 400 && $subfield eq 'a' ) + or ( $tag >= 500 + and $tag < 600 + && C4::Context->preference("marcflavour") eq "MARC21" ) + ) + { + $subfield_data{marc_value} = { + type => 'textarea', + id => $subfield_data{id}, + name => $subfield_data{id}, + value => $value, + }; + + } + else { + $subfield_data{marc_value} = { + type => 'text', + id => $subfield_data{id}, + name => $subfield_data{id}, + value => $value, + size => 67, + maxlength => $subfield_data{maxlength}, + readonly => 0, + }; + + } + } + $subfield_data{'index_subfield'} = $index_subfield; + return \%subfield_data; +} + + +=head2 format_indicator + +Translate indicator value for output form - specifically, map +indicator = ' ' to ''. This is for the convenience of a cataloger +using a mouse to select an indicator input. + +=cut + +sub format_indicator { + my $ind_value = shift; + return '' if not defined $ind_value; + return '' if $ind_value eq ' '; + return $ind_value; +} + +sub build_tabs { + my ( $template, $record, $dbh, $encoding,$input ) = @_; + + # fill arrays + my @loop_data = (); + my $tag; + + my $branch_limit = C4::Context->userenv ? C4::Context->userenv->{"branch"} : ""; + my $query = "SELECT authorised_value, lib + FROM authorised_values"; + $query .= qq{ LEFT JOIN authorised_values_branches ON ( id = av_id )} if $branch_limit; + $query .= " WHERE category = ?"; + $query .= " AND ( branchcode = ? OR branchcode IS NULL )" if $branch_limit; + $query .= " GROUP BY lib ORDER BY lib, lib_opac"; + my $authorised_values_sth = $dbh->prepare( $query ); + + # in this array, we will push all the 10 tabs + # to avoid having 10 tabs in the template : they will all be in the same BIG_LOOP + my @BIG_LOOP; + my %seen; + my @tab_data; # all tags to display + + foreach my $used ( @$usedTagsLib ){ + push @tab_data,$used->{tagfield} if not $seen{$used->{tagfield}}; + $seen{$used->{tagfield}}++; + } + + my $max_num_tab=-1; + foreach(@$usedTagsLib){ + if($_->{tab} > -1 && $_->{tab} >= $max_num_tab && $_->{tagfield} != '995'){ # FIXME : MARC21 ? + $max_num_tab = $_->{tab}; + } + } + if($max_num_tab >= 9){ + $max_num_tab = 9; + } + # loop through each tab 0 through 9 + for ( my $tabloop = 0 ; $tabloop <= $max_num_tab ; $tabloop++ ) { + my @loop_data = (); #innerloop in the template. + my $i = 0; + foreach my $tag (@tab_data) { + $i++; + next if ! $tag; + my ($indicator1, $indicator2); + my $index_tag = CreateKey; + + # if MARC::Record is not empty =>use it as master loop, then add missing subfields that should be in the tab. + # if MARC::Record is empty => use tab as master loop. + if ( $record ne -1 && ( $record->field($tag) || $tag eq '000' ) ) { + my @fields; + if ( $tag ne '000' ) { + @fields = $record->field($tag); + } + else { + push @fields, $record->leader(); # if tag == 000 + } + # loop through each field + foreach my $field (@fields) { + + my @subfields_data; + if ( $tag < 10 ) { + my ( $value, $subfield ); + if ( $tag ne '000' ) { + $value = $field->data(); + $subfield = "@"; + } + else { + $value = $field; + $subfield = '@'; + } + next if ( $tagslib->{$tag}->{$subfield}->{tab} ne $tabloop ); + next + if ( $tagslib->{$tag}->{$subfield}->{kohafield} eq + 'biblio.biblionumber' ); + push( + @subfields_data, + &create_input( + $tag, $subfield, $value, $index_tag, $tabloop, $record, + $authorised_values_sth,$input + ) + ); + } + else { + my @subfields = $field->subfields(); + foreach my $subfieldcount ( 0 .. $#subfields ) { + my $subfield = $subfields[$subfieldcount][0]; + my $value = $subfields[$subfieldcount][1]; + next if ( length $subfield != 1 ); + next if ( $tagslib->{$tag}->{$subfield}->{tab} ne $tabloop ); + push( + @subfields_data, + &create_input( + $tag, $subfield, $value, $index_tag, $tabloop, + $record, $authorised_values_sth,$input + ) + ); + } + } + + # now, loop again to add parameter subfield that are not in the MARC::Record + foreach my $subfield ( sort( keys %{ $tagslib->{$tag} } ) ) + { + next if ( length $subfield != 1 ); + next if ( $tagslib->{$tag}->{$subfield}->{tab} ne $tabloop ); + next if ( $tag < 10 ); + next + if ( ( $tagslib->{$tag}->{$subfield}->{hidden} <= -4 ) + or ( $tagslib->{$tag}->{$subfield}->{hidden} >= 5 ) ) + and not ( $subfield eq "9" and + exists($tagslib->{$tag}->{'a'}->{authtypecode}) and + defined($tagslib->{$tag}->{'a'}->{authtypecode}) and + $tagslib->{$tag}->{'a'}->{authtypecode} ne "" + ) + ; #check for visibility flag + # if subfield is $9 in a field whose $a is authority-controlled, + # always include in the form regardless of the hidden setting - bug 2206 + next if ( defined( $field->subfield($subfield) ) ); + push( + @subfields_data, + &create_input( + $tag, $subfield, '', $index_tag, $tabloop, $record, + $authorised_values_sth,$input + ) + ); + } + if ( $#subfields_data >= 0 ) { + # build the tag entry. + # note that the random() field is mandatory. Otherwise, on repeated fields, you'll + # have twice the same "name" value, and cgi->param() will return only one, making + # all subfields to be merged in a single field. + my %tag_data = ( + tag => $tag, + index => $index_tag, + tag_lib => $tagslib->{$tag}->{lib}, + repeatable => $tagslib->{$tag}->{repeatable}, + mandatory => $tagslib->{$tag}->{mandatory}, + subfield_loop => \@subfields_data, + fixedfield => $tag < 10?1:0, + random => CreateKey, + ); + if ($tag >= 10){ # no indicator for 00x tags + $tag_data{indicator1} = format_indicator($field->indicator(1)), + $tag_data{indicator2} = format_indicator($field->indicator(2)), + } + push( @loop_data, \%tag_data ); + } + } # foreach $field end + + # if breeding is empty + } + else { + my @subfields_data; + foreach my $subfield ( sort( keys %{ $tagslib->{$tag} } ) ) { + next if ( length $subfield != 1 ); + next + if ( ( $tagslib->{$tag}->{$subfield}->{hidden} <= -4 ) + or ( $tagslib->{$tag}->{$subfield}->{hidden} >= 5 ) ) + and not ( $subfield eq "9" and + exists($tagslib->{$tag}->{'a'}->{authtypecode}) and + defined($tagslib->{$tag}->{'a'}->{authtypecode}) and + $tagslib->{$tag}->{'a'}->{authtypecode} ne "" + ) + ; #check for visibility flag + # if subfield is $9 in a field whose $a is authority-controlled, + # always include in the form regardless of the hidden setting - bug 2206 + next + if ( $tagslib->{$tag}->{$subfield}->{tab} ne $tabloop ); + push( + @subfields_data, + &create_input( + $tag, $subfield, '', $index_tag, $tabloop, $record, + $authorised_values_sth,$input + ) + ); + } + if ( $#subfields_data >= 0 ) { + my %tag_data = ( + tag => $tag, + index => $index_tag, + tag_lib => $tagslib->{$tag}->{lib}, + repeatable => $tagslib->{$tag}->{repeatable}, + mandatory => $tagslib->{$tag}->{mandatory}, + indicator1 => $indicator1, + indicator2 => $indicator2, + subfield_loop => \@subfields_data, + tagfirstsubfield => $subfields_data[0], + fixedfield => $tag < 10?1:0, + ); + + push @loop_data, \%tag_data ; + } + } + } + if ( $#loop_data >= 0 ) { + push @BIG_LOOP, { + number => $tabloop, + innerloop => \@loop_data, + }; + } + } + $authorised_values_sth->finish; + $template->param( BIG_LOOP => \@BIG_LOOP ); +} + +# ======================== +# MAIN +#========================= +my $input = new CGI; +my $error = $input->param('error'); +my $biblionumber = $input->param('biblionumber'); +my $holding_id = $input->param('holding_id'); # if holding_id exists, it's a modif, not a new holding. +my $op = $input->param('op'); +my $mode = $input->param('mode'); +my $frameworkcode = $input->param('frameworkcode'); +my $redirect = $input->param('redirect'); +my $searchid = $input->param('searchid'); +my $dbh = C4::Context->dbh; + +my $userflags = 'edit_items'; + +my $changed_framework = $input->param('changed_framework'); +$frameworkcode = &C4::Holdings::GetHoldingFrameworkCode($holding_id) + if ( $holding_id and not( defined $frameworkcode) and $op ne 'add' ); + +$frameworkcode = C4::Context->preference('DefaultSummaryHoldingsFrameworkCode') || 'HLD' if ( !$frameworkcode || $frameworkcode eq 'Default' ); +my ( $template, $loggedinuser, $cookie ) = get_template_and_user( + { + template_name => "cataloguing/addholding.tt", + query => $input, + type => "intranet", + authnotrequired => 0, + flagsrequired => { editcatalogue => $userflags }, + } +); + +# TODO: support in advanced editor? +#if ( $op ne "delete" && C4::Context->preference('EnableAdvancedCatalogingEditor') && $input->cookie( 'catalogue_editor_' . $loggedinuser ) eq 'advanced' ) { +# print $input->redirect( '/cgi-bin/koha/cataloguing/editor.pl#catalog/' . $biblionumber . '/holdings/' . ( $holding_id ? $holding_id : '' ) ); +# exit; +#} + +my $frameworks = Koha::BiblioFrameworks->search({frameworktype => 'hld'}, { order_by => ['frameworktext'] }); +$template->param( + frameworks => $frameworks +); + +# ++ Global +$tagslib = &GetMarcStructure( 1, $frameworkcode ); +$usedTagsLib = &GetUsedMarcStructure( $frameworkcode ); +# -- Global + +my $record = -1; +my $encoding = ""; + +if ($holding_id){ + $record = C4::Holdings::GetMarcHolding($holding_id); +} + +$is_a_modif = 0; + +if ($holding_id) { + $is_a_modif = 1; + +} +my ( $biblionumbertagfield, $biblionumbertagsubfield ) = + &GetMarcFromKohaField( "biblio.biblionumber", $frameworkcode ); + +#------------------------------------------------------------------------------------- +if ( $op eq "add" ) { +#------------------------------------------------------------------------------------- + $template->param( + biblionumberdata => $biblionumber, + ); + # getting html input + my @params = $input->multi_param(); + $record = TransformHtmlToMarc( $input, 1 ); + if ( $is_a_modif ) { + ModHolding( $record, $holding_id, $frameworkcode ); + } + else { + $holding_id = AddHolding( $record, $frameworkcode, $biblionumber ); + } + if ($redirect eq "items" || ($mode ne "popup" && !$is_a_modif && $redirect ne "view" && $redirect ne "just_save")){ + print $input->redirect("/cgi-bin/koha/catalogue/detail.pl?biblionumber=$biblionumber&searchid=$searchid"); + exit; + } + elsif(($is_a_modif || $redirect eq "view") && $redirect ne "just_save"){ + print $input->redirect("/cgi-bin/koha/catalogue/detail.pl?biblionumber=$biblionumber&searchid=$searchid"); + exit; + } + elsif ($redirect eq "just_save"){ + my $tab = $input->param('current_tab'); + print $input->redirect("/cgi-bin/koha/cataloguing/addholding.pl?biblionumber=$biblionumber&holding_id=$holding_id&framework=$frameworkcode&tab=$tab&searchid=$searchid"); + } + else { + $template->param( + biblionumber => $biblionumber, + holding_id => $holding_id, + done =>1, + popup =>1 + ); + $template->param( + popup => $mode, + itemtype => $frameworkcode, + ); + output_html_with_http_headers $input, $cookie, $template->output; + exit; + } +} +elsif ( $op eq "delete" ) { + + my $error = &DelHolding($holding_id); + if ($error) { + warn "ERROR when DELETING HOLDING $holding_id : $error"; + print "Content-Type: text/html\n\n

ERROR when DELETING HOLDING $holding_id : $error

"; + exit; + } + + print $input->redirect("/cgi-bin/koha/catalogue/detail.pl?biblionumber=$biblionumber&searchid=$searchid"); + exit; + +} else { + #---------------------------------------------------------------------------- + # If we're in a duplication case, we have to set to "" the holding_id + # as we'll save the holding as a new one. + $template->param( + holding_iddata => $holding_id, + op => $op, + ); + if ( $op eq "duplicate" ) { + $holding_id = ""; + } + + if($changed_framework eq "changed"){ + $record = TransformHtmlToMarc( $input, 1 ); + } + elsif( $record ne -1 ) { +#FIXME: it's kind of silly to go from MARC::Record to MARC::File::XML and then back again just to fix the encoding + eval { + my $uxml = $record->as_xml; + MARC::Record::default_record_format("UNIMARC") + if ( C4::Context->preference("marcflavour") eq "UNIMARC" ); + my $urecord = MARC::Record::new_from_xml( $uxml, 'UTF-8' ); + $record = $urecord; + }; + } + build_tabs( $template, $record, $dbh, $encoding,$input ); + $template->param( + holding_id => $holding_id, + biblionumber => $biblionumber, + biblionumbertagfield => $biblionumbertagfield, + biblionumbertagsubfield => $biblionumbertagsubfield, + ); +} + +$template->param( + popup => $mode, + frameworkcode => $frameworkcode, + itemtype => $frameworkcode, + borrowernumber => $loggedinuser, + tab => scalar $input->param('tab') +); +$template->{'VARS'}->{'searchid'} = $searchid; + +output_html_with_http_headers $input, $cookie, $template->output; diff --git a/cataloguing/additem.pl b/cataloguing/additem.pl index a6aa25c..d4184a5 100755 --- a/cataloguing/additem.pl +++ b/cataloguing/additem.pl @@ -31,6 +31,7 @@ use C4::Circulation; use C4::Koha; use C4::ClassSource; use Koha::DateUtils; +use Koha::Holdings; use Koha::Items; use Koha::ItemTypes; use Koha::Libraries; @@ -208,6 +209,16 @@ sub generate_subfield_form { #---- "true" authorised value } + elsif ( $subfieldlib->{authorised_value} eq "holdings" ) { + push @authorised_values, "" unless ( $subfieldlib->{mandatory} ); + my $holdings = Koha::Holdings->search({biblionumber => $biblionumber}, { order_by => ['holdingbranch'] })->unblessed; + for my $holding ( @$holdings ) { + push @authorised_values, $holding->{holding_id}; + $authorised_lib{$holding->{holding_id}} = $holding->{holding_id} . ' ' . $holding->{holdingbranch} . ' ' . $holding->{location} . ' ' . $holding->{callnumber}; + } + my $input = new CGI; + $value = $input->param('holding_id') unless ($value); + } else { push @authorised_values, qq{} unless ( $subfieldlib->{mandatory} ); my $av = GetAuthorisedValues( $subfieldlib->{authorised_value} ); diff --git a/cataloguing/value_builder/marc21_field_008_holdings.pl b/cataloguing/value_builder/marc21_field_008_holdings.pl new file mode 100755 index 0000000..9122c4b --- /dev/null +++ b/cataloguing/value_builder/marc21_field_008_holdings.pl @@ -0,0 +1,120 @@ +#!/usr/bin/perl + +# Copyright 2000-2002 Katipo Communications +# Copyright 2017 The University of Helsinki +# +# 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 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. +# +# You should have received a copy of the GNU General Public License +# along with Koha; if not, see . + +use Modern::Perl; +use C4::Auth; +use CGI qw ( -utf8 ); +use C4::Context; + +use C4::Search; +use C4::Output; + +use XML::LibXML; +use Koha::Util::FrameworkPlugin qw|date_entered|; + +my $builder = sub { + my ( $params ) = @_; + + my $lang = C4::Context->preference('DefaultLanguageField008' ); + $lang = "eng" unless $lang; + $lang = pack("A3", $lang); + + my $function_name = $params->{id}; + my $dateentered = date_entered(); + my $res = " + +"; + + return $res; +}; + +my $launcher = sub { + my ( $params ) = @_; + my $input = $params->{cgi}; + my $index= $input->param('index'); + my $result= $input->param('result'); + + my $lang = C4::Context->preference('DefaultLanguageField008' ); + $lang = "eng" unless $lang; + $lang = pack("A3", $lang); + + my ($template, $loggedinuser, $cookie) + = get_template_and_user({template_name => "cataloguing/value_builder/marc21_field_008_holdings.tt", + query => $input, + type => "intranet", + authnotrequired => 0, + flagsrequired => {editcatalogue => '*'}, + debug => 1, + }); + my $dateentered = date_entered(); + $result = $dateentered + '0u 0 0 uu' + $lang + '0' + $dateentered unless $result; + my @f; + for(0,6..8,12..17,20..22,25,26) { + my $len = 1; + if ($_ == 0 || $_ == 26) { + $len = 6; + } elsif ($_ == 8) { + $len = 4; + } elsif ($_ == 17 || $_ == 22) { + $len = 3; + } + warn ($_ . ': ' . $len); + $f[$_]=substr($result,$_,$len); + } + $template->param(index => $index); + + $f[0]= $dateentered if !$f[0] || $f[0]=~/\s/; + $template->param(f1 => $f[0]); + + for(6..8,12..17,20..22,25,26) { + $template->param( + "f$_" => $f[$_], + "f$_".($f[$_] eq '|'? 'pipe': $f[$_]) => $f[$_], + ); + } + output_html_with_http_headers $input, $cookie, $template->output; +}; + +return { builder => $builder, launcher => $launcher }; diff --git a/cataloguing/value_builder/marc21_leader_holdings.pl b/cataloguing/value_builder/marc21_leader_holdings.pl new file mode 100755 index 0000000..ecb9094 --- /dev/null +++ b/cataloguing/value_builder/marc21_leader_holdings.pl @@ -0,0 +1,85 @@ +#!/usr/bin/perl + +# Copyright 2000-2002 Katipo Communications +# Copyright 2017 The University of Helsinki +# +# 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 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. +# +# You should have received a copy of the GNU General Public License +# along with Koha; if not, see . + +use Modern::Perl; +use CGI qw ( -utf8 ); + +use C4::Auth; +use C4::Context; +use C4::Output; + +my $builder = sub { + my ( $params ) = @_; + my $function_name = $params->{id}; + my $res = " + +"; + + return $res; +}; + +my $launcher = sub { + my ( $params ) = @_; + my $input = $params->{cgi}; + my $index = $input->param('index'); + my $result = $input->param('result'); + + my $dbh = C4::Context->dbh; + + my ( $template, $loggedinuser, $cookie ) = get_template_and_user( + { template_name => "cataloguing/value_builder/marc21_leader_holdings.tt", + query => $input, + type => "intranet", + authnotrequired => 0, + flagsrequired => { editcatalogue => '*' }, + debug => 1, + } + ); + $result = " nu a22 ui 4500" unless $result; + my $f5 = substr( $result, 5, 1 ); + my $f6 = substr( $result, 6, 1 ); + my $f17 = substr( $result, 17, 1 ); + my $f18 = substr( $result, 18, 1 ); + $template->param( + index => $index, + "f5$f5" => 1, + "f6$f6" => 1, + "f17$f17" => 1, + "f18$f18" => 1, + ); + output_html_with_http_headers $input, $cookie, $template->output; +}; + +return { builder => $builder, launcher => $launcher }; diff --git a/installer/data/mysql/atomicupdate/bug_20447-add_holdings_tables.sql b/installer/data/mysql/atomicupdate/bug_20447-add_holdings_tables.sql new file mode 100644 index 0000000..9999e85 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_20447-add_holdings_tables.sql @@ -0,0 +1,400 @@ +-- +-- Table structure for table `holdings` +-- + +CREATE TABLE `holdings` ( -- table that stores summary holdings information + `holding_id` int(11) NOT NULL auto_increment, -- unique identifier assigned to each holdings record + `biblionumber` int(11) NOT NULL default 0, -- foreign key from biblio table used to link this record to the right bib record + `biblioitemnumber` int(11) NOT NULL default 0, -- foreign key from the biblioitems table to link record to additional information + `frameworkcode` varchar(4) NOT NULL default '', -- foreign key from the biblio_framework table to identify which framework was used in cataloging this record + `holdingbranch` varchar(10) default NULL, -- foreign key from the branches table for the library that owns this record (MARC21 852$a) + `location` varchar(80) default NULL, -- authorized value for the shelving location for this record (MARC21 852$b) + `callnumber` varchar(255) default NULL, -- call number (852$h+$i in MARC21) + `suppress` tinyint(1) default NULL, -- Boolean indicating whether the record is suppressed in OPAC + `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, -- date and time this record was last touched + `datecreated` DATE NOT NULL, -- the date this record was added to Koha + `deleted_at` DATETIME DEFAULT NULL, -- the date this record was deleted + PRIMARY KEY (`holding_id`), + KEY `hldnoidx` (`holding_id`), + KEY `hldbinoidx` (`biblioitemnumber`), + KEY `hldbibnoidx` (`biblionumber`), + CONSTRAINT `holdings_ibfk_1` FOREIGN KEY (`biblionumber`) REFERENCES `biblio` (`biblionumber`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `holdings_ibfk_2` FOREIGN KEY (`biblioitemnumber`) REFERENCES `biblioitems` (`biblioitemnumber`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `holdings_ibfk_3` FOREIGN KEY (`holdingbranch`) REFERENCES `branches` (`branchcode`) ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + +-- +-- Table structure for table `holdings_metadata` +-- + +CREATE TABLE holdings_metadata ( + `id` INT(11) NOT NULL AUTO_INCREMENT, + `holding_id` INT(11) NOT NULL, + `format` VARCHAR(16) NOT NULL, + `marcflavour` VARCHAR(16) NOT NULL, + `metadata` LONGTEXT NOT NULL, + `deleted_at` DATETIME DEFAULT NULL, -- the date this record was deleted + PRIMARY KEY(id), + UNIQUE KEY `holdings_metadata_uniq_key` (`holding_id`,`format`,`marcflavour`), + KEY `hldnoidx` (`holding_id`), + CONSTRAINT `holdings_metadata_fk_1` FOREIGN KEY (`holding_id`) REFERENCES `holdings` (`holding_id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + +-- +-- Add holding_id to items table +-- + +ALTER TABLE `items` ADD COLUMN `holding_id` int(11) default NULL; +ALTER TABLE `items` ADD CONSTRAINT `items_ibfk_5` FOREIGN KEY (`holding_id`) REFERENCES `holdings` (`holding_id`) ON DELETE CASCADE ON UPDATE CASCADE; +ALTER TABLE `items` ADD KEY `hldid_idx` (`holding_id`); + +-- +-- Add holding_id to deleteditems table +-- + +ALTER TABLE `deleteditems` ADD COLUMN `holding_id` int(11) default NULL; + +-- +-- Insert a new category to authorised_value_categories table +-- + +INSERT INTO authorised_value_categories( category_name ) VALUES ('holdings'); + + +-- +-- Insert 999e to the default framework +-- + +INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES + ('999', 'e', 'Koha holding_id', 'Koha holding_id', 0, 0, 'holdings.holding_id', -1, NULL, NULL, '', NULL, -5, '', '', '', NULL); + + +-- +-- Insert 952v to marc_subfield_structure table +-- + +INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES + ('952', 'V', 'Holding record', 'Holding record', 0, 0, 'items.holding_id', 10, 'holdings', '', '', NULL, 0, '', '', '', NULL); + +-- HOLDINGS RECORD FRAMEWORK + +ALTER TABLE `biblio_framework` ADD COLUMN `frameworktype` ENUM( 'bib', 'hld' ) NOT NULL DEFAULT 'bib'; + +INSERT IGNORE INTO `biblio_framework` (`frameworkcode`, `frameworktext`, `frameworktype`) VALUES ('HLD', 'Default holdings framework', 'hld'); +INSERT IGNORE INTO `marc_tag_structure` (`tagfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `authorised_value`, `frameworkcode`) VALUES + ('999', 'SYSTEM CONTROL NUMBERS (KOHA)', 'SYSTEM CONTROL NUMBERS (KOHA)', 1, 0, '', 'HLD'); + +INSERT IGNORE INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES + ('999', 'c', 'Koha biblionumber', 'Koha biblionumber', 0, 0, 'biblio.biblionumber', -1, NULL, NULL, '', NULL, -5, 'HLD', '', '', NULL), + ('999', 'd', 'Koha biblioitemnumber', 'Koha biblioitemnumber', 0, 0, 'biblioitems.biblioitemnumber', -1, NULL, NULL, '', NULL, -5, 'HLD', '', '', NULL), + ('999', 'e', 'Koha holding_id', 'Koha holding_id', 0, 0, 'holdings.holding_id', -1, NULL, NULL, '', NULL, -5, 'HLD', '', '', NULL); + + +INSERT IGNORE INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES + ('942', 'n', 'Suppress in OPAC', 'Suppress in OPAC', 0, 0, 'holdings.suppress', 9, '', '', '', 0, 0, 'HLD', '', '', NULL); + +INSERT IGNORE INTO `marc_tag_structure` (`tagfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `authorised_value`, `frameworkcode`) VALUES + ('000', 'LEADER', 'LEADER', 0, 1, '', 'HLD'), + ('001', 'CONTROL NUMBER', 'CONTROL NUMBER', 0, 0, '', 'HLD'), + ('003', 'CONTROL NUMBER IDENTIFIER', 'CONTROL NUMBER IDENTIFIER', 0, 1, '', 'HLD'), + ('005', 'DATE AND TIME OF LATEST TRANSACTION', 'DATE AND TIME OF LATEST TRANSACTION', 0, 1, '', 'HLD'), + ('006', 'FIXED-LENGTH DATA ELEMENTS--ADDITIONAL MATERIAL CHARACTERISTICS', 'FIXED-LENGTH DATA ELEMENTS--ADDITIONAL MATERIAL CHARACTERISTICS', 1, 0, '', 'HLD'), + ('007', 'PHYSICAL DESCRIPTION FIXED FIELD--GENERAL INFORMATION', 'PHYSICAL DESCRIPTION FIXED FIELD--GENERAL INFORMATION', 1, 0, '', 'HLD'), + ('008', 'FIXED-LENGTH DATA ELEMENTS--GENERAL INFORMATION', 'FIXED-LENGTH DATA ELEMENTS--GENERAL INFORMATION', 0, 1, '', 'HLD'); + +INSERT IGNORE INTO `marc_tag_structure` (`tagfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `authorised_value`, `frameworkcode`) VALUES + ('850', 'HOLDING INSTITUTION', 'HOLDING INSTITUTION', 1, 0, NULL, 'HLD'), + ('852', 'LOCATION', 'LOCATION', 1, 0, NULL, 'HLD'), + ('853', 'CAPTIONS AND PATTERN--BASIC BIBLIOGRAPHIC UNIT', 'CAPTIONS AND PATTERN--BASIC BIBLIOGRAPHIC UNIT', 1, 0, NULL, 'HLD'), + ('854', 'CAPTIONS AND PATTERN--SUPPLEMENTARY MATERIAL', 'CAPTIONS AND PATTERN--SUPPLEMENTARY MATERIAL', 1, 0, NULL, 'HLD'), + ('855', 'CAPTIONS AND PATTERN--INDEXES', 'CAPTIONS AND PATTERN--INDEXES', 1, 0, NULL, 'HLD'), + ('856', 'ELECTRONIC LOCATION AND ACCESS', 'ELECTRONIC LOCATION AND ACCESS', 1, 0, NULL, 'HLD'), + ('863', 'ENUMERATION AND CHRONOLOGY--BASIC BIBLIOGRAPHIC UNIT', 'ENUMERATION AND CHRONOLOGY--BASIC BIBLIOGRAPHIC UNIT', 1, 0, NULL, 'HLD'), + ('864', 'ENUMERATION AND CHRONOLOGY--SUPPLEMENTARY MATERIAL', 'ENUMERATION AND CHRONOLOGY--SUPPLEMENTARY MATERIAL', 1, 0, NULL, 'HLD'), + ('865', 'ENUMERATION AND CHRONOLOGY--INDEXES', 'ENUMERATION AND CHRONOLOGY--INDEXES', 1, 0, NULL, 'HLD'), + ('866', 'TEXTUAL HOLDINGS--BASIC BIBLIOGRAPHIC UNIT', 'TEXTUAL HOLDINGS--BASIC BIBLIOGRAPHIC UNIT', 1, 0, NULL, 'HLD'), + ('867', 'TEXTUAL HOLDINGS--SUPPLEMENTARY MATERIAL', 'TEXTUAL HOLDINGS--SUPPLEMENTARY MATERIAL', 1, 0, NULL, 'HLD'), + ('868', 'TEXTUAL HOLDINGS--INDEXES', 'TEXTUAL HOLDINGS--INDEXES', 1, 0, NULL, 'HLD'), + ('876', 'ITEM INFORMATION--BASIC BIBLIOGRAPHIC UNIT', 'ITEM INFORMATION--BASIC BIBLIOGRAPHIC UNIT', 1, 0, NULL, 'HLD'), + ('877', 'ITEM INFORMATION--SUPPLEMENTARY MATERIAL', 'ITEM INFORMATION--SUPPLEMENTARY MATERIAL', 1, 0, NULL, 'HLD'), + ('878', 'ITEM INFORMATION--INDEXES', 'ITEM INFORMATION--INDEXES', 1, 0, NULL, 'HLD'); + +INSERT IGNORE INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES + ('000', '@', 'fixed length control field', 'fixed length control field', 0, 1, '', 0, '', '', 'marc21_leader_holdings.pl', 0, 0, 'HLD', '', '', NULL), + ('001', '@', 'control field', 'control field', 0, 0, '', 0, '', '', '', 0, 0, 'HLD', '', '', NULL), + ('003', '@', 'control field', 'control field', 0, 1, '', 0, '', '', 'marc21_orgcode.pl', 0, 0, 'HLD', '', '', NULL), + ('005', '@', 'control field', 'control field', 0, 1, '', 0, '', '', 'marc21_field_005.pl', 0, 0, 'HLD', '', '', NULL), + ('006', '@', 'fixed length control field', 'fixed length control field', 0, 0, '', 0, '', '', 'marc21_field_006.pl', 0, -1, 'HLD', '', '', NULL), + ('007', '@', 'fixed length control field', 'fixed length control field', 0, 0, '', 0, '', '', 'marc21_field_007.pl', 0, 0, 'HLD', '', '', NULL), + ('008', '@', 'fixed length control field', 'fixed length control field', 0, 1, '', 0, '', '', 'marc21_field_008_holdings.pl', 0, 0, 'HLD', '', '', NULL), + ('850', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, NULL, 8, NULL, NULL, '', NULL, 4, 'HLD', '', '', NULL), + ('850', 'a', 'Holding institution', 'Holding institution', 1, 0, NULL, 8, NULL, NULL, '', NULL, 4, 'HLD', '', '', NULL), + ('850', 'b', 'Holdings (NR) (MU VM SE) [OBSOLETE]', 'Holdings (NR) (MU VM SE) [OBSOLETE]', 0, 0, NULL, 8, NULL, NULL, '', NULL, 4, 'HLD', '', '', NULL), + ('850', 'd', 'Inclusive dates (NR) (MU VM SE) [OBSOLETE]', 'Inclusive dates (NR) (MU VM SE) [OBSOLETE]', 0, 0, NULL, 8, NULL, NULL, '', NULL, 4, 'HLD', '', '', NULL), + ('850', 'e', 'Retention statement (NR) (CF MU VM SE) [OBSOLETE]', 'Retention statement (NR) (CF MU VM SE) [OBSOLETE]', 0, 0, NULL, 8, NULL, NULL, '', NULL, 4, 'HLD', '', '', NULL), + ('852', '2', 'Source of classification or shelving scheme', 'Source of classification or shelving scheme', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('852', '3', 'Materials specified', 'Materials specified', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('852', '6', 'Linkage', 'Linkage', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('852', '8', 'Sequence number', 'Sequence number', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('852', 'a', 'Location', 'Location', 0, 0, 'holdings.holdingbranch', 8, 'branches', '', '', NULL, 4, 'HLD', '', '', NULL), + ('852', 'b', 'Sublocation or collection', 'Sublocation or collection', 1, 0, 'holdings.location', 8, 'LOC', '', '', NULL, 4, 'HLD', '', '', NULL), + ('852', 'c', 'Shelving location', 'Shelving location', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('852', 'd', 'Former shelving location', 'Former shelving location', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('852', 'e', 'Address', 'Address', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('852', 'f', 'Coded location qualifier', 'Coded location qualifier', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('852', 'g', 'Non-coded location qualifier', 'Non-coded location qualifier', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('852', 'h', 'Classification part', 'Classification part', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('852', 'i', 'Item part', 'Item part', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('852', 'j', 'Shelving control number', 'Shelving control number', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('852', 'k', 'Call number prefix', 'Call number prefix', 1, 0, 'holdings.callnumber', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('852', 'l', 'Shelving form of title', 'Shelving form of title', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('852', 'm', 'Call number suffix', 'Call number suffix', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('852', 'n', 'Country code', 'Country code', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('852', 'p', 'Piece designation', 'Piece designation', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('852', 'q', 'Piece physical condition', 'Piece physical condition', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('852', 's', 'Copyright article-fee code', 'Copyright article-fee code', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('852', 't', 'Copy number', 'Copy number', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('852', 'u', 'Uniform Resource Identifier', 'Uniform Resource Identifier', 1, 0, '', 8, '', '', '', 1, 4, 'HLD', '', '', NULL), + ('852', 'x', 'Nonpublic note', 'Nonpublic note', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('852', 'z', 'Public note', 'Public note', 1, 0, 'holdings.public_note', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('853', '3', 'Materials specified', 'Materials specified', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('853', '6', 'Linkage', 'Linkage', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('853', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('853', 'a', 'First level of enumeration', 'First level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('853', 'b', 'Second level of enumeration', 'Second level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('853', 'c', 'Third level of enumeration', 'Third level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('853', 'd', 'Fourth level of enumeration', 'Fourth level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('853', 'e', 'Fifth level of enumeration', 'Fifth level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('853', 'f', 'Sixth level of enumeration', 'Sixth level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('853', 'g', 'Alternative numbering scheme, first level of enumeration', 'Alternative numbering scheme, first level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('853', 'h', 'Alternative numbering scheme, second level of enumeration', 'Alternative numbering scheme, second level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('853', 'i', 'First level of chronology', 'First level of chronology', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('853', 'j', 'Second level of chronology', 'Second level of chronology', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('853', 'k', 'Third level of chronology', 'Third level of chronology', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('853', 'l', 'Fourth level of chronology', 'Fourth level of chronology', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('853', 'm', 'Alternative numbering scheme, chronology', 'Alternative numbering scheme, chronology', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('853', 'n', 'Pattern note', 'Pattern note', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('853', 'p', 'Number of pieces per issuance', 'Number of pieces per issuance', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('853', 't', 'Copy', 'Copy', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('853', 'u', 'Bibliographic units per next higher level', 'Bibliographic units per next higher level', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('853', 'v', 'Numbering continuity', 'Numbering continuity', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('853', 'w', 'Frequency', 'Frequency', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('853', 'x', 'Calendar change', 'Calendar change', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('853', 'y', 'Regularity pattern', 'Regularity pattern', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('853', 'z', 'Numbering scheme', 'Numbering scheme', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('854', '3', 'Materials specified', 'Materials specified', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('854', '6', 'Linkage', 'Linkage', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('854', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('854', 'a', 'First level of enumeration', 'First level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('854', 'b', 'Second level of enumeration', 'Second level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('854', 'c', 'Third level of enumeration', 'Third level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('854', 'd', 'Fourth level of enumeration', 'Fourth level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('854', 'e', 'Fifth level of enumeration', 'Fifth level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('854', 'f', 'Sixth level of enumeration', 'Sixth level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('854', 'g', 'Alternative numbering scheme, first level of enumeration', 'Alternative numbering scheme, first level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('854', 'h', 'Alternative numbering scheme, second level of enumeration', 'Alternative numbering scheme, second level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('854', 'i', 'First level of chronology', 'First level of chronology', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('854', 'j', 'Second level of chronology', 'Second level of chronology', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('854', 'k', 'Third level of chronology', 'Third level of chronology', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('854', 'l', 'Fourth level of chronology', 'Fourth level of chronology', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('854', 'm', 'Alternative numbering scheme, chronology', 'Alternative numbering scheme, chronology', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('854', 'n', 'Pattern note', 'Pattern note', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('854', 'p', 'Number of pieces per issuance', 'Number of pieces per issuance', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('854', 't', 'Copy', 'Copy', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('854', 'u', 'Bibliographic units per next higher level', 'Bibliographic units per next higher level', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('854', 'v', 'Numbering continuity', 'Numbering continuity', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('854', 'w', 'Frequency', 'Frequency', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('854', 'x', 'Calendar change', 'Calendar change', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('854', 'y', 'Regularity pattern', 'Regularity pattern', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('854', 'z', 'Numbering scheme', 'Numbering scheme', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('855', '3', 'Materials specified', 'Materials specified', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('855', '6', 'Linkage', 'Linkage', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('855', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('855', 'a', 'First level of enumeration', 'First level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('855', 'b', 'Second level of enumeration', 'Second level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('855', 'c', 'Third level of enumeration', 'Third level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('855', 'd', 'Fourth level of enumeration', 'Fourth level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('855', 'e', 'Fifth level of enumeration', 'Fifth level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('855', 'f', 'Sixth level of enumeration', 'Sixth level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('855', 'g', 'Alternative numbering scheme, first level of enumeration', 'Alternative numbering scheme, first level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('855', 'h', 'Alternative numbering scheme, second level of enumeration', 'Alternative numbering scheme, second level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('855', 'i', 'First level of chronology', 'First level of chronology', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('855', 'j', 'Second level of chronology', 'Second level of chronology', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('855', 'k', 'Third level of chronology', 'Third level of chronology', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('855', 'l', 'Fourth level of chronology', 'Fourth level of chronology', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('855', 'm', 'Alternative numbering scheme, chronology', 'Alternative numbering scheme, chronology', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('855', 'n', 'Pattern note', 'Pattern note', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('855', 'p', 'Number of pieces per issuance', 'Number of pieces per issuance', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('855', 't', 'Copy', 'Copy', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('855', 'u', 'Bibliographic units per next higher level', 'Bibliographic units per next higher level', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('855', 'v', 'Numbering continuity', 'Numbering continuity', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('855', 'w', 'Frequency', 'Frequency', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('855', 'x', 'Calendar change', 'Calendar change', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('855', 'y', 'Regularity pattern', 'Regularity pattern', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('855', 'z', 'Numbering scheme', 'Numbering scheme', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('856', '2', 'Access method', 'Access method', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('856', '3', 'Materials specified', 'Materials specified', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('856', '6', 'Linkage', 'Linkage', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('856', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('856', 'a', 'Host name', 'Host name', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('856', 'b', 'Access number', 'Access number', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('856', 'c', 'Compression information', 'Compression information', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('856', 'd', 'Path', 'Path', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('856', 'f', 'Electronic name', 'Electronic name', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('856', 'h', 'Processor of request', 'Processor of request', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('856', 'i', 'Instruction', 'Instruction', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('856', 'j', 'Bits per second', 'Bits per second', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('856', 'k', 'Password', 'Password', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('856', 'l', 'Logon', 'Logon', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('856', 'm', 'Contact for access assistance', 'Contact for access assistance', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('856', 'n', 'Name of location of host', 'Name of location of host', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('856', 'o', 'Operating system', 'Operating system', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('856', 'p', 'Port', 'Port', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('856', 'q', 'Electronic format type', 'Electronic format type', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('856', 'r', 'Settings', 'Settings', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('856', 's', 'File size', 'File size', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('856', 't', 'Terminal emulation', 'Terminal emulation', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('856', 'u', 'Uniform Resource Identifier', 'Uniform Resource Identifier', 1, 0, 'biblioitems.url', 8, '', '', '', 1, 4, 'HLD', '', '', NULL), + ('856', 'v', 'Hours access method available', 'Hours access method available', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('856', 'w', 'Record control number', 'Record control number', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('856', 'x', 'Nonpublic note', 'Nonpublic note', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('856', 'y', 'Link text', 'Link text', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('856', 'z', 'Public note', 'Public note', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('863', '6', 'Linkage', 'Linkage', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('863', '8', 'Field link and sequence number', 'Field link and sequence number', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('863', 'a', 'First level of enumeration', 'First level of enumeration', 0, 0, 'holdings.summary', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('863', 'b', 'Second level of enumeration', 'Second level of enumeration', 0, 0, 'holdings.summary', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('863', 'c', 'Third level of enumeration', 'Third level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('863', 'd', 'Fourth level of enumeration', 'Fourth level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('863', 'e', 'Fifth level of enumeration', 'Fifth level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('863', 'f', 'Sixth level of enumeration', 'Sixth level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('863', 'g', 'Alternative numbering scheme, first level of enumeration', 'Alternative numbering scheme, first level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('863', 'h', 'Alternative numbering scheme, second level of enumeration', 'Alternative numbering scheme, second level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('863', 'i', 'First level of chronology', 'First level of chronology', 0, 0, 'holdings.summary', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('863', 'j', 'Second level of chronology', 'Second level of chronology', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('863', 'k', 'Third level of chronology', 'Third level of chronology', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('863', 'l', 'Fourth level of chronology', 'Fourth level of chronology', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('863', 'm', 'Alternative numbering scheme, chronology', 'Alternative numbering scheme, chronology', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('863', 'n', 'Converted Gregorian year', 'Converted Gregorian year', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('863', 'o', 'Type of unit', 'Type of unit', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('863', 'p', 'Piece designation', 'Piece designation', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('863', 'q', 'Piece physical condition', 'Piece physical condition', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('863', 's', 'Copyright article-fee code', 'Copyright article-fee code', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('863', 't', 'Copy number', 'Copy number', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('863', 'v', 'Issuing date', 'Issuing date', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('863', 'w', 'Break indicator', 'Break indicator', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('863', 'x', 'Nonpublic note', 'Nonpublic note', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('863', 'z', 'Public note', 'Public note', 1, 0, 'holdings.summary', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('864', '6', 'Linkage', 'Linkage', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('864', '8', 'Field link and sequence number', 'Field link and sequence number', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('864', 'a', 'First level of enumeration', 'First level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('864', 'b', 'Second level of enumeration', 'Second level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('864', 'c', 'Third level of enumeration', 'Third level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('864', 'd', 'Fourth level of enumeration', 'Fourth level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('864', 'e', 'Fifth level of enumeration', 'Fifth level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('864', 'f', 'Sixth level of enumeration', 'Sixth level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('864', 'g', 'Alternative numbering scheme, first level of enumeration', 'Alternative numbering scheme, first level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('864', 'h', 'Alternative numbering scheme, second level of enumeration', 'Alternative numbering scheme, second level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('864', 'i', 'First level of chronology', 'First level of chronology', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('864', 'j', 'Second level of chronology', 'Second level of chronology', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('864', 'k', 'Third level of chronology', 'Third level of chronology', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('864', 'l', 'Fourth level of chronology', 'Fourth level of chronology', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('864', 'm', 'Alternative numbering scheme, chronology', 'Alternative numbering scheme, chronology', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('864', 'n', 'Converted Gregorian year', 'Converted Gregorian year', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('864', 'o', 'Type of unit', 'Type of unit', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('864', 'p', 'Piece designation', 'Piece designation', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('864', 'q', 'Piece physical condition', 'Piece physical condition', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('864', 's', 'Copyright article-fee code', 'Copyright article-fee code', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('864', 't', 'Copy number', 'Copy number', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('864', 'v', 'Issuing date', 'Issuing date', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('864', 'w', 'Break indicator', 'Break indicator', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('864', 'x', 'Nonpublic note', 'Nonpublic note', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('864', 'z', 'Public note', 'Public note', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('865', '6', 'Linkage', 'Linkage', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('865', '8', 'Field link and sequence number', 'Field link and sequence number', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('865', 'a', 'First level of enumeration', 'First level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('865', 'b', 'Second level of enumeration', 'Second level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('865', 'c', 'Third level of enumeration', 'Third level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('865', 'd', 'Fourth level of enumeration', 'Fourth level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('865', 'e', 'Fifth level of enumeration', 'Fifth level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('865', 'f', 'Sixth level of enumeration', 'Sixth level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('865', 'g', 'Alternative numbering scheme, first level of enumeration', 'Alternative numbering scheme, first level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('865', 'h', 'Alternative numbering scheme, second level of enumeration', 'Alternative numbering scheme, second level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('865', 'i', 'First level of chronology', 'First level of chronology', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('865', 'j', 'Second level of chronology', 'Second level of chronology', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('865', 'k', 'Third level of chronology', 'Third level of chronology', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('865', 'l', 'Fourth level of chronology', 'Fourth level of chronology', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('865', 'm', 'Alternative numbering scheme, chronology', 'Alternative numbering scheme, chronology', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('865', 'n', 'Converted Gregorian year', 'Converted Gregorian year', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('865', 'o', 'Type of unit', 'Type of unit', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('865', 'p', 'Piece designation', 'Piece designation', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('865', 'q', 'Piece physical condition', 'Piece physical condition', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('865', 's', 'Copyright article-fee code', 'Copyright article-fee code', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('865', 't', 'Copy number', 'Copy number', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('865', 'v', 'Issuing date', 'Issuing date', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('865', 'w', 'Break indicator', 'Break indicator', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('865', 'x', 'Nonpublic note', 'Nonpublic note', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('865', 'z', 'Public note', 'Public note', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('866', '6', 'Linkage', 'Linkage', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('866', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('866', 'a', 'Textual string', 'Textual string', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('866', 'x', 'Nonpublic note', 'Nonpublic note', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('866', 'z', 'Public note', 'Public note', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('867', '6', 'Linkage', 'Linkage', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('867', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('867', 'a', 'Textual string', 'Textual string', 0, 0, 'holdings.supplements', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('867', 'x', 'Nonpublic note', 'Nonpublic note', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('867', 'z', 'Public note', 'Public note', 1, 0, 'holdings.supplements', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('868', '6', 'Linkage', 'Linkage', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('868', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('868', 'a', 'Textual string', 'Textual string', 0, 0, 'holdings.indexes', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('868', 'x', 'Nonpublic note', 'Nonpublic note', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('868', 'z', 'Public note', 'Public note', 1, 0, 'holdings.indexes', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('876', '3', 'Materials specified', 'Materials specified', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('876', '6', 'Linkage', 'Linkage', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('876', '8', 'Sequence number', 'Sequence number', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('876', 'a', 'Internal item number', 'Internal item number', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('876', 'b', 'Invalid or canceled internal item number', 'Invalid or canceled internal item number', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('876', 'c', 'Cost', 'Cost', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('876', 'd', 'Date acquired', 'Date acquired', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('876', 'e', 'Source of acquisition', 'Source of acquisition', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('876', 'h', 'Use restrictions', 'Use restrictions', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('876', 'j', 'Item status', 'Item status', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('876', 'l', 'Temporary location', 'Temporary location', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('876', 'p', 'Piece designation', 'Piece designation', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('876', 'r', 'Invalid or canceled piece designation', 'Invalid or canceled piece designation', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('876', 't', 'Copy number', 'Copy number', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('876', 'x', 'Nonpublic note', 'Nonpublic note', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('876', 'z', 'Public note', 'Public note', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('877', '3', 'Materials specified', 'Materials specified', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('877', '6', 'Linkage', 'Linkage', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('877', '8', 'Sequence number', 'Sequence number', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('877', 'a', 'Internal item number', 'Internal item number', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('877', 'b', 'Invalid or canceled internal item number', 'Invalid or canceled internal item number', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('877', 'c', 'Cost', 'Cost', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('877', 'd', 'Date acquired', 'Date acquired', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('877', 'e', 'Source of acquisition', 'Source of acquisition', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('877', 'h', 'Use restrictions', 'Use restrictions', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('877', 'j', 'Item status', 'Item status', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('877', 'l', 'Temporary location', 'Temporary location', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('877', 'p', 'Piece designation', 'Piece designation', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('877', 'r', 'Invalid or canceled piece designation', 'Invalid or canceled piece designation', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('877', 't', 'Copy number', 'Copy number', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('877', 'x', 'Nonpublic note', 'Nonpublic note', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('877', 'z', 'Public note', 'Public note', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('878', '3', 'Materials specified', 'Materials specified', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('878', '6', 'Linkage', 'Linkage', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('878', '8', 'Sequence number', 'Sequence number', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('878', 'a', 'Internal item number', 'Internal item number', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('878', 'b', 'Invalid or canceled internal item number', 'Invalid or canceled internal item number', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('878', 'c', 'Cost', 'Cost', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('878', 'd', 'Date acquired', 'Date acquired', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('878', 'e', 'Source of acquisition', 'Source of acquisition', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('878', 'h', 'Use restrictions', 'Use restrictions', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('878', 'j', 'Item status', 'Item status', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('878', 'l', 'Temporary location', 'Temporary location', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('878', 'p', 'Piece designation', 'Piece designation', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('878', 'r', 'Invalid or canceled piece designation', 'Invalid or canceled piece designation', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('878', 't', 'Copy number', 'Copy number', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('878', 'x', 'Nonpublic note', 'Nonpublic note', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('878', 'z', 'Public note', 'Public note', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL); diff --git a/installer/data/mysql/de-DE/marcflavour/marc21/optional/marc21_sample_fastadd_framework.sql b/installer/data/mysql/de-DE/marcflavour/marc21/optional/marc21_sample_fastadd_framework.sql index c86c3e8..e896531 100644 --- a/installer/data/mysql/de-DE/marcflavour/marc21/optional/marc21_sample_fastadd_framework.sql +++ b/installer/data/mysql/de-DE/marcflavour/marc21/optional/marc21_sample_fastadd_framework.sql @@ -1,4 +1,4 @@ -INSERT IGNORE INTO biblio_framework VALUES +INSERT IGNORE INTO biblio_framework (frameworkcode, frameworktext) VALUES ('FA', 'Schnellaufnahme'); INSERT IGNORE INTO marc_tag_structure (tagfield, liblibrarian, libopac, repeatable, mandatory, authorised_value, frameworkcode) diff --git a/installer/data/mysql/de-DE/marcflavour/marc21/optional/marc21_simple_bib_frameworks.sql b/installer/data/mysql/de-DE/marcflavour/marc21/optional/marc21_simple_bib_frameworks.sql index e394238..62dcdf8 100644 --- a/installer/data/mysql/de-DE/marcflavour/marc21/optional/marc21_simple_bib_frameworks.sql +++ b/installer/data/mysql/de-DE/marcflavour/marc21/optional/marc21_simple_bib_frameworks.sql @@ -6,7 +6,7 @@ -- ******************************************************************* -- SIMPLE BOOKS KOHA RECORD AND HOLDINGS MANAGEMENT FIELDS/SUBFIELDS. -- ******************************************************************* -INSERT IGNORE INTO biblio_framework VALUES +INSERT IGNORE INTO biblio_framework (frameworkcode, frameworktext) VALUES ( 'BKS', 'Monographien, Broschüren, Arbeitsbücher' ); INSERT IGNORE INTO marc_tag_structure ( @@ -29,7 +29,7 @@ INSERT IGNORE INTO marc_subfield_structure ( -- **************************************************************************** -- SIMPLE COMPUTER FILES KOHA RECORD AND HOLDINGS MANAGEMENT FIELDS/SUBFIELDS. -- **************************************************************************** -INSERT IGNORE INTO biblio_framework VALUES +INSERT IGNORE INTO biblio_framework (frameworkcode, frameworktext) VALUES ( 'CF', 'CD-ROMs, DVD-ROMs, Online-Ressourcen' ); INSERT IGNORE INTO marc_tag_structure ( tagfield, liblibrarian, libopac, repeatable, mandatory, authorised_value, frameworkcode) @@ -52,7 +52,7 @@ INSERT IGNORE INTO marc_subfield_structure ( -- ***************************************************************************** -- SIMPLE SOUND RECORDINGS KOHA RECORD AND HOLDINGS MANAGEMENT FIELDS/SUBFIELDS. -- ***************************************************************************** -INSERT IGNORE INTO biblio_framework VALUES +INSERT IGNORE INTO biblio_framework (frameworkcode, frameworktext) VALUES ( 'SR', 'Audiokassetten, CDs' ); INSERT IGNORE INTO marc_tag_structure ( @@ -76,7 +76,7 @@ INSERT IGNORE INTO marc_subfield_structure ( -- **************************************************************************** -- SIMPLE VIDEORECORDINGS KOHA RECORD AND HOLDINGS MANAGEMENT FIELDS/SUBFIELDS. -- **************************************************************************** -INSERT IGNORE INTO biblio_framework VALUES +INSERT IGNORE INTO biblio_framework (frameworkcode, frameworktext) VALUES ( 'VR', 'DVDs, Videokassetten' ); INSERT IGNORE INTO marc_tag_structure ( @@ -100,7 +100,7 @@ INSERT IGNORE INTO marc_subfield_structure ( -- ************************************************************************** -- SIMPLE 3D ARTIFACTS KOHA RECORD AND HOLDINGS MANAGEMENT FIELDS/SUBFIELDS. -- ************************************************************************** -INSERT IGNORE INTO biblio_framework VALUES +INSERT IGNORE INTO biblio_framework (frameworkcode, frameworktext) VALUES ( 'AR', 'Artefakte, Gegenstände' ); INSERT IGNORE INTO marc_tag_structure ( @@ -124,7 +124,7 @@ INSERT IGNORE INTO marc_subfield_structure ( -- ****************************************************************** -- SIMPLE KITS KOHA RECORD AND HOLDINGS MANAGEMENT FIELDS/SUBFIELDS. -- ****************************************************************** -INSERT IGNORE INTO biblio_framework VALUES +INSERT IGNORE INTO biblio_framework (frameworkcode, frameworktext) VALUES ( 'KT', 'Medienkombinationen' ); INSERT IGNORE INTO marc_tag_structure ( @@ -148,7 +148,7 @@ INSERT IGNORE INTO marc_subfield_structure ( -- ********************************************************************************** -- SIMPLE INTEGRATING RESOURCES KOHA RECORD AND HOLDINGS MANAGEMENT FIELDS/SUBFIELDS. -- ********************************************************************************** -INSERT IGNORE INTO biblio_framework VALUES +INSERT IGNORE INTO biblio_framework (frameworkcode, frameworktext) VALUES ( 'IR', 'Loseblattsammlungen' ); INSERT IGNORE INTO marc_tag_structure ( @@ -172,7 +172,7 @@ INSERT IGNORE INTO marc_subfield_structure ( -- ********************************************************************* -- SIMPLE SERIALS KOHA RECORD AND HOLDINGS MANAGEMENT FIELDS/SUBFIELDS. -- ********************************************************************* -INSERT IGNORE INTO biblio_framework VALUES +INSERT IGNORE INTO biblio_framework (frameworkcode, frameworktext) VALUES ( 'SER', 'Zeitschriften' ); INSERT IGNORE INTO marc_tag_structure ( @@ -494,7 +494,7 @@ UPDATE marc_subfield_structure SET hidden = 9 WHERE tagfield = '942' AND tagsubf UPDATE marc_subfield_structure SET hidden = 0 WHERE tagfield = '952' AND tagsubfield = '1' AND frameworkcode IN ('AR','BKS','CF','IR','KT','SER','SR','VR'); -- Create the ACQ framework based on the default framework, fields 952 only -INSERT IGNORE INTO biblio_framework VALUES( 'ACQ', 'Acquisition framework' ); +INSERT IGNORE INTO biblio_framework (frameworkcode, frameworktext) VALUES( 'ACQ', 'Acquisition framework' ); INSERT INTO marc_tag_structure(tagfield, liblibrarian, libopac, repeatable, mandatory, authorised_value, frameworkcode) SELECT tagfield, liblibrarian, libopac, repeatable, mandatory, authorised_value, 'ACQ' FROM marc_tag_structure WHERE tagfield='952' AND frameworkcode=''; diff --git a/installer/data/mysql/en/marcflavour/marc21/mandatory/marc21_framework_DEFAULT.sql b/installer/data/mysql/en/marcflavour/marc21/mandatory/marc21_framework_DEFAULT.sql index 46bf421..470ea3d 100644 --- a/installer/data/mysql/en/marcflavour/marc21/mandatory/marc21_framework_DEFAULT.sql +++ b/installer/data/mysql/en/marcflavour/marc21/mandatory/marc21_framework_DEFAULT.sql @@ -34,7 +34,8 @@ INSERT IGNORE INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblib ('999', 'a', 'Item type [OBSOLETE]', 'Item type [OBSOLETE]', 0, 0, NULL, -1, NULL, NULL, '', NULL, -5, '', '', '', NULL), ('999', 'b', 'Koha Dewey Subclass [OBSOLETE]', 'Koha Dewey Subclass [OBSOLETE]', 0, 0, NULL, 0, NULL, NULL, '', NULL, -5, '', '', '', NULL), ('999', 'c', 'Koha biblionumber', 'Koha biblionumber', 0, 0, 'biblio.biblionumber', -1, NULL, NULL, '', NULL, -5, '', '', '', NULL), - ('999', 'd', 'Koha biblioitemnumber', 'Koha biblioitemnumber', 0, 0, 'biblioitems.biblioitemnumber', -1, NULL, NULL, '', NULL, -5, '', '', '', NULL); + ('999', 'd', 'Koha biblioitemnumber', 'Koha biblioitemnumber', 0, 0, 'biblioitems.biblioitemnumber', -1, NULL, NULL, '', NULL, -5, '', '', '', NULL), + ('999', 'e', 'Koha holding_id', 'Koha holding_id', 0, 0, 'holdings.holding_id', -1, NULL, NULL, '', NULL, -5, '', '', '', NULL); -- ****************************************************** @@ -97,6 +98,7 @@ INSERT IGNORE INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblib ('952', '7', 'Not for loan', 'Not for loan', 0, 0, 'items.notforloan', 10, 'NOT_LOAN', '', '', 0, 0, '', '', '', NULL), ('952', '8', 'Collection code', 'Collection code', 0, 0, 'items.ccode', 10, 'CCODE', '', '', 0, 0, '', '', '', NULL), ('952', '9', 'Koha itemnumber (autogenerated)', 'Koha itemnumber', 0, 0, 'items.itemnumber', -1, '', '', '', 0, 7, '', '', '', NULL), + ('952', 'V', 'Holding record', 'Holding record', 0, 0, 'items.holding_id', 10, 'holdings', '', '', NULL, 0, '', '', '', NULL), ('952', 'a', 'Permanent location', 'Permanent Location', 0, 0, 'items.homebranch', 10, 'branches', '', '', 0, 0, '', '', '', NULL), ('952', 'b', 'Current location', 'Current Location', 0, 0, 'items.holdingbranch', 10, 'branches', '', '', 0, 0, '', '', '', NULL), ('952', 'c', 'Shelving location', 'Shelving location', 0, 0, 'items.location', 10, 'LOC', '', '', 0, 0, '', '', '', NULL), @@ -4466,9 +4468,330 @@ UPDATE `marc_subfield_structure` SET maxlength=24 WHERE tagfield='000'; UPDATE `marc_subfield_structure` SET maxlength=40 WHERE tagfield='008'; -- Create the ACQ framework based on the default framework, fields 952 only -INSERT IGNORE INTO biblio_framework VALUES( 'ACQ', 'Acquisition framework' ); +INSERT IGNORE INTO biblio_framework (frameworkcode, frameworktext) VALUES( 'ACQ', 'Acquisition framework' ); INSERT INTO marc_tag_structure(tagfield, liblibrarian, libopac, repeatable, mandatory, authorised_value, frameworkcode) SELECT tagfield, liblibrarian, libopac, repeatable, mandatory, authorised_value, 'ACQ' FROM marc_tag_structure WHERE tagfield='952' AND frameworkcode=''; INSERT INTO marc_subfield_structure(tagfield, tagsubfield, liblibrarian, libopac, repeatable, mandatory, kohafield, tab, authorised_value, authtypecode, value_builder, isurl, hidden, frameworkcode, seealso, link, defaultvalue, maxlength) SELECT tagfield, tagsubfield, liblibrarian, libopac, repeatable, mandatory, kohafield, tab, authorised_value, authtypecode, value_builder, isurl, hidden, 'ACQ', seealso, link, defaultvalue, maxlength FROM marc_subfield_structure WHERE tagfield='952' AND frameworkcode=''; + +-- HOLDINGS RECORD FRAMEWORK + +INSERT IGNORE INTO `biblio_framework` VALUES ('HLD', 'Default holdings framework', 'hld'); +INSERT IGNORE INTO `marc_tag_structure` (`tagfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `authorised_value`, `frameworkcode`) VALUES + ('999', 'SYSTEM CONTROL NUMBERS (KOHA)', 'SYSTEM CONTROL NUMBERS (KOHA)', 1, 0, '', 'HLD'); + +INSERT IGNORE INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES + ('999', 'c', 'Koha biblionumber', 'Koha biblionumber', 0, 0, 'biblio.biblionumber', -1, NULL, NULL, '', NULL, -5, 'HLD', '', '', NULL), + ('999', 'd', 'Koha biblioitemnumber', 'Koha biblioitemnumber', 0, 0, 'biblioitems.biblioitemnumber', -1, NULL, NULL, '', NULL, -5, 'HLD', '', '', NULL), + ('999', 'e', 'Koha holding_id', 'Koha holding_id', 0, 0, 'holdings.holding_id', -1, NULL, NULL, '', NULL, -5, 'HLD', '', '', NULL); + + +INSERT IGNORE INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES + ('942', 'n', 'Suppress in OPAC', 'Suppress in OPAC', 0, 0, 'holdings.suppress', 9, '', '', '', 0, 0, 'HLD', '', '', NULL); + +INSERT IGNORE INTO `marc_tag_structure` (`tagfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `authorised_value`, `frameworkcode`) VALUES + ('000', 'LEADER', 'LEADER', 0, 1, '', 'HLD'), + ('001', 'CONTROL NUMBER', 'CONTROL NUMBER', 0, 0, '', 'HLD'), + ('003', 'CONTROL NUMBER IDENTIFIER', 'CONTROL NUMBER IDENTIFIER', 0, 1, '', 'HLD'), + ('005', 'DATE AND TIME OF LATEST TRANSACTION', 'DATE AND TIME OF LATEST TRANSACTION', 0, 1, '', 'HLD'), + ('006', 'FIXED-LENGTH DATA ELEMENTS--ADDITIONAL MATERIAL CHARACTERISTICS', 'FIXED-LENGTH DATA ELEMENTS--ADDITIONAL MATERIAL CHARACTERISTICS', 1, 0, '', 'HLD'), + ('007', 'PHYSICAL DESCRIPTION FIXED FIELD--GENERAL INFORMATION', 'PHYSICAL DESCRIPTION FIXED FIELD--GENERAL INFORMATION', 1, 0, '', 'HLD'), + ('008', 'FIXED-LENGTH DATA ELEMENTS--GENERAL INFORMATION', 'FIXED-LENGTH DATA ELEMENTS--GENERAL INFORMATION', 0, 1, '', 'HLD'); + +INSERT IGNORE INTO `marc_tag_structure` (`tagfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `authorised_value`, `frameworkcode`) VALUES + ('850', 'HOLDING INSTITUTION', 'HOLDING INSTITUTION', 1, 0, NULL, 'HLD'), + ('852', 'LOCATION', 'LOCATION', 1, 0, NULL, 'HLD'), + ('853', 'CAPTIONS AND PATTERN--BASIC BIBLIOGRAPHIC UNIT', 'CAPTIONS AND PATTERN--BASIC BIBLIOGRAPHIC UNIT', 1, 0, NULL, 'HLD'), + ('854', 'CAPTIONS AND PATTERN--SUPPLEMENTARY MATERIAL', 'CAPTIONS AND PATTERN--SUPPLEMENTARY MATERIAL', 1, 0, NULL, 'HLD'), + ('855', 'CAPTIONS AND PATTERN--INDEXES', 'CAPTIONS AND PATTERN--INDEXES', 1, 0, NULL, 'HLD'), + ('856', 'ELECTRONIC LOCATION AND ACCESS', 'ELECTRONIC LOCATION AND ACCESS', 1, 0, NULL, 'HLD'), + ('863', 'ENUMERATION AND CHRONOLOGY--BASIC BIBLIOGRAPHIC UNIT', 'ENUMERATION AND CHRONOLOGY--BASIC BIBLIOGRAPHIC UNIT', 1, 0, NULL, 'HLD'), + ('864', 'ENUMERATION AND CHRONOLOGY--SUPPLEMENTARY MATERIAL', 'ENUMERATION AND CHRONOLOGY--SUPPLEMENTARY MATERIAL', 1, 0, NULL, 'HLD'), + ('865', 'ENUMERATION AND CHRONOLOGY--INDEXES', 'ENUMERATION AND CHRONOLOGY--INDEXES', 1, 0, NULL, 'HLD'), + ('866', 'TEXTUAL HOLDINGS--BASIC BIBLIOGRAPHIC UNIT', 'TEXTUAL HOLDINGS--BASIC BIBLIOGRAPHIC UNIT', 1, 0, NULL, 'HLD'), + ('867', 'TEXTUAL HOLDINGS--SUPPLEMENTARY MATERIAL', 'TEXTUAL HOLDINGS--SUPPLEMENTARY MATERIAL', 1, 0, NULL, 'HLD'), + ('868', 'TEXTUAL HOLDINGS--INDEXES', 'TEXTUAL HOLDINGS--INDEXES', 1, 0, NULL, 'HLD'), + ('876', 'ITEM INFORMATION--BASIC BIBLIOGRAPHIC UNIT', 'ITEM INFORMATION--BASIC BIBLIOGRAPHIC UNIT', 1, 0, NULL, 'HLD'), + ('877', 'ITEM INFORMATION--SUPPLEMENTARY MATERIAL', 'ITEM INFORMATION--SUPPLEMENTARY MATERIAL', 1, 0, NULL, 'HLD'), + ('878', 'ITEM INFORMATION--INDEXES', 'ITEM INFORMATION--INDEXES', 1, 0, NULL, 'HLD'); + +INSERT IGNORE INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES + ('000', '@', 'fixed length control field', 'fixed length control field', 0, 1, '', 0, '', '', 'marc21_leader_holdings.pl', 0, 0, 'HLD', '', '', NULL), + ('001', '@', 'control field', 'control field', 0, 0, '', 0, '', '', '', 0, 0, 'HLD', '', '', NULL), + ('003', '@', 'control field', 'control field', 0, 1, '', 0, '', '', 'marc21_orgcode.pl', 0, 0, 'HLD', '', '', NULL), + ('005', '@', 'control field', 'control field', 0, 1, '', 0, '', '', 'marc21_field_005.pl', 0, 0, 'HLD', '', '', NULL), + ('006', '@', 'fixed length control field', 'fixed length control field', 0, 0, '', 0, '', '', 'marc21_field_006.pl', 0, -1, 'HLD', '', '', NULL), + ('007', '@', 'fixed length control field', 'fixed length control field', 0, 0, '', 0, '', '', 'marc21_field_007.pl', 0, 0, 'HLD', '', '', NULL), + ('008', '@', 'fixed length control field', 'fixed length control field', 0, 1, '', 0, '', '', 'marc21_field_008_holdings.pl', 0, 0, 'HLD', '', '', NULL), + ('850', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, NULL, 8, NULL, NULL, '', NULL, 4, 'HLD', '', '', NULL), + ('850', 'a', 'Holding institution', 'Holding institution', 1, 0, NULL, 8, NULL, NULL, '', NULL, 4, 'HLD', '', '', NULL), + ('850', 'b', 'Holdings (NR) (MU VM SE) [OBSOLETE]', 'Holdings (NR) (MU VM SE) [OBSOLETE]', 0, 0, NULL, 8, NULL, NULL, '', NULL, 4, 'HLD', '', '', NULL), + ('850', 'd', 'Inclusive dates (NR) (MU VM SE) [OBSOLETE]', 'Inclusive dates (NR) (MU VM SE) [OBSOLETE]', 0, 0, NULL, 8, NULL, NULL, '', NULL, 4, 'HLD', '', '', NULL), + ('850', 'e', 'Retention statement (NR) (CF MU VM SE) [OBSOLETE]', 'Retention statement (NR) (CF MU VM SE) [OBSOLETE]', 0, 0, NULL, 8, NULL, NULL, '', NULL, 4, 'HLD', '', '', NULL), + ('852', '2', 'Source of classification or shelving scheme', 'Source of classification or shelving scheme', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('852', '3', 'Materials specified', 'Materials specified', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('852', '6', 'Linkage', 'Linkage', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('852', '8', 'Sequence number', 'Sequence number', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('852', 'a', 'Location', 'Location', 0, 0, 'holdings.holdingbranch', 8, 'branches', '', '', NULL, 4, 'HLD', '', '', NULL), + ('852', 'b', 'Sublocation or collection', 'Sublocation or collection', 1, 0, 'holdings.location', 8, 'LOC', '', '', NULL, 4, 'HLD', '', '', NULL), + ('852', 'c', 'Shelving location', 'Shelving location', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('852', 'd', 'Former shelving location', 'Former shelving location', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('852', 'e', 'Address', 'Address', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('852', 'f', 'Coded location qualifier', 'Coded location qualifier', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('852', 'g', 'Non-coded location qualifier', 'Non-coded location qualifier', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('852', 'h', 'Classification part', 'Classification part', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('852', 'i', 'Item part', 'Item part', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('852', 'j', 'Shelving control number', 'Shelving control number', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('852', 'k', 'Call number prefix', 'Call number prefix', 1, 0, 'holdings.callnumber', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('852', 'l', 'Shelving form of title', 'Shelving form of title', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('852', 'm', 'Call number suffix', 'Call number suffix', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('852', 'n', 'Country code', 'Country code', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('852', 'p', 'Piece designation', 'Piece designation', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('852', 'q', 'Piece physical condition', 'Piece physical condition', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('852', 's', 'Copyright article-fee code', 'Copyright article-fee code', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('852', 't', 'Copy number', 'Copy number', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('852', 'u', 'Uniform Resource Identifier', 'Uniform Resource Identifier', 1, 0, '', 8, '', '', '', 1, 4, 'HLD', '', '', NULL), + ('852', 'x', 'Nonpublic note', 'Nonpublic note', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('852', 'z', 'Public note', 'Public note', 1, 0, 'holdings.public_note', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('853', '3', 'Materials specified', 'Materials specified', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('853', '6', 'Linkage', 'Linkage', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('853', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('853', 'a', 'First level of enumeration', 'First level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('853', 'b', 'Second level of enumeration', 'Second level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('853', 'c', 'Third level of enumeration', 'Third level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('853', 'd', 'Fourth level of enumeration', 'Fourth level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('853', 'e', 'Fifth level of enumeration', 'Fifth level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('853', 'f', 'Sixth level of enumeration', 'Sixth level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('853', 'g', 'Alternative numbering scheme, first level of enumeration', 'Alternative numbering scheme, first level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('853', 'h', 'Alternative numbering scheme, second level of enumeration', 'Alternative numbering scheme, second level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('853', 'i', 'First level of chronology', 'First level of chronology', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('853', 'j', 'Second level of chronology', 'Second level of chronology', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('853', 'k', 'Third level of chronology', 'Third level of chronology', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('853', 'l', 'Fourth level of chronology', 'Fourth level of chronology', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('853', 'm', 'Alternative numbering scheme, chronology', 'Alternative numbering scheme, chronology', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('853', 'n', 'Pattern note', 'Pattern note', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('853', 'p', 'Number of pieces per issuance', 'Number of pieces per issuance', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('853', 't', 'Copy', 'Copy', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('853', 'u', 'Bibliographic units per next higher level', 'Bibliographic units per next higher level', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('853', 'v', 'Numbering continuity', 'Numbering continuity', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('853', 'w', 'Frequency', 'Frequency', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('853', 'x', 'Calendar change', 'Calendar change', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('853', 'y', 'Regularity pattern', 'Regularity pattern', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('853', 'z', 'Numbering scheme', 'Numbering scheme', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('854', '3', 'Materials specified', 'Materials specified', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('854', '6', 'Linkage', 'Linkage', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('854', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('854', 'a', 'First level of enumeration', 'First level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('854', 'b', 'Second level of enumeration', 'Second level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('854', 'c', 'Third level of enumeration', 'Third level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('854', 'd', 'Fourth level of enumeration', 'Fourth level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('854', 'e', 'Fifth level of enumeration', 'Fifth level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('854', 'f', 'Sixth level of enumeration', 'Sixth level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('854', 'g', 'Alternative numbering scheme, first level of enumeration', 'Alternative numbering scheme, first level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('854', 'h', 'Alternative numbering scheme, second level of enumeration', 'Alternative numbering scheme, second level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('854', 'i', 'First level of chronology', 'First level of chronology', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('854', 'j', 'Second level of chronology', 'Second level of chronology', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('854', 'k', 'Third level of chronology', 'Third level of chronology', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('854', 'l', 'Fourth level of chronology', 'Fourth level of chronology', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('854', 'm', 'Alternative numbering scheme, chronology', 'Alternative numbering scheme, chronology', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('854', 'n', 'Pattern note', 'Pattern note', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('854', 'p', 'Number of pieces per issuance', 'Number of pieces per issuance', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('854', 't', 'Copy', 'Copy', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('854', 'u', 'Bibliographic units per next higher level', 'Bibliographic units per next higher level', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('854', 'v', 'Numbering continuity', 'Numbering continuity', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('854', 'w', 'Frequency', 'Frequency', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('854', 'x', 'Calendar change', 'Calendar change', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('854', 'y', 'Regularity pattern', 'Regularity pattern', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('854', 'z', 'Numbering scheme', 'Numbering scheme', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('855', '3', 'Materials specified', 'Materials specified', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('855', '6', 'Linkage', 'Linkage', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('855', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('855', 'a', 'First level of enumeration', 'First level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('855', 'b', 'Second level of enumeration', 'Second level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('855', 'c', 'Third level of enumeration', 'Third level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('855', 'd', 'Fourth level of enumeration', 'Fourth level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('855', 'e', 'Fifth level of enumeration', 'Fifth level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('855', 'f', 'Sixth level of enumeration', 'Sixth level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('855', 'g', 'Alternative numbering scheme, first level of enumeration', 'Alternative numbering scheme, first level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('855', 'h', 'Alternative numbering scheme, second level of enumeration', 'Alternative numbering scheme, second level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('855', 'i', 'First level of chronology', 'First level of chronology', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('855', 'j', 'Second level of chronology', 'Second level of chronology', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('855', 'k', 'Third level of chronology', 'Third level of chronology', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('855', 'l', 'Fourth level of chronology', 'Fourth level of chronology', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('855', 'm', 'Alternative numbering scheme, chronology', 'Alternative numbering scheme, chronology', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('855', 'n', 'Pattern note', 'Pattern note', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('855', 'p', 'Number of pieces per issuance', 'Number of pieces per issuance', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('855', 't', 'Copy', 'Copy', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('855', 'u', 'Bibliographic units per next higher level', 'Bibliographic units per next higher level', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('855', 'v', 'Numbering continuity', 'Numbering continuity', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('855', 'w', 'Frequency', 'Frequency', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('855', 'x', 'Calendar change', 'Calendar change', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('855', 'y', 'Regularity pattern', 'Regularity pattern', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('855', 'z', 'Numbering scheme', 'Numbering scheme', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('856', '2', 'Access method', 'Access method', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('856', '3', 'Materials specified', 'Materials specified', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('856', '6', 'Linkage', 'Linkage', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('856', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('856', 'a', 'Host name', 'Host name', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('856', 'b', 'Access number', 'Access number', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('856', 'c', 'Compression information', 'Compression information', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('856', 'd', 'Path', 'Path', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('856', 'f', 'Electronic name', 'Electronic name', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('856', 'h', 'Processor of request', 'Processor of request', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('856', 'i', 'Instruction', 'Instruction', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('856', 'j', 'Bits per second', 'Bits per second', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('856', 'k', 'Password', 'Password', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('856', 'l', 'Logon', 'Logon', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('856', 'm', 'Contact for access assistance', 'Contact for access assistance', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('856', 'n', 'Name of location of host', 'Name of location of host', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('856', 'o', 'Operating system', 'Operating system', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('856', 'p', 'Port', 'Port', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('856', 'q', 'Electronic format type', 'Electronic format type', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('856', 'r', 'Settings', 'Settings', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('856', 's', 'File size', 'File size', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('856', 't', 'Terminal emulation', 'Terminal emulation', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('856', 'u', 'Uniform Resource Identifier', 'Uniform Resource Identifier', 1, 0, 'biblioitems.url', 8, '', '', '', 1, 4, 'HLD', '', '', NULL), + ('856', 'v', 'Hours access method available', 'Hours access method available', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('856', 'w', 'Record control number', 'Record control number', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('856', 'x', 'Nonpublic note', 'Nonpublic note', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('856', 'y', 'Link text', 'Link text', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('856', 'z', 'Public note', 'Public note', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('863', '6', 'Linkage', 'Linkage', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('863', '8', 'Field link and sequence number', 'Field link and sequence number', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('863', 'a', 'First level of enumeration', 'First level of enumeration', 0, 0, 'holdings.summary', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('863', 'b', 'Second level of enumeration', 'Second level of enumeration', 0, 0, 'holdings.summary', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('863', 'c', 'Third level of enumeration', 'Third level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('863', 'd', 'Fourth level of enumeration', 'Fourth level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('863', 'e', 'Fifth level of enumeration', 'Fifth level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('863', 'f', 'Sixth level of enumeration', 'Sixth level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('863', 'g', 'Alternative numbering scheme, first level of enumeration', 'Alternative numbering scheme, first level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('863', 'h', 'Alternative numbering scheme, second level of enumeration', 'Alternative numbering scheme, second level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('863', 'i', 'First level of chronology', 'First level of chronology', 0, 0, 'holdings.summary', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('863', 'j', 'Second level of chronology', 'Second level of chronology', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('863', 'k', 'Third level of chronology', 'Third level of chronology', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('863', 'l', 'Fourth level of chronology', 'Fourth level of chronology', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('863', 'm', 'Alternative numbering scheme, chronology', 'Alternative numbering scheme, chronology', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('863', 'n', 'Converted Gregorian year', 'Converted Gregorian year', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('863', 'o', 'Type of unit', 'Type of unit', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('863', 'p', 'Piece designation', 'Piece designation', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('863', 'q', 'Piece physical condition', 'Piece physical condition', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('863', 's', 'Copyright article-fee code', 'Copyright article-fee code', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('863', 't', 'Copy number', 'Copy number', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('863', 'v', 'Issuing date', 'Issuing date', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('863', 'w', 'Break indicator', 'Break indicator', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('863', 'x', 'Nonpublic note', 'Nonpublic note', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('863', 'z', 'Public note', 'Public note', 1, 0, 'holdings.summary', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('864', '6', 'Linkage', 'Linkage', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('864', '8', 'Field link and sequence number', 'Field link and sequence number', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('864', 'a', 'First level of enumeration', 'First level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('864', 'b', 'Second level of enumeration', 'Second level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('864', 'c', 'Third level of enumeration', 'Third level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('864', 'd', 'Fourth level of enumeration', 'Fourth level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('864', 'e', 'Fifth level of enumeration', 'Fifth level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('864', 'f', 'Sixth level of enumeration', 'Sixth level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('864', 'g', 'Alternative numbering scheme, first level of enumeration', 'Alternative numbering scheme, first level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('864', 'h', 'Alternative numbering scheme, second level of enumeration', 'Alternative numbering scheme, second level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('864', 'i', 'First level of chronology', 'First level of chronology', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('864', 'j', 'Second level of chronology', 'Second level of chronology', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('864', 'k', 'Third level of chronology', 'Third level of chronology', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('864', 'l', 'Fourth level of chronology', 'Fourth level of chronology', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('864', 'm', 'Alternative numbering scheme, chronology', 'Alternative numbering scheme, chronology', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('864', 'n', 'Converted Gregorian year', 'Converted Gregorian year', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('864', 'o', 'Type of unit', 'Type of unit', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('864', 'p', 'Piece designation', 'Piece designation', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('864', 'q', 'Piece physical condition', 'Piece physical condition', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('864', 's', 'Copyright article-fee code', 'Copyright article-fee code', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('864', 't', 'Copy number', 'Copy number', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('864', 'v', 'Issuing date', 'Issuing date', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('864', 'w', 'Break indicator', 'Break indicator', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('864', 'x', 'Nonpublic note', 'Nonpublic note', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('864', 'z', 'Public note', 'Public note', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('865', '6', 'Linkage', 'Linkage', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('865', '8', 'Field link and sequence number', 'Field link and sequence number', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('865', 'a', 'First level of enumeration', 'First level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('865', 'b', 'Second level of enumeration', 'Second level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('865', 'c', 'Third level of enumeration', 'Third level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('865', 'd', 'Fourth level of enumeration', 'Fourth level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('865', 'e', 'Fifth level of enumeration', 'Fifth level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('865', 'f', 'Sixth level of enumeration', 'Sixth level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('865', 'g', 'Alternative numbering scheme, first level of enumeration', 'Alternative numbering scheme, first level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('865', 'h', 'Alternative numbering scheme, second level of enumeration', 'Alternative numbering scheme, second level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('865', 'i', 'First level of chronology', 'First level of chronology', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('865', 'j', 'Second level of chronology', 'Second level of chronology', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('865', 'k', 'Third level of chronology', 'Third level of chronology', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('865', 'l', 'Fourth level of chronology', 'Fourth level of chronology', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('865', 'm', 'Alternative numbering scheme, chronology', 'Alternative numbering scheme, chronology', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('865', 'n', 'Converted Gregorian year', 'Converted Gregorian year', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('865', 'o', 'Type of unit', 'Type of unit', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('865', 'p', 'Piece designation', 'Piece designation', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('865', 'q', 'Piece physical condition', 'Piece physical condition', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('865', 's', 'Copyright article-fee code', 'Copyright article-fee code', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('865', 't', 'Copy number', 'Copy number', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('865', 'v', 'Issuing date', 'Issuing date', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('865', 'w', 'Break indicator', 'Break indicator', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('865', 'x', 'Nonpublic note', 'Nonpublic note', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('865', 'z', 'Public note', 'Public note', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('866', '6', 'Linkage', 'Linkage', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('866', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('866', 'a', 'Textual string', 'Textual string', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('866', 'x', 'Nonpublic note', 'Nonpublic note', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('866', 'z', 'Public note', 'Public note', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('867', '6', 'Linkage', 'Linkage', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('867', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('867', 'a', 'Textual string', 'Textual string', 0, 0, 'holdings.supplements', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('867', 'x', 'Nonpublic note', 'Nonpublic note', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('867', 'z', 'Public note', 'Public note', 1, 0, 'holdings.supplements', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('868', '6', 'Linkage', 'Linkage', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('868', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('868', 'a', 'Textual string', 'Textual string', 0, 0, 'holdings.indexes', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('868', 'x', 'Nonpublic note', 'Nonpublic note', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('868', 'z', 'Public note', 'Public note', 1, 0, 'holdings.indexes', 8, '', '', '', 0, 4, 'HLD', '', '', NULL), + ('876', '3', 'Materials specified', 'Materials specified', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('876', '6', 'Linkage', 'Linkage', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('876', '8', 'Sequence number', 'Sequence number', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('876', 'a', 'Internal item number', 'Internal item number', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('876', 'b', 'Invalid or canceled internal item number', 'Invalid or canceled internal item number', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('876', 'c', 'Cost', 'Cost', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('876', 'd', 'Date acquired', 'Date acquired', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('876', 'e', 'Source of acquisition', 'Source of acquisition', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('876', 'h', 'Use restrictions', 'Use restrictions', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('876', 'j', 'Item status', 'Item status', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('876', 'l', 'Temporary location', 'Temporary location', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('876', 'p', 'Piece designation', 'Piece designation', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('876', 'r', 'Invalid or canceled piece designation', 'Invalid or canceled piece designation', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('876', 't', 'Copy number', 'Copy number', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('876', 'x', 'Nonpublic note', 'Nonpublic note', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('876', 'z', 'Public note', 'Public note', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('877', '3', 'Materials specified', 'Materials specified', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('877', '6', 'Linkage', 'Linkage', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('877', '8', 'Sequence number', 'Sequence number', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('877', 'a', 'Internal item number', 'Internal item number', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('877', 'b', 'Invalid or canceled internal item number', 'Invalid or canceled internal item number', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('877', 'c', 'Cost', 'Cost', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('877', 'd', 'Date acquired', 'Date acquired', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('877', 'e', 'Source of acquisition', 'Source of acquisition', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('877', 'h', 'Use restrictions', 'Use restrictions', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('877', 'j', 'Item status', 'Item status', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('877', 'l', 'Temporary location', 'Temporary location', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('877', 'p', 'Piece designation', 'Piece designation', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('877', 'r', 'Invalid or canceled piece designation', 'Invalid or canceled piece designation', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('877', 't', 'Copy number', 'Copy number', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('877', 'x', 'Nonpublic note', 'Nonpublic note', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('877', 'z', 'Public note', 'Public note', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('878', '3', 'Materials specified', 'Materials specified', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('878', '6', 'Linkage', 'Linkage', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('878', '8', 'Sequence number', 'Sequence number', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('878', 'a', 'Internal item number', 'Internal item number', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('878', 'b', 'Invalid or canceled internal item number', 'Invalid or canceled internal item number', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('878', 'c', 'Cost', 'Cost', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('878', 'd', 'Date acquired', 'Date acquired', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('878', 'e', 'Source of acquisition', 'Source of acquisition', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('878', 'h', 'Use restrictions', 'Use restrictions', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('878', 'j', 'Item status', 'Item status', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('878', 'l', 'Temporary location', 'Temporary location', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('878', 'p', 'Piece designation', 'Piece designation', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('878', 'r', 'Invalid or canceled piece designation', 'Invalid or canceled piece designation', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('878', 't', 'Copy number', 'Copy number', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('878', 'x', 'Nonpublic note', 'Nonpublic note', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), + ('878', 'z', 'Public note', 'Public note', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL); diff --git a/installer/data/mysql/en/marcflavour/marc21/optional/marc21_sample_fastadd_framework.sql b/installer/data/mysql/en/marcflavour/marc21/optional/marc21_sample_fastadd_framework.sql index 0b8991c..b69379e 100644 --- a/installer/data/mysql/en/marcflavour/marc21/optional/marc21_sample_fastadd_framework.sql +++ b/installer/data/mysql/en/marcflavour/marc21/optional/marc21_sample_fastadd_framework.sql @@ -1,4 +1,4 @@ -INSERT IGNORE INTO biblio_framework VALUES +INSERT IGNORE INTO biblio_framework (frameworkcode, frameworktext) VALUES ('FA', 'Fast Add Framework'); INSERT IGNORE INTO marc_tag_structure (tagfield, liblibrarian, libopac, repeatable, mandatory, authorised_value, frameworkcode) diff --git a/installer/data/mysql/en/marcflavour/marc21/optional/marc21_simple_bib_frameworks.sql b/installer/data/mysql/en/marcflavour/marc21/optional/marc21_simple_bib_frameworks.sql index 40661d7..7dbabc5 100644 --- a/installer/data/mysql/en/marcflavour/marc21/optional/marc21_simple_bib_frameworks.sql +++ b/installer/data/mysql/en/marcflavour/marc21/optional/marc21_simple_bib_frameworks.sql @@ -6,7 +6,7 @@ -- ******************************************************************* -- SIMPLE BOOKS KOHA RECORD AND HOLDINGS MANAGEMENT FIELDS/SUBFIELDS. -- ******************************************************************* -INSERT IGNORE INTO biblio_framework VALUES +INSERT IGNORE INTO biblio_framework (frameworkcode, frameworktext) VALUES ( 'BKS', 'Books, Booklets, Workbooks' ); INSERT IGNORE INTO marc_tag_structure ( @@ -29,7 +29,7 @@ INSERT IGNORE INTO marc_subfield_structure ( -- **************************************************************************** -- SIMPLE COMPUTER FILES KOHA RECORD AND HOLDINGS MANAGEMENT FIELDS/SUBFIELDS. -- **************************************************************************** -INSERT IGNORE INTO biblio_framework VALUES +INSERT IGNORE INTO biblio_framework (frameworkcode, frameworktext) VALUES ( 'CF', 'CD-ROMs, DVD-ROMs, General Online Resources' ); INSERT IGNORE INTO marc_tag_structure ( tagfield, liblibrarian, libopac, repeatable, mandatory, authorised_value, frameworkcode) @@ -52,7 +52,7 @@ INSERT IGNORE INTO marc_subfield_structure ( -- ***************************************************************************** -- SIMPLE SOUND RECORDINGS KOHA RECORD AND HOLDINGS MANAGEMENT FIELDS/SUBFIELDS. -- ***************************************************************************** -INSERT IGNORE INTO biblio_framework VALUES +INSERT IGNORE INTO biblio_framework (frameworkcode, frameworktext) VALUES ( 'SR', 'Audio Cassettes, CDs' ); INSERT IGNORE INTO marc_tag_structure ( @@ -76,7 +76,7 @@ INSERT IGNORE INTO marc_subfield_structure ( -- **************************************************************************** -- SIMPLE VIDEORECORDINGS KOHA RECORD AND HOLDINGS MANAGEMENT FIELDS/SUBFIELDS. -- **************************************************************************** -INSERT IGNORE INTO biblio_framework VALUES +INSERT IGNORE INTO biblio_framework (frameworkcode, frameworktext) VALUES ( 'VR', 'DVDs, VHS' ); INSERT IGNORE INTO marc_tag_structure ( @@ -100,7 +100,7 @@ INSERT IGNORE INTO marc_subfield_structure ( -- ************************************************************************** -- SIMPLE 3D ARTIFACTS KOHA RECORD AND HOLDINGS MANAGEMENT FIELDS/SUBFIELDS. -- ************************************************************************** -INSERT IGNORE INTO biblio_framework VALUES +INSERT IGNORE INTO biblio_framework (frameworkcode, frameworktext) VALUES ( 'AR', 'Models' ); INSERT IGNORE INTO marc_tag_structure ( @@ -124,7 +124,7 @@ INSERT IGNORE INTO marc_subfield_structure ( -- ****************************************************************** -- SIMPLE KITS KOHA RECORD AND HOLDINGS MANAGEMENT FIELDS/SUBFIELDS. -- ****************************************************************** -INSERT IGNORE INTO biblio_framework VALUES +INSERT IGNORE INTO biblio_framework (frameworkcode, frameworktext) VALUES ( 'KT', 'Kits' ); INSERT IGNORE INTO marc_tag_structure ( @@ -148,7 +148,7 @@ INSERT IGNORE INTO marc_subfield_structure ( -- ********************************************************************************** -- SIMPLE INTEGRATING RESOURCES KOHA RECORD AND HOLDINGS MANAGEMENT FIELDS/SUBFIELDS. -- ********************************************************************************** -INSERT IGNORE INTO biblio_framework VALUES +INSERT IGNORE INTO biblio_framework (frameworkcode, frameworktext) VALUES ( 'IR', 'Binders' ); INSERT IGNORE INTO marc_tag_structure ( @@ -172,7 +172,7 @@ INSERT IGNORE INTO marc_subfield_structure ( -- ********************************************************************* -- SIMPLE SERIALS KOHA RECORD AND HOLDINGS MANAGEMENT FIELDS/SUBFIELDS. -- ********************************************************************* -INSERT IGNORE INTO biblio_framework VALUES +INSERT IGNORE INTO biblio_framework (frameworkcode, frameworktext) VALUES ( 'SER', 'Serials' ); INSERT IGNORE INTO marc_tag_structure ( diff --git a/installer/data/mysql/es-ES/marcflavour/marc21/optional/marc21_sample_fastadd_framework.sql b/installer/data/mysql/es-ES/marcflavour/marc21/optional/marc21_sample_fastadd_framework.sql index 0ccf193..1d5983c 100644 --- a/installer/data/mysql/es-ES/marcflavour/marc21/optional/marc21_sample_fastadd_framework.sql +++ b/installer/data/mysql/es-ES/marcflavour/marc21/optional/marc21_sample_fastadd_framework.sql @@ -1,4 +1,4 @@ -INSERT IGNORE INTO biblio_framework VALUES +INSERT IGNORE INTO biblio_framework (frameworkcode, frameworktext) VALUES ('FA', 'Plantilla de carga rápida'); INSERT IGNORE INTO marc_tag_structure (tagfield, liblibrarian, libopac, repeatable, mandatory, authorised_value, frameworkcode) diff --git a/installer/data/mysql/es-ES/marcflavour/marc21/optional/marc21_simple_bib_frameworks.sql b/installer/data/mysql/es-ES/marcflavour/marc21/optional/marc21_simple_bib_frameworks.sql index 188885b..7b5d5c1 100644 --- a/installer/data/mysql/es-ES/marcflavour/marc21/optional/marc21_simple_bib_frameworks.sql +++ b/installer/data/mysql/es-ES/marcflavour/marc21/optional/marc21_simple_bib_frameworks.sql @@ -6,7 +6,7 @@ -- ******************************************************************* -- SIMPLE BOOKS KOHA RECORD AND HOLDINGS MANAGEMENT FIELDS/SUBFIELDS. -- ******************************************************************* -INSERT IGNORE INTO biblio_framework VALUES +INSERT IGNORE INTO biblio_framework (frameworkcode, frameworktext) VALUES ( 'BKS', 'Libros' ); INSERT IGNORE INTO marc_tag_structure ( @@ -29,7 +29,7 @@ INSERT IGNORE INTO marc_subfield_structure ( -- **************************************************************************** -- SIMPLE COMPUTER FILES KOHA RECORD AND HOLDINGS MANAGEMENT FIELDS/SUBFIELDS. -- **************************************************************************** -INSERT IGNORE INTO biblio_framework VALUES +INSERT IGNORE INTO biblio_framework (frameworkcode, frameworktext) VALUES ( 'CF', 'CD-ROMs, DVD-ROMs, Recursos en línea' ); INSERT IGNORE INTO marc_tag_structure ( tagfield, liblibrarian, libopac, repeatable, mandatory, authorised_value, frameworkcode) @@ -52,7 +52,7 @@ INSERT IGNORE INTO marc_subfield_structure ( -- ***************************************************************************** -- SIMPLE SOUND RECORDINGS KOHA RECORD AND HOLDINGS MANAGEMENT FIELDS/SUBFIELDS. -- ***************************************************************************** -INSERT IGNORE INTO biblio_framework VALUES +INSERT IGNORE INTO biblio_framework (frameworkcode, frameworktext) VALUES ( 'SR', 'Audio Casetes, CD' ); INSERT IGNORE INTO marc_tag_structure ( @@ -76,7 +76,7 @@ INSERT IGNORE INTO marc_subfield_structure ( -- **************************************************************************** -- SIMPLE VIDEORECORDINGS KOHA RECORD AND HOLDINGS MANAGEMENT FIELDS/SUBFIELDS. -- **************************************************************************** -INSERT IGNORE INTO biblio_framework VALUES +INSERT IGNORE INTO biblio_framework (frameworkcode, frameworktext) VALUES ( 'VR', 'DVDs, VHS' ); INSERT IGNORE INTO marc_tag_structure ( @@ -100,7 +100,7 @@ INSERT IGNORE INTO marc_subfield_structure ( -- ************************************************************************** -- SIMPLE 3D ARTIFACTS KOHA RECORD AND HOLDINGS MANAGEMENT FIELDS/SUBFIELDS. -- ************************************************************************** -INSERT IGNORE INTO biblio_framework VALUES +INSERT IGNORE INTO biblio_framework (frameworkcode, frameworktext) VALUES ( 'AR', 'Modelos' ); INSERT IGNORE INTO marc_tag_structure ( @@ -124,7 +124,7 @@ INSERT IGNORE INTO marc_subfield_structure ( -- ****************************************************************** -- SIMPLE KITS KOHA RECORD AND HOLDINGS MANAGEMENT FIELDS/SUBFIELDS. -- ****************************************************************** -INSERT IGNORE INTO biblio_framework VALUES +INSERT IGNORE INTO biblio_framework (frameworkcode, frameworktext) VALUES ( 'KT', 'Conjuntos' ); INSERT IGNORE INTO marc_tag_structure ( @@ -148,7 +148,7 @@ INSERT IGNORE INTO marc_subfield_structure ( -- ********************************************************************************** -- SIMPLE INTEGRATING RESOURCES KOHA RECORD AND HOLDINGS MANAGEMENT FIELDS/SUBFIELDS. -- ********************************************************************************** -INSERT IGNORE INTO biblio_framework VALUES +INSERT IGNORE INTO biblio_framework (frameworkcode, frameworktext) VALUES ( 'IR', 'Carpetas' ); INSERT IGNORE INTO marc_tag_structure ( @@ -172,7 +172,7 @@ INSERT IGNORE INTO marc_subfield_structure ( -- ********************************************************************* -- SIMPLE SERIALS KOHA RECORD AND HOLDINGS MANAGEMENT FIELDS/SUBFIELDS. -- ********************************************************************* -INSERT IGNORE INTO biblio_framework VALUES +INSERT IGNORE INTO biblio_framework (frameworkcode, frameworktext) VALUES ( 'SER', 'Seriadas' ); INSERT IGNORE INTO marc_tag_structure ( @@ -494,7 +494,7 @@ UPDATE marc_subfield_structure SET hidden = 9 WHERE tagfield = '942' AND tagsubf UPDATE marc_subfield_structure SET hidden = 0 WHERE tagfield = '952' AND tagsubfield = '1' AND frameworkcode IN ('AR','BKS','CF','IR','KT','SER','SR','VR'); -- Create the ACQ framework based on the default framework, fields 952 only -INSERT IGNORE INTO biblio_framework VALUES( 'ACQ', 'Acquisition framework' ); +INSERT IGNORE INTO biblio_framework (frameworkcode, frameworktext) VALUES( 'ACQ', 'Acquisition framework' ); INSERT INTO marc_tag_structure(tagfield, liblibrarian, libopac, repeatable, mandatory, authorised_value, frameworkcode) SELECT tagfield, liblibrarian, libopac, repeatable, mandatory, authorised_value, 'ACQ' FROM marc_tag_structure WHERE tagfield='952' AND frameworkcode=''; diff --git a/installer/data/mysql/fr-CA/marcflavour/marc21/facultatif/marc21_grille_simple.sql b/installer/data/mysql/fr-CA/marcflavour/marc21/facultatif/marc21_grille_simple.sql index c368099..566d97f 100644 --- a/installer/data/mysql/fr-CA/marcflavour/marc21/facultatif/marc21_grille_simple.sql +++ b/installer/data/mysql/fr-CA/marcflavour/marc21/facultatif/marc21_grille_simple.sql @@ -1,4 +1,4 @@ -INSERT IGNORE INTO biblio_framework VALUES +INSERT IGNORE INTO biblio_framework (frameworkcode, frameworktext) VALUES ('SIMP', 'Grille simplifiée'); INSERT IGNORE INTO marc_tag_structure (tagfield, liblibrarian, libopac, repeatable, mandatory, authorised_value, frameworkcode) diff --git a/installer/data/mysql/fr-CA/marcflavour/marc21/obligatoire/marc21_sample_acq_framework.sql b/installer/data/mysql/fr-CA/marcflavour/marc21/obligatoire/marc21_sample_acq_framework.sql index c371d95..fde4532 100644 --- a/installer/data/mysql/fr-CA/marcflavour/marc21/obligatoire/marc21_sample_acq_framework.sql +++ b/installer/data/mysql/fr-CA/marcflavour/marc21/obligatoire/marc21_sample_acq_framework.sql @@ -1,4 +1,4 @@ -INSERT IGNORE INTO biblio_framework VALUES +INSERT IGNORE INTO biblio_framework (frameworkcode, frameworktext) VALUES ('ACQ', 'Grille d\'acquisitions'); INSERT IGNORE INTO marc_tag_structure (tagfield, liblibrarian, libopac, repeatable, mandatory, authorised_value, frameworkcode) diff --git a/installer/data/mysql/fr-CA/marcflavour/marc21/obligatoire/marc21_sample_fastadd_framework.sql b/installer/data/mysql/fr-CA/marcflavour/marc21/obligatoire/marc21_sample_fastadd_framework.sql index 3da994f..8054277 100644 --- a/installer/data/mysql/fr-CA/marcflavour/marc21/obligatoire/marc21_sample_fastadd_framework.sql +++ b/installer/data/mysql/fr-CA/marcflavour/marc21/obligatoire/marc21_sample_fastadd_framework.sql @@ -1,4 +1,4 @@ -INSERT IGNORE INTO biblio_framework VALUES +INSERT IGNORE INTO biblio_framework (frameworkcode, frameworktext) VALUES ('FA', 'Grille d\'ajout rapide'); INSERT IGNORE INTO marc_tag_structure (tagfield, liblibrarian, libopac, repeatable, mandatory, authorised_value, frameworkcode) diff --git a/installer/data/mysql/fr-FR/marcflavour/marc21/Optionnel/marc21_simple_bib_frameworks.sql b/installer/data/mysql/fr-FR/marcflavour/marc21/Optionnel/marc21_simple_bib_frameworks.sql index b8bc4b4..2c7037f 100644 --- a/installer/data/mysql/fr-FR/marcflavour/marc21/Optionnel/marc21_simple_bib_frameworks.sql +++ b/installer/data/mysql/fr-FR/marcflavour/marc21/Optionnel/marc21_simple_bib_frameworks.sql @@ -31488,7 +31488,7 @@ INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian` ('998', 'w', 'PLINK (RLIN)', 'PLINK (RLIN)', 0, 0, '', 9, '', '', '', 0, 5, 'SER', '', '', NULL); -- Create the ACQ framework based on the default framework, fields 995 only -INSERT IGNORE INTO biblio_framework VALUES( 'ACQ', 'Acquisition framework' ); +INSERT IGNORE INTO biblio_framework (frameworkcode, frameworktext) VALUES( 'ACQ', 'Acquisition framework' ); INSERT INTO marc_tag_structure(tagfield, liblibrarian, libopac, repeatable, mandatory, authorised_value, frameworkcode) SELECT tagfield, liblibrarian, libopac, repeatable, mandatory, authorised_value, 'ACQ' FROM marc_tag_structure WHERE tagfield='995' AND frameworkcode=''; diff --git a/installer/data/mysql/fr-FR/marcflavour/unimarc_complet/Obligatoire/framework_DEFAULT.sql b/installer/data/mysql/fr-FR/marcflavour/unimarc_complet/Obligatoire/framework_DEFAULT.sql index b50ba60..d28c7b9 100644 --- a/installer/data/mysql/fr-FR/marcflavour/unimarc_complet/Obligatoire/framework_DEFAULT.sql +++ b/installer/data/mysql/fr-FR/marcflavour/unimarc_complet/Obligatoire/framework_DEFAULT.sql @@ -2138,7 +2138,7 @@ UPDATE `marc_subfield_structure` SET maxlength=24 WHERE tagfield='000'; UPDATE `marc_subfield_structure` SET maxlength=36 WHERE tagfield='100'; -- Create the ACQ framework based on the default framework, fields 995 only -INSERT IGNORE INTO biblio_framework VALUES( 'ACQ', 'Acquisition framework' ); +INSERT IGNORE INTO biblio_framework (frameworkcode, frameworktext) VALUES( 'ACQ', 'Acquisition framework' ); INSERT INTO marc_tag_structure(tagfield, liblibrarian, libopac, repeatable, mandatory, authorised_value, frameworkcode) SELECT tagfield, liblibrarian, libopac, repeatable, mandatory, authorised_value, 'ACQ' FROM marc_tag_structure WHERE tagfield='995' AND frameworkcode=''; diff --git a/installer/data/mysql/fr-FR/marcflavour/unimarc_lecture_pub/Obligatoire/framework_DEFAULT.sql b/installer/data/mysql/fr-FR/marcflavour/unimarc_lecture_pub/Obligatoire/framework_DEFAULT.sql index 8937249..4a255d5 100644 --- a/installer/data/mysql/fr-FR/marcflavour/unimarc_lecture_pub/Obligatoire/framework_DEFAULT.sql +++ b/installer/data/mysql/fr-FR/marcflavour/unimarc_lecture_pub/Obligatoire/framework_DEFAULT.sql @@ -7888,7 +7888,7 @@ UPDATE `marc_subfield_structure` SET maxlength=24 WHERE tagfield='000'; UPDATE `marc_subfield_structure` SET maxlength=36 WHERE tagfield='100'; -- Create the ACQ framework based on the default framework, fields 995 only -INSERT IGNORE INTO biblio_framework VALUES( 'ACQ', 'Acquisition framework' ); +INSERT IGNORE INTO biblio_framework (frameworkcode, frameworktext) VALUES( 'ACQ', 'Acquisition framework' ); INSERT INTO marc_tag_structure(tagfield, liblibrarian, libopac, repeatable, mandatory, authorised_value, frameworkcode) SELECT tagfield, liblibrarian, libopac, repeatable, mandatory, authorised_value, 'ACQ' FROM marc_tag_structure WHERE tagfield='995' AND frameworkcode=''; diff --git a/installer/data/mysql/it-IT/marcflavour/marc21/optional/marc21_sample_fastadd_framework.sql b/installer/data/mysql/it-IT/marcflavour/marc21/optional/marc21_sample_fastadd_framework.sql index c4dc621..16a8b05 100644 --- a/installer/data/mysql/it-IT/marcflavour/marc21/optional/marc21_sample_fastadd_framework.sql +++ b/installer/data/mysql/it-IT/marcflavour/marc21/optional/marc21_sample_fastadd_framework.sql @@ -1,4 +1,4 @@ -INSERT IGNORE INTO biblio_framework VALUES +INSERT IGNORE INTO biblio_framework (frameworkcode, frameworktext) VALUES ('FA', 'Cat. veloce'); INSERT IGNORE INTO marc_tag_structure (tagfield, liblibrarian, libopac, repeatable, mandatory, authorised_value, frameworkcode) diff --git a/installer/data/mysql/it-IT/marcflavour/marc21/optional/marc21_simple_bib_frameworks.sql b/installer/data/mysql/it-IT/marcflavour/marc21/optional/marc21_simple_bib_frameworks.sql index 2391159..9cc465e 100644 --- a/installer/data/mysql/it-IT/marcflavour/marc21/optional/marc21_simple_bib_frameworks.sql +++ b/installer/data/mysql/it-IT/marcflavour/marc21/optional/marc21_simple_bib_frameworks.sql @@ -6,7 +6,7 @@ -- ******************************************************************* -- SIMPLE BOOKS KOHA RECORD AND HOLDINGS MANAGEMENT FIELDS/SUBFIELDS. -- ******************************************************************* -INSERT IGNORE INTO biblio_framework VALUES +INSERT IGNORE INTO biblio_framework (frameworkcode, frameworktext) VALUES ( 'BKS', 'Libri' ); INSERT IGNORE INTO marc_tag_structure ( @@ -29,7 +29,7 @@ INSERT IGNORE INTO marc_subfield_structure ( -- **************************************************************************** -- SIMPLE COMPUTER FILES KOHA RECORD AND HOLDINGS MANAGEMENT FIELDS/SUBFIELDS. -- **************************************************************************** -INSERT IGNORE INTO biblio_framework VALUES +INSERT IGNORE INTO biblio_framework (frameworkcode, frameworktext) VALUES ( 'CF', 'Risorse elettroniche' ); INSERT IGNORE INTO marc_tag_structure ( tagfield, liblibrarian, libopac, repeatable, mandatory, authorised_value, frameworkcode) @@ -52,7 +52,7 @@ INSERT IGNORE INTO marc_subfield_structure ( -- ***************************************************************************** -- SIMPLE SOUND RECORDINGS KOHA RECORD AND HOLDINGS MANAGEMENT FIELDS/SUBFIELDS. -- ***************************************************************************** -INSERT IGNORE INTO biblio_framework VALUES +INSERT IGNORE INTO biblio_framework (frameworkcode, frameworktext) VALUES ( 'SR', 'CD e cassette audio' ); INSERT IGNORE INTO marc_tag_structure ( @@ -76,7 +76,7 @@ INSERT IGNORE INTO marc_subfield_structure ( -- **************************************************************************** -- SIMPLE VIDEORECORDINGS KOHA RECORD AND HOLDINGS MANAGEMENT FIELDS/SUBFIELDS. -- **************************************************************************** -INSERT IGNORE INTO biblio_framework VALUES +INSERT IGNORE INTO biblio_framework (frameworkcode, frameworktext) VALUES ( 'VR', 'DVD, VHS' ); INSERT IGNORE INTO marc_tag_structure ( @@ -100,7 +100,7 @@ INSERT IGNORE INTO marc_subfield_structure ( -- ************************************************************************** -- SIMPLE 3D ARTIFACTS KOHA RECORD AND HOLDINGS MANAGEMENT FIELDS/SUBFIELDS. -- ************************************************************************** -INSERT IGNORE INTO biblio_framework VALUES +INSERT IGNORE INTO biblio_framework (frameworkcode, frameworktext) VALUES ( 'AR', 'Modelli' ); INSERT IGNORE INTO marc_tag_structure ( @@ -124,7 +124,7 @@ INSERT IGNORE INTO marc_subfield_structure ( -- ****************************************************************** -- SIMPLE KITS KOHA RECORD AND HOLDINGS MANAGEMENT FIELDS/SUBFIELDS. -- ****************************************************************** -INSERT IGNORE INTO biblio_framework VALUES +INSERT IGNORE INTO biblio_framework (frameworkcode, frameworktext) VALUES ( 'KT', 'Kits' ); INSERT IGNORE INTO marc_tag_structure ( @@ -148,7 +148,7 @@ INSERT IGNORE INTO marc_subfield_structure ( -- ********************************************************************************** -- SIMPLE INTEGRATING RESOURCES KOHA RECORD AND HOLDINGS MANAGEMENT FIELDS/SUBFIELDS. -- ********************************************************************************** -INSERT IGNORE INTO biblio_framework VALUES +INSERT IGNORE INTO biblio_framework (frameworkcode, frameworktext) VALUES ( 'IR', 'Raccolte' ); INSERT IGNORE INTO marc_tag_structure ( @@ -172,7 +172,7 @@ INSERT IGNORE INTO marc_subfield_structure ( -- ********************************************************************* -- SIMPLE SERIALS KOHA RECORD AND HOLDINGS MANAGEMENT FIELDS/SUBFIELDS. -- ********************************************************************* -INSERT IGNORE INTO biblio_framework VALUES +INSERT IGNORE INTO biblio_framework (frameworkcode, frameworktext) VALUES ( 'SER', 'Seriali' ); INSERT IGNORE INTO marc_tag_structure ( @@ -494,7 +494,7 @@ UPDATE marc_subfield_structure SET hidden = 9 WHERE tagfield = '942' AND tagsubf UPDATE marc_subfield_structure SET hidden = 0 WHERE tagfield = '952' AND tagsubfield = '1' AND frameworkcode IN ('AR','BKS','CF','IR','KT','SER','SR','VR'); -- Create the ACQ framework based on the default framework, fields 952 only -INSERT IGNORE INTO biblio_framework VALUES( 'ACQ', 'Acquisition framework' ); +INSERT IGNORE INTO biblio_framework (frameworkcode, frameworktext) VALUES( 'ACQ', 'Acquisition framework' ); INSERT INTO marc_tag_structure(tagfield, liblibrarian, libopac, repeatable, mandatory, authorised_value, frameworkcode) SELECT tagfield, liblibrarian, libopac, repeatable, mandatory, authorised_value, 'ACQ' FROM marc_tag_structure WHERE tagfield='952' AND frameworkcode=''; diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index aa8f78f..5c2dcf8 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -152,6 +152,7 @@ DROP TABLE IF EXISTS `biblio_framework`; CREATE TABLE `biblio_framework` ( -- information about MARC frameworks `frameworkcode` varchar(4) NOT NULL default '', -- the unique code assigned to the framework `frameworktext` varchar(255) NOT NULL default '', -- the description/name given to the framework + `frameworktype` ENUM( 'bib', 'hld' ) NOT NULL DEFAULT 'bib', -- Framework type: biblio or holdings PRIMARY KEY (`frameworkcode`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; @@ -668,6 +669,7 @@ CREATE TABLE `deleteditems` ( `copynumber` varchar(32) default NULL, -- copy number (MARC21 952$t) `stocknumber` varchar(32) default NULL, -- inventory number (MARC21 952$i) `new_status` VARCHAR(32) DEFAULT NULL, -- 'new' value, you can put whatever free-text information. This field is intented to be managed by the automatic_item_modification_by_age cronjob. + `holding_id` int(11) default NULL, -- foreign key from holdings table used to link this item to the right holdings record PRIMARY KEY (`itemnumber`), KEY `delitembarcodeidx` (`barcode`), KEY `delitemstocknumberidx` (`stocknumber`), @@ -879,11 +881,55 @@ CREATE TABLE `refund_lost_item_fee_rules` ( -- refund lost item fee rules tbale ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- +-- Table structure for table `holdings` +-- + +DROP TABLE IF EXISTS `holdings`; +CREATE TABLE `holdings` ( -- table that stores summary holdings information + `holding_id` int(11) NOT NULL auto_increment, -- unique identifier assigned to each holdings record + `biblionumber` int(11) NOT NULL default 0, -- foreign key from biblio table used to link this record to the right bib record + `biblioitemnumber` int(11) NOT NULL default 0, -- foreign key from the biblioitems table to link record to additional information + `frameworkcode` varchar(4) NOT NULL default '', -- foreign key from the biblio_framework table to identify which framework was used in cataloging this record + `holdingbranch` varchar(10) default NULL, -- foreign key from the branches table for the library that owns this record (MARC21 852$a) + `location` varchar(80) default NULL, -- authorized value for the shelving location for this record (MARC21 852$b) + `callnumber` varchar(255) default NULL, -- call number (852$h+$i in MARC21) + `suppress` tinyint(1) default NULL, -- Boolean indicating whether the record is suppressed in OPAC + `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, -- date and time this record was last touched + `datecreated` DATE NOT NULL, -- the date this record was added to Koha + `deleted_at` DATETIME DEFAULT NULL, -- the date this record was deleted + PRIMARY KEY (`holding_id`), + KEY `hldnoidx` (`holding_id`), + KEY `hldbinoidx` (`biblioitemnumber`), + KEY `hldbibnoidx` (`biblionumber`), + CONSTRAINT `holdings_ibfk_1` FOREIGN KEY (`biblionumber`) REFERENCES `biblio` (`biblionumber`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `holdings_ibfk_2` FOREIGN KEY (`biblioitemnumber`) REFERENCES `biblioitems` (`biblioitemnumber`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `holdings_ibfk_3` FOREIGN KEY (`holdingbranch`) REFERENCES `branches` (`branchcode`) ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + +-- +-- Table structure for table `holdings_metadata` +-- + +DROP TABLE IF EXISTS `holdings_metadata`; +CREATE TABLE holdings_metadata ( + `id` INT(11) NOT NULL AUTO_INCREMENT, + `holding_id` INT(11) NOT NULL, + `format` VARCHAR(16) NOT NULL, + `marcflavour` VARCHAR(16) NOT NULL, + `metadata` LONGTEXT NOT NULL, + `deleted_at` DATETIME DEFAULT NULL, -- the date this record was deleted + PRIMARY KEY(id), + UNIQUE KEY `holdings_metadata_uniq_key` (`holding_id`,`format`,`marcflavour`), + KEY `hldnoidx` (`holding_id`), + CONSTRAINT `holdings_metadata_fk_1` FOREIGN KEY (`holding_id`) REFERENCES `holdings` (`holding_id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + +-- -- Table structure for table `items` -- DROP TABLE IF EXISTS `items`; -CREATE TABLE `items` ( -- holdings/item information +CREATE TABLE `items` ( -- item information `itemnumber` int(11) NOT NULL auto_increment, -- primary key and unique identifier added by Koha `biblionumber` int(11) NOT NULL default 0, -- foreign key from biblio table used to link this item to the right bib record `biblioitemnumber` int(11) NOT NULL default 0, -- foreign key from the biblioitems table to link to item to additional information @@ -929,6 +975,7 @@ CREATE TABLE `items` ( -- holdings/item information `copynumber` varchar(32) default NULL, -- copy number (MARC21 952$t) `stocknumber` varchar(32) default NULL, -- inventory number (MARC21 952$i) `new_status` VARCHAR(32) DEFAULT NULL, -- 'new' value, you can put whatever free-text information. This field is intented to be managed by the automatic_item_modification_by_age cronjob. + `holding_id` int(11) default NULL, -- foreign key from holdings table used to link this item to the right holdings record PRIMARY KEY (`itemnumber`), UNIQUE KEY `itembarcodeidx` (`barcode`), KEY `itemstocknumberidx` (`stocknumber`), @@ -941,10 +988,12 @@ CREATE TABLE `items` ( -- holdings/item information KEY `items_ccode` (`ccode`), KEY `itype_idx` (`itype`), KEY `timestamp` (`timestamp`), + KEY `hldid_idx` (`holding_id`), CONSTRAINT `items_ibfk_1` FOREIGN KEY (`biblioitemnumber`) REFERENCES `biblioitems` (`biblioitemnumber`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `items_ibfk_2` FOREIGN KEY (`homebranch`) REFERENCES `branches` (`branchcode`) ON UPDATE CASCADE, CONSTRAINT `items_ibfk_3` FOREIGN KEY (`holdingbranch`) REFERENCES `branches` (`branchcode`) ON UPDATE CASCADE, - CONSTRAINT `items_ibfk_4` FOREIGN KEY (`biblionumber`) REFERENCES `biblio` (`biblionumber`) ON DELETE CASCADE ON UPDATE CASCADE + CONSTRAINT `items_ibfk_4` FOREIGN KEY (`biblionumber`) REFERENCES `biblio` (`biblionumber`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `items_ibfk_5` FOREIGN KEY (`holding_id`) REFERENCES `holdings` (`holding_id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- diff --git a/installer/data/mysql/mandatory/auth_val_cat.sql b/installer/data/mysql/mandatory/auth_val_cat.sql index 09ce8c0..c428839 100644 --- a/installer/data/mysql/mandatory/auth_val_cat.sql +++ b/installer/data/mysql/mandatory/auth_val_cat.sql @@ -18,6 +18,7 @@ INSERT IGNORE INTO authorised_value_categories( category_name ) INSERT IGNORE INTO authorised_value_categories( category_name ) VALUES ('branches'), + ('holdings'), ('itemtypes'), ('cn_source'); diff --git a/installer/data/mysql/nb-NO/marcflavour/marc21/optional/marc21_sample_fastadd_framework.sql b/installer/data/mysql/nb-NO/marcflavour/marc21/optional/marc21_sample_fastadd_framework.sql index 3b5d7bb..64608aa 100644 --- a/installer/data/mysql/nb-NO/marcflavour/marc21/optional/marc21_sample_fastadd_framework.sql +++ b/installer/data/mysql/nb-NO/marcflavour/marc21/optional/marc21_sample_fastadd_framework.sql @@ -1,4 +1,4 @@ -INSERT IGNORE INTO biblio_framework VALUES ( 'FA','Fast Add Framework' ); +INSERT IGNORE INTO biblio_framework (frameworkcode, frameworktext) VALUES ( 'FA','Fast Add Framework' ); INSERT IGNORE INTO `marc_tag_structure` (`tagfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `authorised_value`, `frameworkcode`) VALUES ('000', 'LEADER', 'LEADER', 0, 1, '', 'FA'), ('008', 'FIXED-LENGTH DATA ELEMENTS--GENERAL INFORMATION', 'FIXED-LENGTH DATA ELEMENTS--GENERAL INFORMATION', 0, 1, '', 'FA'), diff --git a/installer/data/mysql/nb-NO/marcflavour/marc21/optional/marc21_simple_bib_frameworks.sql b/installer/data/mysql/nb-NO/marcflavour/marc21/optional/marc21_simple_bib_frameworks.sql index 6e84df2..1c75753 100644 --- a/installer/data/mysql/nb-NO/marcflavour/marc21/optional/marc21_simple_bib_frameworks.sql +++ b/installer/data/mysql/nb-NO/marcflavour/marc21/optional/marc21_simple_bib_frameworks.sql @@ -31480,7 +31480,7 @@ INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian` ('998', 'w', 'PLINK (RLIN)', 'PLINK (RLIN)', 0, 0, '', 9, '', '', '', 0, 5, 'SER', '', '', NULL); -- Create the ACQ framework based on the default framework, fields 952 only -INSERT IGNORE INTO biblio_framework VALUES( 'ACQ', 'Acquisition framework' ); +INSERT IGNORE INTO biblio_framework (frameworkcode, frameworktext) VALUES( 'ACQ', 'Acquisition framework' ); INSERT INTO marc_tag_structure(tagfield, liblibrarian, libopac, repeatable, mandatory, authorised_value, frameworkcode) SELECT tagfield, liblibrarian, libopac, repeatable, mandatory, authorised_value, 'ACQ' FROM marc_tag_structure WHERE tagfield='952' AND frameworkcode=''; diff --git a/installer/data/mysql/nb-NO/marcflavour/normarc/Valgfritt/normarc_fastadd_framework.sql b/installer/data/mysql/nb-NO/marcflavour/normarc/Valgfritt/normarc_fastadd_framework.sql index ae4d676..9ecc778 100644 --- a/installer/data/mysql/nb-NO/marcflavour/normarc/Valgfritt/normarc_fastadd_framework.sql +++ b/installer/data/mysql/nb-NO/marcflavour/normarc/Valgfritt/normarc_fastadd_framework.sql @@ -15,7 +15,7 @@ -- with this program; if not, write to the Free Software Foundation, Inc., -- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -INSERT IGNORE INTO biblio_framework VALUES ( 'FA','Hurtigkatalogisering' ); +INSERT IGNORE INTO biblio_framework (frameworkcode, frameworktext) VALUES ( 'FA','Hurtigkatalogisering' ); DELETE FROM marc_tag_structure WHERE frameworkcode='FA'; INSERT INTO marc_tag_structure (tagfield,liblibrarian,libopac,repeatable,mandatory,authorised_value,frameworkcode) VALUES ('000','Postens hode','Postens hode','0','1','','FA'); diff --git a/installer/data/mysql/pl-PL/marcflavour/marc21/optional/marc21_sample_fastadd_framework.sql b/installer/data/mysql/pl-PL/marcflavour/marc21/optional/marc21_sample_fastadd_framework.sql index 77dde7e..e71d41b 100644 --- a/installer/data/mysql/pl-PL/marcflavour/marc21/optional/marc21_sample_fastadd_framework.sql +++ b/installer/data/mysql/pl-PL/marcflavour/marc21/optional/marc21_sample_fastadd_framework.sql @@ -1,4 +1,4 @@ -INSERT IGNORE INTO biblio_framework VALUES ( 'FA','Fast Add Framework' ); +INSERT IGNORE INTO biblio_framework (frameworkcode, frameworktext) VALUES ( 'FA','Fast Add Framework' ); INSERT IGNORE INTO `marc_tag_structure` (`tagfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `authorised_value`, `frameworkcode`) VALUES ('000', 'LEADER', 'LEADER', 0, 1, '', 'FA'), ('008', 'FIXED-LENGTH DATA ELEMENTS--GENERAL INFORMATION', 'FIXED-LENGTH DATA ELEMENTS--GENERAL INFORMATION', 0, 1, '', 'FA'), diff --git a/installer/data/mysql/ru-RU/marcflavour/unimarc/mandatory/unimarc_bibliographic_DEFAULT_general.sql b/installer/data/mysql/ru-RU/marcflavour/unimarc/mandatory/unimarc_bibliographic_DEFAULT_general.sql index cc0e7ce..7b90e1a 100644 --- a/installer/data/mysql/ru-RU/marcflavour/unimarc/mandatory/unimarc_bibliographic_DEFAULT_general.sql +++ b/installer/data/mysql/ru-RU/marcflavour/unimarc/mandatory/unimarc_bibliographic_DEFAULT_general.sql @@ -2212,7 +2212,7 @@ INSERT INTO marc_subfield_structure (frameworkcode, authtypecode, tagfield, tag ('', '', '899', 'z', 0, 1, 'Публикуемое примечание', 'Публикуемое примечание', 8, 0, '', '', '', 0, NULL, '', ''); -- Create the ACQ framework based on the default framework, fields 995 only -INSERT IGNORE INTO biblio_framework VALUES( 'ACQ', 'Acquisition framework' ); +INSERT IGNORE INTO biblio_framework (frameworkcode, frameworktext) VALUES( 'ACQ', 'Acquisition framework' ); INSERT INTO marc_tag_structure(tagfield, liblibrarian, libopac, repeatable, mandatory, authorised_value, frameworkcode) SELECT tagfield, liblibrarian, libopac, repeatable, mandatory, authorised_value, 'ACQ' FROM marc_tag_structure WHERE tagfield='995' AND frameworkcode=''; diff --git a/installer/data/mysql/uk-UA/marcflavour/marc21/mandatory/marc21_bibliographic_DEFAULT_general.sql b/installer/data/mysql/uk-UA/marcflavour/marc21/mandatory/marc21_bibliographic_DEFAULT_general.sql index 5c2b890..b8828e2 100644 --- a/installer/data/mysql/uk-UA/marcflavour/marc21/mandatory/marc21_bibliographic_DEFAULT_general.sql +++ b/installer/data/mysql/uk-UA/marcflavour/marc21/mandatory/marc21_bibliographic_DEFAULT_general.sql @@ -4222,7 +4222,7 @@ INSERT INTO marc_subfield_structure (frameworkcode, authtypecode, tagfield, tag ('', '', '899', 'v', 0, 0, 'Позначення та номер тому / порядкове позначення', '', 8, 5, '', '', '', NULL, '', '', NULL); -- Create the ACQ framework based on the default framework, fields 952 only -INSERT IGNORE INTO biblio_framework VALUES( 'ACQ', 'Acquisition framework' ); +INSERT IGNORE INTO biblio_framework (frameworkcode, frameworktext) VALUES( 'ACQ', 'Acquisition framework' ); INSERT INTO marc_tag_structure(tagfield, liblibrarian, libopac, repeatable, mandatory, authorised_value, frameworkcode) SELECT tagfield, liblibrarian, libopac, repeatable, mandatory, authorised_value, 'ACQ' FROM marc_tag_structure WHERE tagfield='952' AND frameworkcode=''; diff --git a/installer/data/mysql/uk-UA/marcflavour/unimarc/mandatory/unimarc_bibliographic_DEFAULT_general.sql b/installer/data/mysql/uk-UA/marcflavour/unimarc/mandatory/unimarc_bibliographic_DEFAULT_general.sql index 7297ecb..728994b 100644 --- a/installer/data/mysql/uk-UA/marcflavour/unimarc/mandatory/unimarc_bibliographic_DEFAULT_general.sql +++ b/installer/data/mysql/uk-UA/marcflavour/unimarc/mandatory/unimarc_bibliographic_DEFAULT_general.sql @@ -2214,7 +2214,7 @@ INSERT INTO marc_subfield_structure (frameworkcode, authtypecode, tagfield, tag ('', '', '886', 'b', 1, 0, 'Індикатори та підполя вихідного формату', '', -1, NULL, NULL, NULL, '', NULL, NULL, NULL, NULL); -- Create the ACQ framework based on the default framework, fields 995 only -INSERT IGNORE INTO biblio_framework VALUES( 'ACQ', 'Acquisition framework' ); +INSERT IGNORE INTO biblio_framework (frameworkcode, frameworktext) VALUES( 'ACQ', 'Acquisition framework' ); INSERT INTO marc_tag_structure(tagfield, liblibrarian, libopac, repeatable, mandatory, authorised_value, frameworkcode) SELECT tagfield, liblibrarian, libopac, repeatable, mandatory, authorised_value, 'ACQ' FROM marc_tag_structure WHERE tagfield='995' AND frameworkcode=''; diff --git a/koha-tmpl/intranet-tmpl/prog/css/addholding.css b/koha-tmpl/intranet-tmpl/prog/css/addholding.css new file mode 100644 index 0000000..6900e70 --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/css/addholding.css @@ -0,0 +1,171 @@ +#addholdingtabs { + margin-top : 1em; +} + +#addholdingtabs .ui-tabs-panel { + float : left; +} + +.buttonPlus { + font-weight : bold; + text-decoration : none; +} + +.buttonMinus { + font-weight : bold; + text-decoration : none; +} + +a.expandfield { + text-decoration : none; +} + +#authoritytabs { + margin-top : 1em; + margin-bottom : 1em; +} + +.toptabs .ui-tabs-nav li a { + padding : .2em 1.2em; +} + +div.tag { + clear: both; +} + +div.subfield_line { + padding-bottom: .3em; + float: left; + clear: left; + width: 100%; +} + +div.subfield_line label { + font-size:89%; + float: left; + padding-right : .4em; + width: 16em; + text-align: left; + clear:left; +} + +.subfieldcode img { + cursor: pointer; +} + +.tag_title { + font-size : 90%; + padding : .2em 0; +} + +.tagnum { + font-size : 110%; + font-weight : bold; + color : #000; + padding : .1em .3em .1em 0; +} + +a.tagnum { + font-size : 110%; + font-weight : bold; + color : #000; + padding : .1em .3em .1em 0; + text-decoration : none; +} + +.subfield { + color : #00698a; + float: left; + width: 10em; + text-align:right; +} + +.subfieldcode { + display: block; + float: left; +} + +.labelsubfield { + float:left; +} + +.input_marceditor { + float:left; + width:30em; +} + +.indicator { + width: 1em; + box-sizing: content-box; +} + +*html .input_marceditor { + width : 15em; +} + +#cataloguing_additem_newitem fieldset.rows label, #cataloguing_additem_newitem fieldset.rows span.label { + font-size : 100%; + width : 25%; +} + +#cataloguing_additem_newitem fieldset.rows li { + padding-bottom : 3px; +} +#cataloguing_additem_newitem .input_marceditor { + width : auto; +} + +#cataloguing_additem_newitem textarea.input_marceditor { + width : 31em; +} + +.mandatory_marker { + color: red; +} +.linktools { display: block; white-space: nowrap; } +.linktools a { font-size : 75%; display:block;text-decoration:none;} +.linktools a {margin:0 2px;padding:2px;background-color:#FFF;text-align:center; } +.linktools a:first-child { border-bottom: 1px solid #DDD; } +.linktools a:hover { background-color: #FFC; } +.subfield_controls { margin : 0 .5em; } +.readonly { border-width : 1px; border-style: inset; padding-left : 15px; background: #EEE url(../img/locked.png) center left no-repeat; width:29em; } + +#cataloguing_additem_itemlist { + margin-bottom : 1em; +} +.yui-gf div.first { + width : 19%; +} + +.yui-gf .yui-u { + width: 79.2%; +} + +tbody tr.active:nth-child(2n+1) td, +tbody tr.active td { + background-color: #FFFFCC; +} + +#loading { + background-color: #FFF; + cursor: wait; + height: 100%; + left: 0; + opacity: .7; + position: fixed; + top: 0; + width: 100%; + z-index: 1000; +} +#loading div { + background : transparent url(../img/loading.gif) top left no-repeat; + font-size : 175%; + font-weight: bold; + height: 2em; + left: 50%; + margin: -1em 0 0 -2.5em; + padding-left : 50px; + position: absolute; + top: 50%; + width: 15em; +} diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc index 781b797..a6312ef 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc @@ -10,6 +10,10 @@ CAN_user_serials_create_subscription ) %]
  • New record
  • [% END %] + [% IF show_summary_holdings and CAN_user_editcatalogue_edit_items %] +
  • New holding
  • + [% END %] + [% IF ( CAN_user_editcatalogue_edit_items ) %]
  • New item
  • [% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/biblio_framework.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/biblio_framework.tt index 56f979d..d0d5164 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/biblio_framework.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/biblio_framework.tt @@ -63,7 +63,7 @@ [% END %] [% IF op == 'add_form' %] -

    [% IF framework %]Modify framework text[% ELSE %]Add framework[% END %]

    +

    [% IF framework %]Modify framework[% ELSE %]Add framework[% END %]

    @@ -86,6 +86,14 @@ Required +
  • + + + Required +
  • @@ -123,6 +131,7 @@ + @@ -130,6 +139,7 @@ + - [% FOREACH loo IN frameworks %] + - + [% IF (StaffDetailItemSelection) %][% END %] [% IF ( item_level_itypes ) %][% END %] + [% IF ( show_summary_holdings ) %][% END %] [% IF ( itemdata_ccode ) %][% END %] @@ -367,6 +423,9 @@ [% item.translated_description %] [% END %] + [% IF ( show_summary_holdings ) %] + + [% END %] [% IF ( itemdata_ccode ) %][% END %] @@ -989,12 +1048,16 @@ $("input[name='itemnumber'][type='checkbox']", $("#"+tab)).prop('checked', false); itemSelectionBuildActionLinks(tab); }); + + $('a.delete').click(function() { + return confirm(_('Are you sure?')); + }); }); [% END %] $(document).ready(function() { $('#bibliodetails').tabs(); - [% IF count == 0 %] + [% IF count == 0 and not show_summary_holdings %] $('#bibliodetails').tabs("option", "active", 3); [% END %] $('#search-form').focus(); diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt index ad8aefb..521e56d 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt @@ -1,5 +1,6 @@ [% USE Koha %] [% USE Branches %] +[% USE Holdings %] [% SET footerjs = 1 %] [% INCLUDE 'doc-head-open.inc' %] Koha › Catalog › Item details for [% title | html %] [% FOREACH subtitl IN subtitle %] [% subtitl.subfield | html %][% END %] @@ -53,6 +54,7 @@ [% END %] [% END %][% END %]
      +
    1. Holding: [% Holdings.GetLocation( ITEM_DAT.holding_id ) | html %] 
    2. Home library: [% Branches.GetName( ITEM_DAT.homebranch ) %] 
    3. [% IF ( item_level_itypes ) %]
    4. Item type: [% ITEM_DAT.itype %] 
    5. diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt index 459bc08..eadd286 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt @@ -1,5 +1,6 @@ [% USE Koha %] [% USE Biblio %] +[% USE Holdings %] [% USE KohaDates %] [% SET footerjs = 1 %] [% IF BiblioDefaultViewmarc %] @@ -475,6 +476,19 @@
    Type Code Description  
    Bibliographic   Default framework @@ -196,11 +206,11 @@
    [% IF loo.frameworktype == 'hld' %]Holdings[% ELSE %]Bibliographic[% END %] [% loo.frameworkcode %][% loo.frameworktext |html %][% IF loo.frameworktype == 'hld' and loo.frameworkcode == 'HLD' %]Default holdings framework[% ELSE %][% loo.frameworktext |html %][% END %]
    Item typeHoldingCurrent location Home libraryCollection[% Holdings.GetLocation(item.holding_id) | html %][% UNLESS ( singlebranchmode ) %][% Branches.GetName( item.branchcode ) %] [% END %] [% Branches.GetName(item.homebranch) %][% item.location %] [% item.ccode %]
    + [% IF ( SEARCH_RESULT.summary_holdings ) %] +
    + Holdings +
      + [% FOREACH holding IN SEARCH_RESULT.summary_holdings %] +
    • + [% Holdings.GetLocation(holding) | html %] +
    • + [% END %] +
    +
    + [% END %] + [% IF ( SEARCH_RESULT.items_count ) %] [% IF MaxSearchResultsItemsPerRecordStatusCheck && SEARCH_RESULT.items_count > MaxSearchResultsItemsPerRecordStatusCheck %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addholding.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addholding.tt new file mode 100644 index 0000000..83e2f2b --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addholding.tt @@ -0,0 +1,616 @@ +[% USE Koha %] +[% SET KOHA_VERSION = Koha.Preference('Version') %] +[% INCLUDE 'doc-head-open.inc' %] +Koha › Cataloging › [% IF ( holding_id ) %]Editing record number [% holding_id %][% ELSE %]Add holding record[% END %] +[% INCLUDE 'doc-head-close.inc' %] + + +[% INCLUDE 'browser-strings.inc' %] + + + + + +[% INCLUDE 'select2.inc' %] + + +[% IF ( bidi ) %] + +[% END %] + + + +
    +
    Loading, please wait...
    +
    + +[% INCLUDE 'header.inc' %] + + + +
    + +
    +
    +
    + +

    +[% IF ( holding_id ) %]Editing record number [% holding_id %] +[% ELSE %]Add holdings record +[% END %] +

    + +[% IF ( done ) %] + +[% ELSE %] + + + +[% END %] + +
    + [% IF CAN_user_editcatalogue_edit_items %] + + [% END %] + +
    + + +
    +
    + Cancel +
    +
    + +[% IF ( popup ) %] + +[% END %] + + + + + + +
    + + +[% FOREACH BIG_LOO IN BIG_LOOP %] +
    + + [% FOREACH innerloo IN BIG_LOO.innerloop %] + [% IF ( innerloo.tag ) %] +
    +
    + [% IF advancedMARCEditor %] + [% innerloo.tag %] + [% ELSE %] + [% innerloo.tag %] + [% IF marcflavour != 'NORMARC' %] ?[% END %] + [% END %] + [% IF ( innerloo.fixedfield ) %] + + + [% ELSE %] + + + [% END %] - + + [% UNLESS advancedMARCEditor %] + [% innerloo.tag_lib %] + [% END %] + + [% IF ( innerloo.repeatable ) %] + + Repeat this Tag + + [% END %] + + Delete this Tag + + + +
    + + [% FOREACH subfield_loo IN innerloo.subfield_loop %] + +
    + + [% UNLESS advancedMARCEditor %] + [% IF ( subfield_loo.fixedfield ) %]
    + + [% END %] + +
    + [% END %] + [% END %] +
    +[% END %] + +
    + + + +
    +
    +
    + +[% INCLUDE 'intranet-bottom.inc' %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_008_holdings.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_008_holdings.tt new file mode 100644 index 0000000..6f2dade --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_008_holdings.tt @@ -0,0 +1,193 @@ +[% INCLUDE 'doc-head-open.inc' %] +Koha › Holdings › 008 builder +[% INCLUDE 'doc-head-close.inc' %] + + +

    008 Fixed-length data elements

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    00-05 - Date entered on file[% f1 %]
    + +
    + +
    + +
    + +
    + +
    + +
    + +
    + +
    + +
    + +
    +
    Cancel
    +
    + + +[% INCLUDE 'popup-bottom.inc' %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_leader_holdings.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_leader_holdings.tt new file mode 100644 index 0000000..db3a5df --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_leader_holdings.tt @@ -0,0 +1,105 @@ +[% INCLUDE 'doc-head-open.inc' %] +Koha › Holdings › 000 - Leader builder +[% INCLUDE 'doc-head-close.inc' %] + + +
    + +

    000 - Leader

    + + + + + + + + + + + + + + + 07-08 - Undefined + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    0-4 Record size(auto-filled)
    + +
    + +
    9 - Character coding schemea - UCS/Unicode (auto-filled)
    10-16 - indicator/subfields/size(auto-filled)
    + +
    + +
    19 - Undefined
    20-24 - entry map & lengths(auto-filled)
    +
    Cancel
    +
    + +[% INCLUDE 'popup-bottom.inc' %] diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt index f4b823c..be67e10 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt @@ -4,6 +4,7 @@ [% USE Branches %] [% USE ColumnsSettings %] [% USE AuthorisedValues %] +[% USE Holdings %] [% SET TagsShowEnabled = ( ( Koha.Preference( 'TagsEnabled' ) == 1 ) && TagsShowOnDetail ) %] [% SET TagsInputEnabled = ( ( Koha.Preference( 'opacuserlogin' ) == 1 ) && ( Koha.Preference( 'TagsEnabled' ) == 1 ) && TagsInputOnDetail ) %] [% IF Koha.Preference('AmazonAssocTag') %] @@ -698,6 +699,33 @@ [% END %] [% END %] [% END # IF itemloop.size %] + [% IF summary_holdings %] + [% FOREACH holding IN summary_holdings %] + [% UNLESS holding.suppress %] + [% holding_details = Holdings.GetDetails(holding) %] + [% IF holding_details.public_note || holding_details.summary || holding_details.supplements || holding_details.indexes %] + +
    + Additional information for [% Holdings.GetLocation(holding, 1) | html %] +
      + [% IF holding_details.public_note %] +
    • Public note: [% holding_details.public_note | html %]
    • + [% END %] + [% IF holding_details.summary %] +
    • Summary: [% holding_details.summary | html %]
    • + [% END %] + [% IF holding_details.supplements %] +
    • Supplements: [% holding_details.supplements | html %]
    • + [% END %] + [% IF holding_details.indexes %] +
    • Indexes: [% holding_details.indexes | html %]
    • + [% END %] +
    +
    + [% END %] + [% END %] + [% END %] + [% END %] [% PROCESS 'shelfbrowser.inc' %] [% INCLUDE shelfbrowser tab='holdings' %]
    diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt index 3803627..5aa25e4 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt @@ -1,4 +1,5 @@ [% USE Koha %] +[% USE Holdings %] [% SET TagsShowEnabled = ( ( Koha.Preference( 'TagsEnabled' ) == 1 ) && TagsShowOnList ) %] [% SET TagsInputEnabled = ( ( Koha.Preference( 'opacuserlogin' ) == 1 ) && ( Koha.Preference( 'TagsEnabled' ) == 1 ) && TagsInputOnList ) %] @@ -400,6 +401,15 @@ [% END %] [% ELSE %] No items available: + [% IF ( SEARCH_RESULT.summary_holdings ) %] + + [% FOREACH holding IN SEARCH_RESULT.summary_holdings %] + [% UNLESS holding.suppress %] + [% Holdings.GetLocation(holding, 1) | html %], + [% END %] + [% END %] + + [% END %] [% END %] [% END # / IF SEARCH_RESULT.available_items_loop.size %] diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl index 7349b81..b1b6a8b 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl +++ b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl @@ -4,9 +4,10 @@ + exclude-result-prefixes="marc items holdings"> @@ -1159,7 +1160,21 @@ () - No items available + + No items available + : + + , + + + - + + + - + + + + diff --git a/opac/opac-detail.pl b/opac/opac-detail.pl index ff53871..ea483eb 100755 --- a/opac/opac-detail.pl +++ b/opac/opac-detail.pl @@ -735,6 +735,13 @@ if (scalar(@itemloop) == 0 || scalar(@otheritemloop) == 0) { } } +# Fetch summary holdings +if (C4::Context->preference('SummaryHoldings')) { + my $summary_holdings = C4::Holdings::GetHoldingsByBiblionumber($biblionumber); + $template->param( summary_holdings => $summary_holdings ); +} + + ## get notes and subjects from MARC record if (!C4::Context->preference("OPACXSLTDetailsDisplay") ) { my $marcisbnsarray = GetMarcISBN ($record,$marcflavour); diff --git a/t/db_dependent/Koha/BiblioFrameworks.t b/t/db_dependent/Koha/BiblioFrameworks.t index d2e31d9..ee052ed 100644 --- a/t/db_dependent/Koha/BiblioFrameworks.t +++ b/t/db_dependent/Koha/BiblioFrameworks.t @@ -29,10 +29,12 @@ my $nb_of_frameworks = Koha::BiblioFrameworks->search->count; my $new_framework_1 = Koha::BiblioFramework->new({ frameworkcode => 'mfw1', frameworktext => 'my_frameworktext_for_fw_1', + frameworktype => 'bib', })->store; my $new_framework_2 = Koha::BiblioFramework->new({ frameworkcode => 'mfw2', frameworktext => 'my_frameworktext_for_fw_2', + frameworktype => 'hld', })->store; is( Koha::BiblioFrameworks->search->count, $nb_of_frameworks + 2, 'The 2 biblio frameworks should have been added' ); -- 2.7.4