Bugzilla – Attachment 83550 Details for
Bug 20447
Add support for MARC holdings records
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 20447: MARC Holdings support
Bug-20447-MARC-Holdings-support.patch (text/plain), 239.24 KB, created by
Ere Maijala
on 2018-12-31 12:00:16 UTC
(
hide
)
Description:
Bug 20447: MARC Holdings support
Filename:
MIME Type:
Creator:
Ere Maijala
Created:
2018-12-31 12:00:16 UTC
Size:
239.24 KB
patch
obsolete
>From 49399255e1512fa7c4547702d5e2b7e778f231b6 Mon Sep 17 00:00:00 2001 >From: Ere Maijala <ere.maijala@helsinki.fi> >Date: Mon, 19 Mar 2018 15:11:05 +0200 >Subject: [PATCH] Bug 20447: MARC Holdings support > >https://bugs.koha-community.org/show_bug.cgi?id=20447 > >Enable by setting "SummaryHoldings" option to "Use". > >Sponsored-by: The National Library of Finland >--- > C4/Biblio.pm | 18 + > C4/Holdings.pm | 759 ++++++++++++++++++ > C4/Items.pm | 39 +- > C4/Search.pm | 8 + > C4/XSLT.pm | 46 +- > Koha/Holding.pm | 72 ++ > Koha/Holdings.pm | 64 ++ > Koha/Holdings/Metadata.pm | 48 ++ > Koha/Holdings/Metadatas.pm | 58 ++ > Koha/Schema/Result/Holding.pm | 250 ++++++ > Koha/Schema/Result/HoldingsMetadata.pm | 138 ++++ > Koha/Template/Plugin/Holdings.pm | 119 +++ > admin/marc_subfields_structure.pl | 5 + > catalogue/detail.pl | 18 +- > catalogue/showmarc.pl | 8 +- > cataloguing/addholding.pl | 735 +++++++++++++++++ > cataloguing/additem.pl | 11 + > .../marc21_field_008_holdings.pl | 120 +++ > .../value_builder/marc21_leader_holdings.pl | 85 ++ > .../bug_20447-add_holdings_tables.sql | 62 ++ > .../mandatory/marc21_framework_DEFAULT.sql | 545 ++++++++++++- > installer/data/mysql/kohastructure.sql | 53 +- > .../data/mysql/mandatory/auth_val_cat.sql | 1 + > .../intranet-tmpl/prog/css/addholding.css | 171 ++++ > .../prog/en/includes/cat-toolbar.inc | 4 + > .../prog/en/modules/admin/biblio_framework.tt | 3 +- > .../admin/preferences/cataloguing.pref | 7 + > .../prog/en/modules/catalogue/detail.tt | 68 +- > .../prog/en/modules/catalogue/moredetail.tt | 2 + > .../prog/en/modules/catalogue/results.tt | 14 + > .../prog/en/modules/cataloguing/addholding.tt | 618 ++++++++++++++ > .../marc21_field_008_holdings.tt | 194 +++++ > .../value_builder/marc21_leader_holdings.tt | 105 +++ > .../prog/en/modules/tools/viewlog.tt | 2 + > .../bootstrap/en/modules/opac-detail.tt | 28 + > .../bootstrap/en/modules/opac-results.tt | 10 + > .../en/xslt/MARC21slim2OPACResults.xsl | 19 +- > opac/opac-detail.pl | 7 + > 38 files changed, 4494 insertions(+), 20 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 808ed8d067..24aee2a10b 100644 >--- a/C4/Biblio.pm >+++ b/C4/Biblio.pm >@@ -103,6 +103,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; >@@ -1559,6 +1560,23 @@ 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->ccode() if $holding->ccode(); >+ 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 0000000000..6de9c1f1c9 >--- /dev/null >+++ b/C4/Holdings.pm >@@ -0,0 +1,759 @@ >+package C4::Holdings; >+ >+# Copyright 2000-2002 Katipo Communications >+# Copyright 2010 BibLibre >+# Copyright 2011 Equinox Software, Inc. >+# Copyright 2017-2018 University of Helsinki (The National Library Of Finland) >+# >+# 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 <http://www.gnu.org/licenses>. >+ >+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<MARC::Record> 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 => $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 = 'HLD' 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 holdings WHERE holding_id = ? AND deleted_on IS NULL"); >+ $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<C4::XISBN> >+ >+=cut >+ >+sub GetHoldingsByBiblionumber { >+ my ( $bib ) = @_; >+ >+ my $dbh = C4::Context->dbh; >+ my $sth = $dbh->prepare("SELECT * FROM holdings WHERE holdings.biblionumber = ? AND deleted_on 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 => 123, >+ opac => false >+ }); >+ >+Returns MARC::Record representing a holding record, or C<undef> if the >+record doesn't exist. >+ >+If opac is passed and is 1, the record is filtered as needed. >+ >+=over 4 >+ >+=item C<$holding_id> >+ >+the holding_id >+ >+=item C<$opac> >+ >+set to true to make the result suited for OPAC view. >+ >+=back >+ >+=cut >+ >+sub GetMarcHolding { >+ my ($params) = @_; >+ >+ if (not defined $params) { >+ carp 'GetMarcHolding called without parameters'; >+ return; >+ } >+ >+ my $holding_id = $params->{holding_id}; >+ my $opac = $params->{opac} || 0; >+ >+ if (not defined $holding_id) { >+ carp 'GetMarcHolding called with undefined holding_id'; >+ return; >+ } >+ >+ my $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; >+ >+ my $marcflavour = C4::Context->preference('marcflavour'); >+ my $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) = @_; >+ my $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 = ?, >+ ccode = ?, >+ callnumber = ?, >+ suppress = ?, >+ datecreated = NOW() >+ "; >+ >+ my $sth = $dbh->prepare($query); >+ $sth->execute( >+ $biblionumber, $biblioitemnumber, $frameworkcode, >+ $holding->{holdingbranch}, $holding->{location}, $holding->{ccode}, $holding->{callnumber}, $holding->{suppress} ? 1 : 0 >+ ); >+ >+ 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 = ?, >+ ccode = ?, >+ callnumber = ?, >+ suppress = ? >+ WHERE holding_id = ? >+ " >+ ; >+ my $sth = $dbh->prepare($query); >+ >+ $sth->execute( >+ $frameworkcode, $holding->{holdingbranch}, $holding->{location}, $holding->{ccode}, $holding->{callnumber}, >+ $holding->{suppress} ? 1 : 0, $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_on = NOW() WHERE holding_id=?', undef, $holding_id); >+ $dbh->do('UPDATE holdings SET deleted_on = 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 <http://koha-community.org/> >+ >+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 3b006c686e..3ff2787753 100644 >--- a/C4/Items.pm >+++ b/C4/Items.pm >@@ -464,6 +464,7 @@ sub _build_default_values_for_mod_marc { > stocknumber => undef, > uri => undef, > withdrawn => 0, >+ holding_id => undef, > }; > my %default_values_for_mod_from_marc; > while ( my ( $field, $default_value ) = each %$default_values ) { >@@ -1641,7 +1642,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 }); >@@ -1686,6 +1688,7 @@ sub _koha_new_item { > $item->{'copynumber'}, > $item->{'stocknumber'}, > $item->{'new_status'}, >+ $item->{'holding_id'}, > ); > > my $itemnumber; >@@ -1725,6 +1728,40 @@ sub MoveItemFromBiblio { > AND biblionumber = ? > |, undef, $tobiblioitem, $tobiblio, $itemnumber, $frombiblio ); > if ($return == 1) { >+ # Check if the moved item is attached to a holdings record >+ my $item = GetItem($itemnumber); >+ if ($item->{'holding_id'}) { >+ use C4::Holdings; >+ my $oldHolding = C4::Holdings::GetHolding($item->{'holding_id'}); >+ if ($oldHolding) { >+ # Check if there's a suitable holdings record in the new biblio. >+ # This is not perfect, but at least we try. >+ use Koha::Holdings; >+ my $newHolding = Koha::Holdings->find( >+ { >+ biblionumber => $tobiblio, >+ biblioitemnumber => $tobiblioitem, >+ frameworkcode => $oldHolding->{'frameworkcode'}, >+ holdingbranch => $oldHolding->{'holdingbranch'}, >+ location => $oldHolding->{'location'}, >+ callnumber => $oldHolding->{'callnumber'}, >+ suppress => $oldHolding->{'suppress'}, >+ deleted_on => undef >+ } >+ ); >+ if ($newHolding) { >+ $item->{'holding_id'} = $newHolding->holding_id; >+ } else { >+ # No existing holdings record, make a copy of the old one. >+ my $oldHoldingMarc = C4::Holdings::GetMarcHolding({ holding_id => $item->{'holding_id'} }); >+ $item->{'holding_id'} = C4::Holdings::AddHolding( >+ $oldHoldingMarc, $oldHolding->{'frameworkcode'}, $tobiblio >+ ); >+ } >+ ModItem($item, $tobiblio, $itemnumber); >+ } >+ } >+ > ModZebra( $tobiblio, "specialUpdate", "biblioserver" ); > ModZebra( $frombiblio, "specialUpdate", "biblioserver" ); > # Checking if the item we want to move is in an order >diff --git a/C4/Search.pm b/C4/Search.pm >index fac04b0079..2318be0002 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; >@@ -2063,6 +2064,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) { >@@ -2246,6 +2248,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) { >@@ -2276,6 +2283,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 bf2647ab74..0d6bc4b51c 100644 >--- a/C4/XSLT.pm >+++ b/C4/XSLT.pm >@@ -160,6 +160,12 @@ sub _get_best_default_xslt_filename { > return $xslfilename; > } > >+=head2 get_xslt_sysprefs >+ >+Returns XML for system preferences. >+ >+=cut >+ > sub get_xslt_sysprefs { > my $sysxml = "<sysprefs>\n"; > foreach my $syspref ( qw/ hidelostitems OPACURLOpenInNewWindow >@@ -241,9 +247,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 +349,43 @@ sub buildKohaItemsNamespace { > return $xml; > } > >+=head2 buildKohaHoldingsNamespace >+ >+Returns XML for holdings records. >+Is only used in this module currently. >+ >+=cut >+ >+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 .= >+ "<holding>" >+ . "<holdingbranch>$holdingbranch</holdingbranch>" >+ . "<location>$location</location>" >+ . "<callnumber>$callnumber</callnumber>" >+ . "<suppress>$suppress</suppress>" >+ . "</holding>"; >+ } >+ $xml = "<holdings xmlns=\"http://www.koha-community.org/holdings\">$xml</holdings>"; >+ 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 0000000000..e9379404a8 >--- /dev/null >+++ b/Koha/Holding.pm >@@ -0,0 +1,72 @@ >+package Koha::Holding; >+ >+# Copyright ByWater Solutions 2014 >+# Copyright 2017-2018 University of Helsinki (The National Library Of Finland) >+# >+# 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 <kyle@bywatersolutions.com> >+Ere Maijala <ere.maijala@helsinki.fi> >+ >+=cut >+ >+1; >diff --git a/Koha/Holdings.pm b/Koha/Holdings.pm >new file mode 100644 >index 0000000000..1273413edc >--- /dev/null >+++ b/Koha/Holdings.pm >@@ -0,0 +1,64 @@ >+package Koha::Holdings; >+ >+# Copyright ByWater Solutions 2015 >+# Copyright 2017-2018 University of Helsinki (The National Library Of Finland) >+# >+# 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 <kyle@bywatersolutions.com> >+Ere Maijala <ere.maijala@helsinki.fi> >+ >+=cut >+ >+1; >diff --git a/Koha/Holdings/Metadata.pm b/Koha/Holdings/Metadata.pm >new file mode 100644 >index 0000000000..ede04a87e4 >--- /dev/null >+++ b/Koha/Holdings/Metadata.pm >@@ -0,0 +1,48 @@ >+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::Holdings::Metadata - Koha Holdings Metadata Object class >+ >+=head1 API >+ >+=head2 Internal methods >+ >+=head3 _type >+ >+=cut >+ >+sub _type { >+ return 'HoldingsMetadata'; >+} >+ >+=head1 AUTHOR >+ >+Ere Maijala ere.maijala@helsinki.fi >+ >+=cut >+ >+1; >diff --git a/Koha/Holdings/Metadatas.pm b/Koha/Holdings/Metadatas.pm >new file mode 100644 >index 0000000000..591c81a028 >--- /dev/null >+++ b/Koha/Holdings/Metadatas.pm >@@ -0,0 +1,58 @@ >+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::Holdings::Metadata; >+ >+use base qw(Koha::Objects); >+ >+=head1 NAME >+ >+Koha::Holdings::Metadatas - Koha Holdings Metadata Object set class >+ >+=head1 API >+ >+=head2 Internal methods >+ >+=head3 _type >+ >+=cut >+ >+sub _type { >+ return 'HoldingsMetadata'; >+} >+ >+=head3 object_class >+ >+=cut >+ >+sub object_class { >+ return 'Koha::Holdings::Metadata'; >+} >+ >+=head1 AUTHOR >+ >+Ere Maijala ere.maijala@helsinki.fi >+ >+=cut >+ >+1; >diff --git a/Koha/Schema/Result/Holding.pm b/Koha/Schema/Result/Holding.pm >new file mode 100644 >index 0000000000..be72298ec3 >--- /dev/null >+++ b/Koha/Schema/Result/Holding.pm >@@ -0,0 +1,250 @@ >+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<holdings> >+ >+=cut >+ >+__PACKAGE__->table("holdings"); >+ >+=head1 ACCESSORS >+ >+=head2 holding_id >+ >+ 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 ccode >+ >+ 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_on >+ >+ data_type: 'datetime' >+ datetime_undef_if_invalid: 1 >+ is_nullable: 1 >+ >+=cut >+ >+__PACKAGE__->add_columns( >+ "holding_id", >+ { 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 }, >+ "ccode", >+ { 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_on", >+ { >+ data_type => "datetime", >+ datetime_undef_if_invalid => 1, >+ is_nullable => 1, >+ }, >+); >+ >+=head1 PRIMARY KEY >+ >+=over 4 >+ >+=item * L</holding_id> >+ >+=back >+ >+=cut >+ >+__PACKAGE__->set_primary_key("holding_id"); >+ >+=head1 RELATIONS >+ >+=head2 biblioitemnumber >+ >+Type: belongs_to >+ >+Related object: L<Koha::Schema::Result::Biblioitem> >+ >+=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<Koha::Schema::Result::Biblio> >+ >+=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<Koha::Schema::Result::Branch> >+ >+=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<Koha::Schema::Result::HoldingsMetadata> >+ >+=cut >+ >+__PACKAGE__->has_many( >+ "holdings_metadatas", >+ "Koha::Schema::Result::HoldingsMetadata", >+ { "foreign.holding_id" => "self.holding_id" }, >+ { cascade_copy => 0, cascade_delete => 0 }, >+); >+ >+=head2 items >+ >+Type: has_many >+ >+Related object: L<Koha::Schema::Result::Item> >+ >+=cut >+ >+__PACKAGE__->has_many( >+ "items", >+ "Koha::Schema::Result::Item", >+ { "foreign.holding_id" => "self.holding_id" }, >+ { cascade_copy => 0, cascade_delete => 0 }, >+); >+ >+ >+# Created by DBIx::Class::Schema::Loader v0.07048 @ 2018-11-27 15:20:47 >+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:PzvRAsqSEGDA5GU+FUJ/4w >+ >+ >+# 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 0000000000..b089f16a3b >--- /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<holdings_metadata> >+ >+=cut >+ >+__PACKAGE__->table("holdings_metadata"); >+ >+=head1 ACCESSORS >+ >+=head2 id >+ >+ data_type: 'integer' >+ is_auto_increment: 1 >+ is_nullable: 0 >+ >+=head2 holding_id >+ >+ 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_on >+ >+ 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 }, >+ "holding_id", >+ { 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_on", >+ { >+ data_type => "datetime", >+ datetime_undef_if_invalid => 1, >+ is_nullable => 1, >+ }, >+); >+ >+=head1 PRIMARY KEY >+ >+=over 4 >+ >+=item * L</id> >+ >+=back >+ >+=cut >+ >+__PACKAGE__->set_primary_key("id"); >+ >+=head1 UNIQUE CONSTRAINTS >+ >+=head2 C<holdings_metadata_uniq_key> >+ >+=over 4 >+ >+=item * L</holding_id> >+ >+=item * L</format> >+ >+=item * L</marcflavour> >+ >+=back >+ >+=cut >+ >+__PACKAGE__->add_unique_constraint( >+ "holdings_metadata_uniq_key", >+ ["holding_id", "format", "marcflavour"], >+); >+ >+=head1 RELATIONS >+ >+=head2 holding >+ >+Type: belongs_to >+ >+Related object: L<Koha::Schema::Result::Holding> >+ >+=cut >+ >+__PACKAGE__->belongs_to( >+ "holding", >+ "Koha::Schema::Result::Holding", >+ { holding_id => "holding_id" }, >+ { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, >+); >+ >+ >+# Created by DBIx::Class::Schema::Loader v0.07048 @ 2018-11-27 15:20:47 >+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:V8R1I3CeEOWP+YO9gUAK3A >+ >+ >+# You can replace this text with custom code or comments, and it will be preserved on regeneration >+1; >diff --git a/Koha/Template/Plugin/Holdings.pm b/Koha/Template/Plugin/Holdings.pm >new file mode 100644 >index 0000000000..77412b36ad >--- /dev/null >+++ b/Koha/Template/Plugin/Holdings.pm >@@ -0,0 +1,119 @@ >+package Koha::Template::Plugin::Holdings; >+ >+# Copyright ByWater Solutions 2012 >+# Copyright BibLibre 2014 >+# Copyright 2017-2018 University of Helsinki (The National Library Of Finland) >+ >+# 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 <http://www.gnu.org/licenses>. >+ >+use Modern::Perl; >+ >+use Template::Plugin; >+use base qw( Template::Plugin ); >+ >+use C4::Context; >+use C4::Holdings; >+ >+use Koha::Holdings; >+ >+=head1 NAME >+ >+Koha::Template::Plugin::Holdings - TT Plugin for holdings >+ >+=head1 SYNOPSIS >+ >+[% USE Holdings %] >+ >+[% Holdings.GetLocation(holding) | html %] >+ >+=head1 ROUTINES >+ >+=head2 GetLocation >+ >+Get a location string for a holdings record >+ >+ [% Holdings.GetLocation(holding) | html %] >+ >+=cut >+ >+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->{'ccode'} if $holding->{'ccode'}; >+ push @parts, $holding->{'callnumber'} if $holding->{'callnumber'}; >+ return join(' ', @parts); >+} >+ >+=head2 GetDetails >+ >+Get the Koha fields for a holdings record >+ >+ [% details = Holdings.GetDetails(holding) %] >+ >+=cut >+ >+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_id => $holding, opac => $opac }); >+ >+ return C4::Holdings::TransformMarcHoldingToKoha( $marcHolding ); >+} >+ >+1; >diff --git a/admin/marc_subfields_structure.pl b/admin/marc_subfields_structure.pl >index 25196491b1..90b7cadd51 100755 >--- a/admin/marc_subfields_structure.pl >+++ b/admin/marc_subfields_structure.pl >@@ -125,6 +125,11 @@ if ( $op eq 'add_form' ) { > while ( ( my $field ) = $sth2->fetchrow_array ) { > push @kohafields, "items." . $field; > } >+ $sth2 = $dbh->prepare("SHOW COLUMNS from holdings"); >+ $sth2->execute; >+ while ( ( my $field ) = $sth2->fetchrow_array ) { >+ push @kohafields, "holdings." . $field; >+ } > > # build authorised value list > $sth2->finish; >diff --git a/catalogue/detail.pl b/catalogue/detail.pl >index 154d63260a..774f43c816 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; >@@ -190,6 +191,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') ) { >@@ -383,13 +389,15 @@ $template->param( > itemdata_copynumber => $itemfields{copynumber}, > itemdata_stocknumber => $itemfields{stocknumber}, > volinfo => $itemfields{enumchron}, >- itemdata_itemnotes => $itemfields{itemnotes}, >- itemdata_nonpublicnotes => $itemfields{itemnotes_nonpublic}, >+ itemdata_itemnotes => $itemfields{itemnotes}, >+ itemdata_nonpublicnotes => $itemfields{itemnotes_nonpublic}, > z3950_search_params => C4::Search::z3950_search_args($dat), >- hostrecords => $hostrecords, >- analytics_flag => $analytics_flag, >+ 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/catalogue/showmarc.pl b/catalogue/showmarc.pl >index 13bde06693..c8d685c766 100755 >--- a/catalogue/showmarc.pl >+++ b/catalogue/showmarc.pl >@@ -32,6 +32,7 @@ use C4::Context; > use C4::Output; > use C4::Auth; > use C4::Biblio; >+use C4::Holdings; > use C4::ImportBatch; > use C4::XSLT (); > >@@ -50,9 +51,12 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( > my $biblionumber= $input->param('id'); > my $importid= $input->param('importid'); > my $view= $input->param('viewas')||''; >+my $holding_id= $input->param('holding_id')||''; > > my $record; >-if ($importid) { >+if ($holding_id) { >+ $record = C4::Holdings::GetMarcHolding({ holding_id => $holding_id }); >+} elsif ($importid) { > $record = C4::ImportBatch::GetRecordFromImportBiblio( $importid, 'embed_items' ); > } > else { >@@ -64,7 +68,7 @@ if(!ref $record) { > } > > if($view eq 'card' || $view eq 'html') { >- my $xml = $importid ? $record->as_xml(): GetXmlBiblio($biblionumber); >+ my $xml = $record->as_xml(); > my $xsl; > if ( $view eq 'card' ){ > $xsl = C4::Context->preference('marcflavour') eq 'UNIMARC' >diff --git a/cataloguing/addholding.pl b/cataloguing/addholding.pl >new file mode 100755 >index 0000000000..01e4f72ad9 >--- /dev/null >+++ b/cataloguing/addholding.pl >@@ -0,0 +1,735 @@ >+#!/usr/bin/perl >+ >+ >+# Copyright 2000-2002 Katipo Communications >+# Copyright 2004-2010 BibLibre >+# Copyright 2017-2018 University of Helsinki (The National Library Of Finland) >+# >+# 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 <http://www.gnu.org/licenses>. >+ >+# 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::Biblios; >+use Koha::BiblioFrameworks; >+use Koha::DateUtils; >+use C4::Matcher; >+ >+use Koha::ItemTypes; >+use Koha::Libraries; >+ >+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 <input ...> 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 <<YYYY>>, <<MM>>, <<DD>> 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/<<YYYY>>/$year/g; >+ $value =~ s/<<MM>>/$month/g; >+ $value =~ s/<<DD>>/$day/g; >+ # And <<USER>> with surname (?) >+ my $username=(C4::Context->userenv?C4::Context->userenv->{'surname'}:"superlibrarian"); >+ $value=~s/<<USER>>/$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 = '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({}, { 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 => $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<html><body><h1>ERROR when DELETING HOLDING $holding_id : $error</h1></body></html>"; >+ 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; >+ }; >+ } >+ if ( !$biblionumber ) { >+ # we must have a holding_id if we don't have a biblionumber >+ my $holdingRecord = Koha::Holdings->find( $holding_id ); >+ $biblionumber = $holdingRecord->biblionumber; >+ } >+ my $biblio = Koha::Biblios->find( $biblionumber ); >+ build_tabs( $template, $record, $dbh, $encoding,$input ); >+ $template->param( >+ holding_id => $holding_id, >+ biblionumber => $biblionumber, >+ biblionumbertagfield => $biblionumbertagfield, >+ biblionumbertagsubfield => $biblionumbertagsubfield, >+ title => $biblio->title, >+ author => $biblio->author >+ ); >+} >+ >+$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 6bf4629500..eab615ee69 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; >@@ -209,6 +210,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->{ccode} . ' ' . $holding->{callnumber}; >+ } >+ my $input = new CGI; >+ $value = $input->param('holding_id') unless ($value); >+ } > else { > push @authorised_values, qq{}; > 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 0000000000..38e228c7d7 >--- /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-2018 University of Helsinki (The National Library Of Finland) >+# >+# 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 <http://www.gnu.org/licenses>. >+ >+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 = " >+<script type=\"text/javascript\"> >+//<![CDATA[ >+ >+function Focus$function_name(event) { >+ if ( document.getElementById(event.data.id).value ) { >+ } >+ else { >+ document.getElementById(event.data.id).value='$dateentered' + '0u 0 4 uu${lang}0$dateentered'; >+ } >+ return 1; >+} >+ >+function Click$function_name(event) { >+ defaultvalue=document.getElementById(event.data.id).value; >+ //Retrieve full leader string and pass it to the 008 tag editor >+ var leader_value = \$(\"input[id^='tag_000']\").val(); >+ var leader_parameter = \"\"; >+ if (leader_value){ >+ //Only add the parameter to the URL if there is a value to add >+ leader_parameter = \"&leader=\"+leader_value; >+ } >+ newin=window.open(\"../cataloguing/plugin_launcher.pl?plugin_name=marc21_field_008_holdings.pl&index=\"+ event.data.id +\"&result=\"+defaultvalue+leader_parameter,\"tag_editor\",'width=1000,height=600,toolbar=false,scrollbars=yes'); >+ >+} >+//]]> >+</script> >+"; >+ >+ 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 0000000000..3fc08e5566 >--- /dev/null >+++ b/cataloguing/value_builder/marc21_leader_holdings.pl >@@ -0,0 +1,85 @@ >+#!/usr/bin/perl >+ >+# Copyright 2000-2002 Katipo Communications >+# Copyright 2017-2018 University of Helsinki (The National Library Of Finland) >+# >+# 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 <http://www.gnu.org/licenses>. >+ >+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 = " >+<script type=\"text/javascript\"> >+//<![CDATA[ >+ >+function Focus$function_name(event) { >+ if(!document.getElementById(event.data.id).value){ >+ document.getElementById(event.data.id).value = ' nu a22 ui 4500'; >+ } >+} >+ >+function Click$function_name(event) { >+ defaultvalue=document.getElementById(event.data.id).value; >+ newin=window.open(\"../cataloguing/plugin_launcher.pl?plugin_name=marc21_leader_holdings.pl&index=\"+ event.data.id +\"&result=\"+defaultvalue,\"tag_editor\",'width=1000,height=600,toolbar=false,scrollbars=yes'); >+} >+ >+//]]> >+</script> >+"; >+ >+ 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 0000000000..7a29eaaa3a >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_20447-add_holdings_tables.sql >@@ -0,0 +1,62 @@ >+-- >+-- 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) >+ `ccode` varchar(80) default NULL, -- authorized value for the collection code associated with this item (MARC21 852$g) >+ `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_on` 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_on` 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'); >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 4b77adf23c..f087d3b108 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), >@@ -4621,3 +4623,544 @@ SELECT tagfield, tagsubfield, liblibrarian, libopac, repeatable, mandatory, koha > FROM marc_subfield_structure > WHERE frameworkcode="" > AND kohafield IN ("biblio.title", "biblio.author", "biblioitems.publishercode", "biblioitems.editionstatement", "biblio.copyrightdate", "biblioitems.isbn", "biblio.seriestitle" ); >+ >+ >+-- HOLDINGS RECORD FRAMEWORK >+ >+INSERT IGNORE INTO `biblio_framework` VALUES ('HLD', 'Default holdings framework'); >+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 >+ ('010', 'LIBRARY OF CONGRESS CONTROL NUMBER', 'LIBRARY OF CONGRESS CONTROL NUMBER', 0, 0, '', 'HLD'), >+ ('014', 'LINKAGE NUMBER', 'LINKAGE NUMBER', 1, 0, '', 'HLD'), >+ ('016', 'NATIONAL BIBLIOGRAPHIC AGENCY CONTROL NUMBER', 'NATIONAL BIBLIOGRAPHIC AGENCY CONTROL NUMBER', 1, 0, '', 'HLD'), >+ ('017', 'COPYRIGHT OR LEGAL DEPOSIT NUMBER', 'COPYRIGHT OR LEGAL DEPOSIT NUMBER', 1, 0, '', 'HLD'), >+ ('020', 'INTERNATIONAL STANDARD BOOK NUMBER', 'INTERNATIONAL STANDARD BOOK NUMBER', 1, 0, NULL, 'HLD'), >+ ('022', 'INTERNATIONAL STANDARD SERIAL NUMBER', 'INTERNATIONAL STANDARD SERIAL NUMBER', 1, 0, NULL, 'HLD'), >+ ('024', 'OTHER STANDARD IDENTIFIER', 'OTHER STANDARD IDENTIFIER', 1, 0, NULL, 'HLD'), >+ ('027', 'STANDARD TECHNICAL REPORT NUMBER', 'STANDARD TECHNICAL REPORT NUMBER', 1, 0, '', 'HLD'), >+ ('030', 'CODEN DESIGNATION', 'CODEN DESIGNATION', 1, 0, '', 'HLD'), >+ ('035', 'SYSTEM CONTROL NUMBER', 'SYSTEM CONTROL NUMBER', 1, 0, NULL, 'HLD'), >+ ('040', 'CATALOGING SOURCE', 'CATALOGING SOURCE', 0, 1, NULL, 'HLD'), >+ ('066', 'CHARACTER SETS PRESENT', 'CHARACTER SETS PRESENT', 0, 0, NULL, 'HLD'), >+ ('337', 'MEDIA TYPE', 'MEDIA TYPE', 1, 0, NULL, 'HLD'), >+ ('338', 'CARRIER TYPE', 'CARRIER TYPE', 1, 0, NULL, 'HLD'), >+ ('347', 'DIGITAL FILE CHARACTERISTICS', 'DIGITAL FILE CHARACTERISTICS', 1, 0, NULL, 'HLD'), >+ ('506', 'RESTRICTIONS ON ACCESS NOTE', 'RESTRICTIONS ON ACCESS NOTE', 1, 0, NULL, 'HLD'), >+ ('538', 'SYSTEM DETAILS NOTE', 'SYSTEM DETAILS NOTE', 1, 0, NULL, 'HLD'), >+ ('541', 'IMMEDIATE SOURCE OF ACQUISITION NOTE', 'IMMEDIATE SOURCE OF ACQUISITION NOTE', 1, 0, NULL, 'HLD'), >+ ('561', 'OWNERSHIP AND CUSTODIAL HISTORY', 'OWNERSHIP AND CUSTODIAL HISTORY', 1, 0, NULL, 'HLD'), >+ ('562', 'COPY AND VERSION IDENTIFICATION NOTE', 'COPY AND VERSION IDENTIFICATION NOTE', 1, 0, NULL, 'HLD'), >+ ('563', 'BINDING INFORMATION', 'BINDING INFORMATION', 1, 0, NULL, 'HLD'), >+ ('583', 'ACTION NOTE', 'ACTION NOTE', 1, 0, NULL, 'HLD'), >+ ('842', 'TEXTUAL PHYSICAL FORM DESIGNATOR', 'TEXTUAL PHYSICAL FORM DESIGNATOR', 0, 0, NULL, 'HLD'), >+ ('843', 'REPRODUCTION NOTE', 'REPRODUCTION NOTE', 1, 0, NULL, 'HLD'), >+ ('844', 'NAME OF UNIT', 'NAME OF UNIT', 0, 0, NULL, 'HLD'), >+ ('845', 'TERMS GOVERNING USE AND REPRODUCTION NOTE', 'TERMS GOVERNING USE AND REPRODUCTION NOTE', 1, 0, NULL, 'HLD'), >+ ('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), >+ ('010', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 0, '', '', NULL, 0, -6, 'HLD', '', '', NULL), >+ ('010', 'a', 'LC control number', 'LC control number', 0, 0, 'biblioitems.lccn', 0, '', '', '', 0, 0, 'HLD', '', '', NULL), >+ ('010', 'b', 'NUCMC control number', 'NUCMC control number', 1, 0, '', 0, '', '', '', 0, -1, '', '', '', NULL), >+ ('010', 'z', 'Canceled/invalid LC control number', 'Canceled/invalid LC control number', 1, 0, '', 0, '', '', '', 0, -1, 'HLD', '', '', NULL), >+ ('014', '6', 'Linkage', 'Linkage', 0, 0, '', 0, '', '', '', 0, -6, '', '', '', NULL), >+ ('014', 'a', 'Linkage number', 'Linkage number', 0, 0, '', 0, '', '', '', 0, 0, 'HLD', '', '', NULL), >+ ('014', 'b', 'Source of number', 'Source of number', 0, 0, '', 0, '', '', '', 0, -1, 'HLD', '', '', NULL), >+ ('014', 'z', 'Canceled/invalid linkage number', 'Canceled/invalid linkage number', 1, 0, '', 0, '', '', '', 0, -1, 'HLD', '', '', NULL), >+ ('016', '2', 'Source', 'Source', 0, 0, '', 0, '', '', '', 0, 0, '', '', '', NULL), >+ ('016', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 0, '', '', '', 0, -6, 'HLD', '', '', NULL), >+ ('016', 'a', 'Record control number', 'Record control number', 0, 0, '', 0, '', '', '', 0, 0, 'HLD', '', '', NULL), >+ ('016', 'z', 'Canceled/invalid control number', 'Canceled/invalid control number', 1, 0, '', 0, '', '', '', 0, -1, 'HLD', '', '', NULL), >+ ('017', '2', 'Source', 'Source', 0, 0, '', 0, '', '', '', 0, -6, '', '', '', NULL), >+ ('017', '6', 'Linkage', 'Linkage', 0, 0, '', 0, '', '', '', 0, -6, '', '', '', NULL), >+ ('017', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 0, '', '', '', 0, -6, 'HLD', '', '', NULL), >+ ('017', 'a', 'Copyright or legal deposit number', 'Copyright or legal deposit number', 1, 0, '', 0, '', '', '', 0, -6, 'HLD', '', '', NULL), >+ ('017', 'b', 'Assigning agency', 'Assigning agency', 0, 0, '', 0, '', '', '', 0, -6, 'HLD', '', '', NULL), >+ ('017', 'd', 'Date', 'Date', 0, 0, '', 0, '', '', NULL, 0, -6, 'HLD', '', '', NULL), >+ ('017', 'i', 'Display text', 'Display text', 0, 0, '', 0, '', '', '', 0, -6, 'HLD', '', '', NULL), >+ ('017', 'z', 'Canceled/invalid copyright or legal deposit number', 'Canceled/invalid copyright or legal deposit number', 1, 0, '', 0, '', '', '', NULL, -6, 'HLD', '', '', NULL), >+ ('020', '6', 'Linkage', 'Linkage', 0, 0, '', 0, '', '', '', 0, -6, 'HLD', '', '', NULL), >+ ('020', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 0, '', '', '', 0, -6, 'HLD', '', '', NULL), >+ ('020', 'a', 'International Standard Book Number', 'International Standard Book Number', 0, 0, 'biblioitems.isbn', 0, '', '', '', 0, 0, 'HLD', '', '', NULL), >+ ('020', 'c', 'Terms of availability', 'Terms of availability', 0, 0, '', 0, '', '', '', 0, 0, 'HLD', '', '', NULL), >+ ('020', 'q', 'Qualifying information', 'Qualifying information', 1, 0, '', 0, '', '', '', 0, 0, 'HLD', '', '', NULL), >+ ('020', 'z', 'Canceled/invalid ISBN', 'Canceled/invalid ISBN', 1, 0, '', 0, '', '', '', 0, -1, 'HLD', '', '', NULL), >+ ('022', '2', 'Source', 'Source', 0, 0, '', 0, '', '', '', 0, 0, 'HLD', '', '', NULL), >+ ('022', '6', 'Linkage', 'Linkage', 0, 0, '', 0, '', '', '', 0, -6, 'HLD', '', '', NULL), >+ ('022', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 0, '', '', '', 0, -6, 'HLD', '', '', NULL), >+ ('022', 'a', 'International Standard Serial Number', 'International Standard Serial Number', 0, 0, 'biblioitems.issn', 0, '', '', '', 0, 0, 'HLD', '', '', NULL), >+ ('022', 'l', 'ISSN-L', 'ISSN-L', 0, 0, '', 0, '', '', '', NULL, -6, 'HLD', '', '', NULL), >+ ('022', 'm', 'Canceled ISSN-L', 'Canceled ISSN-L', 1, 0, '', 0, '', '', '', NULL, -6, 'HLD', '', '', NULL), >+ ('022', 'y', 'Incorrect ISSN', 'Incorrect ISSN', 1, 0, '', 0, '', '', '', 0, -1, 'HLD', '', '', NULL), >+ ('022', 'z', 'Canceled ISSN', 'Canceled ISSN', 1, 0, '', 0, '', '', '', 0, -1, 'HLD', '', '', NULL), >+ ('024', '2', 'Source of number or code', 'Source of number or code', 0, 0, '', 0, '', '', '', 0, 0, 'HLD', '', '', NULL), >+ ('024', '6', 'Linkage', 'Linkage', 0, 0, '', 0, '', '', '', 0, -6, 'HLD', '', '', NULL), >+ ('024', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 0, '', '', '', 0, -6, 'HLD', '', '', NULL), >+ ('024', 'a', 'Standard number or code', 'Standard number or code', 0, 0, '', 0, '', '', '', 0, 0, 'HLD', '', '', NULL), >+ ('024', 'b', 'Additional codes following the standard number [OBSOLETE]', 'Additional codes following the standard number [OBSOLETE]', 0, 0, '', 0, '', '', '', 0, -6, 'HLD', '', '', NULL), >+ ('024', 'c', 'Terms of availability', 'Terms of availability', 0, 0, '', 0, '', '', '', 0, 0, 'HLD', '', '', NULL), >+ ('024', 'd', 'Additional codes following the standard number or code', 'Additional codes following the standard number or code', 0, 0, '', 0, '', '', '', 0, 0, 'HLD', '', '', NULL), >+ ('024', 'q', 'Qualifying information', 'Qualifying information', 1, 0, '', 0, '', '', '', 0, 0, 'HLD', '', '', NULL), >+ ('024', 'z', 'Canceled/invalid standard number or code', 'Canceled/invalid standard number or code', 1, 0, '', 0, '', '', '', 0, -1, 'HLD', '', '', NULL), >+ ('027', '6', 'Linkage', 'Linkage', 0, 0, '', 0, '', '', '', 0, -6, 'HLD', '', '', NULL), >+ ('027', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 0, '', '', '', 0, -6, 'HLD', '', '', NULL), >+ ('027', 'a', 'Standard technical report number', 'Standard technical report number', 0, 0, '', 0, '', '', '', 0, -1, 'HLD', '', '', NULL), >+ ('027', 'q', 'Qualifying information', 'Qualifying information', 1, 0, '', 0, '', '', '', 0, 0, 'HLD', '', '', NULL), >+ ('027', 'z', 'Canceled/invalid number', 'Canceled/invalid number', 1, 0, '', 0, '', '', '', 0, -1, 'HLD', '', '', NULL), >+ ('030', '6', 'Linkage', 'Linkage', 0, 0, '', 0, '', '', '', 0, -6, 'HLD', '', '', NULL), >+ ('030', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 0, '', '', '', 0, -6, 'HLD', '', '', NULL), >+ ('030', 'a', 'CODEN', 'CODEN', 0, 0, '', 0, '', '', '', 0, -6, 'HLD', '', '', NULL), >+ ('030', 'z', 'Canceled/invalid CODEN', 'Canceled/invalid CODEN', 1, 0, '', 0, '', '', '', 0, -6, 'HLD', '', '', NULL), >+ ('035', '6', 'Linkage', 'Linkage', 0, 0, '', 0, '', '', '', 0, -6, 'HLD', '', '', NULL), >+ ('035', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 0, '', '', '', 0, -6, 'HLD', '', '', NULL), >+ ('035', 'a', 'System control number', 'System control number', 0, 0, '', 0, '', '', '', 0, 0, 'HLD', '', '', NULL), >+ ('035', 'z', 'Canceled/invalid control number', 'Canceled/invalid control number', 1, 0, '', 0, '', '', '', 0, -1, 'HLD', '', '', NULL), >+ ('040', '6', 'Linkage', 'Linkage', 0, 0, '', 0, '', '', '', 0, -6, 'HLD', '', '', NULL), >+ ('040', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 0, '', '', '', 0, -6, 'HLD', '', '', NULL), >+ ('040', 'a', 'Original cataloging agency', 'Original cataloging agency', 0, 0, '', 0, '', '', '', 0, 0, 'HLD', '', '', NULL), >+ ('040', 'b', 'Language of cataloging', 'Language of cataloging', 0, 0, '', 0, '', '', '', 0, 0, 'HLD', '', '', NULL), >+ ('040', 'c', 'Transcribing agency', 'Transcribing agency', 0, 1, '', 0, '', '', '', 0, 0, 'HLD', '', '', NULL), >+ ('040', 'd', 'Modifying agency', 'Modifying agency', 1, 0, '', 0, '', '', '', 0, 0, 'HLD', '', '', NULL), >+ ('066', 'a', 'Primary G0 character set', 'Primary G0 character set', 0, 0, NULL, 0, NULL, NULL, '', NULL, -6, 'HLD', '', '', NULL), >+ ('066', 'b', 'Primary G1 character set', 'Primary G1 character set', 0, 0, NULL, 0, NULL, NULL, '', NULL, -6, 'HLD', '', '', NULL), >+ ('066', 'c', 'Alternate G0 or G1 character set', 'Alternate G0 or G1 character set', 1, 0, NULL, 0, NULL, NULL, '', NULL, -6, 'HLD', '', '', NULL), >+ >+ ('337', '0', 'Authority record control number or standard number', 'Authority record control number or standard number', 1, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL), >+ ('337', '1', 'Real World Object URI', 'Real World Object URI', 1, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL), >+ ('337', '2', 'Source', 'Source', 0, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL), >+ ('337', '3', 'Materials specified', 'Materials specified', 0, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL), >+ ('337', '6', 'Linkage', 'Linkage', 0, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL), >+ ('337', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL), >+ ('337', 'a', 'Media type term', 'Media type term', 1, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL), >+ ('337', 'b', 'Media type code', 'Media type code', 1, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL), >+ ('338', '0', 'Authority record control number or standard number', 'Authority record control number or standard number', 1, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL), >+ ('338', '1', 'Real World Object URI', 'Real World Object URI', 1, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL), >+ ('338', '2', 'Source', 'Source', 0, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL), >+ ('338', '3', 'Materials specified', 'Materials specified', 0, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL), >+ ('338', '6', 'Linkage', 'Linkage', 0, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL), >+ ('338', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL), >+ ('338', 'a', 'Carrier type term', 'Carrier type term', 1, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL), >+ ('338', 'b', 'Carrier type code', 'Carrier type code', 1, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL), >+ ('347', 'a', 'File type', 'File type', 1, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL), >+ ('347', '0', 'Authority record control number or standard number', 'Authority record control number or standard number', 1, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL), >+ ('347', '1', 'Real World Object URI', 'Real World Object URI', 1, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL), >+ ('347', '2', 'Source', 'Source', 0, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL), >+ ('347', '3', 'Materials specified', 'Materials specified', 0, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL), >+ ('347', '6', 'Linkage', 'Linkage', 0, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL), >+ ('347', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL), >+ ('347', 'b', 'Encoding format', 'Encoding format', 1, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL), >+ ('347', 'c', 'File size', 'File size', 1, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL), >+ ('347', 'd', 'Resolution', 'Resolution', 1, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL), >+ ('347', 'e', 'Regional encoding', 'Regional encoding', 1, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL), >+ ('347', 'f', 'Encoded bitrate', 'Encoded bitrate', 1, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL), >+ ('506', '2', 'Source of term', 'Source of term', 0, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL), >+ ('506', '3', 'Materials specified', 'Materials specified', 0, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL), >+ ('506', '5', 'Institution to which field applies', 'Institution to which field applies', 0, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL), >+ ('506', '6', 'Linkage', 'Linkage', 0, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL), >+ ('506', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL), >+ ('506', 'a', 'Terms governing access', 'Terms governing access', 0, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL), >+ ('506', 'b', 'Jurisdiction', 'Jurisdiction', 1, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL), >+ ('506', 'c', 'Physical access provisions', 'Physical access provisions', 1, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL), >+ ('506', 'd', 'Authorized users', 'Authorized users', 1, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL), >+ ('506', 'e', 'Authorization', 'Authorization', 1, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL), >+ ('506', 'f', 'Standardized terminology for access restriction', 'Standardized terminology for access restriction', 1, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL), >+ ('506', 'u', 'Uniform Resource Identifier', 'Uniform Resource Identifier', 1, 0, '', 5, '', '', '', 1, -6, 'HLD', '', '', NULL), >+ ('538', '3', 'Materials specified', 'Materials specified', 0, 0, NULL, 5, NULL, NULL, '', NULL, -6, 'HLD', '', '', NULL), >+ ('538', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL), >+ ('538', '6', 'Linkage', 'Linkage', 0, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL), >+ ('538', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL), >+ ('538', 'a', 'System details note', 'System details note', 0, 0, '', 5, '', '', '', NULL, -1, 'HLD', '', '', NULL), >+ ('538', 'i', 'Display text', 'Display text', 0, 0, '', 5, '', '', '', NULL, -1, 'HLD', '', '', NULL), >+ ('538', 'u', 'Uniform Resource Identifier', 'Uniform Resource Identifier', 1, 0, '', 5, '', '', '', 1, -1, 'HLD', '', '', NULL), >+ ('541', '3', 'Materials specified', 'Materials specified', 0, 0, NULL, 5, NULL, NULL, '', NULL, -6, 'HLD', '', '', NULL), >+ ('541', '5', 'Institution to which field applies', 'Institution to which field applies', 0, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL), >+ ('541', '6', 'Linkage', 'Linkage', 0, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL), >+ ('541', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL), >+ ('541', 'a', 'Source of acquisition', 'Source of acquisition', 0, 0, '', 5, '', '', '', NULL, 1, 'HLD', '', '', NULL), >+ ('541', 'b', 'Address', 'Address', 0, 0, '', 5, '', '', '', NULL, 1, 'HLD', '', '', NULL), >+ ('541', 'c', 'Method of acquisition', 'Method of acquisition', 0, 0, '', 5, '', '', '', NULL, 1, 'HLD', '', '', NULL), >+ ('541', 'd', 'Date of acquisition', 'Date of acquisition', 0, 0, '', 5, '', '', '', NULL, 1, 'HLD', '', '', NULL), >+ ('541', 'e', 'Accession number', 'Accession number', 0, 0, '', 5, '', '', '', NULL, 1, 'HLD', '', '', NULL), >+ ('541', 'f', 'Owner', 'Owner', 0, 0, '', 5, '', '', '', NULL, 1, 'HLD', '', '', NULL), >+ ('541', 'h', 'Purchase price', 'Purchase price', 0, 0, '', 5, '', '', '', NULL, 1, 'HLD', '', '', NULL), >+ ('541', 'n', 'Extent', 'Extent', 1, 0, '', 5, '', '', '', NULL, 1, 'HLD', '', '', NULL), >+ ('541', 'o', 'Type of unit', 'Type of unit', 1, 0, '', 5, '', '', '', NULL, 1, 'HLD', '', '', NULL), >+ ('561', '3', 'Materials specified', 'Materials specified', 0, 0, NULL, 5, NULL, NULL, '', NULL, -6, 'HLD', '', '', NULL), >+ ('561', '5', 'Institution to which field applies', 'Institution to which field applies', 0, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL), >+ ('561', '6', 'Linkage', 'Linkage', 0, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL), >+ ('561', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL), >+ ('561', 'a', 'History', 'History', 0, 0, '', 5, '', '', '', NULL, 6, 'HLD', '', '', NULL), >+ ('561', 'b', 'Time of collation [OBSOLETE]', 'Time of collation [OBSOLETE]', 0, 0, '', 5, '', '', '', NULL, 6, 'HLD', '', '', NULL), >+ ('561', 'u', 'Uniform Resource Identifier', 'Uniform Resource Identifier', 1, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL), >+ ('562', '3', 'Materials specified', 'Materials specified', 0, 0, NULL, 5, NULL, NULL, '', NULL, -6, 'HLD', '', '', NULL), >+ ('562', '5', 'Institution to which field applies', 'Institution to which field applies', 0, 0, NULL, -1, NULL, NULL, '', NULL, -6, 'HLD', '', '', NULL), >+ ('562', '6', 'Linkage', 'Linkage', 0, 0, NULL, 5, NULL, NULL, '', NULL, -6, 'HLD', '', '', NULL), >+ ('562', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, NULL, 5, NULL, NULL, '', NULL, -6, 'HLD', '', '', NULL), >+ ('562', 'a', 'Identifying markings', 'Identifying markings', 1, 0, NULL, 5, NULL, NULL, '', NULL, -1, 'HLD', '', '', NULL), >+ ('562', 'b', 'Copy identification', 'Copy identification', 1, 0, NULL, 5, NULL, NULL, '', NULL, -1, 'HLD', '', '', NULL), >+ ('562', 'c', 'Version identification', 'Version identification', 1, 0, NULL, 5, NULL, NULL, '', NULL, -1, 'HLD', '', '', NULL), >+ ('562', 'd', 'Presentation format', 'Presentation format', 1, 0, NULL, 5, NULL, NULL, '', NULL, -1, 'HLD', '', '', NULL), >+ ('562', 'e', 'Number of copies', 'Number of copies', 1, 0, NULL, 5, NULL, NULL, '', NULL, -1, 'HLD', '', '', NULL), >+ ('563', '3', 'Materials specified', 'Materials specified', 0, 0, NULL, 5, NULL, NULL, '', NULL, -6, 'HLD', '', '', NULL), >+ ('563', '5', 'Institution to which field applies', 'Institution to which field applies', 0, 0, NULL, -1, NULL, NULL, '', NULL, -6, 'HLD', '', '', NULL), >+ ('563', '6', 'Linkage', 'Linkage', 0, 0, NULL, 5, NULL, NULL, '', NULL, -6, 'HLD', '', '', NULL), >+ ('563', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, NULL, 5, NULL, NULL, '', NULL, -6, 'HLD', '', '', NULL), >+ ('563', 'a', 'Binding note', 'Binding note', 0, 0, NULL, 5, NULL, NULL, '', NULL, -1, 'HLD', '', '', NULL), >+ ('563', 'u', 'Uniform Resource Identifier', 'Uniform Resource Identifier', 1, 0, NULL, 5, NULL, NULL, '', 1, -1, 'HLD', '', '', NULL), >+ ('583', '2', 'Source of term', 'Source of term', 0, 0, NULL, 5, NULL, NULL, '', NULL, -6, 'HLD', '', '', NULL), >+ ('583', '3', 'Materials specified', 'Materials specified', 0, 0, NULL, 5, NULL, NULL, '', NULL, -6, 'HLD', '', '', NULL), >+ ('583', '5', 'Institution to which field applies', 'Institution to which field applies', 0, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL), >+ ('583', '6', 'Linkage', 'Linkage', 0, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL), >+ ('583', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL), >+ ('583', 'a', 'Action', 'Action', 0, 0, '', 5, '', '', '', NULL, -1, 'HLD', '', '', NULL), >+ ('583', 'b', 'Action identification', 'Action identification', 1, 0, '', 5, '', '', '', NULL, -1, 'HLD', '', '', NULL), >+ ('583', 'c', 'Time/date of action', 'Time/date of action', 1, 0, '', 5, '', '', '', NULL, -1, 'HLD', '', '', NULL), >+ ('583', 'd', 'Action interval', 'Action interval', 1, 0, '', 5, '', '', '', NULL, -1, 'HLD', '', '', NULL), >+ ('583', 'e', 'Contingency for action', 'Contingency for action', 1, 0, '', 5, '', '', '', NULL, -1, 'HLD', '', '', NULL), >+ ('583', 'f', 'Authorization', 'Authorization', 1, 0, '', 5, '', '', '', NULL, -1, 'HLD', '', '', NULL), >+ ('583', 'h', 'Jurisdiction', 'Jurisdiction', 1, 0, '', 5, '', '', '', NULL, -1, 'HLD', '', '', NULL), >+ ('583', 'i', 'Method of action', 'Method of action', 1, 0, '', 5, '', '', '', NULL, -1, 'HLD', '', '', NULL), >+ ('583', 'j', 'Site of action', 'Site of action', 1, 0, '', 5, '', '', '', NULL, -1, 'HLD', '', '', NULL), >+ ('583', 'k', 'Action agent', 'Action agent', 1, 0, '', 5, '', '', '', NULL, -1, 'HLD', '', '', NULL), >+ ('583', 'l', 'Status', 'Status', 1, 0, '', 5, '', '', '', NULL, -1, 'HLD', '', '', NULL), >+ ('583', 'n', 'Extent', 'Extent', 1, 0, '', 5, '', '', '', NULL, -1, 'HLD', '', '', NULL), >+ ('583', 'o', 'Type of unit', 'Type of unit', 1, 0, '', 5, '', '', '', NULL, -1, 'HLD', '', '', NULL), >+ ('583', 'u', 'Uniform Resource Identifier', 'Uniform Resource Identifier', 1, 0, '', 5, '', '', '', 1, -1, 'HLD', '', '', NULL), >+ ('583', 'x', 'Nonpublic note', 'Nonpublic note', 1, 0, '', 5, '', '', '', NULL, 4, 'HLD', '', '', NULL), >+ ('583', 'z', 'Public note', 'Public note', 1, 0, '', 5, '', '', '', NULL, -1, 'HLD', '', '', NULL), >+ ('842', '6', 'Linkage', 'Linkage', 0, 0, '', 8, '', '', '', NULL, -6, 'HLD', '', '', NULL), >+ ('842', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 8, '', '', '', NULL, -6, 'HLD', '', '', NULL), >+ ('842', 'a', 'Textual physical form designator', 'Textual physical form designator', 0, 0, '', 8, '', '', '', NULL, -1, 'HLD', '', '', NULL), >+ ('843', '3', 'Materials specified', 'Materials specified', 0, 0, NULL, 8, NULL, NULL, '', NULL, -6, 'HLD', '', '', NULL), >+ ('843', '5', 'Institution to which field applies', 'Institution to which field applies', 0, 0, NULL, -1, NULL, NULL, '', NULL, -6, 'HLD', '', '', NULL), >+ ('843', '6', 'Linkage', 'Linkage', 0, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL), >+ ('843', '7', 'Fixed-length data elements of reproduction', 'Fixed-length data elements of reproduction', 0, 0, NULL, 8, NULL, NULL, '', NULL, -6, 'HLD', '', '', NULL), >+ ('843', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 8, '', '', '', NULL, -6, 'HLD', '', '', NULL), >+ ('843', 'a', 'Type of reproduction', 'Type of reproduction', 0, 0, NULL, 8, NULL, NULL, '', NULL, -1, 'HLD', '', '', NULL), >+ ('843', 'b', 'Place of reproduction', 'Place of reproduction', 1, 0, NULL, 8, NULL, NULL, '', NULL, -1, 'HLD', '', '', NULL), >+ ('843', 'c', 'Agency responsible for reproduction', 'Agency responsible for reproduction', 1, 0, NULL, 8, NULL, NULL, '', NULL, -1, 'HLD', '', '', NULL), >+ ('843', 'd', 'Date of reproduction', 'Date of reproduction', 0, 0, NULL, 8, NULL, NULL, '', NULL, -1, 'HLD', '', '', NULL), >+ ('843', 'e', 'Physical description of reproduction', 'Physical description of reproduction', 0, 0, NULL, 8, NULL, NULL, '', NULL, -1, 'HLD', '', '', NULL), >+ ('843', 'f', 'Series statement of reproduction', 'Series statement of reproduction', 1, 0, NULL, 8, NULL, NULL, '', NULL, -1, 'HLD', '', '', NULL), >+ ('843', 'm', 'Dates and/or sequential designation of issues reproduced', 'Dates and/or sequential designation of issues reproduced', 1, 0, NULL, 8, NULL, NULL, '', NULL, -1, 'HLD', '', '', NULL), >+ ('843', 'n', 'Note about reproduction', 'Note about reproduction', 1, 0, NULL, 8, NULL, NULL, '', NULL, -1, 'HLD', '', '', NULL), >+ ('844', '6', 'Linkage', 'Linkage', 0, 0, '', 8, '', '', '', NULL, -6, 'HLD', '', '', NULL), >+ ('844', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 8, '', '', '', NULL, -6, 'HLD', '', '', NULL), >+ ('844', 'a', 'Name of unit', 'Name of unit', 0, 0, '', 8, '', '', '', NULL, -1, 'HLD', '', '', NULL), >+ ('845', 'a', 'Terms governing use and reproduction', 'Terms governing use and reproduction', 0, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL), >+ ('845', 'b', 'Jurisdiction', 'Jurisdiction', 0, 0, '', 8, '', '', '', NULL, -6, 'HLD', '', '', NULL), >+ ('845', 'c', 'Authorization', 'Authorization', 0, 0, '', 8, '', '', '', NULL, -6, 'HLD', '', '', NULL), >+ ('845', 'd', 'Authorized users', 'Authorized users', 0, 0, '', 8, '', '', '', NULL, -6, 'HLD', '', '', NULL), >+ ('845', 'u', 'Uniform Resource Identifier', 'Uniform Resource Identifier', 1, 0, '', 8, '', '', '', 1, -6, '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, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), >+ ('852', 'b', 'Sublocation or collection', 'Sublocation or collection', 1, 0, 'holdings.holdingbranch', 8, 'branches', '', '', NULL, 4, 'HLD', '', '', NULL), >+ ('852', 'c', 'Shelving location', 'Shelving location', 1, 0, 'holdings.location', 8, 'LOC', '', '', 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, 'holdings.ccode', 8, 'CCODE', '', '', NULL, 4, 'HLD', '', '', NULL), >+ ('852', 'h', 'Classification part', 'Classification part', 0, 0, 'holdings.callnumber', 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, 'holdings.callnumber', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL), >+ ('852', 'm', 'Call number suffix', 'Call number suffix', 1, 0, 'holdings.callnumber', 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/kohastructure.sql b/installer/data/mysql/kohastructure.sql >index 8a8ca49122..46ce93c16d 100644 >--- a/installer/data/mysql/kohastructure.sql >+++ b/installer/data/mysql/kohastructure.sql >@@ -698,6 +698,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`), >@@ -911,12 +912,57 @@ CREATE TABLE `refund_lost_item_fee_rules` ( -- refund lost item fee rules tbale > PRIMARY KEY (`branchcode`) > ) 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) >+ `ccode` varchar(80) default NULL, -- authorized value for the collection code associated with this item (MARC21 852$g) >+ `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_on` 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_on` 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 >@@ -962,6 +1008,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`), >@@ -974,10 +1021,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 c4ce39a634..04afd4f4bc 100644 >--- a/installer/data/mysql/mandatory/auth_val_cat.sql >+++ b/installer/data/mysql/mandatory/auth_val_cat.sql >@@ -22,6 +22,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/koha-tmpl/intranet-tmpl/prog/css/addholding.css b/koha-tmpl/intranet-tmpl/prog/css/addholding.css >new file mode 100644 >index 0000000000..6900e703d2 >--- /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 b45984ccbe..ffb1247c28 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 ) %] > <li><a id="newbiblio" href="/cgi-bin/koha/cataloguing/addbiblio.pl">New record</a></li> > [% END %] > >+ [% IF ( show_summary_holdings && CAN_user_editcatalogue_edit_items ) %] >+ <li><a id="newholding" href="/cgi-bin/koha/cataloguing/addholding.pl?biblionumber=[% biblionumber %]#addholding">New holdings record</a></li> >+ [% END %] >+ > [% IF ( CAN_user_editcatalogue_edit_items ) %] > <li><a id="newitem" href="/cgi-bin/koha/cataloguing/additem.pl?biblionumber=[% biblionumber | html %]#additema">New item</a></li> > [% 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 e565d675b5..385d3f2914 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 >@@ -133,7 +133,7 @@ > <tbody> > <tr> > <td> </td> >- <td>Default framework</td> >+ <td>Default bibliographic framework</td> > <td> > <div class="dropdown"> > <a class="btn btn-default btn-xs dropdown-toggle" id="frameworkactions[% loo.frameworkcode | html %]" role="button" data-toggle="dropdown" href="#"> >@@ -198,7 +198,6 @@ > </div> > </td> > </tr> >- > [% FOREACH loo IN frameworks %] > <tr> > <td>[% loo.frameworkcode | html %]</td> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref >index af80da855e..65577a789a 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref >@@ -291,3 +291,10 @@ Cataloging: > - "All values of repeating tags and subfields will be printed with the given RIS tag." > - "<br/>" > - "Use of TY ( record type ) as a key will <i>replace</i> the default TY with the field value of your choosing." >+ Holdings: >+ - >+ - pref: SummaryHoldings >+ choices: >+ yes: Use >+ no: "Don't use" >+ - summary holdings records. >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >index bfab7727aa..5da90e1939 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >@@ -6,6 +6,7 @@ > [% USE Branches %] > [% USE Biblio %] > [% USE ColumnsSettings %] >+[% USE Holdings %] > [% SET AdlibrisEnabled = Koha.Preference('AdlibrisCoversEnabled') %] > [% SET AdlibrisURL = Koha.Preference('AdlibrisCoversURL') %] > >@@ -302,16 +303,19 @@ > <div id="bibliodetails" class="toptabs"> > > <ul> >+ [% IF (show_summary_holdings) %] >+ <li><a href="#summaryholdings">Holdings ([% summary_holdings.size() || 0 | html %])</a></li> >+ [% END %] > [% IF (SeparateHoldings) %] > <li> >- <a href="#holdings">[% LoginBranchname | html %] holdings ([% itemloop.size() || 0 | html %])</a> >+ <a href="#holdings">[% LoginBranchname | html %] [% IF (show_summary_holdings) %]items[% ELSE %]holdings[% END %] ([% itemloop.size() || 0 | html %])</a> > </li> > <li> >- <a href="#otherholdings">Other holdings ([% otheritemloop.size() || 0 | html %])</a> >+ <a href="#otherholdings">[% IF (show_summary_holdings) %]Other items[% ELSE %]Other holdings[% END %] ([% otheritemloop.size() || 0 | html %])</a> > </li> > [% ELSE %] > <li> >- <a href="#holdings">Holdings ([% itemloop.size() || 0 | html %])</a> >+ <a href="#holdings">[% IF (show_summary_holdings) %]Items[% ELSE %]Holdings[% END %] ([% itemloop.size() || 0 | html %])</a> > </li> > [% END %] > [% IF ( MARCNOTES || notes ) %]<li><a href="#description">Descriptions</a></li>[% END %] >@@ -331,6 +335,54 @@ > [% END %] > </ul> > >+[% IF ( show_summary_holdings ) %] >+ <div id="summaryholdings"> >+ >+ [% IF ( summary_holdings ) %] >+ <div class="summaryholdings_table_controls"> >+ </div> >+ <table class="summaryholdings_table"> >+ <thead> >+ <tr> >+ <th>Library</th> >+ <th>Location</th> >+ <th>Collection</th> >+ <th>Call number</th> >+ <th>Status</th> >+ [% IF ( CAN_user_editcatalogue_edit_items ) %]<th class="NoSort"> </th>[% END %] >+ </tr> >+ </thead> >+ <tbody> >+ [% FOREACH holding IN summary_holdings %] >+ <tr> >+ <td class="branch">[% UNLESS ( singlebranchmode ) %][% Branches.GetName( holding.holdingbranch ) | html %] [% END %]</td> >+ <td class="location"><span class="shelvingloc">[% holding.location | html %][% IF ( holding.sub_location ) %] ([% holding.sub_location | html %])[% END %]</span> >+ <td class="collection">[% holding.ccode | html %]</span> >+ <td class="itemcallnumber">[% IF ( holding.callnumber ) %] [% holding.callnumber | html %][% END %]</td> >+ <td class="status"> >+ [% IF ( holding.suppress ) %] >+ <span class="suppressed">Suppressed in OPAC</span> >+ [% END %] >+ </td> >+ [% IF CAN_user_editcatalogue_edit_items %] >+ <td class="actions"> >+ <a class="btn btn-default btn-xs" href="/cgi-bin/koha/cataloguing/addholding.pl?op=edit&biblionumber=[% holding.biblionumber %]&holding_id=[% holding.holding_id %]#editholding"><i class="fa fa-pencil"></i> Edit</a> >+ <a class="btn btn-default btn-xs delete" href="/cgi-bin/koha/cataloguing/addholding.pl?op=delete&biblionumber=[% holding.biblionumber %]&holding_id=[% holding.holding_id %]"><i class="fa fa-eraser"></i> Delete</a> >+ <a class="btn btn-default btn-xs" href="/cgi-bin/koha/cataloguing/additem.pl?biblionumber=[% holding.biblionumber %]&holding_id=[% holding.holding_id %]#additema"><i class="fa fa-plus"></i> Add item</a> >+ <a class="btn btn-default btn-xs previewMARC" href="/cgi-bin/koha/catalogue/showmarc.pl?holding_id=[% holding.holding_id | uri %]&viewas=html" title="MARC">Show MARC</a> >+ </td> >+ [% END %] >+ </tr> >+ [% END %] >+ </tbody> >+ </table> >+ [% ELSE %] >+ <div id="noitems">No holdings records</div> >+ [% END %] >+ >+ </div> >+[% END %] >+ > [% items_table_block_iter = 0 %] > [% BLOCK items_table %] > [% items_table_block_iter = items_table_block_iter + 1 %] >@@ -354,6 +406,7 @@ > <tr> > [% IF (StaffDetailItemSelection) %]<th class="NoSort"></th>[% END %] > [% IF ( item_level_itypes ) %]<th>Item type</th>[% END %] >+ [% IF ( show_summary_holdings ) %]<th>Holding</th>[% END %] > <th>Current location</th> > <th>Home library</th> > [% IF ( itemdata_ccode ) %]<th>Collection</th>[% END %] >@@ -392,6 +445,9 @@ > [% item.translated_description | html %] > </td> > [% END %] >+ [% IF ( show_summary_holdings ) %] >+ <td class="holding">[% Holdings.GetLocation(item.holding_id) | html %]</td> >+ [% END %] > <td class="location">[% UNLESS ( singlebranchmode ) %][% Branches.GetName( item.branchcode ) | html %] [% END %]</td> > <td class="homebranch">[% Branches.GetName(item.homebranch) | html %]<span class="shelvingloc">[% item.location | html %]</span> </td> > [% IF ( itemdata_ccode ) %]<td>[% item.ccode | html %]</td>[% END %] >@@ -1028,12 +1084,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 4474432d93..6f1488c542 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt >@@ -2,6 +2,7 @@ > [% USE Asset %] > [% USE Koha %] > [% USE Branches %] >+[% USE Holdings %] > [% SET footerjs = 1 %] > [% INCLUDE 'doc-head-open.inc' %] > <title>Koha › Catalog › Item details for [% title | html %] [% FOREACH subtitl IN subtitle %] [% subtitl.subfield | html %][% END %]</title> >@@ -55,6 +56,7 @@ > [% END %] > [% END %][% END %]</h4> > <ol class="bibliodetails"> >+ <li><span class="label">Holding:</span> [% Holdings.GetLocation( ITEM_DAT.holding_id ) | html %] </li> > <li><span class="label">Home library:</span> [% Branches.GetName( ITEM_DAT.homebranch ) | html %] </li> > [% IF ( item_level_itypes ) %] > <li><span class="label">Item type:</span> [% ITEM_DAT.itype | html %] </li> >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 e2645731c7..0f4ec3adf3 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt >@@ -2,6 +2,7 @@ > [% USE Asset %] > [% USE Koha %] > [% USE Biblio %] >+[% USE Holdings %] > [% USE KohaDates %] > [% PROCESS 'i18n.inc' %] > [% SET footerjs = 1 %] >@@ -484,6 +485,19 @@ > </td> > > <td><div class="availability"> >+ [% IF ( SEARCH_RESULT.summary_holdings ) %] >+ <div class="holdings"> >+ <strong>Holdings</strong> >+ <ul> >+ [% FOREACH holding IN SEARCH_RESULT.summary_holdings %] >+ <li> >+ [% Holdings.GetLocation(holding) | html %] >+ </li> >+ [% END %] >+ </ul> >+ </div> >+ [% END %] >+ > [% IF ( SEARCH_RESULT.items_count ) %] > <strong> > [% 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 0000000000..8d2ee39267 >--- /dev/null >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addholding.tt >@@ -0,0 +1,618 @@ >+[% USE raw %] >+[% USE Asset %] >+[% USE Koha %] >+[% INCLUDE 'doc-head-open.inc' %] >+<title>Koha › Cataloging › [% title | html %] [% IF ( author ) %] by [% author | html %][% END %] (Record #[% biblionumber | html %]) › Holdings</title> >+[% INCLUDE 'doc-head-close.inc' %] >+[% Asset.js("lib/jquery/plugins/jquery.fixFloat.js") | $raw %] >+[% Asset.js("js/cataloging.js") | $raw %] >+[% INCLUDE 'browser-strings.inc' %] >+[% Asset.js("js/browser.js") | $raw %] >+<script type="text/javascript"> >+//<![CDATA[ >+ var browser = KOHA.browser('[% searchid | html %]', parseInt('[% biblionumber | html %]', 10)); >+ browser.show(); >+ >+ $(window).load(function() { >+ $("#loading").hide(); >+ }); >+ $(document).ready(function() { >+ $('#addholdingtabs').tabs().bind('show.ui-tabs', function(e, ui) { >+ $("#"+ui.panel.id+" input:eq(0)").focus(); >+ }); >+ >+ [% IF tab %] >+ $('#addholdingtabs').selectTabByID("#[% tab | html %]"); >+ [% END %] >+ >+ $('#toolbar').fixFloat(); >+ >+ /* check cookie to hide/show marcdocs*/ >+ if($.cookie("marcdocs_[% borrowernumber | html %]") == 'hide'){ >+ toggleMARCdocLinks(false); >+ } else { >+ toggleMARCdocLinks(true); >+ } >+ >+ $("#marcDocsSelect").click(function(){ >+ if($.cookie("marcdocs_[% borrowernumber | html %]") == 'hide'){ >+ toggleMARCdocLinks(true); >+ } else { >+ toggleMARCdocLinks(false); >+ } >+ }); >+ >+ /* check cookie to hide/show marc tags*/ >+ var marctags_cookie = $.cookie("marctags_[% borrowernumber | html %]"); >+ if (marctags_cookie == 'hide'){ >+ toggleMARCTagLinks(false); >+ } else if( marctags_cookie == 'show'){ >+ toggleMARCTagLinks(true) >+ } else { >+ [% UNLESS Koha.Preference("hide_marc") %] >+ toggleMARCTagLinks(true) >+ [% ELSE %] >+ toggleMARCTagLinks(false); >+ [% END %] >+ } >+ >+ $("#marcTagsSelect").click(function(){ >+ if( $.cookie("marctags_[% borrowernumber | html %]") == 'hide'){ >+ toggleMARCTagLinks(true) >+ } else { >+ toggleMARCTagLinks(false); >+ } >+ }); >+ >+ $("#saverecord").click(function(){ >+ $(".btn-group").removeClass("open"); >+ onOption(); >+ return false; >+ }); >+ >+ $("#saveandview").click(function(){ >+ $(".btn-group").removeClass("open"); >+ redirect("view"); >+ return false; >+ }); >+ >+ $("#saveanditems").click(function(){ >+ $(".btn-group").removeClass("open"); >+ redirect("items"); >+ return false; >+ }); >+ $("#saveandcontinue").click(function(){ >+ $(".btn-group").removeClass("open"); >+ var tab = $("#addholdingtabs li.ui-tabs-active:first a").attr('href'); >+ tab = tab.replace('#', ''); >+ $("#current_tab").val(tab); >+ redirect("just_save", tab); >+ return false; >+ }); >+ >+ $( '#switcheditor' ).click( function() { >+ >+ if ( !confirm( _("Any changes will not be saved. Continue?") ) ) return false; >+ >+ $.cookie( 'catalogue_editor_[% USER_INFO.borrowernumber | html %]', 'advanced', { expires: 365, path: '/' } ); >+ >+ var holding_id = [% holding_id || "''" | html %]; >+ window.location = '/cgi-bin/koha/cataloguing/editor.pl#catalog/' + biblionumber + '/holdings/' + holding_id; >+ >+ return false; >+ } ); >+ $(".change-framework").on("click", function(){ >+ var frameworkcode = $(this).data("frameworkcode"); >+ $("#frameworkcode").val( frameworkcode ); >+ Changefwk(); >+ }); >+ }); >+ >+function redirect(dest){ >+ $("#redirect").attr("value",dest); >+ return Check(); >+} >+ >+[% IF ( CAN_user_editcatalogue_edit_items ) %] >+ var onOption = function () { >+ return Check(); >+ } >+[% END %] >+ >+function Dopop(link,i) { >+ defaultvalue = document.getElementById(i).value; >+ window.open(link+"&result="+defaultvalue,"valuebuilder",'width=700,height=550,toolbar=false,scrollbars=yes'); >+} >+ >+function PopupMARCFieldDoc(field) { >+ [% IF ( marcflavour == 'MARC21' ) %] >+ _MARC21FieldDoc(field); >+ [% ELSIF ( marcflavour == 'UNIMARC' ) %] >+ _UNIMARCFieldDoc(field); >+ [% END %] >+} >+ >+function _MARC21FieldDoc(field) { >+ if(field == 0) { >+ window.open("http://www.loc.gov/marc/holdings/hdleader.html"); >+ } else if (field < 900) { >+ window.open("http://www.loc.gov/marc/holdings/hd" + ("000"+field).slice(-3) + ".html"); >+ } else { >+ window.open("http://www.loc.gov/marc/holdings/hd9xx.html"); >+ } >+} >+ >+function _UNIMARCFieldDoc(field) { >+ /* http://archive.ifla.org/VI/3/p1996-1/ is an outdated version of UNIMARC, but >+ seems to be the only version available that can be linked to per tag. More recent >+ versions of the UNIMARC standard are available on the IFLA website only as >+ PDFs! >+ */ >+ var url; >+ if (field == 0) { >+ url = "http://archive.ifla.org/VI/3/p1996-1/uni.htm"; >+ } else { >+ var first = field.substring(0,1); >+ url = "http://archive.ifla.org/VI/3/p1996-1/uni" + first + ".htm#"; >+ if (first == 0) url = url + "b"; >+ url = first == 9 >+ ? "http://archive.ifla.org/VI/3/p1996-1/uni9.htm" >+ : url + field; >+ } >+ window.open(url); >+} >+ >+/* >+ * Functions to hide/show marc docs and tags links >+ */ >+ >+function toggleMARCdocLinks(flag){ >+ if( flag === true ){ >+ $(".marcdocs").show(); >+ $.cookie("marcdocs_[% borrowernumber | html %]",'show', { path: "/", expires: 365 }); >+ $("#marcDocsSelect i").addClass('fa-check-square-o').removeClass('fa-square-o'); >+ } else { >+ $(".marcdocs").hide(); >+ $.cookie("marcdocs_[% borrowernumber | html %]",'hide', { path: "/", expires: 365 }); >+ $("#marcDocsSelect i").removeClass('fa-check-square-o').addClass('fa-square-o'); >+ } >+} >+ >+function toggleMARCTagLinks(flag){ >+ if( flag === true ){ >+ $(".tagnum").show(); >+ $(".subfieldcode").show(); >+ $.cookie("marctags_[% borrowernumber | html %]",'show', { path: "/", expires: 365 }); >+ $("#marcTagsSelect i").addClass('fa-check-square-o').removeClass('fa-square-o'); >+ } else { >+ $(".tagnum").hide(); >+ $(".subfieldcode").hide(); >+ $.cookie("marctags_[% borrowernumber | html %]",'hide', { path: "/", expires: 365 }); >+ $("#marcTagsSelect i").removeClass('fa-check-square-o').addClass('fa-square-o'); >+ } >+} >+ >+/** >+ * check if mandatory subfields are written >+ */ >+function AreMandatoriesNotOk(){ >+ var mandatories = new Array(); >+ var mandatoriesfields = new Array(); >+ var tab = new Array(); >+ var label = new Array(); >+ var flag=0; >+ var tabflag= new Array(); >+ [% FOREACH BIG_LOO IN BIG_LOOP %] >+ [% FOREACH innerloo IN BIG_LOO.innerloop %] >+ [% IF ( innerloo.mandatory ) %] >+ mandatoriesfields.push(new Array("[% innerloo.tag | html %]","[% innerloo.index | html %][% innerloo.random | html %]","[% innerloo.index | html %]")); >+ [% END %] >+ [% FOREACH subfield_loo IN innerloo.subfield_loop %] >+ [% IF ( subfield_loo.mandatory ) %] >+ mandatories.push("[% subfield_loo.id | html %]"); >+ tab.push("[% BIG_LOO.number | html %]"); >+ label.push("[% subfield_loo.marc_lib | $raw %]"); >+ [% END %] >+ [% END %] >+ [% END %] >+ [% END %] >+ var StrAlert = _("Can't save this record because the following field aren't filled:"); >+ StrAlert += "\n\n"; >+ for (var i=0,len=mandatories.length; i<len ; i++) { >+ var tag=mandatories[i].substr(4,3); >+ var subfield=mandatories[i].substr(17,1); >+ var tagnumber=mandatories[i].substr(19,mandatories[i].lastIndexOf("_")-19); >+ if (tabflag[tag+subfield+tagnumber] == null) { >+ tabflag[tag+subfield+tagnumber]=new Array(); >+ tabflag[tag+subfield+tagnumber][0]=0; >+ } >+ if (tabflag[tag+subfield+tagnumber][0] != 1 && (document.getElementById(mandatories[i]) != null && ! document.getElementById(mandatories[i]).value || document.getElementById(mandatories[i]) == null)) { >+ tabflag[tag+subfield+tagnumber][0] = 0 + tabflag[tag+subfield+tagnumber] ; >+ document.getElementById(mandatories[i]).setAttribute('class','subfield_not_filled'); >+ $('#' + mandatories[i]).focus(); >+ tabflag[tag+subfield+tagnumber][1]=label[i]; >+ tabflag[tag+subfield+tagnumber][2]=tab[i]; >+ } else { >+ tabflag[tag+subfield+tagnumber][0] = 1; >+ } >+ } >+ for (var tagsubfieldid in tabflag) { >+ if (tabflag[tagsubfieldid][0]==0) { >+ var tag=tagsubfieldid.substr(0,3); >+ var subfield=tagsubfieldid.substr(3,1); >+ StrAlert += "\t* "+_("tag %s subfield %s %s in tab %s").format(tag, subfield, tabflag[tagsubfieldid][1], tabflag[tagsubfieldid][2]) + "\n"; >+ flag=1; >+ } >+ } >+ >+ /* Check for mandatories field(not subfields) */ >+ for (var i=0,len=mandatoriesfields.length; i<len; i++) { >+ isempty = true; >+ arr = mandatoriesfields[i]; >+ divid = "tag_" + arr[0] + "_" + arr[1]; >+ varegexp = new RegExp("^tag_" + arr[0] + "_code_"); >+ >+ if(parseInt(arr[0]) >= 10) { >+ elem = document.getElementById(divid); >+ eleminputs = elem.getElementsByTagName('input'); >+ >+ for(var j=0,len2=eleminputs.length; j<len2; j++){ >+ >+ if(eleminputs[j].name.match(varegexp) && eleminputs[j].value){ >+ inputregexp = new RegExp("^tag_" + arr[0] + "_subfield_" + eleminputs[j].value + "_" + arr[2]); >+ >+ for( var k=0; k<len2; k++){ >+ if(eleminputs[k].id.match(inputregexp) && eleminputs[k].value){ >+ isempty = false >+ } >+ } >+ >+ elemselect = elem.getElementsByTagName('select'); >+ for( var k=0; k<elemselect.length; k++){ >+ if(elemselect[k].id.match(inputregexp) && elemselect[k].value){ >+ isempty = false >+ } >+ } >+ } >+ } >+ >+ elemtextareas = elem.getElementsByTagName('textarea'); >+ for(var j=0,len2=elemtextareas.length; j<len2; j++){ >+ // this bit assumes that the only textareas in this context would be for subfields >+ if (elemtextareas[j].value) { >+ isempty = false; >+ } >+ } >+ } else { >+ isempty = false; >+ } >+ >+ if (isempty) { >+ flag = 1; >+ StrAlert += "\t* " + _("Field %s is mandatory, at least one of its subfields must be filled.").format(arr[0]) + "\n"; >+ } >+ } >+ >+ if (flag) { >+ return StrAlert; >+ } else { >+ return flag; >+ } >+} >+ >+/** >+ * >+ * >+ */ >+function Check(){ >+ var StrAlert = AreMandatoriesNotOk(); >+ if( ! StrAlert ){ >+ document.f.submit(); >+ return true; >+ } else { >+ alert(StrAlert); >+ return false; >+ } >+} >+ >+function Changefwk() { >+ var f = document.f; >+ f.op.value = "[% op | html %]"; >+ f.biblionumber.value = "[% biblionumber | html %]"; >+ f.holding_id.value = "[% holding_iddata | html %]"; >+ f.changed_framework.value = "changed"; >+ f.submit(); >+} >+ >+//]]> >+</script> >+[% Asset.css("css/addholding.css") | $raw %] >+ >+[% INCLUDE 'select2.inc' %] >+<script> >+ $(document).ready(function() { >+ $('.subfield_line select').select2(); >+ }); >+</script> >+ >+[% IF ( bidi ) %] >+ [% Asset.css("css/right-to-left.css") | $raw %] >+[% END %] >+</head> >+<body id="cat_addholding" class="cat"> >+ >+ <div id="loading"> >+ <div>Loading, please wait...</div> >+ </div> >+ >+[% INCLUDE 'header.inc' %] >+ >+<div id="breadcrumbs"> >+ <a href="/cgi-bin/koha/mainpage.pl">Home</a> >+ › <a href="/cgi-bin/koha/cataloguing/addbooks.pl">Cataloging</a> >+ › Edit <a href="/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=[% biblionumber | html %]">[% title | html %] [% IF ( author ) %] by [% author | html %][% END %] (Record #[% biblionumber | html %])</a> >+ › <a href="/cgi-bin/koha/cataloguing/addholding.pl?biblionumber=[% biblionumber | html %]">Holdings</a> >+</div> >+ >+<div id="doc" class="yui-t7"> >+ >+<div id="bd"> >+ <div id="yui-main"> >+ <div class="yui-g"> >+ >+<h1> >+[% IF ( holding_id ) %]Editing holdings record number [% holding_id | html %] >+[% ELSE %]Add holdings record >+[% END %] >+</h1> >+ >+[% IF ( done ) %] >+ <script type="text/javascript"> >+ opener.document.forms['f'].holding_id.value=[% holding_id | html %]; >+ window.close(); >+ </script> >+[% ELSE %] >+ <form method="post" name="f" id="f" action="/cgi-bin/koha/cataloguing/addholding.pl" onsubmit="return Check();"> >+ <input type="hidden" value="[% IF ( holding_id ) %]view[% ELSE %]holdings[% END %]" id="redirect" name="redirect" /> >+ <input type="hidden" value="" id="current_tab" name="current_tab" /> >+[% END %] >+ >+<div id="toolbar" class="btn-toolbar"> >+ [% IF CAN_user_editcatalogue_edit_items %] >+ <div class="btn-group"> >+ <button class="btn btn-default btn-sm" id="saverecord"><i class="fa fa-save"></i> Save</button> >+ <button class="btn btn-default btn-sm dropdown-toggle" data-toggle="dropdown"> >+ <span class="caret"></span> >+ </button> >+ <ul class="dropdown-menu"> >+ <li><a id="saveandview" href="#">Save and view record</a></li> >+ <li><a id="saveanditems" href="#">Save and edit items</a></li> >+ <li><a id="saveandcontinue" href="#">Save and continue editing</a></li> >+ </ul> >+ </div> >+ [% END %] >+ >+ <div class="btn-group"> >+ <button class="btn btn-default btn-sm dropdown-toggle" data-toggle="dropdown"><i class="fa fa-cog"></i> Settings <span class="caret"></span></button> >+ <ul id="settings-menu" class="dropdown-menu"> >+ [% IF Koha.Preference( 'EnableAdvancedCatalogingEditor' ) == 1 %] >+ <li><a href="#" id="switcheditor">Switch to advanced editor</a></li> >+ [% END %] >+ [% IF marcflavour != 'NORMARC' AND NOT advancedMARCEditor %] >+ <li> >+ <a href="#" id="marcDocsSelect"><i class="fa fa-check-square-o"></i> Show MARC tag documentation links</a> >+ <li> >+ <a href="#" id="marcTagsSelect"><i class="fa fa-check-square-o"></i> Show tags</a> >+ </li> >+ [% END %] >+ <li class="divider"></li> >+ <li class="nav-header">Change framework</li> >+ <li> >+ <a href="#" class="change-framework" data-frameworkcode=""> >+ [% IF ( frameworkcode ) %] >+ <i class="fa fa-fw"> </i> >+ [% ELSE %] >+ <i class="fa fa-fw fa-check"></i> >+ [% END %] >+ Default >+ </a> >+ </li> >+ [% FOREACH framework IN frameworks%] >+ <li> >+ <a href="#" class="change-framework" data-frameworkcode="[% framework.frameworkcode | html %]"> >+ [% IF framework.frameworkcode == frameworkcode %] >+ <i class="fa fa-fw fa-check"></i> >+ [% ELSE %] >+ <i class="fa fa-fw"> </i> >+ [% END %] >+ [% framework.frameworktext | html %] >+ </a> >+ </li> >+ [% END %] >+ </ul> >+ </div> >+ <div class="btn-group"> >+ <a class="btn btn-default btn-sm" id="cancel" href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblionumber | url %]">Cancel</a> >+ </div> >+</div> >+ >+[% IF ( popup ) %] >+ <input type="hidden" name="mode" value="popup" /> >+[% END %] >+ <input type="hidden" name="op" value="add" /> >+ <input type="hidden" id="frameworkcode" name="frameworkcode" value="[% frameworkcode | html %]" /> >+ <input type="hidden" name="biblionumber" value="[% biblionumber | html %]" /> >+ <input type="hidden" name="holding_id" value="[% holding_id | html %]" /> >+ <input type="hidden" name="changed_framework" value="" /> >+ >+<div id="addholdingtabs" class="toptabs numbered"> >+ <ul> >+ [% FOREACH BIG_LOO IN BIG_LOOP %] >+ <li><a href="#tab[% BIG_LOO.number | html %]XX">[% BIG_LOO.number | html %]</a></li> >+ [% END %] >+ </ul> >+ >+[% FOREACH BIG_LOO IN BIG_LOOP %] >+ <div id="tab[% BIG_LOO.number | html %]XX"> >+ >+ [% FOREACH innerloo IN BIG_LOO.innerloop %] >+ [% IF ( innerloo.tag ) %] >+ <div class="tag" id="tag_[% innerloo.tag | html %]_[% innerloo.index | html %][% innerloo.random | html %]"> >+ <div class="tag_title" id="div_indicator_tag_[% innerloo.tag | html %]_[% innerloo.index | html %][% innerloo.random | html %]"> >+ [% IF advancedMARCEditor %] >+ <a href="#" tabindex="1" class="tagnum" title="[% innerloo.tag_lib | html %] - Click to Expand this Tag" onclick="ExpandField('tag_[% innerloo.tag | html %]_[% innerloo.index | html %][% innerloo.random | html %]'); return false;">[% innerloo.tag %]</a> >+ [% ELSE %] >+ <span class="tagnum" title="[% innerloo.tag_lib %]">[% innerloo.tag | html %]</span> >+ [% IF marcflavour != 'NORMARC' %]<a href="#" class="marcdocs" onclick="PopupMARCFieldDoc('[% innerloo.tag | html %]'); return false;"> ?</a>[% END %] >+ [% END %] >+ [% IF ( innerloo.fixedfield ) %] >+ <input type="text" >+ tabindex="1" >+ class="indicator flat" >+ style="display:none;" >+ name="tag_[% innerloo.tag | html %]_indicator1_[% innerloo.index | html %][% innerloo.random | html %]" >+ size="1" >+ maxlength="1" >+ value="[% innerloo.indicator1 | html %]" /> >+ <input type="text" >+ tabindex="1" >+ class="indicator flat" >+ style="display:none;" >+ name="tag_[% innerloo.tag | html %]_indicator2_[% innerloo.index | html %][% innerloo.random | html %]" >+ size="1" >+ maxlength="1" >+ value="[% innerloo.indicator2 | html %]" /> >+ [% ELSE %] >+ <input type="text" >+ tabindex="1" >+ class="indicator flat" >+ name="tag_[% innerloo.tag | html %]_indicator1_[% innerloo.index | html %][% innerloo.random | html %]" >+ size="1" >+ maxlength="1" >+ value="[% innerloo.indicator1 | html %]" /> >+ <input type="text" >+ tabindex="1" >+ class="indicator flat" >+ name="tag_[% innerloo.tag | html %]_indicator2_[% innerloo.index | html %][% innerloo.random | html %]" >+ size="1" >+ maxlength="1" >+ value="[% innerloo.indicator2 | html %]" /> >+ [% END %] - >+ >+ [% UNLESS advancedMARCEditor %] >+ <a href="#" tabindex="1" class="expandfield" onclick="ExpandField('tag_[% innerloo.tag | html %]_[% innerloo.index | html %][% innerloo.random | html %]'); return false;" title="Click to Expand this Tag">[% innerloo.tag_lib | html %]</a> >+ [% END %] >+ <span class="field_controls"> >+ [% IF ( innerloo.repeatable ) %] >+ <a href="#" tabindex="1" class="buttonPlus" onclick="CloneField('tag_[% innerloo.tag | html %]_[% innerloo.index | html %][% innerloo.random | html %]','0','[% advancedMARCEditor | html %]'); return false;" title="Repeat this Tag"> >+ <img src="[% interface | html %]/[% theme | html %]/img/repeat-tag.png" alt="Repeat this Tag" /> >+ </a> >+ [% END %] >+ <a href="#" tabindex="1" class="buttonMinus" onclick="UnCloneField('tag_[% innerloo.tag | html %]_[% innerloo.index | html %][% innerloo.random | html %]'); return false;" title="Delete this Tag"> >+ <img src="[% interface | html %]/[% theme | html %]/img/delete-tag.png" alt="Delete this Tag" /> >+ </a> >+ </span> >+ >+ </div> >+ >+ [% FOREACH subfield_loo IN innerloo.subfield_loop %] >+ <!-- One line on the marc editor --> >+ <div class="subfield_line" style="[% subfield_loo.visibility | html %]" id="subfield[% subfield_loo.tag | html %][% subfield_loo.subfield | html %][% subfield_loo.random | html %]"> >+ >+ [% UNLESS advancedMARCEditor %] >+ [% IF ( subfield_loo.fixedfield ) %]<label for="tag_[% subfield_loo.tag | html %]_subfield_[% subfield_loo.subfield | html %]_[% subfield_loo.index | html %]_[% subfield_loo.index_subfield | html %]" style="display:none;" class="labelsubfield"> >+ [% ELSE %]<label for="tag_[% subfield_loo.tag | html %]_subfield_[% subfield_loo.subfield | html %]_[% subfield_loo.index | html %]_[% subfield_loo.index_subfield | html %]" class="labelsubfield"> >+ [% END %] >+ [% END %] >+ >+ <span class="subfieldcode"> >+ [% IF ( subfield_loo.fixedfield ) %] >+ <img class="buttonUp" style="display:none;" src="[% interface | html %]/[% theme | html %]/img/up.png" onclick="upSubfield('subfield[% subfield_loo.tag | html %][% subfield_loo.subfield | html %][% subfield_loo.random | html %]')" alt="Move Up" title="Move Up" /> >+ [% ELSE %] >+ <img class="buttonUp" src="[% interface | html %]/[% theme | html %]/img/up.png" onclick="upSubfield('subfield[% subfield_loo.tag | html %][% subfield_loo.subfield | html %][% subfield_loo.random | html %]')" alt="Move Up" title="Move Up" /> >+ [% END %] >+ <input type="text" >+ title="[% subfield_loo.marc_lib | html %]" >+ style=" [% IF ( subfield_loo.fixedfield ) %]display:none; [% END %]border:0;" >+ name="tag_[% subfield_loo.tag | html %]_code_[% subfield_loo.subfield | html %]_[% subfield_loo.index | html %]_[% subfield_loo.index_subfield | html %]" >+ value="[% subfield_loo.subfield | html %]" >+ size="1" >+ maxlength="1" >+ class="flat" >+ tabindex="0" /> >+ </span> >+ >+ [% UNLESS advancedMARCEditor %] >+ [% IF ( subfield_loo.mandatory ) %]<span class="subfield subfield_mandatory">[% ELSE %]<span class="subfield">[% END %] >+ [% subfield_loo.marc_lib %] >+ [% IF ( subfield_loo.mandatory ) %]<span class="mandatory_marker" title="This field is mandatory">*</span>[% END %] >+ </span> >+ </label> >+ [% END %] >+ >+ [% SET mv = subfield_loo.marc_value %] >+ [% IF ( mv.type == 'text' ) %] >+ [% IF ( mv.readonly == 1 ) %] >+ <input type="text" id="[%- mv.id | html -%]" name="[%- mv.name | html -%]" value="[%- mv.value | html -%]" class="input_marceditor readonly" tabindex="1" size="[%- mv.size | html -%]" maxlength="[%- mv.maxlength | html -%]" readonly="readonly" /> >+ [% ELSE %] >+ <input type="text" id="[%- mv.id | html -%]" name="[%- mv.name | html -%]" value="[%- mv.value | html -%]" class="input_marceditor" tabindex="1" size="[%- mv.size | html -%]" maxlength="[%- mv.maxlength | html -%]" /> >+ [% END %] >+ [% IF ( mv.authtype ) %] >+ <span class="subfield_controls"><a href="#" class="buttonDot tag_editor" onclick="openAuth(this.parentNode.parentNode.getElementsByTagName('input')[1].id,'[%- mv.authtype | html -%]','holding'); return false;" tabindex="1" title="Tag editor">Tag editor</a></span> >+ [% END %] >+ [% ELSIF ( mv.type == 'text_complex' ) %] >+ <input type="text" id="[%- mv.id | html -%]" name="[%- mv.name | html -%]" value="[%- mv.value | html -%]" class="input_marceditor framework_plugin" tabindex="1" size="[%- mv.size | html -%]" maxlength="[%- mv.maxlength | html -%]" /> >+ <span class="subfield_controls"> >+ [% IF mv.noclick %] >+ <a href="#" class="buttonDot tag_editor disabled" tabindex="-1" title="No popup"></a> >+ [% ELSE %] >+ <a href="#" id="buttonDot_[% mv.id | html %]" class="buttonDot tag_editor framework_plugin" tabindex="1" title="Tag editor">Tag editor</a> >+ [% END %] >+ </span> >+ [% mv.javascript %] >+ [% ELSIF ( mv.type == 'hidden' ) %] >+ <input tabindex="1" type="hidden" id="[%- mv.id | html -%]" name="[%- mv.name | html -%]" size="[%- mv.size | html -%]" maxlength="[%- mv.maxlength | html -%]" value="[%- mv.value | html -%]" /> >+ [% ELSIF ( mv.type == 'textarea' ) %] >+ <textarea cols="70" rows="4" id="[%- mv.id | html -%]" name="[%- mv.name | html -%]" class="input_marceditor" tabindex="1">[%- mv.value -%]</textarea> >+ [% ELSIF ( mv.type == 'select' ) %] >+ <select name="[%- mv.name | html -%]" tabindex="1" size="1" class="input_marceditor" id="[%- mv.id | html -%]"> >+ [% FOREACH aval IN mv.values %] >+ [% IF aval == mv.default %] >+ <option value="[%- aval | html -%]" selected="selected">[%- mv.labels.$aval | html -%]</option> >+ [% ELSE %] >+ <option value="[%- aval | html -%]">[%- mv.labels.$aval | html -%]</option> >+ [% END %] >+ [% END %] >+ </select> >+ [% END %] >+ >+ <span class="subfield_controls"> >+ [% IF ( subfield_loo.repeatable ) %] >+ <a href="#" class="buttonPlus" tabindex="1" onclick="CloneSubfield('subfield[% subfield_loo.tag | html %][% subfield_loo.subfield | html %][% subfield_loo.random | html %]','[% advancedMARCEditor | html %]'); return false;"> >+ <img src="[% interface | html %]/[% theme | html %]/img/clone-subfield.png" alt="Clone" title="Clone this subfield" /> >+ </a> >+ <a href="#" class="buttonMinus" tabindex="1" onclick="UnCloneField('subfield[% subfield_loo.tag | html %][% subfield_loo.subfield | html %][% subfield_loo.random | html %]'); return false;"> >+ <img src="[% interface | html %]/[% theme | html %]/img/delete-subfield.png" alt="Delete" title="Delete this subfield" /> >+ </a> >+ [% END %] >+ </span> >+ >+ </div> >+ <!-- End of the line --> >+ [% END %] >+ >+ </div> >+ [% END %]<!-- if innerloo.tag --> >+ [% END %]<!-- BIG_LOO.innerloop --> >+ </div> >+[% END %]<!-- BIG_LOOP --> >+ >+</div><!-- tabs --> >+ >+</form> >+ >+</div> >+</div> >+</div> >+ >+[% 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 0000000000..4644402919 >--- /dev/null >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_008_holdings.tt >@@ -0,0 +1,194 @@ >+[% USE raw %] >+[% INCLUDE 'doc-head-open.inc' %] >+<title>Koha › Holdings › 008 builder</title> >+[% INCLUDE 'doc-head-close.inc' %] >+</head> >+<body id="cat_marc21_field_008_holdings" class="cat" style="padding:1em;"> >+<h3> 008 Fixed-length data elements</h3> >+<form name="f_pop" onsubmit="report()" action=""> >+<input type="hidden" name="plugin_name" value="marc21_field_008_holdings.pl" /> >+<input name="f1" value="[% f1 | html %]" type="hidden" /> >+<table> >+ <tr> >+ <td>00-05 - Date entered on file</td> >+ <td>[% f1 | html %]</td> >+ </tr> >+ <tr> >+ <td><label for="f6">06 - Receipt or acquisition status</label></td> >+ <td> >+ <select name="f6" id="f6" size="1"> >+ <option value="0"[%- IF ( f60 ) -%] selected="selected"[%- END -%]>0 - Unknown</option> >+ <option value="1"[%- IF ( f61 ) -%] selected="selected"[%- END -%]>1 - Other receipt or acquisition status</option> >+ <option value="2"[%- IF ( f62 ) -%] selected="selected"[%- END -%]>2 - Received and complete or ceased</option> >+ <option value="3"[%- IF ( f63 ) -%] selected="selected"[%- END -%]>3 - On order</option> >+ <option value="4"[%- IF ( f64 ) -%] selected="selected"[%- END -%]>4 - Currently received</option> >+ <option value="5"[%- IF ( f65 ) -%] selected="selected"[%- END -%]>5 - Not currently received</option> >+ </select> >+ </td> >+ </tr> >+ <tr> >+ <td><label for="f7">07 - Method of acquisition</label></td> >+ <td> >+ <select name="f7" id="f7" size="1"> >+ <option value="c"[%- IF ( f7c ) -%] selected="selected"[%- END -%]>c - Cooperative or consortial purchase</option> >+ <option value="d"[%- IF ( f7d ) -%] selected="selected"[%- END -%]>d - Deposit</option> >+ <option value="e"[%- IF ( f7e ) -%] selected="selected"[%- END -%]>e - Exchange</option> >+ <option value="f"[%- IF ( f7f ) -%] selected="selected"[%- END -%]>f - Free</option> >+ <option value="g"[%- IF ( f7g ) -%] selected="selected"[%- END -%]>g - Gift</option> >+ <option value="l"[%- IF ( f7l ) -%] selected="selected"[%- END -%]>l - Legal deposit</option> >+ <option value="m"[%- IF ( f7m ) -%] selected="selected"[%- END -%]>m - Membership</option> >+ <option value="n"[%- IF ( f7n ) -%] selected="selected"[%- END -%]>n - Non-library purchase</option> >+ <option value="p"[%- IF ( f7p ) -%] selected="selected"[%- END -%]>p - Purchase</option> >+ <option value="q"[%- IF ( f7q ) -%] selected="selected"[%- END -%]>q - Lease</option> >+ <option value="u"[%- IF ( f7u ) -%] selected="selected"[%- END -%]>u - Unknown</option> >+ <option value="z"[%- IF ( f7z ) -%] selected="selected"[%- END -%]>z - Other method of acquisition</option> >+ </select> >+ </td> >+ </tr> >+ <tr> >+ <td><label for="f8">08-11 - Expected acquisition end date</label></td> >+ <td><input type="text" name="f8" id="f8" maxlength="4" size="5" value="[% f8 | html %]" /></td> >+ </tr> >+ <tr> >+ <td><label for="f12">12- General retention policy</label></td> >+ <td> >+ <select name="f12" id="f12" size="1"> >+ <option value="0"[%- IF ( f120 ) -%] selected="selected"[%- END -%]>0 - Unknown</option> >+ <option value="1"[%- IF ( f121 ) -%] selected="selected"[%- END -%]>1 - Other general retention policy</option> >+ <option value="2"[%- IF ( f122 ) -%] selected="selected"[%- END -%]>2 - Retained except as replaced by updates</option> >+ <option value="3"[%- IF ( f123 ) -%] selected="selected"[%- END -%]>3 - Sample issue retained</option> >+ <option value="4"[%- IF ( f124 ) -%] selected="selected"[%- END -%]>4 - Retained until replaced by microform</option> >+ <option value="5"[%- IF ( f125 ) -%] selected="selected"[%- END -%]>5 - Retained until replaced by cumulation, replacement volume, or revision</option> >+ <option value="6"[%- IF ( f126 ) -%] selected="selected"[%- END -%]>6 - Retained for a limited period</option> >+ <option value="7"[%- IF ( f127 ) -%] selected="selected"[%- END -%]>7 - Not retained</option> >+ <option value="8"[%- IF ( f128 ) -%] selected="selected"[%- END -%]>8 - Permanently retained</option> >+ </select> >+ </td> >+ </tr> >+ <tr> >+ <td><label for="f13">13 - Policy type</label></td> >+ <td> >+ <select name="f13" id="f13" size="1"> >+ <option value=" "[%- IF ( f13 ) -%] selected="selected"[%- END -%]># - No information provided</option> >+ <option value="l"[%- IF ( f13l ) -%] selected="selected"[%- END -%]>l - Latest</option> >+ <option value="p"[%- IF ( f13p ) -%] selected="selected"[%- END -%]>p - Previous</option> >+ </select> >+ </td> >+ </tr> >+ <tr> >+ <td><label for="f14">14 - Number of units</label></td> >+ <td> >+ <select name="f14" id="f14" size="1"> >+ <option value=" "[%- IF ( f14 ) -%] selected="selected"[%- END -%]># - No information provided</option> >+ <option value="1"[%- IF ( f141 ) -%] selected="selected"[%- END -%]>1</option> >+ <option value="2"[%- IF ( f142 ) -%] selected="selected"[%- END -%]>2</option> >+ <option value="3"[%- IF ( f143 ) -%] selected="selected"[%- END -%]>3</option> >+ <option value="4"[%- IF ( f144 ) -%] selected="selected"[%- END -%]>4</option> >+ <option value="5"[%- IF ( f145 ) -%] selected="selected"[%- END -%]>5</option> >+ <option value="6"[%- IF ( f146 ) -%] selected="selected"[%- END -%]>6</option> >+ <option value="7"[%- IF ( f147 ) -%] selected="selected"[%- END -%]>7</option> >+ <option value="8"[%- IF ( f148 ) -%] selected="selected"[%- END -%]>8</option> >+ <option value="9"[%- IF ( f149 ) -%] selected="selected"[%- END -%]>9 </option> >+ </select> >+ </td> >+ </tr> >+ <tr> >+ <td><label for="f15">15 - Unit type</label></td> >+ <td> >+ <select name="f15" id="f15" size="1"> >+ <option value=" "[%- IF ( f15 ) -%] selected="selected"[%- END -%]># - No information provided</option> >+ <option value="m"[%- IF ( f15m ) -%] selected="selected"[%- END -%]>m - Month(s)</option> >+ <option value="w"[%- IF ( f15w ) -%] selected="selected"[%- END -%]>w - Week(s)</option> >+ <option value="y"[%- IF ( f15y ) -%] selected="selected"[%- END -%]>y - Year(s)</option> >+ <option value="e"[%- IF ( f15e ) -%] selected="selected"[%- END -%]>e - Edition(s)</option> >+ <option value="i"[%- IF ( f15i ) -%] selected="selected"[%- END -%]>i - Issue(s)</option> >+ <option value="s"[%- IF ( f15s ) -%] selected="selected"[%- END -%]>s - Supplement(s)</option> >+ </select> >+ </td> >+ </tr> >+ <tr> >+ <td><label for="f16">16 - Completeness</label></td> >+ <td> >+ <select name="f16" id="f16" size="1"> >+ <option value="0"[%- IF ( f160 ) -%] selected="selected"[%- END -%]>0 - Other</option> >+ <option value="1"[%- IF ( f161 ) -%] selected="selected"[%- END -%]>1 - Complete</option> >+ <option value="2"[%- IF ( f162 ) -%] selected="selected"[%- END -%]>2 - Incomplete</option> >+ <option value="3"[%- IF ( f163 ) -%] selected="selected"[%- END -%]>3 - Scattered</option> >+ <option value="4"[%- IF ( f164 ) -%] selected="selected"[%- END -%]>4 - Not applicable</option> >+ </select> >+ </td> >+ </tr> >+ <tr> >+ <td><label for="f17">17-19 - Number of copies reported</label></td> >+ <td><input type="text" name="f17" id="f17" maxlength="3" size="4" value="[% f17 | html %]" /></td> >+ </tr> >+ <tr> >+ <td><label for="f20">20 - Lending policy</label></td> >+ <td> >+ <select name="f20" id="f20" size="1"> >+ <option value="a"[%- IF ( f20a ) -%] selected="selected"[%- END -%]>a - Will lend</option> >+ <option value="b"[%- IF ( f20b ) -%] selected="selected"[%- END -%]>b - Will not lend</option> >+ <option value="c"[%- IF ( f20c ) -%] selected="selected"[%- END -%]>c - Will lend hard copy only</option> >+ <option value="l"[%- IF ( f20l ) -%] selected="selected"[%- END -%]>l - Limited lending policy</option> >+ <option value="u"[%- IF ( f20u ) -%] selected="selected"[%- END -%]>u - Unknown</option> >+ </select> >+ </td> >+ </tr> >+ <tr> >+ <td><label for="f21">21 - Reproduction policy</label></td> >+ <td> >+ <select name="f21" id="f21" size="1"> >+ <option value="a"[%- IF ( f21a ) -%] selected="selected"[%- END -%]>a - Will reproduce</option> >+ <option value="b"[%- IF ( f21b ) -%] selected="selected"[%- END -%]>b - Will not reproduce</option> >+ <option value="u"[%- IF ( f21u ) -%] selected="selected"[%- END -%]>u - Unknown</option> >+ </select> >+ </td> >+ </tr> >+ <tr> >+ <td><label for="f22">22-24 - Language</label></td> >+ <td><input type="text" name="f22" id="f22" maxlength="3" size="4" value="[% f22 | html %]" /></td> >+ </tr> >+ <tr> >+ <td><label for="f25">25 - Separate or composite copy report</label></td> >+ <td> >+ <select name="f25" id="f25" size="1"> >+ <option value="0"[%- IF ( f250 ) -%] selected="selected"[%- END -%]>0 - Separate copy report</option> >+ <option value="1"[%- IF ( f251 ) -%] selected="selected"[%- END -%]>1 - Composite copy report</option> >+ </select> >+ </td> >+ </tr> >+ <tr> >+ <td><label for="f26">26-31 - Date of report</label></td> >+ <td><input type="text" name="f26" id="f26" maxlength="6" size="7" value="[% f26 | html %]" /></td> >+ </tr> >+</table> >+<fieldset class="action"><input type="submit" value="OK" /> <a href="#" class="cancel close">Cancel</a></fieldset> >+</form> >+<script type="text/javascript">//<![CDATA[ >+ function report() { >+ var doc = opener.document; >+ var field = doc.getElementById("[% index | html %]"); >+ >+ field.value = >+ document.f_pop.f1.value+ >+ document.f_pop.f6.value+ >+ document.f_pop.f7.value+ >+ (document.f_pop.f8.value + ' ').substr(0, 4)+ >+ document.f_pop.f12.value+ >+ document.f_pop.f13.value+ >+ document.f_pop.f14.value+ >+ document.f_pop.f15.value+ >+ document.f_pop.f16.value+ >+ (document.f_pop.f17.value + ' ').substr(0, 3)+ >+ document.f_pop.f20.value+ >+ document.f_pop.f21.value+ >+ (document.f_pop.f22.value + ' ').substr(0, 3)+ >+ document.f_pop.f25.value+ >+ document.f_pop.f26.value; >+ self.close(); >+ return false; >+ } >+ //]]> >+</script> >+ >+[% 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 0000000000..7ef2a43663 >--- /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' %] >+<title>Koha › Holdings › 000 - Leader builder</title> >+[% INCLUDE 'doc-head-close.inc' %] >+</head> >+<body id="cat_marc21_leader_holdings" class="cat" style="padding:1em;"> >+<form name="f_pop" onsubmit="report()" action=""> >+<input type="hidden" name="plugin_name" value="marc21_leader_holdings.pl" /> >+<h3>000 - Leader</h3> >+<table> >+ <tr> >+ <td><span class="label">0-4 Record size</span></td> >+ <td>(auto-filled)</td> >+ </tr> >+ <tr> >+ <td><label for="f5">5 - Record status</label></td> >+ <td> >+ <select name="f5" id="f5" size="1"> >+ <option value="c"[%- IF ( f5c ) -%] selected="selected"[%- END -%]>c - Corrected or revised</option> >+ <option value="d"[%- IF ( f5d ) -%] selected="selected"[%- END -%]>d - Deleted</option> >+ <option value="n"[%- IF ( f5n ) -%] selected="selected"[%- END -%]>n - New</option> >+ </select> >+ </td> >+ </tr> >+ <tr> >+ <td><label for="f6">6 - Type of record</label></td> >+ <td> >+ <select name="f6" id="f6" size="1"> >+ <option value="u"[%- IF ( f6u ) -%] selected="selected"[%- END -%]>u - Unknown</option> >+ <option value="v"[%- IF ( f6v ) -%] selected="selected"[%- END -%]>v - Multipart item holdings</option> >+ <option value="x"[%- IF ( f6x ) -%] selected="selected"[%- END -%]>x - Single-part item holdings</option> >+ <option value="y"[%- IF ( f6y ) -%] selected="selected"[%- END -%]>y - Serial item holdings</option> >+ </select> >+ </td> >+ </tr> >+ <tr> >+ <tr>07-08 - Undefined</tr> >+ <tr> </tr> >+ </tr> >+ <tr> >+ <td>9 - Character coding scheme</td> >+ <td>a - UCS/Unicode (auto-filled)</td> >+ </tr> >+ <tr> >+ <td>10-16 - indicator/subfields/size</td> >+ <td>(auto-filled)</td> >+ </tr> >+ <tr> >+ <td><label for="f17">17 - Encoding level</label></td> >+ <td> >+ <select name="f17" id="f17" size="1"> >+ <option value="1"[%- IF ( f171 ) -%] selected="selected"[%- END -%]>1 - Holdings level 1</option> >+ <option value="2"[%- IF ( f172 ) -%] selected="selected"[%- END -%]>2 - Holdings level 2</option> >+ <option value="3"[%- IF ( f173 ) -%] selected="selected"[%- END -%]>3 - Holdings level 3</option> >+ <option value="4"[%- IF ( f174 ) -%] selected="selected"[%- END -%]>4 - Holdings level 4</option> >+ <option value="5"[%- IF ( f175 ) -%] selected="selected"[%- END -%]>5 - Holdings level 4 with piece designation</option> >+ <option value="m"[%- IF ( f17m ) -%] selected="selected"[%- END -%]>m - Mixed level</option> >+ <option value="u"[%- IF ( f17u ) -%] selected="selected"[%- END -%]>u - Unknown</option> >+ <option value="z"[%- IF ( f17z ) -%] selected="selected"[%- END -%]>z - Other level</option> >+ </select> >+ </td> >+ </tr> >+ <tr> >+ <td><label for="f18">18 - Item information in record</label></td> >+ <td> >+ <select name="f18" id="f18" size="1"> >+ <option value="i"[%- IF ( f18i ) -%] selected="selected"[%- END -%]>i - Item information</option> >+ <option value="n"[%- IF ( f18n ) -%] selected="selected"[%- END -%]>n - No item information</option> >+ </select> >+ </td> >+ </tr> >+ <tr> >+ <td>19 - Undefined</td> >+ <td></td> >+ </tr> >+ <tr> >+ <td>20-24 - entry map & lengths</td> >+ <td>(auto-filled)</td> >+ </tr> >+ >+</table> >+<fieldset class="action"><input type="submit" value="OK" /> <a href="#" class="cancel close">Cancel</a></fieldset> >+</form> >+<script type="text/javascript"> >+//<![CDATA[ >+function report() { >+ var doc = opener.document; >+ var field = doc.getElementById("[% index | html %]"); >+ >+ field.value = >+ ' '+ >+ document.f_pop.f5.value+ >+ document.f_pop.f6.value+ >+ ' '+ >+ 'a'+ // MARC21 UNICODE flag - must be 'a' for Koha >+ '22 '+ >+ document.f_pop.f17.value+ >+ document.f_pop.f18.value+ >+ ' '+ >+ '4500'; >+ self.close(); >+ return false; >+ } >+ //]]> >+</script> >+[% INCLUDE 'popup-bottom.inc' %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tt >index d56cd0afb0..25ee249596 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tt >@@ -230,6 +230,8 @@ > <a href="/cgi-bin/koha/catalogue/moredetail.pl?item=[% loopro.object | uri %]&biblionumber=[% loopro.biblionumber | uri %]&bi=[% loopro.biblioitemnumber | uri %]#item[% loopro.object | uri %]">Item [% loopro.object | html %]</a> > [% ELSIF ( loopro.info.substr(0, 6) == 'biblio' ) %] > <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% loopro.object | uri %]" title="Display detail for this biblio">Biblio [% loopro.object | html %]</a> >+ [% ELSIF ( loopro.info.substr(0, 7) == 'holding' ) %] >+ <a href="/cgi-bin/koha/cataloguing/addholding.pl?op=edit&holding_id=[% loopro.object | uri %]" title="Display detail for this holding">Holding [% loopro.object | html %]</a> > [% ELSE %] > [% loopro.object | html %] > [% END %] >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 4c3641b78f..f3f5c9c82f 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt >@@ -6,6 +6,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') %] >@@ -682,6 +683,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 %] >+ <span class="summary-holdings"> >+ <br> >+ <strong>Additional information for [% Holdings.GetLocation(holding, 1) | html %]</strong> >+ <ul> >+ [% IF holding_details.public_note %] >+ <li>Public note: [% holding_details.public_note | html %]</li> >+ [% END %] >+ [% IF holding_details.summary %] >+ <li>Summary: [% holding_details.summary | html %]</li> >+ [% END %] >+ [% IF holding_details.supplements %] >+ <li>Supplements: [% holding_details.supplements | html %]</li> >+ [% END %] >+ [% IF holding_details.indexes %] >+ <li>Indexes: [% holding_details.indexes | html %]</li> >+ [% END %] >+ </ul> >+ </span> >+ [% END %] >+ [% END %] >+ [% END %] >+ [% END %] > [% PROCESS 'shelfbrowser.inc' %] > [% INCLUDE shelfbrowser tab='holdings' %] > <br style="clear:both;" /> >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 548c0c055c..b317394532 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt >@@ -1,6 +1,7 @@ > [% USE raw %] > [% USE Asset %] > [% USE Koha %] >+[% USE Holdings %] > [% SET TagsShowEnabled = ( ( Koha.Preference( 'TagsEnabled' ) == 1 ) && TagsShowOnList ) %] > [% SET TagsInputEnabled = ( ( Koha.Preference( 'opacuserlogin' ) == 1 ) && ( Koha.Preference( 'TagsEnabled' ) == 1 ) && TagsInputOnList ) %] > [% SET AdlibrisEnabled = Koha.Preference('AdlibrisCoversEnabled') %] >@@ -407,6 +408,15 @@ > [% END %] > [% ELSE %] > <span class="unavailable">No items available:</span> >+ [% IF ( SEARCH_RESULT.summary_holdings ) %] >+ <span class="summary-holdings"> >+ [% FOREACH holding IN SEARCH_RESULT.summary_holdings %] >+ [% UNLESS holding.suppress %] >+ [% Holdings.GetLocation(holding, 1) | html %], >+ [% END %] >+ [% END %] >+ </span> >+ [% 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 b6c9ee7747..6d5026d1a0 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 @@ > <xsl:stylesheet version="1.0" > xmlns:marc="http://www.loc.gov/MARC21/slim" > xmlns:items="http://www.koha-community.org/items" >+ xmlns:holdings="http://www.koha-community.org/holdings" > xmlns:xsl="http://www.w3.org/1999/XSL/Transform" > xmlns:str="http://exslt.org/strings" >- exclude-result-prefixes="marc items"> >+ exclude-result-prefixes="marc items holdings"> > <xsl:import href="MARC21slimUtils.xsl"/> > <xsl:output method = "html" indent="yes" omit-xml-declaration = "yes" encoding="UTF-8"/> > <xsl:key name="item-by-status" match="items:item" use="items:status"/> >@@ -1160,7 +1161,21 @@ > </xsl:for-each> > (<xsl:value-of select="$AlternateHoldingsCount"/>) > </xsl:when> >- <xsl:otherwise>No items available </xsl:otherwise> >+ <xsl:otherwise> >+ <xsl:text>No items available</xsl:text> >+ <xsl:if test="//holdings:holdings/holdings:holding/holdings:suppress[.='0']">: >+ <xsl:for-each select="//holdings:holdings/holdings:holding[./holdings:suppress='0']"> >+ <xsl:if test="position() > 1">, </xsl:if> >+ <xsl:value-of select="./holdings:holdingbranch"/> >+ <xsl:if test="string-length(./holdings:location) > 0"> >+ - <xsl:value-of select="./holdings:location"/> >+ </xsl:if> >+ <xsl:if test="string-length(./holdings:callnumber) > 0"> >+ - <xsl:value-of select="./holdings:callnumber"/> >+ </xsl:if> >+ </xsl:for-each> >+ </xsl:if> >+ </xsl:otherwise> > </xsl:choose> > </xsl:when> > <xsl:when test="count(key('item-by-status', 'available'))>0"> >diff --git a/opac/opac-detail.pl b/opac/opac-detail.pl >index a7c24ef3d9..d53d35f8ae 100755 >--- a/opac/opac-detail.pl >+++ b/opac/opac-detail.pl >@@ -746,6 +746,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); >-- >2.17.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 20447
:
73703
|
73704
|
76485
|
76542
|
76670
|
76671
|
76672
|
76735
|
76736
|
78178
|
78179
|
78180
|
78738
|
78739
|
78740
|
78907
|
79403
|
79413
|
79565
|
79566
|
79567
|
79568
|
79569
|
79570
|
79812
|
79813
|
79814
|
79815
|
79816
|
79819
|
80320
|
80321
|
80322
|
80323
|
80324
|
80823
|
80824
|
80825
|
80826
|
80827
|
81264
|
81265
|
81266
|
81267
|
81268
|
82669
|
82670
|
82671
|
82672
|
82673
|
83550
|
83551
|
83552
|
83553
|
83554
|
83555
|
83556
|
83557
|
83558
|
83559
|
85364
|
85368
|
85369
|
85370
|
85371
|
85416
|
85417
|
85418
|
85419
|
85906
|
85907
|
85908
|
85909
|
85994
|
85995
|
85996
|
85997
|
86088
|
86089
|
86090
|
86091
|
87307
|
87308
|
87309
|
87310
|
87346
|
87347
|
87348
|
87349
|
88751
|
88752
|
88753
|
88754
|
88755
|
91743
|
91744
|
91745
|
91746
|
91747
|
94539
|
94540
|
94541
|
94542
|
97796
|
97797
|
97798
|
97799
|
97800
|
97843
|
97844
|
97845
|
97846
|
99143
|
99144
|
99145
|
99146
|
99176
|
99177
|
99178
|
99179
|
99235
|
99236
|
99237
|
99238
|
99239
|
105068
|
105069
|
105070
|
105071
|
105072
|
105259
|
105260
|
105261
|
105262
|
105263
|
106147
|
106148
|
106149
|
106150
|
106151
|
108250
|
108251
|
108252
|
108253
|
108254
|
108255
|
108336
|
108337
|
108338
|
108339
|
108340
|
108341
|
108789
|
108790
|
108791
|
108792
|
108793
|
108794
|
109695
|
109696
|
109697
|
109698
|
109699
|
109700
|
109703
|
109704
|
109705
|
109706
|
109707
|
109708
|
109711
|
109712
|
109713
|
109714
|
109715
|
109717
|
109718
|
109719
|
109720
|
109721
|
109722
|
109741
|
109742
|
109743
|
109744
|
109745
|
109746
|
109765
|
109766
|
109767
|
109768
|
109769
|
109770
|
109873
|
109874
|
109875
|
109877
|
109878
|
109879
|
110115
|
110174
|
110313
|
110314
|
110315
|
110316
|
110317
|
110318
|
110319
|
110320
|
110467
|
110468
|
110469
|
110471
|
110472
|
110473
|
110474
|
110475
|
112176
|
112177
|
112179
|
112180
|
112181
|
112182
|
112189
|
112190
|
112191
|
112192
|
112193
|
112194
|
112570
|
112571
|
112572
|
112573
|
112574
|
112575
|
113943
|
113944
|
113945
|
113946
|
113947
|
113948
|
113952
|
113953
|
113954
|
113955
|
113956
|
113957
|
113958
|
113959
|
115239
|
115240
|
115241
|
115242
|
115243
|
115244
|
115245
|
115654
|
115655
|
115656
|
115657
|
115658
|
115659
|
115660
|
115722
|
115723
|
115724
|
115725
|
115726
|
115727
|
115728
|
115729
|
116797
|
116798
|
116799
|
116800
|
116801
|
116802
|
116803
|
116804
|
116805
|
116806
|
116807
|
116808
|
116809
|
116810
|
116811
|
116812
|
118382
|
118383
|
118385
|
118386
|
118387
|
118388
|
118389
|
118390
|
118397
|
118398
|
118399
|
118400
|
118401
|
118402
|
118403
|
118404
|
118405
|
118406
|
118407
|
118408
|
118409
|
118410
|
118411
|
118412
|
118429
|
118430
|
118431
|
118432
|
118433
|
118434
|
118435
|
118436
|
118527
|
118528
|
118529
|
118530
|
118531
|
118532
|
118533
|
118534
|
118535
|
118536
|
119265
|
119266
|
119267
|
119268
|
119269
|
119270
|
119271
|
119272
|
119273
|
119274
|
119514
|
119515
|
119516
|
119517
|
119518
|
119519
|
119520
|
119521
|
119522
|
119523
|
119570
|
119571
|
121216
|
121217
|
121220
|
121221
|
121222
|
121223
|
121226
|
121227
|
121228
|
121229
|
121230
|
121231
|
121379
|
121380
|
121381
|
121382
|
121383
|
121406
|
121407
|
121408
|
121409
|
121410
|
122501
|
122502
|
122503
|
122504
|
122505
|
122851
|
122852
|
122853
|
122854
|
122855
|
122856
|
122891
|
122892
|
122893
|
122894
|
122895
|
122896
|
122897
|
123047
|
123048
|
123049
|
123050
|
123051
|
123052
|
123053
|
123054
|
123055
|
123056
|
123057
|
123058
|
123059
|
123060
|
123061
|
124012
|
124013
|
124014
|
124015
|
124016
|
124017
|
124018
|
124944
|
124945
|
124946
|
124947
|
124948
|
124949
|
124950
|
126204
|
126205
|
126206
|
126207
|
126208
|
126209
|
126210
|
126211
|
126212
|
126296
|
126391
|
126392
|
126394
|
126395
|
126396
|
126397
|
126398
|
126399
|
126400
|
126401
|
126402
|
126403
|
126404
|
126405
|
126932
|
126933
|
126934
|
126935
|
126936
|
126937
|
126938
|
126939
|
126940
|
126941
|
126942
|
126943
|
127040
|
128079
|
128131
|
128134
|
130776
|
130777
|
130778
|
130779
|
130780
|
130781
|
130782
|
130783
|
130784
|
130785
|
130786
|
130787
|
130788
|
130789
|
130790
|
130791
|
130792
|
130793
|
130794
|
130795
|
130796
|
130797
|
130798
|
130799
|
130800
|
130801
|
130802
|
130803
|
130804
|
130805
|
130806
|
130807
|
131458
|
131459
|
131460
|
131461
|
131462
|
131463
|
131464
|
131465
|
131466
|
131467
|
131468
|
131469
|
131470
|
131471
|
131472
|
131473
|
131474
|
131475
|
131476
|
131477
|
131478
|
131479
|
131480
|
131481
|
131482
|
139865
|
139866
|
139867
|
139868
|
139869
|
139870
|
139871
|
139872
|
139873
|
139874
|
139875
|
139876
|
139877
|
139878
|
139879
|
139880
|
139881
|
139882
|
139883
|
139884
|
139885
|
139886
|
139887
|
139888
|
139889
|
139890
|
139891
|
139892
|
139893
|
139894
|
139895
|
139896
|
157492
|
157493