View | Details | Raw Unified | Return to bug 20447
Collapse All | Expand All

(-)a/C4/Biblio.pm (-6 / +36 lines)
Lines 102-107 use Koha::Caches; Link Here
102
use Koha::Authority::Types;
102
use Koha::Authority::Types;
103
use Koha::Acquisition::Currencies;
103
use Koha::Acquisition::Currencies;
104
use Koha::Biblio::Metadatas;
104
use Koha::Biblio::Metadatas;
105
use Koha::Holdings;
105
use Koha::Holds;
106
use Koha::Holds;
106
use Koha::ItemTypes;
107
use Koha::ItemTypes;
107
use Koha::SearchEngine;
108
use Koha::SearchEngine;
Lines 1561-1566 sub GetAuthorisedValueDesc { Link Here
1561
            return $itemtype ? $itemtype->translated_description : q||;
1562
            return $itemtype ? $itemtype->translated_description : q||;
1562
        }
1563
        }
1563
1564
1565
        #---- holdings
1566
        if ( $tagslib->{$tag}->{$subfield}->{'authorised_value'} eq "holdings" ) {
1567
            my $holding = Koha::Holdings->find( $value );
1568
            if ( $holding ) {
1569
                my @parts;
1570
1571
                push @parts, $value;
1572
                push @parts, $holding->holdingbranch() if $holding->holdingbranch();
1573
                push @parts, $holding->location() if $holding->location();
1574
                push @parts, $holding->ccode() if $holding->ccode();
1575
                push @parts, $holding->callnumber() if $holding->callnumber();
1576
1577
                return join(' ', @parts);
1578
            }
1579
            return q||;
1580
        }
1581
1564
        #---- "true" authorized value
1582
        #---- "true" authorized value
1565
        $category = $tagslib->{$tag}->{$subfield}->{'authorised_value'};
1583
        $category = $tagslib->{$tag}->{$subfield}->{'authorised_value'};
1566
    }
1584
    }
Lines 2773-2786 sub ModZebra { Link Here
2773
=head2 EmbedItemsInMarcBiblio
2791
=head2 EmbedItemsInMarcBiblio
2774
2792
2775
    EmbedItemsInMarcBiblio({
2793
    EmbedItemsInMarcBiblio({
2776
        marc_record  => $marc,
2794
        marc_record   => $marc,
2777
        biblionumber => $biblionumber,
2795
        biblionumber  => $biblionumber,
2778
        item_numbers => $itemnumbers,
2796
        item_numbers  => $itemnumbers,
2779
        opac         => $opac });
2797
        opac          => $opac,
2798
        skip_holdings => 1 });
2780
2799
2781
Given a MARC::Record object containing a bib record,
2800
Given a MARC::Record object containing a bib record,
2782
modify it to include the items attached to it as 9XX
2801
modify it to include the items attached to it as 9XX
2783
per the bib's MARC framework.
2802
per the bib's MARC framework and any holdings location information.
2784
if $itemnumbers is defined, only specified itemnumbers are embedded.
2803
if $itemnumbers is defined, only specified itemnumbers are embedded.
2785
2804
2786
If $opac is true, then opac-relevant suppressions are included.
2805
If $opac is true, then opac-relevant suppressions are included.
Lines 2788-2798 If $opac is true, then opac-relevant suppressions are included. Link Here
2788
If opac filtering will be done, borcat should be passed to properly
2807
If opac filtering will be done, borcat should be passed to properly
2789
override if necessary.
2808
override if necessary.
2790
2809
2810
If $skip_holdings is set, it overrides the default of embedding basic
2811
location information from holdings records if summary holdings are
2812
enabled.
2813
2791
=cut
2814
=cut
2792
2815
2793
sub EmbedItemsInMarcBiblio {
2816
sub EmbedItemsInMarcBiblio {
2794
    my ($params) = @_;
2817
    my ($params) = @_;
2795
    my ($marc, $biblionumber, $itemnumbers, $opac, $borcat);
2818
    my ($marc, $biblionumber, $itemnumbers, $opac, $borcat, $skip_holdings);
2796
    $marc = $params->{marc_record};
2819
    $marc = $params->{marc_record};
2797
    if ( !$marc ) {
2820
    if ( !$marc ) {
2798
        carp 'EmbedItemsInMarcBiblio: No MARC record passed';
2821
        carp 'EmbedItemsInMarcBiblio: No MARC record passed';
Lines 2802-2810 sub EmbedItemsInMarcBiblio { Link Here
2802
    $itemnumbers = $params->{item_numbers};
2825
    $itemnumbers = $params->{item_numbers};
2803
    $opac = $params->{opac};
2826
    $opac = $params->{opac};
2804
    $borcat = $params->{borcat} // q{};
2827
    $borcat = $params->{borcat} // q{};
2828
    $skip_holdings = $params->{skip_holdings} // 0;
2805
2829
2806
    $itemnumbers = [] unless defined $itemnumbers;
2830
    $itemnumbers = [] unless defined $itemnumbers;
2807
2831
2832
    if ( !$skip_holdings && C4::Context->preference('SummaryHoldings') && !@$itemnumbers ) {
2833
        require Koha::Holdings;
2834
        my $holdings_fields = Koha::Holdings->get_embeddable_marc_fields({ biblionumber => $biblionumber });
2835
        $marc->append_fields(@$holdings_fields) if ( @$holdings_fields );
2836
    }
2837
2808
    my $frameworkcode = GetFrameworkCode($biblionumber);
2838
    my $frameworkcode = GetFrameworkCode($biblionumber);
2809
    _strip_item_fields($marc, $frameworkcode);
2839
    _strip_item_fields($marc, $frameworkcode);
2810
2840
(-)a/C4/ImportBatch.pm (-2 / +26 lines)
Lines 1505-1517 sub RecordsFromISO2709File { Link Here
1505
1505
1506
    open IN, "<$input_file" or die "$0: cannot open input file $input_file: $!\n";
1506
    open IN, "<$input_file" or die "$0: cannot open input file $input_file: $!\n";
1507
    my @marc_records;
1507
    my @marc_records;
1508
    my $count = 0;
1508
    $/ = "\035";
1509
    $/ = "\035";
1509
    while (<IN>) {
1510
    while (<IN>) {
1510
        s/^\s+//;
1511
        s/^\s+//;
1511
        s/\s+$//;
1512
        s/\s+$//;
1512
        next unless $_; # skip if record has only whitespace, as might occur
1513
        next unless $_; # skip if record has only whitespace, as might occur
1513
                        # if file includes newlines between each MARC record
1514
                        # if file includes newlines between each MARC record
1515
        ++$count;
1514
        my ($marc_record, $charset_guessed, $char_errors) = MarcToUTF8Record($_, $marc_type, $encoding);
1516
        my ($marc_record, $charset_guessed, $char_errors) = MarcToUTF8Record($_, $marc_type, $encoding);
1517
        # Ignore holdings records
1518
        if ($record_type eq 'biblio' && $marc_type eq 'MARC21') {
1519
            my $leader = $marc_record->leader();
1520
            if ($leader =~ /^.{6}[uvxy]/) {
1521
                push @errors, "Ignoring record $count (holdings record)";
1522
                next;
1523
            }
1524
        }
1525
1515
        push @marc_records, $marc_record;
1526
        push @marc_records, $marc_record;
1516
        if ($charset_guessed ne $encoding) {
1527
        if ($charset_guessed ne $encoding) {
1517
            push @errors,
1528
            push @errors,
Lines 1536-1550 Returns two array refs. Link Here
1536
=cut
1547
=cut
1537
1548
1538
sub RecordsFromMARCXMLFile {
1549
sub RecordsFromMARCXMLFile {
1539
    my ( $filename, $encoding ) = @_;
1550
    my ( $filename, $record_type, $encoding ) = @_;
1551
1552
    my $marcflavour = C4::Context->preference('marcflavour');
1540
    my $batch = MARC::File::XML->in( $filename );
1553
    my $batch = MARC::File::XML->in( $filename );
1541
    my ( @marcRecords, @errors, $record );
1554
    my ( @marcRecords, @errors, $record );
1555
    my $count = 0;
1542
    do {
1556
    do {
1557
        ++$count;
1543
        eval { $record = $batch->next( $encoding ); };
1558
        eval { $record = $batch->next( $encoding ); };
1544
        if ($@) {
1559
        if ($@) {
1545
            push @errors, $@;
1560
            push @errors, $@;
1546
        }
1561
        }
1547
        push @marcRecords, $record if $record;
1562
        # Ignore holdings records
1563
        my $valid = 1;
1564
        if ($record && $record_type eq 'biblio' && $marcflavour eq 'MARC21') {
1565
            my $leader = $record->leader();
1566
            if ($leader =~ /^.{6}[uvxy]/) {
1567
                push @errors, "Ignoring record $count (holdings record)";
1568
                $valid = 0;
1569
            }
1570
        }
1571
        push @marcRecords, $record if $record && $valid;
1548
    } while( $record );
1572
    } while( $record );
1549
    return (\@errors, \@marcRecords);
1573
    return (\@errors, \@marcRecords);
1550
}
1574
}
(-)a/C4/Items.pm (-2 / +36 lines)
Lines 75-80 use Koha::DateUtils qw(dt_from_string); Link Here
75
use Koha::Database;
75
use Koha::Database;
76
76
77
use Koha::Biblioitems;
77
use Koha::Biblioitems;
78
use Koha::Holdings;
78
use Koha::Items;
79
use Koha::Items;
79
use Koha::ItemTypes;
80
use Koha::ItemTypes;
80
use Koha::SearchEngine;
81
use Koha::SearchEngine;
Lines 464-469 sub _build_default_values_for_mod_marc { Link Here
464
        stocknumber              => undef,
465
        stocknumber              => undef,
465
        uri                      => undef,
466
        uri                      => undef,
466
        withdrawn                => 0,
467
        withdrawn                => 0,
468
        holding_id               => undef,
467
    };
469
    };
468
    my %default_values_for_mod_from_marc;
470
    my %default_values_for_mod_from_marc;
469
    while ( my ( $field, $default_value ) = each %$default_values ) {
471
    while ( my ( $field, $default_value ) = each %$default_values ) {
Lines 1121-1127 Item's itemcallnumber Link Here
1121
Item's call number normalized for sorting
1123
Item's call number normalized for sorting
1122
1124
1123
=back
1125
=back
1124
  
1126
1125
=cut
1127
=cut
1126
1128
1127
sub GetItemsLocationInfo {
1129
sub GetItemsLocationInfo {
Lines 1648-1654 sub _koha_new_item { Link Here
1648
            more_subfields_xml  = ?,
1650
            more_subfields_xml  = ?,
1649
            copynumber          = ?,
1651
            copynumber          = ?,
1650
            stocknumber         = ?,
1652
            stocknumber         = ?,
1651
            new_status          = ?
1653
            new_status          = ?,
1654
            holding_id          = ?
1652
          ";
1655
          ";
1653
    my $sth = $dbh->prepare($query);
1656
    my $sth = $dbh->prepare($query);
1654
    my $today = output_pref({ dt => dt_from_string, dateformat => 'iso', dateonly => 1 });
1657
    my $today = output_pref({ dt => dt_from_string, dateformat => 'iso', dateonly => 1 });
Lines 1693-1698 sub _koha_new_item { Link Here
1693
            $item->{'copynumber'},
1696
            $item->{'copynumber'},
1694
            $item->{'stocknumber'},
1697
            $item->{'stocknumber'},
1695
            $item->{'new_status'},
1698
            $item->{'new_status'},
1699
            $item->{'holding_id'},
1696
    );
1700
    );
1697
1701
1698
    my $itemnumber;
1702
    my $itemnumber;
Lines 1732-1737 sub MoveItemFromBiblio { Link Here
1732
            AND biblionumber = ?
1736
            AND biblionumber = ?
1733
    |, undef, $tobiblioitem, $tobiblio, $itemnumber, $frombiblio );
1737
    |, undef, $tobiblioitem, $tobiblio, $itemnumber, $frombiblio );
1734
    if ($return == 1) {
1738
    if ($return == 1) {
1739
        # Check if the moved item is attached to a holdings record
1740
        my $item = GetItem($itemnumber);
1741
        if ($item->{'holding_id'}) {
1742
            my $oldHolding = Koha::Holdings->find($item->{'holding_id'});
1743
            if ($oldHolding) {
1744
                # Check if there's a suitable holdings record in the new biblio.
1745
                # This is not perfect, but at least we try.
1746
                use Koha::Holdings;
1747
                my $newHolding = Koha::Holdings->find(
1748
                    {
1749
                        biblionumber     => $tobiblio,
1750
                        frameworkcode    => $oldHolding->{'frameworkcode'},
1751
                        holdingbranch    => $oldHolding->{'holdingbranch'},
1752
                        location         => $oldHolding->{'location'},
1753
                        callnumber       => $oldHolding->{'callnumber'},
1754
                        suppress         => $oldHolding->{'suppress'},
1755
                        deleted_on       => undef
1756
                    }
1757
                );
1758
                if (!$newHolding) {
1759
                    # No existing holdings record, make a copy of the old one.
1760
                    $newHolding = Koha::Holding->new({ biblionumber => $tobiblio });
1761
                    $newHolding->set_marc({ record => $oldHolding->metadata()->record() });
1762
                    $newHolding->store();
1763
                }
1764
                $item->{'holding_id'} = $newHolding->holding_id();
1765
                ModItem($item, $tobiblio, $itemnumber);
1766
            }
1767
        }
1768
1735
        ModZebra( $tobiblio, "specialUpdate", "biblioserver" );
1769
        ModZebra( $tobiblio, "specialUpdate", "biblioserver" );
1736
        ModZebra( $frombiblio, "specialUpdate", "biblioserver" );
1770
        ModZebra( $frombiblio, "specialUpdate", "biblioserver" );
1737
	    # Checking if the item we want to move is in an order 
1771
	    # Checking if the item we want to move is in an order 
(-)a/C4/Search.pm (+8 lines)
Lines 31-36 use C4::Reserves; # GetReserveStatus Link Here
31
use C4::Debug;
31
use C4::Debug;
32
use C4::Charset;
32
use C4::Charset;
33
use Koha::AuthorisedValues;
33
use Koha::AuthorisedValues;
34
use Koha::Holdings;
34
use Koha::ItemTypes;
35
use Koha::ItemTypes;
35
use Koha::Libraries;
36
use Koha::Libraries;
36
use Koha::Patrons;
37
use Koha::Patrons;
Lines 2066-2071 sub searchResults { Link Here
2066
        my $maxitems_pref = C4::Context->preference('maxItemsinSearchResults');
2067
        my $maxitems_pref = C4::Context->preference('maxItemsinSearchResults');
2067
        my $maxitems = $maxitems_pref ? $maxitems_pref - 1 : 1;
2068
        my $maxitems = $maxitems_pref ? $maxitems_pref - 1 : 1;
2068
        my @hiddenitems; # hidden itemnumbers based on OpacHiddenItems syspref
2069
        my @hiddenitems; # hidden itemnumbers based on OpacHiddenItems syspref
2070
        my $summary_holdings;
2069
2071
2070
        # loop through every item
2072
        # loop through every item
2071
        foreach my $field (@fields) {
2073
        foreach my $field (@fields) {
Lines 2249-2254 sub searchResults { Link Here
2249
            push @available_items_loop, $available_items->{$key}
2251
            push @available_items_loop, $available_items->{$key}
2250
        }
2252
        }
2251
2253
2254
        # Fetch summary holdings
2255
        if (C4::Context->preference('SummaryHoldings')) {
2256
            $summary_holdings = Koha::Holdings->search({ biblionumber => $oldbiblio->{biblionumber}, deleted_on => undef })->unblessed;
2257
        }
2258
2252
        # XSLT processing of some stuff
2259
        # XSLT processing of some stuff
2253
        # we fetched the sysprefs already before the loop through all retrieved record!
2260
        # we fetched the sysprefs already before the loop through all retrieved record!
2254
        if (!$scan && $xslfile) {
2261
        if (!$scan && $xslfile) {
Lines 2279-2284 sub searchResults { Link Here
2279
        $oldbiblio->{onholdcount}          = $item_onhold_count;
2286
        $oldbiblio->{onholdcount}          = $item_onhold_count;
2280
        $oldbiblio->{orderedcount}         = $ordered_count;
2287
        $oldbiblio->{orderedcount}         = $ordered_count;
2281
        $oldbiblio->{notforloancount}      = $notforloan_count;
2288
        $oldbiblio->{notforloancount}      = $notforloan_count;
2289
        $oldbiblio->{summary_holdings}     = $summary_holdings;
2282
2290
2283
        if (C4::Context->preference("AlternateHoldingsField") && $items_count == 0) {
2291
        if (C4::Context->preference("AlternateHoldingsField") && $items_count == 0) {
2284
            my $fieldspec = C4::Context->preference("AlternateHoldingsField");
2292
            my $fieldspec = C4::Context->preference("AlternateHoldingsField");
(-)a/C4/XSLT.pm (-1 / +45 lines)
Lines 160-165 sub _get_best_default_xslt_filename { Link Here
160
    return $xslfilename;
160
    return $xslfilename;
161
}
161
}
162
162
163
=head2 get_xslt_sysprefs
164
165
Returns XML for system preferences.
166
167
=cut
168
163
sub get_xslt_sysprefs {
169
sub get_xslt_sysprefs {
164
    my $sysxml = "<sysprefs>\n";
170
    my $sysxml = "<sysprefs>\n";
165
    foreach my $syspref ( qw/ hidelostitems OPACURLOpenInNewWindow
171
    foreach my $syspref ( qw/ hidelostitems OPACURLOpenInNewWindow
Lines 241-249 sub XSLTParse4Display { Link Here
241
    # grab the XML, run it through our stylesheet, push it out to the browser
247
    # grab the XML, run it through our stylesheet, push it out to the browser
242
    my $record = transformMARCXML4XSLT($biblionumber, $orig_record);
248
    my $record = transformMARCXML4XSLT($biblionumber, $orig_record);
243
    my $itemsxml  = buildKohaItemsNamespace($biblionumber, $hidden_items);
249
    my $itemsxml  = buildKohaItemsNamespace($biblionumber, $hidden_items);
250
    my $holdingsxml  = buildKohaHoldingsNamespace($biblionumber);
244
    my $xmlrecord = $record->as_xml(C4::Context->preference('marcflavour'));
251
    my $xmlrecord = $record->as_xml(C4::Context->preference('marcflavour'));
245
252
246
    $xmlrecord =~ s/\<\/record\>/$itemsxml$sysxml\<\/record\>/;
253
    $xmlrecord =~ s/\<\/record\>/$itemsxml$holdingsxml$sysxml\<\/record\>/;
247
    if ($fixamps) { # We need to correct the HTML entities that Zebra outputs
254
    if ($fixamps) { # We need to correct the HTML entities that Zebra outputs
248
        $xmlrecord =~ s/\&amp;amp;/\&amp;/g;
255
        $xmlrecord =~ s/\&amp;amp;/\&amp;/g;
249
        $xmlrecord =~ s/\&amp\;lt\;/\&lt\;/g;
256
        $xmlrecord =~ s/\&amp\;lt\;/\&lt\;/g;
Lines 342-347 sub buildKohaItemsNamespace { Link Here
342
    return $xml;
349
    return $xml;
343
}
350
}
344
351
352
=head2 buildKohaHoldingsNamespace
353
354
Returns XML for holdings records.
355
Is only used in this module currently.
356
357
=cut
358
359
sub buildKohaHoldingsNamespace {
360
    my ($biblionumber) = @_;
361
362
    my $holdings = Koha::Holdings->search({ biblionumber => $biblionumber, deleted_on => undef })->as_list;
363
364
    my $shelflocations =
365
      { map { $_->{authorised_value} => $_->{opac_description} } Koha::AuthorisedValues->get_descriptions_by_koha_field( { frameworkcode => 'HLD', kohafield => 'holdings.location' } ) };
366
367
    my %branches = map { $_->branchcode => $_->branchname } Koha::Libraries->search({}, { order_by => 'branchname' });
368
369
    my $location = "";
370
    my $ccode = "";
371
    my $xml = '';
372
    foreach my $holding ( @{$holdings} ) {
373
        my $holdingbranch = $holding->{holdingbranch} ? xml_escape($branches{$holding->{holdingbranch}}) : '';
374
        my $location = $holding->{location} ? xml_escape($shelflocations->{$holding->{location}} || $holding->{location}) : '';
375
        my $callnumber = xml_escape($holding->{callnumber});
376
        my $suppress = $holding->{suppress} || '0';
377
        $xml .=
378
            "<holding>"
379
          . "<holdingbranch>$holdingbranch</holdingbranch>"
380
          . "<location>$location</location>"
381
          . "<callnumber>$callnumber</callnumber>"
382
          . "<suppress>$suppress</suppress>"
383
          . "</holding>";
384
    }
385
    $xml = "<holdings xmlns=\"http://www.koha-community.org/holdings\">$xml</holdings>";
386
    return $xml;
387
}
388
345
=head2 engine
389
=head2 engine
346
390
347
Returns reference to XSLT handler object.
391
Returns reference to XSLT handler object.
(-)a/Koha/Holding.pm (+331 lines)
Line 0 Link Here
1
package Koha::Holding;
2
3
# Copyright ByWater Solutions 2014
4
# Copyright 2017-2019 University of Helsinki (The National Library Of Finland)
5
#
6
# This file is part of Koha.
7
#
8
# Koha is free software; you can redistribute it and/or modify it under the
9
# terms of the GNU General Public License as published by the Free Software
10
# Foundation; either version 3 of the License, or (at your option) any later
11
# version.
12
#
13
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
14
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
15
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
16
#
17
# You should have received a copy of the GNU General Public License along
18
# with Koha; if not, write to the Free Software Foundation, Inc.,
19
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20
21
use Modern::Perl;
22
23
use Carp;
24
25
use C4::Charset;
26
use C4::Log;
27
28
use Koha::Database;
29
use Koha::DateUtils qw(dt_from_string);
30
use Koha::Holdings::Metadatas;
31
32
use base qw(Koha::Object);
33
34
=head1 NAME
35
36
Koha::Holding - Koha Holding Object class
37
38
=head1 API
39
40
=head2 Class Methods
41
42
=cut
43
44
=head3 metadata
45
46
my $metadata = $holding->metadata();
47
48
Returns a Koha::Holding::Metadata object
49
50
=cut
51
52
sub metadata {
53
    my ($self) = @_;
54
55
    $self->{_metadata} ||= Koha::Holdings::Metadatas->find({ holding_id => $self->id });
56
57
    return $self->{_metadata};
58
}
59
60
=head3 set_marc
61
62
$holding->set_marc({ record => $record });
63
64
Updates the MARC format metadata from a Marc::Record.
65
Does not store the results in the database.
66
67
If passed an undefined record will log the error.
68
69
Returns $self
70
71
=cut
72
73
sub set_marc {
74
    my ($self, $params) = @_;
75
76
    if (!defined $params->{record}) {
77
        carp('set_marc called with undefined record');
78
        return $self;
79
    }
80
81
    # Clone record as it gets modified
82
    my $record = $params->{record}->clone();
83
    SetUTF8Flag($record);
84
    my $encoding = C4::Context->preference('marcflavour');
85
    if ($encoding eq 'MARC21' || $encoding eq 'UNIMARC') {
86
      # YY MM DD HH MM SS (update year and month)
87
      my @a = (localtime) [5,4,3,2,1,0]; $a[0] += 1900; $a[1]++;
88
      my $f005 = $record->field('005');
89
      $f005->update(sprintf('%4d%02d%02d%02d%02d%04.1f', @a)) if $f005;
90
    }
91
92
    $self->{_marcxml} = $record->as_xml_record($encoding);
93
    my $fields = $self->marc_to_koha_fields({ record => $record });
94
    delete $fields->{holding_id};
95
    $self->set($fields);
96
97
    return $self;
98
}
99
100
=head3 items
101
102
my @items = $holding->items();
103
my $items = $holding->items();
104
105
Returns the related Koha::Items object for this holding in scalar context,
106
or list of Koha::Item objects in list context.
107
108
=cut
109
110
sub items {
111
    my ($self) = @_;
112
113
    $self->{_items} ||= Koha::Items->search( { holding_id => $self->holding_id() } );
114
115
    return wantarray ? $self->{_items}->as_list : $self->{_items};
116
}
117
118
=head3 store
119
120
    $holding->store();
121
122
Saves the holding record.
123
124
Returns:
125
    $self  if the store was a success
126
    undef  if the store failed
127
128
=cut
129
130
sub store {
131
    my ($self) = @_;
132
133
    my $action = $self->holding_id() ? 'UPDATE' : 'ADD';
134
135
    $self->datecreated(dt_from_string('', 'sql')) unless $self->datecreated();
136
137
    my $schema = Koha::Database->new()->schema();
138
    # Use a transaction only if AutoCommit is enabled - otherwise handled outside of this sub
139
    my $guard = C4::Context->dbh->{AutoCommit} ? $schema->txn_scope_guard() : undef;
140
141
    my $result = $self->SUPER::store();
142
143
    return $result unless $result;
144
145
    # Create or update the metadata record
146
    my $marcflavour = C4::Context->preference('marcflavour');
147
    my $marc_record = $self->{_marcxml}
148
        ? MARC::Record::new_from_xml($self->{_marcxml}, 'utf-8', $marcflavour)
149
        : $self->metadata()->record();
150
151
    $self->_update_marc_ids($marc_record);
152
153
    my $metadata = {
154
        holding_id => $self->holding_id(),
155
        format     => 'marcxml',
156
        schema     => $marcflavour,
157
    };
158
    my $metadata_record = Koha::Holdings::Metadatas->find_or_new($metadata);
159
    $metadata_record->metadata($marc_record->as_xml_record($marcflavour));
160
161
    $result = $metadata_record->store() ? $self : undef;
162
163
    $guard->commit() if defined $guard && $result;
164
165
    logaction('CATALOGUING', $action, $self->holding_id(), 'holding') if $result && C4::Context->preference('CataloguingLog');
166
167
    return $result;
168
}
169
170
=head3 delete
171
172
    $holding->delete();
173
174
Marks the holdings record deleted.
175
176
Returns:
177
    1  if the deletion was a success
178
    0  if the deletion failed
179
    -1 if the object was never in storage
180
181
=cut
182
183
sub delete {
184
    my ($self) = @_;
185
186
    return -1 unless $self->_result()->in_storage();
187
188
    if ($self->items()->count()) {
189
        return 0;
190
    }
191
192
    my $schema = Koha::Database->new()->schema();
193
    # Use a transaction only if AutoCommit is enabled - otherwise handled outside of this sub
194
    my $guard = C4::Context->dbh->{AutoCommit} ? $schema->txn_scope_guard() : undef;
195
196
    my $now = dt_from_string('', 'sql');
197
    $self->deleted_on($now)->store();
198
    Koha::Holdings::Metadatas->find({ holding_id => $self->holding_id() })->update({ deleted_on => $now });
199
200
    $guard->commit() if defined $guard;
201
202
    logaction('CATALOGUING', 'DELETE', $self->holding_id(), 'holding') if C4::Context->preference('CataloguingLog');
203
204
    return 1;
205
}
206
207
=head3 type
208
209
=cut
210
211
sub _type {
212
    return 'Holding';
213
}
214
215
=head2 marc_to_koha_fields
216
217
    $result = Koha::Holding->marc_to_koha_fields({ record => $record })
218
219
Extract data from a MARC::Record holdings record into a hashref representing
220
Koha holdings fields.
221
222
If passed an undefined record will log the error and return an empty
223
hash_ref.
224
225
=cut
226
227
sub marc_to_koha_fields {
228
    my ($class, $params) = @_;
229
230
    my $result = {};
231
    if (!defined $params->{record}) {
232
        carp('marc_to_koha_fields called with undefined record');
233
        return $result;
234
    }
235
    my $record = $params->{record};
236
237
    # The next call uses the HLD framework since it is AUTHORITATIVE
238
    # for all Koha to MARC mappings for holdings.
239
    my $mss = C4::Biblio::GetMarcSubfieldStructure( 'HLD', { unsafe => 1 } ); # Do not change framework
240
    foreach my $kohafield (keys %{ $mss }) {
241
        my ($table, $column) = split /[.]/, $kohafield, 2;
242
        next unless $table eq 'holdings' && $mss->{$kohafield};
243
244
        my @values;
245
        foreach my $field (@{$mss->{$kohafield}}) {
246
            my $tag = $field->{tagfield};
247
            my $sub = $field->{tagsubfield};
248
            foreach my $fld ($record->field($tag)) {
249
                if( $sub eq '@' || $fld->is_control_field ) {
250
                    push @values, $fld->data if $fld->data;
251
                } else {
252
                    push @values, grep { $_ } $fld->subfield($sub);
253
                }
254
            }
255
        }
256
        $result->{$column} = join(' | ', @values) if (@values);
257
    }
258
    return $result;
259
}
260
261
=head3 get_marc_field_mapping
262
263
    ($field, $subfield) = Koha::Holding->get_marc_field_mapping({ field => $kohafield });
264
    @fields = Koha::Holding->get_marc_field_mapping({ field => $kohafield });
265
    $field = Koha::Holding->get_marc_field_mapping({ field => $kohafield });
266
267
    Returns the MARC fields & subfields mapped to $kohafield.
268
    Uses the HLD framework that is considered as authoritative.
269
270
    In list context all mappings are returned; there can be multiple
271
    mappings. Note that in the above example you could miss a second
272
    mapping in the first call.
273
    In scalar context only the field tag of the first mapping is returned.
274
275
=cut
276
277
sub get_marc_field_mapping {
278
    my ($class, $params) = @_;
279
280
    return unless $params->{field};
281
282
    # The next call uses the HLD framework since it is AUTHORITATIVE
283
    # for all Koha to MARC mappings for holdings.
284
    my $mss = C4::Biblio::GetMarcSubfieldStructure('HLD', { unsafe => 1 } ); # Do not change framework
285
    my @retval;
286
    foreach (@{ $mss->{$params->{field}} }) {
287
        push @retval, $_->{tagfield}, $_->{tagsubfield};
288
    }
289
    return wantarray ? @retval : ( @retval ? $retval[0] : undef );
290
}
291
292
=head2 Internal methods
293
294
=head3 _update_marc_ids
295
296
  $self->_update_marc_ids($record);
297
298
Internal function to add or update holding_id, biblionumber and biblioitemnumber to
299
the MARC record.
300
301
=cut
302
303
sub _update_marc_ids {
304
    my ($self, $record) = @_;
305
306
    my ($holding_tag, $holding_subfield) = $self->get_marc_field_mapping({ field => 'holdings.holding_id' });
307
    die qq{No holding_id tag for framework "HLD"} unless $holding_tag;
308
    if ($holding_tag < 10) {
309
        C4::Biblio::UpsertMarcControlField($record, $holding_tag, $self->holding_id);
310
    } else {
311
        C4::Biblio::UpsertMarcSubfield($record, $holding_tag, $holding_subfield, $self->holding_id);
312
    }
313
314
    my ($biblio_tag, $biblio_subfield) = $self->get_marc_field_mapping({ field => 'biblio.biblionumber' });
315
    die qq{No biblionumber tag for framework "HLD"} unless $biblio_tag;
316
    if ($biblio_tag < 10) {
317
        C4::Biblio::UpsertMarcControlField($record, $biblio_tag, $self->biblionumber);
318
    } else {
319
        C4::Biblio::UpsertMarcSubfield($record, $biblio_tag, $biblio_subfield, $self->biblionumber);
320
    }
321
}
322
323
324
=head1 AUTHOR
325
326
Kyle M Hall <kyle@bywatersolutions.com>
327
Ere Maijala <ere.maijala@helsinki.fi>
328
329
=cut
330
331
1;
(-)a/Koha/Holdings.pm (+150 lines)
Line 0 Link Here
1
package Koha::Holdings;
2
3
# Copyright ByWater Solutions 2015
4
# Copyright 2017-2019 University of Helsinki (The National Library Of Finland)
5
#
6
# This file is part of Koha.
7
#
8
# Koha is free software; you can redistribute it and/or modify it under the
9
# terms of the GNU General Public License as published by the Free Software
10
# Foundation; either version 3 of the License, or (at your option) any later
11
# version.
12
#
13
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
14
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
15
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
16
#
17
# You should have received a copy of the GNU General Public License along
18
# with Koha; if not, write to the Free Software Foundation, Inc.,
19
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20
21
use Modern::Perl;
22
23
use Carp;
24
25
use C4::Biblio;
26
use C4::Charset;
27
use C4::Context;
28
use Koha::Database;
29
use Koha::Holding;
30
31
use base qw(Koha::Objects);
32
33
=head1 NAME
34
35
Koha::Holdings - Koha Holdings object set class
36
37
=head1 API
38
39
=head2 Class Methods
40
41
=cut
42
43
=head3 type
44
45
=cut
46
47
sub _type {
48
    return 'Holding';
49
}
50
51
=head3 object_class
52
53
=cut
54
55
sub object_class {
56
    return 'Koha::Holding';
57
}
58
59
=head3 get_embeddable_marc_fields
60
61
  my @marc_fields = Koha::Holding->get_embeddable_marc_fields({biblionumber => $biblionumber});
62
63
Returns an array of MARC::Record objects of the holdings for the biblio.
64
65
=cut
66
67
sub get_embeddable_marc_fields {
68
    my ($class, $params) = @_;
69
70
    my @holdings_fields;
71
    if (not defined $params->{biblionumber}) {
72
        carp('get_embeddable_marc_fields called with undefined biblionumber');
73
        return \@holdings_fields;
74
    }
75
76
    # N.B. This method is used in batch processes. Direct SQL instead of using Koha::Holdings->search is so much
77
    # faster that it makes sense even if it's ugly.
78
    my $sth = C4::Context->dbh->prepare( 'SELECT * FROM holdings WHERE biblionumber = ?' );
79
    $sth->execute($params->{biblionumber});
80
    my $holdings = $sth->fetchall_arrayref({});
81
    $sth->finish();
82
    my ($holdingstag, $holdingssubfield) = Koha::Holding->get_marc_field_mapping({ field => 'holdings.holdingbranch' });
83
    foreach my $holding (@$holdings) {
84
        my $mungedholding = {
85
            map {
86
                defined($holding->{$_}) && $holding->{$_} ne '' ? ("holdings.$_" => $holding->{$_}) : ()
87
            } keys %{ $holding }
88
        };
89
        my $marc = $class->_holding_to_marc($mungedholding);
90
        push @holdings_fields, $marc->field($holdingstag);
91
    }
92
    return \@holdings_fields;
93
}
94
95
=head2 _holding_to_marc
96
97
    $record = $class->_holding_to_marc($hash)
98
99
This function builds partial MARC::Record from holdings hash entries.
100
This function is called when embedding holdings into a biblio record.
101
102
=cut
103
104
sub _holding_to_marc {
105
    my ($class, $hash, $params) = @_;
106
107
    my $record = MARC::Record->new();
108
    SetMarcUnicodeFlag($record, C4::Context->preference('marcflavour'));
109
110
    # The next call uses the HLD framework since it is AUTHORITATIVE
111
    # for all Koha to MARC mappings for holdings.
112
    my $mss = C4::Biblio::GetMarcSubfieldStructure('HLD', { unsafe => 1 }); # do not change framewok
113
    my $tag_hr = {};
114
    while (my ($kohafield, $value) = each %$hash) {
115
        foreach my $fld (@{$mss->{$kohafield}}) {
116
            my $tagfield    = $fld->{tagfield};
117
            my $tagsubfield = $fld->{tagsubfield};
118
            next if !$tagfield;
119
            my @values = $params->{no_split}
120
                ? ( $value )
121
                : split(/\s?\|\s?/, $value, -1);
122
            foreach my $value (@values) {
123
                next if $value eq '';
124
                $tag_hr->{$tagfield} //= [];
125
                push @{$tag_hr->{$tagfield}}, [($tagsubfield, $value)];
126
            }
127
        }
128
    }
129
    foreach my $tag (sort keys %$tag_hr) {
130
        my @sfl = @{$tag_hr->{$tag}};
131
        @sfl = sort { $a->[0] cmp $b->[0]; } @sfl;
132
        @sfl = map { @{$_}; } @sfl;
133
        # Special care for control fields: remove the subfield indication @
134
        # and do not insert indicators.
135
        my @ind = $tag < 10 ? () : ( " ", " " );
136
        @sfl = grep { $_ ne '@' } @sfl if $tag < 10;
137
        $record->insert_fields_ordered(MARC::Field->new($tag, @ind, @sfl));
138
    }
139
    return $record;
140
}
141
142
143
=head1 AUTHOR
144
145
Kyle M Hall <kyle@bywatersolutions.com>
146
Ere Maijala <ere.maijala@helsinki.fi>
147
148
=cut
149
150
1;
(-)a/Koha/Holdings/Metadata.pm (+100 lines)
Line 0 Link Here
1
package Koha::Holdings::Metadata;
2
3
# This file is part of Koha.
4
#
5
# Koha is free software; you can redistribute it and/or modify it under the
6
# terms of the GNU General Public License as published by the Free Software
7
# Foundation; either version 3 of the License, or (at your option) any later
8
# version.
9
#
10
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
11
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
12
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
13
#
14
# You should have received a copy of the GNU General Public License along
15
# with Koha; if not, write to the Free Software Foundation, Inc.,
16
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17
18
use Modern::Perl;
19
20
use Carp;
21
22
use Koha::Database;
23
24
use base qw(Koha::Object);
25
26
=head1 NAME
27
28
Koha::Holdings::Metadata - Koha Holdings Metadata Object class
29
30
=head1 API
31
32
=head2 Class methods
33
34
=cut
35
36
=head3 record
37
38
my @record = $metadata->record($params);
39
my $record = $metadata->record;
40
41
Returns an object representing the metadata record. The expected record type
42
corresponds to this table:
43
44
    -------------------------------
45
    | format     | object type    |
46
    -------------------------------
47
    | marcxml    | MARC::Record   |
48
    -------------------------------
49
50
=head4 Error handling
51
52
=over
53
54
=item If an unsupported format is found, it throws a I<Koha::Exceptions::Metadata> exception.
55
56
=item If it fails to create the record object, it throws a I<Koha::Exceptions::Metadata::Invalid> exception.
57
58
=back
59
60
=cut
61
62
sub record {
63
    my ($self) = @_;
64
65
    my $record;
66
67
    if ($self->format eq 'marcxml') {
68
        $record = eval { MARC::Record::new_from_xml( $self->metadata, 'utf-8', $self->schema ); };
69
        unless ($record) {
70
            Koha::Exceptions::Metadata::Invalid->throw(
71
                id     => $self->id,
72
                format => $self->format,
73
                schema => $self->schema
74
            );
75
        }
76
    } else {
77
        Koha::Exceptions::Metadata->throw(
78
            'Koha::Holdings::Metadata->record called on unhandled format: ' . $self->format );
79
    }
80
81
    return $record;
82
}
83
84
=head2 Internal methods
85
86
=head3 _type
87
88
=cut
89
90
sub _type {
91
    return 'HoldingsMetadata';
92
}
93
94
=head1 AUTHOR
95
96
Ere Maijala ere.maijala@helsinki.fi
97
98
=cut
99
100
1;
(-)a/Koha/Holdings/Metadatas.pm (+58 lines)
Line 0 Link Here
1
package Koha::Holdings::Metadatas;
2
3
# This file is part of Koha.
4
#
5
# Koha is free software; you can redistribute it and/or modify it under the
6
# terms of the GNU General Public License as published by the Free Software
7
# Foundation; either version 3 of the License, or (at your option) any later
8
# version.
9
#
10
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
11
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
12
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
13
#
14
# You should have received a copy of the GNU General Public License along
15
# with Koha; if not, write to the Free Software Foundation, Inc.,
16
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17
18
use Modern::Perl;
19
20
use Carp;
21
22
use Koha::Database;
23
24
use Koha::Holdings::Metadata;
25
26
use base qw(Koha::Objects);
27
28
=head1 NAME
29
30
Koha::Holdings::Metadatas - Koha Holdings Metadata Object set class
31
32
=head1 API
33
34
=head2 Internal methods
35
36
=head3 _type
37
38
=cut
39
40
sub _type {
41
    return 'HoldingsMetadata';
42
}
43
44
=head3 object_class
45
46
=cut
47
48
sub object_class {
49
    return 'Koha::Holdings::Metadata';
50
}
51
52
=head1 AUTHOR
53
54
Ere Maijala ere.maijala@helsinki.fi
55
56
=cut
57
58
1;
(-)a/Koha/OAI/Server/ListBase.pm (-2 / +8 lines)
Lines 69-76 sub GetRecords { Link Here
69
        if ($include_items) {
69
        if ($include_items) {
70
            $sql .= "
70
            $sql .= "
71
                OR biblionumber IN (SELECT biblionumber from deleteditems WHERE timestamp >= ? AND timestamp <= ?)
71
                OR biblionumber IN (SELECT biblionumber from deleteditems WHERE timestamp >= ? AND timestamp <= ?)
72
                OR biblionumber IN (SELECT biblionumber from holdings WHERE timestamp >= ? AND timestamp <= ?)
72
            ";
73
            ";
73
            push @bind_params, ($token->{'from_arg'}, $token->{'until_arg'});
74
            push @bind_params, ($token->{'from_arg'}, $token->{'until_arg'}, $token->{'from_arg'}, $token->{'until_arg'});
74
            if (!$deleted) {
75
            if (!$deleted) {
75
                $sql .= "
76
                $sql .= "
76
                    OR biblionumber IN (SELECT biblionumber from items WHERE timestamp >= ? AND timestamp <= ?)
77
                    OR biblionumber IN (SELECT biblionumber from items WHERE timestamp >= ? AND timestamp <= ?)
Lines 106-111 sub GetRecords { Link Here
106
                    SELECT timestamp FROM deletedbiblio_metadata WHERE biblionumber = ?
107
                    SELECT timestamp FROM deletedbiblio_metadata WHERE biblionumber = ?
107
                    UNION
108
                    UNION
108
                    SELECT timestamp FROM deleteditems WHERE biblionumber = ?
109
                    SELECT timestamp FROM deleteditems WHERE biblionumber = ?
110
                    UNION
111
                    SELECT timestamp FROM holdings WHERE biblionumber = ?
109
                ) bis
112
                ) bis
110
            ";
113
            ";
111
        } else {
114
        } else {
Lines 117-122 sub GetRecords { Link Here
117
                    SELECT timestamp FROM deleteditems WHERE biblionumber = ?
120
                    SELECT timestamp FROM deleteditems WHERE biblionumber = ?
118
                    UNION
121
                    UNION
119
                    SELECT timestamp FROM items WHERE biblionumber = ?
122
                    SELECT timestamp FROM items WHERE biblionumber = ?
123
                    UNION
124
                    SELECT timestamp FROM holdings WHERE biblionumber = ?
120
                ) bi
125
                ) bi
121
            ";
126
            ";
122
        }
127
        }
Lines 139-145 sub GetRecords { Link Here
139
                );
144
                );
140
                last STAGELOOP;
145
                last STAGELOOP;
141
            }
146
            }
142
            my @params = $deleted ? ( $biblionumber, $biblionumber ) : ( $biblionumber, $biblionumber, $biblionumber );
147
            my @params = $deleted ? ( $biblionumber, $biblionumber, $biblionumber )
148
                : ( $biblionumber, $biblionumber, $biblionumber, $biblionumber );
143
            $record_sth->execute( @params ) || die( 'Could not execute statement: ' . $sth->errstr );
149
            $record_sth->execute( @params ) || die( 'Could not execute statement: ' . $sth->errstr );
144
150
145
            my ($timestamp) = $record_sth->fetchrow;
151
            my ($timestamp) = $record_sth->fetchrow;
(-)a/Koha/OAI/Server/Repository.pm (+1 lines)
Lines 93-98 mode. A configuration file koha-oai.conf can look like that: Link Here
93
      xsl_file: /usr/local/koha/koha-tmpl/intranet-tmpl/xslt/UNIMARCslim2OAIDC.xsl
93
      xsl_file: /usr/local/koha/koha-tmpl/intranet-tmpl/xslt/UNIMARCslim2OAIDC.xsl
94
94
95
Note the 'include_items' parameter which is the only mean to return item-level info.
95
Note the 'include_items' parameter which is the only mean to return item-level info.
96
If summary holdings are enabled, 'include_items' includes their location information too.
96
97
97
=cut
98
=cut
98
99
(-)a/Koha/Objects.pm (+18 lines)
Lines 116-121 sub find_or_create { Link Here
116
    return $object;
116
    return $object;
117
}
117
}
118
118
119
=head3 Koha::Objects->find_or_new();
120
121
my $object = Koha::Objects->find_or_new( $attrs );
122
123
=cut
124
125
sub find_or_new {
126
    my ( $self, $params ) = @_;
127
128
    my $result = $self->_resultset->find_or_new($params);
129
130
    return unless $result;
131
132
    my $object = $self->object_class->_new_from_dbic($result);
133
134
    return $object;
135
}
136
119
=head3 Koha::Objects->search();
137
=head3 Koha::Objects->search();
120
138
121
my @objects = Koha::Objects->search($params);
139
my @objects = Koha::Objects->search($params);
(-)a/Koha/Template/Plugin/Holdings.pm (+118 lines)
Line 0 Link Here
1
package Koha::Template::Plugin::Holdings;
2
3
# Copyright ByWater Solutions 2012
4
# Copyright BibLibre 2014
5
# Copyright 2017-2019 University of Helsinki (The National Library Of Finland)
6
7
# This file is part of Koha.
8
#
9
# Koha is free software; you can redistribute it and/or modify it
10
# under the terms of the GNU General Public License as published by
11
# the Free Software Foundation; either version 3 of the License, or
12
# (at your option) any later version.
13
#
14
# Koha is distributed in the hope that it will be useful, but
15
# WITHOUT ANY WARRANTY; without even the implied warranty of
16
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
# GNU General Public License for more details.
18
#
19
# You should have received a copy of the GNU General Public License
20
# along with Koha; if not, see <http://www.gnu.org/licenses>.
21
22
use Modern::Perl;
23
24
use Template::Plugin;
25
use base qw( Template::Plugin );
26
27
use C4::Context;
28
29
use Koha::Holdings;
30
31
=head1 NAME
32
33
Koha::Template::Plugin::Holdings - TT Plugin for holdings
34
35
=head1 SYNOPSIS
36
37
[% USE Holdings %]
38
39
[% Holdings.GetLocation(holding) | html %]
40
41
=head1 ROUTINES
42
43
=head2 GetLocation
44
45
Get a location string for a holdings record
46
47
    [% Holdings.GetLocation(holding) | html %]
48
49
=cut
50
51
sub GetLocation {
52
    my ($self, $holding) = @_;
53
    my $opac = shift || 0;
54
55
    if (!$holding) {
56
        return '';
57
    }
58
59
    if (ref($holding) ne 'HASH') {
60
        $holding = Koha::Holdings->find($holding)->unblessed;
61
        if (!$holding) {
62
            return '';
63
        }
64
    }
65
66
    my @parts;
67
68
    if ($opac) {
69
        if ($holding->{'holdingbranch'}) {
70
            my $query = "SELECT branchname FROM branches WHERE branchcode = ?";
71
            my $sth = C4::Context->dbh->prepare($query);
72
            $sth->execute($holding->{'holdingbranch'});
73
            my $b = $sth->fetchrow_hashref();
74
            push @parts, $b->{'branchname'} if $b;
75
            $sth->finish();
76
        }
77
        if ($holding->{'location'}) {
78
            my $av = Koha::AuthorisedValues->search({ category => 'LOC', authorised_value => $holding->{'location'} });
79
            push @parts, $av->next->opac_description if $av->count;
80
        }
81
        push @parts, $holding->{'callnumber'} if $holding->{'callnumber'};
82
        return join(' - ', @parts);
83
    }
84
85
    push @parts, $holding->{'holding_id'};
86
    push @parts, $holding->{'holdingbranch'} if $holding->{'holdingbranch'};
87
    push @parts, $holding->{'location'} if $holding->{'location'};
88
    push @parts, $holding->{'ccode'} if $holding->{'ccode'};
89
    push @parts, $holding->{'callnumber'} if $holding->{'callnumber'};
90
    return join(' ', @parts);
91
}
92
93
=head2 GetDetails
94
95
Get the Koha fields for a holdings record
96
97
    [% details = Holdings.GetDetails(holding) %]
98
99
=cut
100
101
sub GetDetails {
102
    my ($self, $holding) = @_;
103
    my $opac = shift || 0;
104
105
    if (!$holding) {
106
        return '';
107
    }
108
109
    if (ref($holding) eq 'HASH') {
110
        $holding = $holding->{'holding_id'};
111
    }
112
113
    my $holding_marc = Koha::Holdings->find($holding)->metadata()->record();
114
115
    return Koha::Holding::marc_to_koha_fields({ record => $holding_marc });
116
}
117
118
1;
(-)a/admin/marc_subfields_structure.pl (+5 lines)
Lines 125-130 if ( $op eq 'add_form' ) { Link Here
125
    while ( ( my $field ) = $sth2->fetchrow_array ) {
125
    while ( ( my $field ) = $sth2->fetchrow_array ) {
126
        push @kohafields, "items." . $field;
126
        push @kohafields, "items." . $field;
127
    }
127
    }
128
    $sth2 = $dbh->prepare("SHOW COLUMNS from holdings");
129
    $sth2->execute;
130
    while ( ( my $field ) = $sth2->fetchrow_array ) {
131
        push @kohafields, "holdings." . $field;
132
    }
128
133
129
    # build authorised value list
134
    # build authorised value list
130
    $sth2->finish;
135
    $sth2->finish;
(-)a/catalogue/detail.pl (-5 / +13 lines)
Lines 42-47 use C4::CourseReserves qw(GetItemCourseReservesInfo); Link Here
42
use C4::Acquisition qw(GetOrdersByBiblionumber);
42
use C4::Acquisition qw(GetOrdersByBiblionumber);
43
use Koha::AuthorisedValues;
43
use Koha::AuthorisedValues;
44
use Koha::Biblios;
44
use Koha::Biblios;
45
use Koha::Holdings;
45
use Koha::Items;
46
use Koha::Items;
46
use Koha::ItemTypes;
47
use Koha::ItemTypes;
47
use Koha::Patrons;
48
use Koha::Patrons;
Lines 190-195 foreach my $subscription (@subscriptions) { Link Here
190
    push @subs, \%cell;
191
    push @subs, \%cell;
191
}
192
}
192
193
194
# Summary holdings
195
my $summary_holdings;
196
if (C4::Context->preference('SummaryHoldings')) {
197
    $summary_holdings = Koha::Holdings->search({ biblionumber => $biblionumber, deleted_on => undef })->unblessed;
198
}
193
199
194
# Get acquisition details
200
# Get acquisition details
195
if ( C4::Context->preference('AcquisitionDetails') ) {
201
if ( C4::Context->preference('AcquisitionDetails') ) {
Lines 383-395 $template->param( Link Here
383
    itemdata_copynumber => $itemfields{copynumber},
389
    itemdata_copynumber => $itemfields{copynumber},
384
    itemdata_stocknumber => $itemfields{stocknumber},
390
    itemdata_stocknumber => $itemfields{stocknumber},
385
    volinfo                => $itemfields{enumchron},
391
    volinfo                => $itemfields{enumchron},
386
        itemdata_itemnotes  => $itemfields{itemnotes},
392
    itemdata_itemnotes  => $itemfields{itemnotes},
387
        itemdata_nonpublicnotes => $itemfields{itemnotes_nonpublic},
393
    itemdata_nonpublicnotes => $itemfields{itemnotes_nonpublic},
388
    z3950_search_params    => C4::Search::z3950_search_args($dat),
394
    z3950_search_params    => C4::Search::z3950_search_args($dat),
389
        hostrecords         => $hostrecords,
395
    hostrecords         => $hostrecords,
390
    analytics_flag    => $analytics_flag,
396
    analytics_flag      => $analytics_flag,
391
    C4::Search::enabled_staff_search_views,
397
    C4::Search::enabled_staff_search_views,
392
        materials       => $materials_flag,
398
    materials       => $materials_flag,
399
    show_summary_holdings => C4::Context->preference('SummaryHoldings') ? 1 : 0,
400
    summary_holdings    => $summary_holdings,
393
);
401
);
394
402
395
if (C4::Context->preference("AlternateHoldingsField") && scalar @items == 0) {
403
if (C4::Context->preference("AlternateHoldingsField") && scalar @items == 0) {
(-)a/catalogue/showmarc.pl (-2 / +7 lines)
Lines 35-40 use C4::Biblio; Link Here
35
use C4::ImportBatch;
35
use C4::ImportBatch;
36
use C4::XSLT ();
36
use C4::XSLT ();
37
37
38
use Koha::Holdings;
39
38
my $input= new CGI;
40
my $input= new CGI;
39
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
41
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
40
  {
42
  {
Lines 50-58 my ( $template, $loggedinuser, $cookie ) = get_template_and_user( Link Here
50
my $biblionumber= $input->param('id');
52
my $biblionumber= $input->param('id');
51
my $importid= $input->param('importid');
53
my $importid= $input->param('importid');
52
my $view= $input->param('viewas')||'';
54
my $view= $input->param('viewas')||'';
55
my $holding_id= $input->param('holding_id')||'';
53
56
54
my $record;
57
my $record;
55
if ($importid) {
58
if ($holding_id) {
59
    $record = Koha::Holdings->find($holding_id)->metadata()->record();
60
} elsif ($importid) {
56
    $record = C4::ImportBatch::GetRecordFromImportBiblio( $importid, 'embed_items' );
61
    $record = C4::ImportBatch::GetRecordFromImportBiblio( $importid, 'embed_items' );
57
}
62
}
58
else {
63
else {
Lines 64-70 if(!ref $record) { Link Here
64
}
69
}
65
70
66
if($view eq 'card' || $view eq 'html') {
71
if($view eq 'card' || $view eq 'html') {
67
    my $xml = $importid ? $record->as_xml(): GetXmlBiblio($biblionumber);
72
    my $xml = $record->as_xml();
68
    my $xsl;
73
    my $xsl;
69
    if ( $view eq 'card' ){
74
    if ( $view eq 'card' ){
70
        $xsl = C4::Context->preference('marcflavour') eq 'UNIMARC'
75
        $xsl = C4::Context->preference('marcflavour') eq 'UNIMARC'
(-)a/cataloguing/addholding.pl (+700 lines)
Line 0 Link Here
1
#!/usr/bin/perl
2
3
4
# Copyright 2000-2002 Katipo Communications
5
# Copyright 2004-2010 BibLibre
6
# Copyright 2017-2019 University of Helsinki (The National Library Of Finland)
7
#
8
# This file is part of Koha.
9
#
10
# Koha is free software; you can redistribute it and/or modify it
11
# under the terms of the GNU General Public License as published by
12
# the Free Software Foundation; either version 3 of the License, or
13
# (at your option) any later version.
14
#
15
# Koha is distributed in the hope that it will be useful, but
16
# WITHOUT ANY WARRANTY; without even the implied warranty of
17
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18
# GNU General Public License for more details.
19
#
20
# You should have received a copy of the GNU General Public License
21
# along with Koha; if not, see <http://www.gnu.org/licenses>.
22
23
# TODO: refactor to avoid duplication from addbiblio
24
25
use strict;
26
#use warnings; FIXME - Bug 2505
27
use CGI q(-utf8);
28
use C4::Output;
29
use C4::Auth;
30
use C4::Search;
31
use C4::Biblio;
32
use C4::Context;
33
use MARC::Record;
34
use C4::Log;
35
use C4::Koha;
36
use C4::ClassSource;
37
use C4::ImportBatch;
38
use C4::Charset;
39
use Koha::Biblios;
40
use Koha::BiblioFrameworks;
41
use Koha::DateUtils;
42
use C4::Matcher;
43
44
use Koha::ItemTypes;
45
use Koha::Libraries;
46
47
use Date::Calc qw(Today);
48
use MARC::File::USMARC;
49
use MARC::File::XML;
50
use URI::Escape;
51
52
if ( C4::Context->preference('marcflavour') eq 'UNIMARC' ) {
53
    MARC::File::XML->default_record_format('UNIMARC');
54
}
55
56
our($tagslib,$authorised_values_sth,$is_a_modif,$usedTagsLib,$mandatory_z3950);
57
58
=head1 FUNCTIONS
59
60
=head2 build_authorized_values_list
61
62
=cut
63
64
sub build_authorized_values_list {
65
    my ( $tag, $subfield, $value, $dbh, $authorised_values_sth,$index_tag,$index_subfield ) = @_;
66
67
    my @authorised_values;
68
    my %authorised_lib;
69
70
    # builds list, depending on authorised value...
71
72
    #---- branch
73
    if ( $tagslib->{$tag}->{$subfield}->{'authorised_value'} eq "branches" ) {
74
        my $libraries = Koha::Libraries->search_filtered({}, {order_by => ['branchname']});
75
        while ( my $l = $libraries->next ) {
76
            push @authorised_values, $l->branchcode;
77
            $authorised_lib{$l->branchcode} = $l->branchname;
78
        }
79
    }
80
    elsif ( $tagslib->{$tag}->{$subfield}->{authorised_value} eq "LOC" ) {
81
        push @authorised_values, ""
82
          unless ( $tagslib->{$tag}->{$subfield}->{mandatory}
83
            && ( $value || $tagslib->{$tag}->{$subfield}->{defaultvalue} ) );
84
85
86
        my $branch_limit = C4::Context->userenv ? C4::Context->userenv->{"branch"} : "";
87
        my $avs = Koha::AuthorisedValues->search(
88
            {
89
                branchcode => $branch_limit,
90
                category => $tagslib->{$tag}->{$subfield}->{authorised_value},
91
            },
92
            {
93
                order_by => [ 'category', 'lib', 'lib_opac' ],
94
            }
95
        );
96
97
        while ( my $av = $avs->next ) {
98
            push @authorised_values, $av->authorised_value;
99
            $authorised_lib{$av->authorised_value} = $av->lib;
100
        }
101
    }
102
    elsif ( $tagslib->{$tag}->{$subfield}->{authorised_value} eq "cn_source" ) {
103
        push @authorised_values, ""
104
          unless ( $tagslib->{$tag}->{$subfield}->{mandatory} );
105
106
        my $class_sources = GetClassSources();
107
108
        my $default_source = C4::Context->preference("DefaultClassificationSource");
109
110
        foreach my $class_source (sort keys %$class_sources) {
111
            next unless $class_sources->{$class_source}->{'used'} or
112
                        ($value and $class_source eq $value) or
113
                        ($class_source eq $default_source);
114
            push @authorised_values, $class_source;
115
            $authorised_lib{$class_source} = $class_sources->{$class_source}->{'description'};
116
        }
117
        $value = $default_source unless $value;
118
    }
119
    else {
120
        my $branch_limit = C4::Context->userenv ? C4::Context->userenv->{"branch"} : "";
121
        $authorised_values_sth->execute(
122
            $tagslib->{$tag}->{$subfield}->{authorised_value},
123
            $branch_limit ? $branch_limit : (),
124
        );
125
126
        push @authorised_values, ""
127
          unless ( $tagslib->{$tag}->{$subfield}->{mandatory}
128
            && ( $value || $tagslib->{$tag}->{$subfield}->{defaultvalue} ) );
129
130
        while ( my ( $value, $lib ) = $authorised_values_sth->fetchrow_array ) {
131
            push @authorised_values, $value;
132
            $authorised_lib{$value} = $lib;
133
        }
134
    }
135
    $authorised_values_sth->finish;
136
    return {
137
        type     => 'select',
138
        id       => "tag_".$tag."_subfield_".$subfield."_".$index_tag."_".$index_subfield,
139
        name     => "tag_".$tag."_subfield_".$subfield."_".$index_tag."_".$index_subfield,
140
        default  => $value,
141
        values   => \@authorised_values,
142
        labels   => \%authorised_lib,
143
    };
144
145
}
146
147
=head2 CreateKey
148
149
    Create a random value to set it into the input name
150
151
=cut
152
153
sub CreateKey {
154
    return int(rand(1000000));
155
}
156
157
=head2 create_input
158
159
 builds the <input ...> entry for a subfield.
160
161
=cut
162
163
sub create_input {
164
    my ( $tag, $subfield, $value, $index_tag, $tabloop, $rec, $authorised_values_sth,$cgi ) = @_;
165
166
    my $index_subfield = CreateKey(); # create a specific key for each subfield
167
168
    $value =~ s/"/&quot;/g;
169
170
    # if there is no value provided but a default value in parameters, get it
171
    if ( $value eq '' ) {
172
        $value = $tagslib->{$tag}->{$subfield}->{defaultvalue};
173
174
        # get today date & replace <<YYYY>>, <<MM>>, <<DD>> if provided in the default value
175
        my $today_dt = dt_from_string;
176
        my $year = $today_dt->strftime('%Y');
177
        my $month = $today_dt->strftime('%m');
178
        my $day = $today_dt->strftime('%d');
179
        $value =~ s/<<YYYY>>/$year/g;
180
        $value =~ s/<<MM>>/$month/g;
181
        $value =~ s/<<DD>>/$day/g;
182
        # And <<USER>> with surname (?)
183
        my $username=(C4::Context->userenv?C4::Context->userenv->{'surname'}:"superlibrarian");
184
        $value=~s/<<USER>>/$username/g;
185
186
    }
187
    my $dbh = C4::Context->dbh;
188
189
    # map '@' as "subfield" label for fixed fields
190
    # to something that's allowed in a div id.
191
    my $id_subfield = $subfield;
192
    $id_subfield = "00" if $id_subfield eq "@";
193
194
    my %subfield_data = (
195
        tag        => $tag,
196
        subfield   => $id_subfield,
197
        marc_lib       => $tagslib->{$tag}->{$subfield}->{lib},
198
        tag_mandatory  => $tagslib->{$tag}->{mandatory},
199
        mandatory      => $tagslib->{$tag}->{$subfield}->{mandatory},
200
        repeatable     => $tagslib->{$tag}->{$subfield}->{repeatable},
201
        kohafield      => $tagslib->{$tag}->{$subfield}->{kohafield},
202
        index          => $index_tag,
203
        id             => "tag_".$tag."_subfield_".$id_subfield."_".$index_tag."_".$index_subfield,
204
        value          => $value,
205
        maxlength      => $tagslib->{$tag}->{$subfield}->{maxlength},
206
        random         => CreateKey(),
207
    );
208
209
    if(exists $mandatory_z3950->{$tag.$subfield}){
210
        $subfield_data{z3950_mandatory} = $mandatory_z3950->{$tag.$subfield};
211
    }
212
    # Subfield is hidden depending of hidden and mandatory flag, and is always
213
    # shown if it contains anything or if its field is mandatory.
214
    my $tdef = $tagslib->{$tag};
215
    $subfield_data{visibility} = "display:none;"
216
        if $tdef->{$subfield}->{hidden} % 2 == 1 &&
217
           $value eq '' &&
218
           !$tdef->{$subfield}->{mandatory} &&
219
           !$tdef->{mandatory};
220
    # expand all subfields of 773 if there is a host item provided in the input
221
    $subfield_data{visibility} ="" if ($tag eq 773 and $cgi->param('hostitemnumber'));
222
223
    # it's an authorised field
224
    if ( $tagslib->{$tag}->{$subfield}->{authorised_value} ) {
225
        $subfield_data{marc_value} =
226
          build_authorized_values_list( $tag, $subfield, $value, $dbh,
227
            $authorised_values_sth,$index_tag,$index_subfield );
228
229
    # it's a subfield $9 linking to an authority record - see bug 2206
230
    }
231
    elsif ($subfield eq "9" and
232
           exists($tagslib->{$tag}->{'a'}->{authtypecode}) and
233
           defined($tagslib->{$tag}->{'a'}->{authtypecode}) and
234
           $tagslib->{$tag}->{'a'}->{authtypecode} ne '') {
235
236
        $subfield_data{marc_value} = {
237
            type      => 'text',
238
            id        => $subfield_data{id},
239
            name      => $subfield_data{id},
240
            value     => $value,
241
            size      => 5,
242
            maxlength => $subfield_data{maxlength},
243
            readonly  => 1,
244
        };
245
246
    # it's a thesaurus / authority field
247
    }
248
    elsif ( $tagslib->{$tag}->{$subfield}->{authtypecode} ) {
249
        # when authorities auto-creation is allowed, do not set readonly
250
        my $is_readonly = !C4::Context->preference("BiblioAddsAuthorities");
251
252
        $subfield_data{marc_value} = {
253
            type      => 'text',
254
            id        => $subfield_data{id},
255
            name      => $subfield_data{id},
256
            value     => $value,
257
            size      => 67,
258
            maxlength => $subfield_data{maxlength},
259
            readonly  => ($is_readonly) ? 1 : 0,
260
            authtype  => $tagslib->{$tag}->{$subfield}->{authtypecode},
261
        };
262
263
    # it's a plugin field
264
    } elsif ( $tagslib->{$tag}->{$subfield}->{'value_builder'} ) {
265
        require Koha::FrameworkPlugin;
266
        my $plugin = Koha::FrameworkPlugin->new( {
267
            name => $tagslib->{$tag}->{$subfield}->{'value_builder'},
268
        });
269
        my $pars= { dbh => $dbh, record => $rec, tagslib => $tagslib,
270
            id => $subfield_data{id}, tabloop => $tabloop };
271
        $plugin->build( $pars );
272
        if( !$plugin->errstr ) {
273
            $subfield_data{marc_value} = {
274
                type           => 'text_complex',
275
                id             => $subfield_data{id},
276
                name           => $subfield_data{id},
277
                value          => $value,
278
                size           => 67,
279
                maxlength      => $subfield_data{maxlength},
280
                javascript     => $plugin->javascript,
281
                noclick        => $plugin->noclick,
282
            };
283
        } else {
284
            warn $plugin->errstr;
285
            # supply default input form
286
            $subfield_data{marc_value} = {
287
                type      => 'text',
288
                id        => $subfield_data{id},
289
                name      => $subfield_data{id},
290
                value     => $value,
291
                size      => 67,
292
                maxlength => $subfield_data{maxlength},
293
                readonly  => 0,
294
            };
295
        }
296
297
    # it's an hidden field
298
    } elsif ( $tag eq '' ) {
299
        $subfield_data{marc_value} = {
300
            type      => 'hidden',
301
            id        => $subfield_data{id},
302
            name      => $subfield_data{id},
303
            value     => $value,
304
            size      => 67,
305
            maxlength => $subfield_data{maxlength},
306
        };
307
308
    }
309
    else {
310
        # it's a standard field
311
        if (
312
            length($value) > 100
313
            or
314
            ( C4::Context->preference("marcflavour") eq "UNIMARC" && $tag >= 300
315
                and $tag < 400 && $subfield eq 'a' )
316
            or (    $tag >= 500
317
                and $tag < 600
318
                && C4::Context->preference("marcflavour") eq "MARC21" )
319
          )
320
        {
321
            $subfield_data{marc_value} = {
322
                type      => 'textarea',
323
                id        => $subfield_data{id},
324
                name      => $subfield_data{id},
325
                value     => $value,
326
            };
327
328
        }
329
        else {
330
            $subfield_data{marc_value} = {
331
                type      => 'text',
332
                id        => $subfield_data{id},
333
                name      => $subfield_data{id},
334
                value     => $value,
335
                size      => 67,
336
                maxlength => $subfield_data{maxlength},
337
                readonly  => 0,
338
            };
339
340
        }
341
    }
342
    $subfield_data{'index_subfield'} = $index_subfield;
343
    return \%subfield_data;
344
}
345
346
347
=head2 format_indicator
348
349
Translate indicator value for output form - specifically, map
350
indicator = ' ' to ''.  This is for the convenience of a cataloger
351
using a mouse to select an indicator input.
352
353
=cut
354
355
sub format_indicator {
356
    my $ind_value = shift;
357
    return '' if not defined $ind_value;
358
    return '' if $ind_value eq ' ';
359
    return $ind_value;
360
}
361
362
sub build_tabs {
363
    my ( $template, $record, $dbh, $encoding,$input ) = @_;
364
365
    # fill arrays
366
    my @loop_data = ();
367
    my $tag;
368
369
    my $branch_limit = C4::Context->userenv ? C4::Context->userenv->{"branch"} : "";
370
    my $query = "SELECT authorised_value, lib
371
                FROM authorised_values";
372
    $query .= qq{ LEFT JOIN authorised_values_branches ON ( id = av_id )} if $branch_limit;
373
    $query .= " WHERE category = ?";
374
    $query .= " AND ( branchcode = ? OR branchcode IS NULL )" if $branch_limit;
375
    $query .= " GROUP BY lib ORDER BY lib, lib_opac";
376
    my $authorised_values_sth = $dbh->prepare( $query );
377
378
    # in this array, we will push all the 10 tabs
379
    # to avoid having 10 tabs in the template : they will all be in the same BIG_LOOP
380
    my @BIG_LOOP;
381
    my %seen;
382
    my @tab_data; # all tags to display
383
384
    foreach my $used ( @$usedTagsLib ){
385
        push @tab_data,$used->{tagfield} if not $seen{$used->{tagfield}};
386
        $seen{$used->{tagfield}}++;
387
    }
388
389
    my $max_num_tab=-1;
390
    foreach(@$usedTagsLib){
391
        if($_->{tab} > -1 && $_->{tab} >= $max_num_tab && $_->{tagfield} != '995'){ # FIXME : MARC21 ?
392
            $max_num_tab = $_->{tab};
393
        }
394
    }
395
    if($max_num_tab >= 9){
396
        $max_num_tab = 9;
397
    }
398
    # loop through each tab 0 through 9
399
    for ( my $tabloop = 0 ; $tabloop <= $max_num_tab ; $tabloop++ ) {
400
        my @loop_data = (); #innerloop in the template.
401
        my $i = 0;
402
        foreach my $tag (@tab_data) {
403
            $i++;
404
            next if ! $tag;
405
            my ($indicator1, $indicator2);
406
            my $index_tag = CreateKey;
407
408
            # if MARC::Record is not empty =>use it as master loop, then add missing subfields that should be in the tab.
409
            # if MARC::Record is empty => use tab as master loop.
410
            if ( $record ne -1 && ( $record->field($tag) || $tag eq '000' ) ) {
411
                my @fields;
412
        if ( $tag ne '000' ) {
413
                    @fields = $record->field($tag);
414
        }
415
        else {
416
           push @fields, $record->leader(); # if tag == 000
417
        }
418
        # loop through each field
419
                foreach my $field (@fields) {
420
421
                    my @subfields_data;
422
                    if ( $tag < 10 ) {
423
                        my ( $value, $subfield );
424
                        if ( $tag ne '000' ) {
425
                            $value    = $field->data();
426
                            $subfield = "@";
427
                        }
428
                        else {
429
                            $value    = $field;
430
                            $subfield = '@';
431
                        }
432
                        next if ( $tagslib->{$tag}->{$subfield}->{tab} ne $tabloop );
433
                        next
434
                          if ( $tagslib->{$tag}->{$subfield}->{kohafield} eq
435
                            'biblio.biblionumber' );
436
                        push(
437
                            @subfields_data,
438
                            &create_input(
439
                                $tag, $subfield, $value, $index_tag, $tabloop, $record,
440
                                $authorised_values_sth,$input
441
                            )
442
                        );
443
                    }
444
                    else {
445
                        my @subfields = $field->subfields();
446
                        foreach my $subfieldcount ( 0 .. $#subfields ) {
447
                            my $subfield = $subfields[$subfieldcount][0];
448
                            my $value    = $subfields[$subfieldcount][1];
449
                            next if ( length $subfield != 1 );
450
                            next if ( $tagslib->{$tag}->{$subfield}->{tab} ne $tabloop );
451
                            push(
452
                                @subfields_data,
453
                                &create_input(
454
                                    $tag, $subfield, $value, $index_tag, $tabloop,
455
                                    $record, $authorised_values_sth,$input
456
                                )
457
                            );
458
                        }
459
                    }
460
461
                    # now, loop again to add parameter subfield that are not in the MARC::Record
462
                    foreach my $subfield ( sort( keys %{ $tagslib->{$tag} } ) )
463
                    {
464
                        next if ( length $subfield != 1 );
465
                        next if ( $tagslib->{$tag}->{$subfield}->{tab} ne $tabloop );
466
                        next if ( $tag < 10 );
467
                        next
468
                          if ( ( $tagslib->{$tag}->{$subfield}->{hidden} <= -4 )
469
                            or ( $tagslib->{$tag}->{$subfield}->{hidden} >= 5 ) )
470
                            and not ( $subfield eq "9" and
471
                                      exists($tagslib->{$tag}->{'a'}->{authtypecode}) and
472
                                      defined($tagslib->{$tag}->{'a'}->{authtypecode}) and
473
                                      $tagslib->{$tag}->{'a'}->{authtypecode} ne ""
474
                                    )
475
                          ;    #check for visibility flag
476
                               # if subfield is $9 in a field whose $a is authority-controlled,
477
                               # always include in the form regardless of the hidden setting - bug 2206
478
                        next if ( defined( $field->subfield($subfield) ) );
479
                        push(
480
                            @subfields_data,
481
                            &create_input(
482
                                $tag, $subfield, '', $index_tag, $tabloop, $record,
483
                                $authorised_values_sth,$input
484
                            )
485
                        );
486
                    }
487
                    if ( $#subfields_data >= 0 ) {
488
                        # build the tag entry.
489
                        # note that the random() field is mandatory. Otherwise, on repeated fields, you'll
490
                        # have twice the same "name" value, and cgi->param() will return only one, making
491
                        # all subfields to be merged in a single field.
492
                        my %tag_data = (
493
                            tag           => $tag,
494
                            index         => $index_tag,
495
                            tag_lib       => $tagslib->{$tag}->{lib},
496
                            repeatable       => $tagslib->{$tag}->{repeatable},
497
                            mandatory       => $tagslib->{$tag}->{mandatory},
498
                            subfield_loop => \@subfields_data,
499
                            fixedfield    => $tag < 10?1:0,
500
                            random        => CreateKey,
501
                        );
502
                        if ($tag >= 10){ # no indicator for 00x tags
503
                           $tag_data{indicator1} = format_indicator($field->indicator(1)),
504
                           $tag_data{indicator2} = format_indicator($field->indicator(2)),
505
                        }
506
                        push( @loop_data, \%tag_data );
507
                    }
508
                 } # foreach $field end
509
510
            # if breeding is empty
511
            }
512
            else {
513
                my @subfields_data;
514
                foreach my $subfield ( sort( keys %{ $tagslib->{$tag} } ) ) {
515
                    next if ( length $subfield != 1 );
516
                    next
517
                      if ( ( $tagslib->{$tag}->{$subfield}->{hidden} <= -4 )
518
                        or ( $tagslib->{$tag}->{$subfield}->{hidden} >= 5 ) )
519
                      and not ( $subfield eq "9" and
520
                                exists($tagslib->{$tag}->{'a'}->{authtypecode}) and
521
                                defined($tagslib->{$tag}->{'a'}->{authtypecode}) and
522
                                $tagslib->{$tag}->{'a'}->{authtypecode} ne ""
523
                              )
524
                      ;    #check for visibility flag
525
                           # if subfield is $9 in a field whose $a is authority-controlled,
526
                           # always include in the form regardless of the hidden setting - bug 2206
527
                    next
528
                      if ( $tagslib->{$tag}->{$subfield}->{tab} ne $tabloop );
529
                    push(
530
                        @subfields_data,
531
                        &create_input(
532
                            $tag, $subfield, '', $index_tag, $tabloop, $record,
533
                            $authorised_values_sth,$input
534
                        )
535
                    );
536
                }
537
                if ( $#subfields_data >= 0 ) {
538
                    my %tag_data = (
539
                        tag              => $tag,
540
                        index            => $index_tag,
541
                        tag_lib          => $tagslib->{$tag}->{lib},
542
                        repeatable       => $tagslib->{$tag}->{repeatable},
543
                        mandatory       => $tagslib->{$tag}->{mandatory},
544
                        indicator1       => $indicator1,
545
                        indicator2       => $indicator2,
546
                        subfield_loop    => \@subfields_data,
547
                        tagfirstsubfield => $subfields_data[0],
548
                        fixedfield       => $tag < 10?1:0,
549
                    );
550
551
                    push @loop_data, \%tag_data ;
552
                }
553
            }
554
        }
555
        if ( $#loop_data >= 0 ) {
556
            push @BIG_LOOP, {
557
                number    => $tabloop,
558
                innerloop => \@loop_data,
559
            };
560
        }
561
    }
562
    $authorised_values_sth->finish;
563
    $template->param( BIG_LOOP => \@BIG_LOOP );
564
}
565
566
##########################
567
#          MAIN
568
##########################
569
my $input = new CGI;
570
my $error = $input->param('error');
571
my $biblionumber  = $input->param('biblionumber');
572
my $holding_id    = $input->param('holding_id'); # if holding_id exists, it's a modification, not a new holding.
573
my $op            = $input->param('op');
574
my $mode          = $input->param('mode');
575
my $frameworkcode = $input->param('frameworkcode');
576
my $redirect      = $input->param('redirect');
577
my $searchid      = $input->param('searchid');
578
my $userflags     = 'edit_items';
579
my $changed_framework = $input->param('changed_framework');
580
581
my ($template, $loggedinuser, $cookie) = get_template_and_user(
582
    {
583
        template_name   => "cataloguing/addholding.tt",
584
        query           => $input,
585
        type            => "intranet",
586
        authnotrequired => 0,
587
        flagsrequired   => { editcatalogue => $userflags },
588
    }
589
);
590
591
my $record = $holding_id ? Koha::Holdings->find($holding_id) : Koha::Holding->new();
592
593
$frameworkcode = 'HLD' if ($frameworkcode eq '');
594
595
# TODO: support in advanced editor?
596
#if ( $op ne "delete" && C4::Context->preference('EnableAdvancedCatalogingEditor') && $input->cookie( 'catalogue_editor_' . $loggedinuser ) eq 'advanced' ) {
597
#    print $input->redirect( '/cgi-bin/koha/cataloguing/editor.pl#catalog/' . $biblionumber . '/holdings/' . ( $holding_id ? $holding_id : '' ) );
598
#    exit;
599
#}
600
601
# ++ Global
602
$tagslib         = &GetMarcStructure( 1, $frameworkcode );
603
$usedTagsLib     = &GetUsedMarcStructure( $frameworkcode );
604
# -- Global
605
606
my ( $biblionumbertagfield, $biblionumbertagsubfield ) =
607
    &GetMarcFromKohaField( "biblio.biblionumber", $frameworkcode );
608
609
if ($op eq 'add') {
610
    $template->param(
611
        biblionumberdata => $biblionumber,
612
    );
613
    # Convert HTML input to MARC
614
    my @params = $input->multi_param();
615
    my $marc = TransformHtmlToMarc( $input, 1 );
616
617
    $record->frameworkcode($frameworkcode);
618
    $record->biblionumber($biblionumber);
619
    $record->set_marc({ record => $marc });
620
    $record->store();
621
622
    if ($redirect eq 'items' || ($mode ne 'popup' && !$holding_id && $redirect ne 'view' && $redirect ne 'just_save')) {
623
        print $input->redirect("/cgi-bin/koha/catalogue/detail.pl?biblionumber=$biblionumber&searchid=$searchid");
624
        exit;
625
    } elsif ($holding_id && $redirect eq 'view') {
626
        print $input->redirect("/cgi-bin/koha/catalogue/detail.pl?biblionumber=$biblionumber&searchid=$searchid");
627
        exit;
628
    } elsif ($redirect eq 'just_save') {
629
        my $tab = $input->param('current_tab');
630
        print $input->redirect("/cgi-bin/koha/cataloguing/addholding.pl?biblionumber=$biblionumber&holding_id=$holding_id&framework=$frameworkcode&tab=$tab&searchid=$searchid");
631
    } else {
632
        $template->param(
633
            biblionumber => $biblionumber,
634
            holding_id   => $holding_id,
635
            done         => 1,
636
            popup        => $mode,
637
        );
638
        output_html_with_http_headers($input, $cookie, $template->output);
639
        exit;
640
    }
641
} elsif ($op eq 'delete') {
642
    if ($record->items()->count()) {
643
        $template->param(
644
            error_items_exist => 1
645
        );
646
    } elsif (!$record->delete()) {
647
        $template->param(
648
            error_delete_failed => 1
649
        );
650
    } else {
651
        print $input->redirect("/cgi-bin/koha/catalogue/detail.pl?biblionumber=$biblionumber&searchid=$searchid");
652
        exit;
653
    }
654
}
655
656
#----------------------------------------------------------------------------
657
# If we're in a duplication case, we have to clear the holding_id
658
# as we'll save the holding as a new one.
659
$template->param(
660
    holding_iddata => $holding_id,
661
    op             => $op,
662
);
663
if ($op eq 'duplicate') {
664
    $holding_id = '';
665
}
666
667
my $marc;
668
if ($changed_framework eq 'changed') {
669
    $marc = TransformHtmlToMarc($input, 1);
670
} else {
671
    my $metadata = $record->metadata();
672
    $marc = $metadata ? $metadata->record() : -1;
673
}
674
675
if (!$biblionumber) {
676
    # we must have a holding record if we don't have a biblionumber
677
    $biblionumber = $record->biblionumber;
678
}
679
my $biblio = Koha::Biblios->find($biblionumber);
680
build_tabs($template, $marc, C4::Context->dbh, '', $input);
681
$template->param(
682
    holding_id               => $holding_id,
683
    biblionumber             => $biblionumber,
684
    biblionumbertagfield     => $biblionumbertagfield,
685
    biblionumbertagsubfield  => $biblionumbertagsubfield,
686
    title                    => $biblio->title,
687
    author                   => $biblio->author
688
);
689
690
$template->param(
691
    frameworks => Koha::BiblioFrameworks->search({}, { order_by => ['frameworktext'] }),
692
    popup => $mode,
693
    frameworkcode => $frameworkcode,
694
    itemtype => $frameworkcode,
695
    borrowernumber => $loggedinuser,
696
    tab => scalar $input->param('tab')
697
);
698
$template->{'VARS'}->{'searchid'} = $searchid;
699
700
output_html_with_http_headers($input, $cookie, $template->output);
(-)a/cataloguing/additem.pl (+11 lines)
Lines 31-36 use C4::Circulation; Link Here
31
use C4::Koha;
31
use C4::Koha;
32
use C4::ClassSource;
32
use C4::ClassSource;
33
use Koha::DateUtils;
33
use Koha::DateUtils;
34
use Koha::Holdings;
34
use Koha::Items;
35
use Koha::Items;
35
use Koha::ItemTypes;
36
use Koha::ItemTypes;
36
use Koha::Libraries;
37
use Koha::Libraries;
Lines 209-214 sub generate_subfield_form { Link Here
209
        
210
        
210
                  #---- "true" authorised value
211
                  #---- "true" authorised value
211
            }
212
            }
213
            elsif ( $subfieldlib->{authorised_value} eq "holdings" ) {
214
                push @authorised_values, "" unless ( $subfieldlib->{mandatory} );
215
                my $holdings = Koha::Holdings->search({ biblionumber => $biblionumber, deleted_on => undef }, { order_by => ['holdingbranch'] })->unblessed;
216
                for my $holding ( @$holdings ) {
217
                    push @authorised_values, $holding->{holding_id};
218
                    $authorised_lib{$holding->{holding_id}} = $holding->{holding_id} . ' ' . $holding->{holdingbranch} . ' ' . $holding->{location} . ' ' . $holding->{ccode} . ' ' . $holding->{callnumber};
219
                }
220
                my $input = new CGI;
221
                $value = $input->param('holding_id') unless ($value);
222
            }
212
            else {
223
            else {
213
                  push @authorised_values, qq{};
224
                  push @authorised_values, qq{};
214
                  my $av = GetAuthorisedValues( $subfieldlib->{authorised_value} );
225
                  my $av = GetAuthorisedValues( $subfieldlib->{authorised_value} );
(-)a/cataloguing/value_builder/marc21_field_008_holdings.pl (+120 lines)
Line 0 Link Here
1
#!/usr/bin/perl
2
3
# Copyright 2000-2002 Katipo Communications
4
# Copyright 2017-2018 University of Helsinki (The National Library Of Finland)
5
#
6
# This file is part of Koha.
7
#
8
# Koha is free software; you can redistribute it and/or modify it
9
# under the terms of the GNU General Public License as published by
10
# the Free Software Foundation; either version 3 of the License, or
11
# (at your option) any later version.
12
#
13
# Koha is distributed in the hope that it will be useful, but
14
# WITHOUT ANY WARRANTY; without even the implied warranty of
15
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
# GNU General Public License for more details.
17
#
18
# You should have received a copy of the GNU General Public License
19
# along with Koha; if not, see <http://www.gnu.org/licenses>.
20
21
use Modern::Perl;
22
use C4::Auth;
23
use CGI qw ( -utf8 );
24
use C4::Context;
25
26
use C4::Search;
27
use C4::Output;
28
29
use XML::LibXML;
30
use Koha::Util::FrameworkPlugin qw|date_entered|;
31
32
my $builder = sub {
33
    my ( $params ) = @_;
34
35
    my $lang = C4::Context->preference('DefaultLanguageField008' );
36
    $lang = "eng" unless $lang;
37
    $lang = pack("A3", $lang);
38
39
    my $function_name = $params->{id};
40
    my $dateentered = date_entered();
41
    my $res           = "
42
<script type=\"text/javascript\">
43
//<![CDATA[
44
45
function Focus$function_name(event) {
46
    if ( document.getElementById(event.data.id).value ) {
47
    }
48
    else {
49
        document.getElementById(event.data.id).value='$dateentered' + '0u    0   4   uu${lang}0$dateentered';
50
    }
51
    return 1;
52
}
53
54
function Click$function_name(event) {
55
    defaultvalue=document.getElementById(event.data.id).value;
56
    //Retrieve full leader string and pass it to the 008 tag editor
57
    var leader_value = \$(\"input[id^='tag_000']\").val();
58
    var leader_parameter = \"\";
59
    if (leader_value){
60
        //Only add the parameter to the URL if there is a value to add
61
        leader_parameter = \"&leader=\"+leader_value;
62
    }
63
    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');
64
65
}
66
//]]>
67
</script>
68
";
69
70
    return $res;
71
};
72
73
my $launcher = sub {
74
    my ( $params ) = @_;
75
    my $input = $params->{cgi};
76
    my $index= $input->param('index');
77
    my $result= $input->param('result');
78
79
    my $lang = C4::Context->preference('DefaultLanguageField008' );
80
    $lang = "eng" unless $lang;
81
    $lang = pack("A3", $lang);
82
83
    my ($template, $loggedinuser, $cookie)
84
    = get_template_and_user({template_name => "cataloguing/value_builder/marc21_field_008_holdings.tt",
85
                 query => $input,
86
                 type => "intranet",
87
                 authnotrequired => 0,
88
                 flagsrequired => {editcatalogue => '*'},
89
                 debug => 1,
90
                 });
91
    my $dateentered = date_entered();
92
    $result = $dateentered + '0u    0   0   uu' + $lang + '0' + $dateentered unless $result;
93
    my @f;
94
    for(0,6..8,12..17,20..22,25,26) {
95
        my $len = 1;
96
        if ($_ == 0 || $_ == 26) {
97
            $len = 6;
98
        } elsif ($_ == 8) {
99
            $len = 4;
100
        } elsif ($_ == 17 || $_ == 22) {
101
            $len = 3;
102
        }
103
        warn ($_ . ': ' . $len);
104
        $f[$_]=substr($result,$_,$len);
105
    }
106
    $template->param(index => $index);
107
108
    $f[0]= $dateentered if !$f[0] || $f[0]=~/\s/;
109
    $template->param(f1 => $f[0]);
110
111
    for(6..8,12..17,20..22,25,26) {
112
        $template->param(
113
            "f$_" => $f[$_],
114
            "f$_".($f[$_] eq '|'? 'pipe': $f[$_]) => $f[$_],
115
        );
116
    }
117
    output_html_with_http_headers $input, $cookie, $template->output;
118
};
119
120
return { builder => $builder, launcher => $launcher };
(-)a/cataloguing/value_builder/marc21_leader_holdings.pl (+85 lines)
Line 0 Link Here
1
#!/usr/bin/perl
2
3
# Copyright 2000-2002 Katipo Communications
4
# Copyright 2017-2018 University of Helsinki (The National Library Of Finland)
5
#
6
# This file is part of Koha.
7
#
8
# Koha is free software; you can redistribute it and/or modify it
9
# under the terms of the GNU General Public License as published by
10
# the Free Software Foundation; either version 3 of the License, or
11
# (at your option) any later version.
12
#
13
# Koha is distributed in the hope that it will be useful, but
14
# WITHOUT ANY WARRANTY; without even the implied warranty of
15
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
# GNU General Public License for more details.
17
#
18
# You should have received a copy of the GNU General Public License
19
# along with Koha; if not, see <http://www.gnu.org/licenses>.
20
21
use Modern::Perl;
22
use CGI qw ( -utf8 );
23
24
use C4::Auth;
25
use C4::Context;
26
use C4::Output;
27
28
my $builder = sub {
29
    my ( $params ) = @_;
30
    my $function_name = $params->{id};
31
    my $res           = "
32
<script type=\"text/javascript\">
33
//<![CDATA[
34
35
function Focus$function_name(event) {
36
    if(!document.getElementById(event.data.id).value){
37
        document.getElementById(event.data.id).value = '     nu  a22     ui 4500';
38
    }
39
}
40
41
function Click$function_name(event) {
42
    defaultvalue=document.getElementById(event.data.id).value;
43
    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');
44
}
45
46
//]]>
47
</script>
48
";
49
50
    return $res;
51
};
52
53
my $launcher = sub {
54
    my ( $params ) = @_;
55
    my $input = $params->{cgi};
56
    my $index   = $input->param('index');
57
    my $result  = $input->param('result');
58
59
    my $dbh = C4::Context->dbh;
60
61
    my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
62
        {   template_name   => "cataloguing/value_builder/marc21_leader_holdings.tt",
63
            query           => $input,
64
            type            => "intranet",
65
            authnotrequired => 0,
66
            flagsrequired   => { editcatalogue => '*' },
67
            debug           => 1,
68
        }
69
    );
70
    $result = "     nu  a22     ui 4500" unless $result;
71
    my $f5    = substr( $result, 5,  1 );
72
    my $f6    = substr( $result, 6,  1 );
73
    my $f17   = substr( $result, 17, 1 );
74
    my $f18   = substr( $result, 18, 1 );
75
    $template->param(
76
        index     => $index,
77
        "f5$f5"   => 1,
78
        "f6$f6"   => 1,
79
        "f17$f17" => 1,
80
        "f18$f18" => 1,
81
    );
82
    output_html_with_http_headers $input, $cookie, $template->output;
83
};
84
85
return { builder => $builder, launcher => $launcher };
(-)a/installer/data/mysql/atomicupdate/bug_20447-add_holdings_tables.perl (+620 lines)
Line 0 Link Here
1
$DBversion = 'XXX'; # will be replaced by the RM
2
if( CheckVersion( $DBversion ) ) {
3
    if( !TableExists( 'holdings' ) ) {
4
        $dbh->do(q{
5
            CREATE TABLE `holdings` ( -- table that stores summary holdings information
6
                `holding_id` int(11) NOT NULL auto_increment, -- unique identifier assigned to each holdings record
7
                `biblionumber` int(11) NOT NULL default 0, -- foreign key from biblio table used to link this record to the right bib record
8
                `frameworkcode` varchar(4) NOT NULL default '', -- foreign key from the biblio_framework table to identify which framework was used in cataloging this record
9
                `holdingbranch` varchar(10) default NULL, -- foreign key from the branches table for the library that owns this record (MARC21 852$a)
10
                `location` varchar(80) default NULL, -- authorized value for the shelving location for this record (MARC21 852$b)
11
                `ccode` varchar(80) default NULL, -- authorized value for the collection code associated with this item (MARC21 852$g)
12
                `callnumber` varchar(255) default NULL, -- call number (852$h+$i in MARC21)
13
                `suppress` tinyint(1) default NULL, -- Boolean indicating whether the record is suppressed in OPAC
14
                `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, -- date and time this record was last touched
15
                `datecreated` DATE NOT NULL, -- the date this record was added to Koha
16
                `deleted_on` DATETIME DEFAULT NULL, -- the date this record was deleted
17
                PRIMARY KEY  (`holding_id`),
18
                KEY `hldnoidx` (`holding_id`),
19
                KEY `hldbibnoidx` (`biblionumber`),
20
                CONSTRAINT `holdings_ibfk_1` FOREIGN KEY (`biblionumber`) REFERENCES `biblio` (`biblionumber`) ON DELETE CASCADE ON UPDATE CASCADE,
21
                CONSTRAINT `holdings_ibfk_2` FOREIGN KEY (`holdingbranch`) REFERENCES `branches` (`branchcode`) ON UPDATE CASCADE
22
            ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
23
        });
24
    }
25
    if( !TableExists( 'holdings_metadata' ) ) {
26
        $dbh->do(q{
27
            CREATE TABLE `holdings_metadata` (
28
                `id` INT(11) NOT NULL AUTO_INCREMENT,
29
                `holding_id` INT(11) NOT NULL,
30
                `format` VARCHAR(16) NOT NULL,
31
                `schema` VARCHAR(16) NOT NULL,
32
                `metadata` LONGTEXT NOT NULL,
33
                `deleted_on` DATETIME DEFAULT NULL, -- the date this record was deleted
34
                PRIMARY KEY(id),
35
                UNIQUE KEY `holdings_metadata_uniq_key` (`holding_id`,`format`,`schema`),
36
                KEY `hldnoidx` (`holding_id`),
37
                CONSTRAINT `holdings_metadata_fk_1` FOREIGN KEY (`holding_id`) REFERENCES `holdings` (`holding_id`) ON DELETE CASCADE ON UPDATE CASCADE
38
            ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
39
        });
40
    }
41
42
    if( !column_exists( 'items', 'holding_id' ) ) {
43
        $dbh->do(q{
44
            ALTER TABLE `items` ADD COLUMN `holding_id` int(11) default NULL;
45
        });
46
        $dbh->do(q{
47
            ALTER TABLE `items` ADD CONSTRAINT `items_ibfk_5` FOREIGN KEY (`holding_id`) REFERENCES `holdings` (`holding_id`) ON DELETE CASCADE ON UPDATE CASCADE;
48
        });
49
        $dbh->do(q{
50
            ALTER TABLE `items` ADD KEY `hldid_idx` (`holding_id`);
51
        });
52
53
        $dbh->do(q{
54
            ALTER TABLE `deleteditems` ADD COLUMN `holding_id` int(11) default NULL;
55
        });
56
    }
57
58
    $dbh->do(q{
59
        INSERT IGNORE INTO authorised_value_categories( category_name ) VALUES ('holdings');
60
    });
61
62
    $dbh->do(q{
63
        INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES 
64
            ('SummaryHoldings', '0', NULL, 'If ON, enables support for holdings records.', 'YesNo');
65
    });
66
67
    $dbh->do(q{
68
        INSERT IGNORE INTO `biblio_framework` VALUES ('HLD', 'Default holdings framework');
69
    });
70
    $dbh->do(q{
71
        INSERT IGNORE INTO `marc_tag_structure` (`tagfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `authorised_value`, `frameworkcode`) VALUES
72
                ('999', 'SYSTEM CONTROL NUMBERS (KOHA)', 'SYSTEM CONTROL NUMBERS (KOHA)', 1, 0, '', 'HLD');
73
    });
74
75
    $dbh->do(q{
76
        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
77
                ('999', 'c', 'Koha biblionumber', 'Koha biblionumber', 0, 0, 'biblio.biblionumber', -1, NULL, NULL, '', NULL, -5, 'HLD', '', '', NULL),
78
                ('999', 'e', 'Koha holding_id', 'Koha holding_id', 0, 0, 'holdings.holding_id', -1, NULL, NULL, '', NULL, -5, 'HLD', '', '', NULL);
79
    });
80
81
82
    $dbh->do(q{
83
        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
84
                ('942', 'n', 'Suppress in OPAC', 'Suppress in OPAC', 0, 0, 'holdings.suppress', 9, '', '', '', 0, 0, 'HLD', '', '', NULL);
85
    });
86
87
    $dbh->do(q{
88
        INSERT IGNORE INTO `marc_tag_structure` (`tagfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `authorised_value`, `frameworkcode`) VALUES
89
                ('000', 'LEADER', 'LEADER', 0, 1, '', 'HLD'),
90
                ('001', 'CONTROL NUMBER', 'CONTROL NUMBER', 0, 0, '', 'HLD'),
91
                ('003', 'CONTROL NUMBER IDENTIFIER', 'CONTROL NUMBER IDENTIFIER', 0, 1, '', 'HLD'),
92
                ('005', 'DATE AND TIME OF LATEST TRANSACTION', 'DATE AND TIME OF LATEST TRANSACTION', 0, 1, '', 'HLD'),
93
                ('006', 'FIXED-LENGTH DATA ELEMENTS--ADDITIONAL MATERIAL CHARACTERISTICS', 'FIXED-LENGTH DATA ELEMENTS--ADDITIONAL MATERIAL CHARACTERISTICS', 1, 0, '', 'HLD'),
94
                ('007', 'PHYSICAL DESCRIPTION FIXED FIELD--GENERAL INFORMATION', 'PHYSICAL DESCRIPTION FIXED FIELD--GENERAL INFORMATION', 1, 0, '', 'HLD'),
95
                ('008', 'FIXED-LENGTH DATA ELEMENTS--GENERAL INFORMATION', 'FIXED-LENGTH DATA ELEMENTS--GENERAL INFORMATION', 0, 1, '', 'HLD');
96
    });
97
98
    $dbh->do(q{
99
        INSERT IGNORE INTO `marc_tag_structure` (`tagfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `authorised_value`, `frameworkcode`) VALUES
100
                ('010', 'LIBRARY OF CONGRESS CONTROL NUMBER', 'LIBRARY OF CONGRESS CONTROL NUMBER', 0, 0, '', 'HLD'),
101
                ('014', 'LINKAGE NUMBER', 'LINKAGE NUMBER', 1, 0, '', 'HLD'),
102
                ('016', 'NATIONAL BIBLIOGRAPHIC AGENCY CONTROL NUMBER', 'NATIONAL BIBLIOGRAPHIC AGENCY CONTROL NUMBER', 1, 0, '', 'HLD'),
103
                ('017', 'COPYRIGHT OR LEGAL DEPOSIT NUMBER', 'COPYRIGHT OR LEGAL DEPOSIT NUMBER', 1, 0, '', 'HLD'),
104
                ('020', 'INTERNATIONAL STANDARD BOOK NUMBER', 'INTERNATIONAL STANDARD BOOK NUMBER', 1, 0, NULL, 'HLD'),
105
                ('022', 'INTERNATIONAL STANDARD SERIAL NUMBER', 'INTERNATIONAL STANDARD SERIAL NUMBER', 1, 0, NULL, 'HLD'),
106
                ('024', 'OTHER STANDARD IDENTIFIER', 'OTHER STANDARD IDENTIFIER', 1, 0, NULL, 'HLD'),
107
                ('027', 'STANDARD TECHNICAL REPORT NUMBER', 'STANDARD TECHNICAL REPORT NUMBER', 1, 0, '', 'HLD'),
108
                ('030', 'CODEN DESIGNATION', 'CODEN DESIGNATION', 1, 0, '', 'HLD'),
109
                ('035', 'SYSTEM CONTROL NUMBER', 'SYSTEM CONTROL NUMBER', 1, 0, NULL, 'HLD'),
110
                ('040', 'CATALOGING SOURCE', 'CATALOGING SOURCE', 0, 1, NULL, 'HLD'),
111
                ('066', 'CHARACTER SETS PRESENT', 'CHARACTER SETS PRESENT', 0, 0, NULL, 'HLD'),
112
                ('337', 'MEDIA TYPE', 'MEDIA TYPE', 1, 0, NULL, 'HLD'),
113
                ('338', 'CARRIER TYPE', 'CARRIER TYPE', 1, 0, NULL, 'HLD'),
114
                ('347', 'DIGITAL FILE CHARACTERISTICS', 'DIGITAL FILE CHARACTERISTICS', 1, 0, NULL, 'HLD'),
115
                ('506', 'RESTRICTIONS ON ACCESS NOTE', 'RESTRICTIONS ON ACCESS NOTE', 1, 0, NULL, 'HLD'),
116
                ('538', 'SYSTEM DETAILS NOTE', 'SYSTEM DETAILS NOTE', 1, 0, NULL, 'HLD'),
117
                ('541', 'IMMEDIATE SOURCE OF ACQUISITION NOTE', 'IMMEDIATE SOURCE OF ACQUISITION NOTE', 1, 0, NULL, 'HLD'),
118
                ('561', 'OWNERSHIP AND CUSTODIAL HISTORY', 'OWNERSHIP AND CUSTODIAL HISTORY', 1, 0, NULL, 'HLD'),
119
                ('562', 'COPY AND VERSION IDENTIFICATION NOTE', 'COPY AND VERSION IDENTIFICATION NOTE', 1, 0, NULL, 'HLD'),
120
                ('563', 'BINDING INFORMATION', 'BINDING INFORMATION', 1, 0, NULL, 'HLD'),
121
                ('583', 'ACTION NOTE', 'ACTION NOTE', 1, 0, NULL, 'HLD'),
122
                ('842', 'TEXTUAL PHYSICAL FORM DESIGNATOR', 'TEXTUAL PHYSICAL FORM DESIGNATOR', 0, 0, NULL, 'HLD'),
123
                ('843', 'REPRODUCTION NOTE', 'REPRODUCTION NOTE', 1, 0, NULL, 'HLD'),
124
                ('844', 'NAME OF UNIT', 'NAME OF UNIT', 0, 0, NULL, 'HLD'),
125
                ('845', 'TERMS GOVERNING USE AND REPRODUCTION NOTE', 'TERMS GOVERNING USE AND REPRODUCTION NOTE', 1, 0, NULL, 'HLD'),
126
                ('850', 'HOLDING INSTITUTION', 'HOLDING INSTITUTION', 1, 0, NULL, 'HLD'),
127
                ('852', 'LOCATION', 'LOCATION', 1, 0, NULL, 'HLD'),
128
                ('853', 'CAPTIONS AND PATTERN--BASIC BIBLIOGRAPHIC UNIT', 'CAPTIONS AND PATTERN--BASIC BIBLIOGRAPHIC UNIT', 1, 0, NULL, 'HLD'),
129
                ('854', 'CAPTIONS AND PATTERN--SUPPLEMENTARY MATERIAL', 'CAPTIONS AND PATTERN--SUPPLEMENTARY MATERIAL', 1, 0, NULL, 'HLD'),
130
                ('855', 'CAPTIONS AND PATTERN--INDEXES', 'CAPTIONS AND PATTERN--INDEXES', 1, 0, NULL, 'HLD'),
131
                ('856', 'ELECTRONIC LOCATION AND ACCESS', 'ELECTRONIC LOCATION AND ACCESS', 1, 0, NULL, 'HLD'),
132
                ('863', 'ENUMERATION AND CHRONOLOGY--BASIC BIBLIOGRAPHIC UNIT', 'ENUMERATION AND CHRONOLOGY--BASIC BIBLIOGRAPHIC UNIT', 1, 0, NULL, 'HLD'),
133
                ('864', 'ENUMERATION AND CHRONOLOGY--SUPPLEMENTARY MATERIAL', 'ENUMERATION AND CHRONOLOGY--SUPPLEMENTARY MATERIAL', 1, 0, NULL, 'HLD'),
134
                ('865', 'ENUMERATION AND CHRONOLOGY--INDEXES', 'ENUMERATION AND CHRONOLOGY--INDEXES', 1, 0, NULL, 'HLD'),
135
                ('866', 'TEXTUAL HOLDINGS--BASIC BIBLIOGRAPHIC UNIT', 'TEXTUAL HOLDINGS--BASIC BIBLIOGRAPHIC UNIT', 1, 0, NULL, 'HLD'),
136
                ('867', 'TEXTUAL HOLDINGS--SUPPLEMENTARY MATERIAL', 'TEXTUAL HOLDINGS--SUPPLEMENTARY MATERIAL', 1, 0, NULL, 'HLD'),
137
                ('868', 'TEXTUAL HOLDINGS--INDEXES', 'TEXTUAL HOLDINGS--INDEXES', 1, 0, NULL, 'HLD'),
138
                ('876', 'ITEM INFORMATION--BASIC BIBLIOGRAPHIC UNIT', 'ITEM INFORMATION--BASIC BIBLIOGRAPHIC UNIT', 1, 0, NULL, 'HLD'),
139
                ('877', 'ITEM INFORMATION--SUPPLEMENTARY MATERIAL', 'ITEM INFORMATION--SUPPLEMENTARY MATERIAL', 1, 0, NULL, 'HLD'),
140
                ('878', 'ITEM INFORMATION--INDEXES', 'ITEM INFORMATION--INDEXES', 1, 0, NULL, 'HLD');
141
    });
142
143
    $dbh->do(q{
144
        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
145
                ('000', '@', 'fixed length control field', 'fixed length control field', 0, 1, '', 0, '', '', 'marc21_leader_holdings.pl', 0, 0, 'HLD', '', '', NULL),
146
                ('001', '@', 'control field', 'control field', 0, 0, '', 0, '', '', '', 0, 0, 'HLD', '', '', NULL),
147
                ('003', '@', 'control field', 'control field', 0, 1, '', 0, '', '', 'marc21_orgcode.pl', 0, 0, 'HLD', '', '', NULL),
148
                ('005', '@', 'control field', 'control field', 0, 1, '', 0, '', '', 'marc21_field_005.pl', 0, 0, 'HLD', '', '', NULL),
149
                ('006', '@', 'fixed length control field', 'fixed length control field', 0, 0, '', 0, '', '', 'marc21_field_006.pl', 0, -1, 'HLD', '', '', NULL),
150
                ('007', '@', 'fixed length control field', 'fixed length control field', 0, 0, '', 0, '', '', 'marc21_field_007.pl', 0, 0, 'HLD', '', '', NULL),
151
                ('008', '@', 'fixed length control field', 'fixed length control field', 0, 1, '', 0, '', '', 'marc21_field_008_holdings.pl', 0, 0, 'HLD', '', '', NULL),
152
                ('010', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 0, '', '', NULL, 0, -6, 'HLD', '', '', NULL),
153
                ('010', 'a', 'LC control number', 'LC control number', 0, 0, 'biblioitems.lccn', 0, '', '', '', 0, 0, 'HLD', '', '', NULL),
154
                ('010', 'b', 'NUCMC control number', 'NUCMC control number', 1, 0, '', 0, '', '', '', 0, -1, '', '', '', NULL),
155
                ('010', 'z', 'Canceled/invalid LC control number', 'Canceled/invalid LC control number', 1, 0, '', 0, '', '', '', 0, -1, 'HLD', '', '', NULL),
156
                ('014', '6', 'Linkage', 'Linkage', 0, 0, '', 0, '', '', '', 0, -6, '', '', '', NULL),
157
                ('014', 'a', 'Linkage number', 'Linkage number', 0, 0, '', 0, '', '', '', 0, 0, 'HLD', '', '', NULL),
158
                ('014', 'b', 'Source of number', 'Source of number', 0, 0, '', 0, '', '', '', 0, -1, 'HLD', '', '', NULL),
159
                ('014', 'z', 'Canceled/invalid linkage number', 'Canceled/invalid linkage number', 1, 0, '', 0, '', '', '', 0, -1, 'HLD', '', '', NULL),
160
                ('016', '2', 'Source', 'Source', 0, 0, '', 0, '', '', '', 0, 0, '', '', '', NULL),
161
                ('016', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 0, '', '', '', 0, -6, 'HLD', '', '', NULL),
162
                ('016', 'a', 'Record control number', 'Record control number', 0, 0, '', 0, '', '', '', 0, 0, 'HLD', '', '', NULL),
163
                ('016', 'z', 'Canceled/invalid control number', 'Canceled/invalid control number', 1, 0, '', 0, '', '', '', 0, -1, 'HLD', '', '', NULL),
164
                ('017', '2', 'Source', 'Source', 0, 0, '', 0, '', '', '', 0, -6, '', '', '', NULL),
165
                ('017', '6', 'Linkage', 'Linkage', 0, 0, '', 0, '', '', '', 0, -6, '', '', '', NULL),
166
                ('017', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 0, '', '', '', 0, -6, 'HLD', '', '', NULL),
167
                ('017', 'a', 'Copyright or legal deposit number', 'Copyright or legal deposit number', 1, 0, '', 0, '', '', '', 0, -6, 'HLD', '', '', NULL),
168
                ('017', 'b', 'Assigning agency', 'Assigning agency', 0, 0, '', 0, '', '', '', 0, -6, 'HLD', '', '', NULL),
169
                ('017', 'd', 'Date', 'Date', 0, 0, '', 0, '', '', NULL, 0, -6, 'HLD', '', '', NULL),
170
                ('017', 'i', 'Display text', 'Display text', 0, 0, '', 0, '', '', '', 0, -6, 'HLD', '', '', NULL),
171
                ('017', 'z', 'Canceled/invalid copyright or legal deposit number', 'Canceled/invalid copyright or legal deposit number', 1, 0, '', 0, '', '', '', NULL, -6, 'HLD', '', '', NULL),
172
                ('020', '6', 'Linkage', 'Linkage', 0, 0, '', 0, '', '', '', 0, -6, 'HLD', '', '', NULL),
173
                ('020', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 0, '', '', '', 0, -6, 'HLD', '', '', NULL),
174
                ('020', 'a', 'International Standard Book Number', 'International Standard Book Number', 0, 0, 'biblioitems.isbn', 0, '', '', '', 0, 0, 'HLD', '', '', NULL),
175
                ('020', 'c', 'Terms of availability', 'Terms of availability', 0, 0, '', 0, '', '', '', 0, 0, 'HLD', '', '', NULL),
176
                ('020', 'q', 'Qualifying information', 'Qualifying information', 1, 0, '', 0, '', '', '', 0, 0, 'HLD', '', '', NULL),
177
                ('020', 'z', 'Canceled/invalid ISBN', 'Canceled/invalid ISBN', 1, 0, '', 0, '', '', '', 0, -1, 'HLD', '', '', NULL),
178
                ('022', '2', 'Source', 'Source', 0, 0, '', 0, '', '', '', 0, 0, 'HLD', '', '', NULL),
179
                ('022', '6', 'Linkage', 'Linkage', 0, 0, '', 0, '', '', '', 0, -6, 'HLD', '', '', NULL),
180
                ('022', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 0, '', '', '', 0, -6, 'HLD', '', '', NULL),
181
                ('022', 'a', 'International Standard Serial Number', 'International Standard Serial Number', 0, 0, 'biblioitems.issn', 0, '', '', '', 0, 0, 'HLD', '', '', NULL),
182
                ('022', 'l', 'ISSN-L', 'ISSN-L', 0, 0, '', 0, '', '', '', NULL, -6, 'HLD', '', '', NULL),
183
                ('022', 'm', 'Canceled ISSN-L', 'Canceled ISSN-L', 1, 0, '', 0, '', '', '', NULL, -6, 'HLD', '', '', NULL),
184
                ('022', 'y', 'Incorrect ISSN', 'Incorrect ISSN', 1, 0, '', 0, '', '', '', 0, -1, 'HLD', '', '', NULL),
185
                ('022', 'z', 'Canceled ISSN', 'Canceled ISSN', 1, 0, '', 0, '', '', '', 0, -1, 'HLD', '', '', NULL),
186
                ('024', '2', 'Source of number or code', 'Source of number or code', 0, 0, '', 0, '', '', '', 0, 0, 'HLD', '', '', NULL),
187
                ('024', '6', 'Linkage', 'Linkage', 0, 0, '', 0, '', '', '', 0, -6, 'HLD', '', '', NULL),
188
                ('024', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 0, '', '', '', 0, -6, 'HLD', '', '', NULL),
189
                ('024', 'a', 'Standard number or code', 'Standard number or code', 0, 0, '', 0, '', '', '', 0, 0, 'HLD', '', '', NULL),
190
                ('024', 'b', 'Additional codes following the standard number [OBSOLETE]', 'Additional codes following the standard number [OBSOLETE]', 0, 0, '', 0, '', '', '', 0, -6, 'HLD', '', '', NULL),
191
                ('024', 'c', 'Terms of availability', 'Terms of availability', 0, 0, '', 0, '', '', '', 0, 0, 'HLD', '', '', NULL),
192
                ('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),
193
                ('024', 'q', 'Qualifying information', 'Qualifying information', 1, 0, '', 0, '', '', '', 0, 0, 'HLD', '', '', NULL),
194
                ('024', 'z', 'Canceled/invalid standard number or code', 'Canceled/invalid standard number or code', 1, 0, '', 0, '', '', '', 0, -1, 'HLD', '', '', NULL),
195
                ('027', '6', 'Linkage', 'Linkage', 0, 0, '', 0, '', '', '', 0, -6, 'HLD', '', '', NULL),
196
                ('027', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 0, '', '', '', 0, -6, 'HLD', '', '', NULL),
197
                ('027', 'a', 'Standard technical report number', 'Standard technical report number', 0, 0, '', 0, '', '', '', 0, -1, 'HLD', '', '', NULL),
198
                ('027', 'q', 'Qualifying information', 'Qualifying information', 1, 0, '', 0, '', '', '', 0, 0, 'HLD', '', '', NULL),
199
                ('027', 'z', 'Canceled/invalid number', 'Canceled/invalid number', 1, 0, '', 0, '', '', '', 0, -1, 'HLD', '', '', NULL),
200
                ('030', '6', 'Linkage', 'Linkage', 0, 0, '', 0, '', '', '', 0, -6, 'HLD', '', '', NULL),
201
                ('030', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 0, '', '', '', 0, -6, 'HLD', '', '', NULL),
202
                ('030', 'a', 'CODEN', 'CODEN', 0, 0, '', 0, '', '', '', 0, -6, 'HLD', '', '', NULL),
203
                ('030', 'z', 'Canceled/invalid CODEN', 'Canceled/invalid CODEN', 1, 0, '', 0, '', '', '', 0, -6, 'HLD', '', '', NULL),
204
                ('035', '6', 'Linkage', 'Linkage', 0, 0, '', 0, '', '', '', 0, -6, 'HLD', '', '', NULL),
205
                ('035', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 0, '', '', '', 0, -6, 'HLD', '', '', NULL),
206
                ('035', 'a', 'System control number', 'System control number', 0, 0, '', 0, '', '', '', 0, 0, 'HLD', '', '', NULL),
207
                ('035', 'z', 'Canceled/invalid control number', 'Canceled/invalid control number', 1, 0, '', 0, '', '', '', 0, -1, 'HLD', '', '', NULL),
208
                ('040', '6', 'Linkage', 'Linkage', 0, 0, '', 0, '', '', '', 0, -6, 'HLD', '', '', NULL),
209
                ('040', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 0, '', '', '', 0, -6, 'HLD', '', '', NULL),
210
                ('040', 'a', 'Original cataloging agency', 'Original cataloging agency', 0, 0, '', 0, '', '', '', 0, 0, 'HLD', '', '', NULL),
211
                ('040', 'b', 'Language of cataloging', 'Language of cataloging', 0, 0, '', 0, '', '', '', 0, 0, 'HLD', '', '', NULL),
212
                ('040', 'c', 'Transcribing agency', 'Transcribing agency', 0, 1, '', 0, '', '', '', 0, 0, 'HLD', '', '', NULL),
213
                ('040', 'd', 'Modifying agency', 'Modifying agency', 1, 0, '', 0, '', '', '', 0, 0, 'HLD', '', '', NULL),
214
                ('066', 'a', 'Primary G0 character set', 'Primary G0 character set', 0, 0, NULL, 0, NULL, NULL, '', NULL, -6, 'HLD', '', '', NULL),
215
                ('066', 'b', 'Primary G1 character set', 'Primary G1 character set', 0, 0, NULL, 0, NULL, NULL, '', NULL, -6, 'HLD', '', '', NULL),
216
                ('066', 'c', 'Alternate G0 or G1 character set', 'Alternate G0 or G1 character set', 1, 0, NULL, 0, NULL, NULL, '', NULL, -6, 'HLD', '', '', NULL),
217
                ('337', '0', 'Authority record control number or standard number', 'Authority record control number or standard number', 1, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL),
218
                ('337', '1', 'Real World Object URI', 'Real World Object URI', 1, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL),
219
                ('337', '2', 'Source', 'Source', 0, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL),
220
                ('337', '3', 'Materials specified', 'Materials specified', 0, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL),
221
                ('337', '6', 'Linkage', 'Linkage', 0, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL),
222
                ('337', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL),
223
                ('337', 'a', 'Media type term', 'Media type term', 1, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL),
224
                ('337', 'b', 'Media type code', 'Media type code', 1, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL),
225
                ('338', '0', 'Authority record control number or standard number', 'Authority record control number or standard number', 1, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL),
226
                ('338', '1', 'Real World Object URI', 'Real World Object URI', 1, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL),
227
                ('338', '2', 'Source', 'Source', 0, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL),
228
                ('338', '3', 'Materials specified', 'Materials specified', 0, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL),
229
                ('338', '6', 'Linkage', 'Linkage', 0, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL),
230
                ('338', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL),
231
                ('338', 'a', 'Carrier type term', 'Carrier type term', 1, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL),
232
                ('338', 'b', 'Carrier type code', 'Carrier type code', 1, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL),
233
                ('347', 'a', 'File type', 'File type', 1, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL),
234
                ('347', '0', 'Authority record control number or standard number', 'Authority record control number or standard number', 1, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL),
235
                ('347', '1', 'Real World Object URI', 'Real World Object URI', 1, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL),
236
                ('347', '2', 'Source', 'Source', 0, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL),
237
                ('347', '3', 'Materials specified', 'Materials specified', 0, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL),
238
                ('347', '6', 'Linkage', 'Linkage', 0, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL),
239
                ('347', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL),
240
                ('347', 'b', 'Encoding format', 'Encoding format', 1, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL),
241
                ('347', 'c', 'File size', 'File size', 1, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL),
242
                ('347', 'd', 'Resolution', 'Resolution', 1, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL),
243
                ('347', 'e', 'Regional encoding', 'Regional encoding', 1, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL),
244
                ('347', 'f', 'Encoded bitrate', 'Encoded bitrate', 1, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL),
245
                ('506', '2', 'Source of term', 'Source of term', 0, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL),
246
                ('506', '3', 'Materials specified', 'Materials specified', 0, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL),
247
                ('506', '5', 'Institution to which field applies', 'Institution to which field applies', 0, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL),
248
                ('506', '6', 'Linkage', 'Linkage', 0, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL),
249
                ('506', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL),
250
                ('506', 'a', 'Terms governing access', 'Terms governing access', 0, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL),
251
                ('506', 'b', 'Jurisdiction', 'Jurisdiction', 1, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL),
252
                ('506', 'c', 'Physical access provisions', 'Physical access provisions', 1, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL),
253
                ('506', 'd', 'Authorized users', 'Authorized users', 1, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL),
254
                ('506', 'e', 'Authorization', 'Authorization', 1, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL),
255
                ('506', 'f', 'Standardized terminology for access restriction', 'Standardized terminology for access restriction', 1, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL),
256
                ('506', 'u', 'Uniform Resource Identifier', 'Uniform Resource Identifier', 1, 0, '', 5, '', '', '', 1, -6, 'HLD', '', '', NULL),
257
                ('538', '3', 'Materials specified', 'Materials specified', 0, 0, NULL, 5, NULL, NULL, '', NULL, -6, 'HLD', '', '', NULL),
258
                ('538', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL),
259
                ('538', '6', 'Linkage', 'Linkage', 0, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL),
260
                ('538', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL),
261
                ('538', 'a', 'System details note', 'System details note', 0, 0, '', 5, '', '', '', NULL, -1, 'HLD', '', '', NULL),
262
                ('538', 'i', 'Display text', 'Display text', 0, 0, '', 5, '', '', '', NULL, -1, 'HLD', '', '', NULL),
263
                ('538', 'u', 'Uniform Resource Identifier', 'Uniform Resource Identifier', 1, 0, '', 5, '', '', '', 1, -1, 'HLD', '', '', NULL),
264
                ('541', '3', 'Materials specified', 'Materials specified', 0, 0, NULL, 5, NULL, NULL, '', NULL, -6, 'HLD', '', '', NULL),
265
                ('541', '5', 'Institution to which field applies', 'Institution to which field applies', 0, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL),
266
                ('541', '6', 'Linkage', 'Linkage', 0, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL),
267
                ('541', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL),
268
                ('541', 'a', 'Source of acquisition', 'Source of acquisition', 0, 0, '', 5, '', '', '', NULL, 1, 'HLD', '', '', NULL),
269
                ('541', 'b', 'Address', 'Address', 0, 0, '', 5, '', '', '', NULL, 1, 'HLD', '', '', NULL),
270
                ('541', 'c', 'Method of acquisition', 'Method of acquisition', 0, 0, '', 5, '', '', '', NULL, 1, 'HLD', '', '', NULL),
271
                ('541', 'd', 'Date of acquisition', 'Date of acquisition', 0, 0, '', 5, '', '', '', NULL, 1, 'HLD', '', '', NULL),
272
                ('541', 'e', 'Accession number', 'Accession number', 0, 0, '', 5, '', '', '', NULL, 1, 'HLD', '', '', NULL),
273
                ('541', 'f', 'Owner', 'Owner', 0, 0, '', 5, '', '', '', NULL, 1, 'HLD', '', '', NULL),
274
                ('541', 'h', 'Purchase price', 'Purchase price', 0, 0, '', 5, '', '', '', NULL, 1, 'HLD', '', '', NULL),
275
                ('541', 'n', 'Extent', 'Extent', 1, 0, '', 5, '', '', '', NULL, 1, 'HLD', '', '', NULL),
276
                ('541', 'o', 'Type of unit', 'Type of unit', 1, 0, '', 5, '', '', '', NULL, 1, 'HLD', '', '', NULL),
277
                ('561', '3', 'Materials specified', 'Materials specified', 0, 0, NULL, 5, NULL, NULL, '', NULL, -6, 'HLD', '', '', NULL),
278
                ('561', '5', 'Institution to which field applies', 'Institution to which field applies', 0, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL),
279
                ('561', '6', 'Linkage', 'Linkage', 0, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL),
280
                ('561', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL),
281
                ('561', 'a', 'History', 'History', 0, 0, '', 5, '', '', '', NULL, 6, 'HLD', '', '', NULL),
282
                ('561', 'b', 'Time of collation [OBSOLETE]', 'Time of collation [OBSOLETE]', 0, 0, '', 5, '', '', '', NULL, 6, 'HLD', '', '', NULL),
283
                ('561', 'u', 'Uniform Resource Identifier', 'Uniform Resource Identifier', 1, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL),
284
                ('562', '3', 'Materials specified', 'Materials specified', 0, 0, NULL, 5, NULL, NULL, '', NULL, -6, 'HLD', '', '', NULL),
285
                ('562', '5', 'Institution to which field applies', 'Institution to which field applies', 0, 0, NULL, -1, NULL, NULL, '', NULL, -6, 'HLD', '', '', NULL),
286
                ('562', '6', 'Linkage', 'Linkage', 0, 0, NULL, 5, NULL, NULL, '', NULL, -6, 'HLD', '', '', NULL),
287
                ('562', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, NULL, 5, NULL, NULL, '', NULL, -6, 'HLD', '', '', NULL),
288
                ('562', 'a', 'Identifying markings', 'Identifying markings', 1, 0, NULL, 5, NULL, NULL, '', NULL, -1, 'HLD', '', '', NULL),
289
                ('562', 'b', 'Copy identification', 'Copy identification', 1, 0, NULL, 5, NULL, NULL, '', NULL, -1, 'HLD', '', '', NULL),
290
                ('562', 'c', 'Version identification', 'Version identification', 1, 0, NULL, 5, NULL, NULL, '', NULL, -1, 'HLD', '', '', NULL),
291
                ('562', 'd', 'Presentation format', 'Presentation format', 1, 0, NULL, 5, NULL, NULL, '', NULL, -1, 'HLD', '', '', NULL),
292
                ('562', 'e', 'Number of copies', 'Number of copies', 1, 0, NULL, 5, NULL, NULL, '', NULL, -1, 'HLD', '', '', NULL),
293
                ('563', '3', 'Materials specified', 'Materials specified', 0, 0, NULL, 5, NULL, NULL, '', NULL, -6, 'HLD', '', '', NULL),
294
                ('563', '5', 'Institution to which field applies', 'Institution to which field applies', 0, 0, NULL, -1, NULL, NULL, '', NULL, -6, 'HLD', '', '', NULL),
295
                ('563', '6', 'Linkage', 'Linkage', 0, 0, NULL, 5, NULL, NULL, '', NULL, -6, 'HLD', '', '', NULL),
296
                ('563', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, NULL, 5, NULL, NULL, '', NULL, -6, 'HLD', '', '', NULL),
297
                ('563', 'a', 'Binding note', 'Binding note', 0, 0, NULL, 5, NULL, NULL, '', NULL, -1, 'HLD', '', '', NULL),
298
                ('563', 'u', 'Uniform Resource Identifier', 'Uniform Resource Identifier', 1, 0, NULL, 5, NULL, NULL, '', 1, -1, 'HLD', '', '', NULL),
299
                ('583', '2', 'Source of term', 'Source of term', 0, 0, NULL, 5, NULL, NULL, '', NULL, -6, 'HLD', '', '', NULL),
300
                ('583', '3', 'Materials specified', 'Materials specified', 0, 0, NULL, 5, NULL, NULL, '', NULL, -6, 'HLD', '', '', NULL),
301
                ('583', '5', 'Institution to which field applies', 'Institution to which field applies', 0, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL),
302
                ('583', '6', 'Linkage', 'Linkage', 0, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL),
303
                ('583', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL),
304
                ('583', 'a', 'Action', 'Action', 0, 0, '', 5, '', '', '', NULL, -1, 'HLD', '', '', NULL),
305
                ('583', 'b', 'Action identification', 'Action identification', 1, 0, '', 5, '', '', '', NULL, -1, 'HLD', '', '', NULL),
306
                ('583', 'c', 'Time/date of action', 'Time/date of action', 1, 0, '', 5, '', '', '', NULL, -1, 'HLD', '', '', NULL),
307
                ('583', 'd', 'Action interval', 'Action interval', 1, 0, '', 5, '', '', '', NULL, -1, 'HLD', '', '', NULL),
308
                ('583', 'e', 'Contingency for action', 'Contingency for action', 1, 0, '', 5, '', '', '', NULL, -1, 'HLD', '', '', NULL),
309
                ('583', 'f', 'Authorization', 'Authorization', 1, 0, '', 5, '', '', '', NULL, -1, 'HLD', '', '', NULL),
310
                ('583', 'h', 'Jurisdiction', 'Jurisdiction', 1, 0, '', 5, '', '', '', NULL, -1, 'HLD', '', '', NULL),
311
                ('583', 'i', 'Method of action', 'Method of action', 1, 0, '', 5, '', '', '', NULL, -1, 'HLD', '', '', NULL),
312
                ('583', 'j', 'Site of action', 'Site of action', 1, 0, '', 5, '', '', '', NULL, -1, 'HLD', '', '', NULL),
313
                ('583', 'k', 'Action agent', 'Action agent', 1, 0, '', 5, '', '', '', NULL, -1, 'HLD', '', '', NULL),
314
                ('583', 'l', 'Status', 'Status', 1, 0, '', 5, '', '', '', NULL, -1, 'HLD', '', '', NULL),
315
                ('583', 'n', 'Extent', 'Extent', 1, 0, '', 5, '', '', '', NULL, -1, 'HLD', '', '', NULL),
316
                ('583', 'o', 'Type of unit', 'Type of unit', 1, 0, '', 5, '', '', '', NULL, -1, 'HLD', '', '', NULL),
317
                ('583', 'u', 'Uniform Resource Identifier', 'Uniform Resource Identifier', 1, 0, '', 5, '', '', '', 1, -1, 'HLD', '', '', NULL),
318
                ('583', 'x', 'Nonpublic note', 'Nonpublic note', 1, 0, '', 5, '', '', '', NULL, 4, 'HLD', '', '', NULL),
319
                ('583', 'z', 'Public note', 'Public note', 1, 0, '', 5, '', '', '', NULL, -1, 'HLD', '', '', NULL),
320
                ('842', '6', 'Linkage', 'Linkage', 0, 0, '', 8, '', '', '', NULL, -6, 'HLD', '', '', NULL),
321
                ('842', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 8, '', '', '', NULL, -6, 'HLD', '', '', NULL),
322
                ('842', 'a', 'Textual physical form designator', 'Textual physical form designator', 0, 0, '', 8, '', '', '', NULL, -1, 'HLD', '', '', NULL),
323
                ('843', '3', 'Materials specified', 'Materials specified', 0, 0, NULL, 8, NULL, NULL, '', NULL, -6, 'HLD', '', '', NULL),
324
                ('843', '5', 'Institution to which field applies', 'Institution to which field applies', 0, 0, NULL, -1, NULL, NULL, '', NULL, -6, 'HLD', '', '', NULL),
325
                ('843', '6', 'Linkage', 'Linkage', 0, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL),
326
                ('843', '7', 'Fixed-length data elements of reproduction', 'Fixed-length data elements of reproduction', 0, 0, NULL, 8, NULL, NULL, '', NULL, -6, 'HLD', '', '', NULL),
327
                ('843', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 8, '', '', '', NULL, -6, 'HLD', '', '', NULL),
328
                ('843', 'a', 'Type of reproduction', 'Type of reproduction', 0, 0, NULL, 8, NULL, NULL, '', NULL, -1, 'HLD', '', '', NULL),
329
                ('843', 'b', 'Place of reproduction', 'Place of reproduction', 1, 0, NULL, 8, NULL, NULL, '', NULL, -1, 'HLD', '', '', NULL),
330
                ('843', 'c', 'Agency responsible for reproduction', 'Agency responsible for reproduction', 1, 0, NULL, 8, NULL, NULL, '', NULL, -1, 'HLD', '', '', NULL),
331
                ('843', 'd', 'Date of reproduction', 'Date of reproduction', 0, 0, NULL, 8, NULL, NULL, '', NULL, -1, 'HLD', '', '', NULL),
332
                ('843', 'e', 'Physical description of reproduction', 'Physical description of reproduction', 0, 0, NULL, 8, NULL, NULL, '', NULL, -1, 'HLD', '', '', NULL),
333
                ('843', 'f', 'Series statement of reproduction', 'Series statement of reproduction', 1, 0, NULL, 8, NULL, NULL, '', NULL, -1, 'HLD', '', '', NULL),
334
                ('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),
335
                ('843', 'n', 'Note about reproduction', 'Note about reproduction', 1, 0, NULL, 8, NULL, NULL, '', NULL, -1, 'HLD', '', '', NULL),
336
                ('844', '6', 'Linkage', 'Linkage', 0, 0, '', 8, '', '', '', NULL, -6, 'HLD', '', '', NULL),
337
                ('844', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 8, '', '', '', NULL, -6, 'HLD', '', '', NULL),
338
                ('844', 'a', 'Name of unit', 'Name of unit', 0, 0, '', 8, '', '', '', NULL, -1, 'HLD', '', '', NULL),
339
                ('845', 'a', 'Terms governing use and reproduction', 'Terms governing use and reproduction', 0, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL),
340
                ('845', 'b', 'Jurisdiction', 'Jurisdiction', 0, 0, '', 8, '', '', '', NULL, -6, 'HLD', '', '', NULL),
341
                ('845', 'c', 'Authorization', 'Authorization', 0, 0, '', 8, '', '', '', NULL, -6, 'HLD', '', '', NULL),
342
                ('845', 'd', 'Authorized users', 'Authorized users', 0, 0, '', 8, '', '', '', NULL, -6, 'HLD', '', '', NULL),
343
                ('845', 'u', 'Uniform Resource Identifier', 'Uniform Resource Identifier', 1, 0, '', 8, '', '', '', 1, -6, 'HLD', '', '', NULL),
344
                ('850', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, NULL, 8, NULL, NULL, '', NULL, 4, 'HLD', '', '', NULL),
345
                ('850', 'a', 'Holding institution', 'Holding institution', 1, 0, NULL, 8, NULL, NULL, '', NULL, 4, 'HLD', '', '', NULL),
346
                ('850', 'b', 'Holdings (NR) (MU VM SE) [OBSOLETE]', 'Holdings (NR) (MU VM SE) [OBSOLETE]', 0, 0, NULL, 8, NULL, NULL, '', NULL, 4, 'HLD', '', '', NULL),
347
                ('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),
348
                ('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),
349
                ('852', '2', 'Source of classification or shelving scheme', 'Source of classification or shelving scheme', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
350
                ('852', '3', 'Materials specified', 'Materials specified', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
351
                ('852', '6', 'Linkage', 'Linkage', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
352
                ('852', '8', 'Sequence number', 'Sequence number', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
353
                ('852', 'a', 'Location', 'Location', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
354
                ('852', 'b', 'Sublocation or collection', 'Sublocation or collection', 1, 0, 'holdings.holdingbranch', 8, 'branches', '', '', NULL, 4, 'HLD', '', '', NULL),
355
                ('852', 'c', 'Shelving location', 'Shelving location', 1, 0, 'holdings.location', 8, 'LOC', '', '', NULL, 4, 'HLD', '', '', NULL),
356
                ('852', 'd', 'Former shelving location', 'Former shelving location', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
357
                ('852', 'e', 'Address', 'Address', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
358
                ('852', 'f', 'Coded location qualifier', 'Coded location qualifier', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
359
                ('852', 'g', 'Non-coded location qualifier', 'Non-coded location qualifier', 1, 0, 'holdings.ccode', 8, 'CCODE', '', '', NULL, 4, 'HLD', '', '', NULL),
360
                ('852', 'h', 'Classification part', 'Classification part', 0, 0, 'holdings.callnumber', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
361
                ('852', 'i', 'Item part', 'Item part', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
362
                ('852', 'j', 'Shelving control number', 'Shelving control number', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
363
                ('852', 'k', 'Call number prefix', 'Call number prefix', 1, 0, 'holdings.callnumber', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
364
                ('852', 'l', 'Shelving form of title', 'Shelving form of title', 0, 0, 'holdings.callnumber', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
365
                ('852', 'm', 'Call number suffix', 'Call number suffix', 1, 0, 'holdings.callnumber', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
366
                ('852', 'n', 'Country code', 'Country code', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
367
                ('852', 'p', 'Piece designation', 'Piece designation', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
368
                ('852', 'q', 'Piece physical condition', 'Piece physical condition', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
369
                ('852', 's', 'Copyright article-fee code', 'Copyright article-fee code', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
370
                ('852', 't', 'Copy number', 'Copy number', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
371
                ('852', 'u', 'Uniform Resource Identifier', 'Uniform Resource Identifier', 1, 0, '', 8, '', '', '', 1, 4, 'HLD', '', '', NULL),
372
                ('852', 'x', 'Nonpublic note', 'Nonpublic note', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
373
                ('852', 'z', 'Public note', 'Public note', 1, 0, 'holdings.public_note', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
374
                ('853', '3', 'Materials specified', 'Materials specified', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
375
                ('853', '6', 'Linkage', 'Linkage', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
376
                ('853', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
377
                ('853', 'a', 'First level of enumeration', 'First level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
378
                ('853', 'b', 'Second level of enumeration', 'Second level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
379
                ('853', 'c', 'Third level of enumeration', 'Third level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
380
                ('853', 'd', 'Fourth level of enumeration', 'Fourth level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
381
                ('853', 'e', 'Fifth level of enumeration', 'Fifth level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
382
                ('853', 'f', 'Sixth level of enumeration', 'Sixth level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
383
                ('853', 'g', 'Alternative numbering scheme, first level of enumeration', 'Alternative numbering scheme, first level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
384
                ('853', 'h', 'Alternative numbering scheme, second level of enumeration', 'Alternative numbering scheme, second level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
385
                ('853', 'i', 'First level of chronology', 'First level of chronology', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
386
                ('853', 'j', 'Second level of chronology', 'Second level of chronology', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
387
                ('853', 'k', 'Third level of chronology', 'Third level of chronology', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
388
                ('853', 'l', 'Fourth level of chronology', 'Fourth level of chronology', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
389
                ('853', 'm', 'Alternative numbering scheme, chronology', 'Alternative numbering scheme, chronology', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
390
                ('853', 'n', 'Pattern note', 'Pattern note', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
391
                ('853', 'p', 'Number of pieces per issuance', 'Number of pieces per issuance', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
392
                ('853', 't', 'Copy', 'Copy', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
393
                ('853', 'u', 'Bibliographic units per next higher level', 'Bibliographic units per next higher level', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
394
                ('853', 'v', 'Numbering continuity', 'Numbering continuity', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
395
                ('853', 'w', 'Frequency', 'Frequency', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
396
                ('853', 'x', 'Calendar change', 'Calendar change', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
397
                ('853', 'y', 'Regularity pattern', 'Regularity pattern', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
398
                ('853', 'z', 'Numbering scheme', 'Numbering scheme', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
399
                ('854', '3', 'Materials specified', 'Materials specified', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
400
                ('854', '6', 'Linkage', 'Linkage', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
401
                ('854', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
402
                ('854', 'a', 'First level of enumeration', 'First level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
403
                ('854', 'b', 'Second level of enumeration', 'Second level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
404
                ('854', 'c', 'Third level of enumeration', 'Third level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
405
                ('854', 'd', 'Fourth level of enumeration', 'Fourth level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
406
                ('854', 'e', 'Fifth level of enumeration', 'Fifth level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
407
                ('854', 'f', 'Sixth level of enumeration', 'Sixth level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
408
                ('854', 'g', 'Alternative numbering scheme, first level of enumeration', 'Alternative numbering scheme, first level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
409
                ('854', 'h', 'Alternative numbering scheme, second level of enumeration', 'Alternative numbering scheme, second level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
410
                ('854', 'i', 'First level of chronology', 'First level of chronology', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
411
                ('854', 'j', 'Second level of chronology', 'Second level of chronology', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
412
                ('854', 'k', 'Third level of chronology', 'Third level of chronology', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
413
                ('854', 'l', 'Fourth level of chronology', 'Fourth level of chronology', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
414
                ('854', 'm', 'Alternative numbering scheme, chronology', 'Alternative numbering scheme, chronology', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
415
                ('854', 'n', 'Pattern note', 'Pattern note', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
416
                ('854', 'p', 'Number of pieces per issuance', 'Number of pieces per issuance', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
417
                ('854', 't', 'Copy', 'Copy', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
418
                ('854', 'u', 'Bibliographic units per next higher level', 'Bibliographic units per next higher level', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
419
                ('854', 'v', 'Numbering continuity', 'Numbering continuity', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
420
                ('854', 'w', 'Frequency', 'Frequency', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
421
                ('854', 'x', 'Calendar change', 'Calendar change', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
422
                ('854', 'y', 'Regularity pattern', 'Regularity pattern', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
423
                ('854', 'z', 'Numbering scheme', 'Numbering scheme', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
424
                ('855', '3', 'Materials specified', 'Materials specified', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
425
                ('855', '6', 'Linkage', 'Linkage', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
426
                ('855', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
427
                ('855', 'a', 'First level of enumeration', 'First level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
428
                ('855', 'b', 'Second level of enumeration', 'Second level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
429
                ('855', 'c', 'Third level of enumeration', 'Third level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
430
                ('855', 'd', 'Fourth level of enumeration', 'Fourth level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
431
                ('855', 'e', 'Fifth level of enumeration', 'Fifth level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
432
                ('855', 'f', 'Sixth level of enumeration', 'Sixth level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
433
                ('855', 'g', 'Alternative numbering scheme, first level of enumeration', 'Alternative numbering scheme, first level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
434
                ('855', 'h', 'Alternative numbering scheme, second level of enumeration', 'Alternative numbering scheme, second level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
435
                ('855', 'i', 'First level of chronology', 'First level of chronology', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
436
                ('855', 'j', 'Second level of chronology', 'Second level of chronology', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
437
                ('855', 'k', 'Third level of chronology', 'Third level of chronology', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
438
                ('855', 'l', 'Fourth level of chronology', 'Fourth level of chronology', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
439
                ('855', 'm', 'Alternative numbering scheme, chronology', 'Alternative numbering scheme, chronology', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
440
                ('855', 'n', 'Pattern note', 'Pattern note', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
441
                ('855', 'p', 'Number of pieces per issuance', 'Number of pieces per issuance', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
442
                ('855', 't', 'Copy', 'Copy', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
443
                ('855', 'u', 'Bibliographic units per next higher level', 'Bibliographic units per next higher level', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
444
                ('855', 'v', 'Numbering continuity', 'Numbering continuity', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
445
                ('855', 'w', 'Frequency', 'Frequency', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
446
                ('855', 'x', 'Calendar change', 'Calendar change', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
447
                ('855', 'y', 'Regularity pattern', 'Regularity pattern', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
448
                ('855', 'z', 'Numbering scheme', 'Numbering scheme', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
449
                ('856', '2', 'Access method', 'Access method', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
450
                ('856', '3', 'Materials specified', 'Materials specified', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
451
                ('856', '6', 'Linkage', 'Linkage', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
452
                ('856', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
453
                ('856', 'a', 'Host name', 'Host name', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
454
                ('856', 'b', 'Access number', 'Access number', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
455
                ('856', 'c', 'Compression information', 'Compression information', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
456
                ('856', 'd', 'Path', 'Path', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
457
                ('856', 'f', 'Electronic name', 'Electronic name', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
458
                ('856', 'h', 'Processor of request', 'Processor of request', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
459
                ('856', 'i', 'Instruction', 'Instruction', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
460
                ('856', 'j', 'Bits per second', 'Bits per second', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
461
                ('856', 'k', 'Password', 'Password', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
462
                ('856', 'l', 'Logon', 'Logon', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
463
                ('856', 'm', 'Contact for access assistance', 'Contact for access assistance', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
464
                ('856', 'n', 'Name of location of host', 'Name of location of host', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
465
                ('856', 'o', 'Operating system', 'Operating system', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
466
                ('856', 'p', 'Port', 'Port', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
467
                ('856', 'q', 'Electronic format type', 'Electronic format type', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
468
                ('856', 'r', 'Settings', 'Settings', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
469
                ('856', 's', 'File size', 'File size', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
470
                ('856', 't', 'Terminal emulation', 'Terminal emulation', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
471
                ('856', 'u', 'Uniform Resource Identifier', 'Uniform Resource Identifier', 1, 0, 'biblioitems.url', 8, '', '', '', 1, 4, 'HLD', '', '', NULL),
472
                ('856', 'v', 'Hours access method available', 'Hours access method available', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
473
                ('856', 'w', 'Record control number', 'Record control number', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
474
                ('856', 'x', 'Nonpublic note', 'Nonpublic note', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
475
                ('856', 'y', 'Link text', 'Link text', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
476
                ('856', 'z', 'Public note', 'Public note', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
477
                ('863', '6', 'Linkage', 'Linkage', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
478
                ('863', '8', 'Field link and sequence number', 'Field link and sequence number', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
479
                ('863', 'a', 'First level of enumeration', 'First level of enumeration', 0, 0, 'holdings.summary', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
480
                ('863', 'b', 'Second level of enumeration', 'Second level of enumeration', 0, 0, 'holdings.summary', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
481
                ('863', 'c', 'Third level of enumeration', 'Third level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
482
                ('863', 'd', 'Fourth level of enumeration', 'Fourth level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
483
                ('863', 'e', 'Fifth level of enumeration', 'Fifth level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
484
                ('863', 'f', 'Sixth level of enumeration', 'Sixth level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
485
                ('863', 'g', 'Alternative numbering scheme, first level of enumeration', 'Alternative numbering scheme, first level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
486
                ('863', 'h', 'Alternative numbering scheme, second level of enumeration', 'Alternative numbering scheme, second level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
487
                ('863', 'i', 'First level of chronology', 'First level of chronology', 0, 0, 'holdings.summary', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
488
                ('863', 'j', 'Second level of chronology', 'Second level of chronology', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
489
                ('863', 'k', 'Third level of chronology', 'Third level of chronology', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
490
                ('863', 'l', 'Fourth level of chronology', 'Fourth level of chronology', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
491
                ('863', 'm', 'Alternative numbering scheme, chronology', 'Alternative numbering scheme, chronology', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
492
                ('863', 'n', 'Converted Gregorian year', 'Converted Gregorian year', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
493
                ('863', 'o', 'Type of unit', 'Type of unit', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
494
                ('863', 'p', 'Piece designation', 'Piece designation', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
495
                ('863', 'q', 'Piece physical condition', 'Piece physical condition', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
496
                ('863', 's', 'Copyright article-fee code', 'Copyright article-fee code', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
497
                ('863', 't', 'Copy number', 'Copy number', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
498
                ('863', 'v', 'Issuing date', 'Issuing date', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
499
                ('863', 'w', 'Break indicator', 'Break indicator', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
500
                ('863', 'x', 'Nonpublic note', 'Nonpublic note', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
501
                ('863', 'z', 'Public note', 'Public note', 1, 0, 'holdings.summary', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
502
                ('864', '6', 'Linkage', 'Linkage', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
503
                ('864', '8', 'Field link and sequence number', 'Field link and sequence number', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
504
                ('864', 'a', 'First level of enumeration', 'First level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
505
                ('864', 'b', 'Second level of enumeration', 'Second level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
506
                ('864', 'c', 'Third level of enumeration', 'Third level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
507
                ('864', 'd', 'Fourth level of enumeration', 'Fourth level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
508
                ('864', 'e', 'Fifth level of enumeration', 'Fifth level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
509
                ('864', 'f', 'Sixth level of enumeration', 'Sixth level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
510
                ('864', 'g', 'Alternative numbering scheme, first level of enumeration', 'Alternative numbering scheme, first level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
511
                ('864', 'h', 'Alternative numbering scheme, second level of enumeration', 'Alternative numbering scheme, second level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
512
                ('864', 'i', 'First level of chronology', 'First level of chronology', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
513
                ('864', 'j', 'Second level of chronology', 'Second level of chronology', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
514
                ('864', 'k', 'Third level of chronology', 'Third level of chronology', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
515
                ('864', 'l', 'Fourth level of chronology', 'Fourth level of chronology', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
516
                ('864', 'm', 'Alternative numbering scheme, chronology', 'Alternative numbering scheme, chronology', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
517
                ('864', 'n', 'Converted Gregorian year', 'Converted Gregorian year', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
518
                ('864', 'o', 'Type of unit', 'Type of unit', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
519
                ('864', 'p', 'Piece designation', 'Piece designation', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
520
                ('864', 'q', 'Piece physical condition', 'Piece physical condition', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
521
                ('864', 's', 'Copyright article-fee code', 'Copyright article-fee code', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
522
                ('864', 't', 'Copy number', 'Copy number', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
523
                ('864', 'v', 'Issuing date', 'Issuing date', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
524
                ('864', 'w', 'Break indicator', 'Break indicator', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
525
                ('864', 'x', 'Nonpublic note', 'Nonpublic note', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
526
                ('864', 'z', 'Public note', 'Public note', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
527
                ('865', '6', 'Linkage', 'Linkage', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
528
                ('865', '8', 'Field link and sequence number', 'Field link and sequence number', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
529
                ('865', 'a', 'First level of enumeration', 'First level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
530
                ('865', 'b', 'Second level of enumeration', 'Second level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
531
                ('865', 'c', 'Third level of enumeration', 'Third level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
532
                ('865', 'd', 'Fourth level of enumeration', 'Fourth level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
533
                ('865', 'e', 'Fifth level of enumeration', 'Fifth level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
534
                ('865', 'f', 'Sixth level of enumeration', 'Sixth level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
535
                ('865', 'g', 'Alternative numbering scheme, first level of enumeration', 'Alternative numbering scheme, first level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
536
                ('865', 'h', 'Alternative numbering scheme, second level of enumeration', 'Alternative numbering scheme, second level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
537
                ('865', 'i', 'First level of chronology', 'First level of chronology', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
538
                ('865', 'j', 'Second level of chronology', 'Second level of chronology', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
539
                ('865', 'k', 'Third level of chronology', 'Third level of chronology', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
540
                ('865', 'l', 'Fourth level of chronology', 'Fourth level of chronology', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
541
                ('865', 'm', 'Alternative numbering scheme, chronology', 'Alternative numbering scheme, chronology', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
542
                ('865', 'n', 'Converted Gregorian year', 'Converted Gregorian year', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
543
                ('865', 'o', 'Type of unit', 'Type of unit', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
544
                ('865', 'p', 'Piece designation', 'Piece designation', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
545
                ('865', 'q', 'Piece physical condition', 'Piece physical condition', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
546
                ('865', 's', 'Copyright article-fee code', 'Copyright article-fee code', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
547
                ('865', 't', 'Copy number', 'Copy number', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
548
                ('865', 'v', 'Issuing date', 'Issuing date', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
549
                ('865', 'w', 'Break indicator', 'Break indicator', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
550
                ('865', 'x', 'Nonpublic note', 'Nonpublic note', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
551
                ('865', 'z', 'Public note', 'Public note', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
552
                ('866', '6', 'Linkage', 'Linkage', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
553
                ('866', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
554
                ('866', 'a', 'Textual string', 'Textual string', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
555
                ('866', 'x', 'Nonpublic note', 'Nonpublic note', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
556
                ('866', 'z', 'Public note', 'Public note', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
557
                ('867', '6', 'Linkage', 'Linkage', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
558
                ('867', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
559
                ('867', 'a', 'Textual string', 'Textual string', 0, 0, 'holdings.supplements', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
560
                ('867', 'x', 'Nonpublic note', 'Nonpublic note', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
561
                ('867', 'z', 'Public note', 'Public note', 1, 0, 'holdings.supplements', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
562
                ('868', '6', 'Linkage', 'Linkage', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
563
                ('868', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
564
                ('868', 'a', 'Textual string', 'Textual string', 0, 0, 'holdings.indexes', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
565
                ('868', 'x', 'Nonpublic note', 'Nonpublic note', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
566
                ('868', 'z', 'Public note', 'Public note', 1, 0, 'holdings.indexes', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
567
                ('876', '3', 'Materials specified', 'Materials specified', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
568
                ('876', '6', 'Linkage', 'Linkage', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
569
                ('876', '8', 'Sequence number', 'Sequence number', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
570
                ('876', 'a', 'Internal item number', 'Internal item number', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
571
                ('876', 'b', 'Invalid or canceled internal item number', 'Invalid or canceled internal item number', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
572
                ('876', 'c', 'Cost', 'Cost', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
573
                ('876', 'd', 'Date acquired', 'Date acquired', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
574
                ('876', 'e', 'Source of acquisition', 'Source of acquisition', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
575
                ('876', 'h', 'Use restrictions', 'Use restrictions', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
576
                ('876', 'j', 'Item status', 'Item status', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
577
                ('876', 'l', 'Temporary location', 'Temporary location', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
578
                ('876', 'p', 'Piece designation', 'Piece designation', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
579
                ('876', 'r', 'Invalid or canceled piece designation', 'Invalid or canceled piece designation', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
580
                ('876', 't', 'Copy number', 'Copy number', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
581
                ('876', 'x', 'Nonpublic note', 'Nonpublic note', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
582
                ('876', 'z', 'Public note', 'Public note', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
583
                ('877', '3', 'Materials specified', 'Materials specified', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
584
                ('877', '6', 'Linkage', 'Linkage', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
585
                ('877', '8', 'Sequence number', 'Sequence number', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
586
                ('877', 'a', 'Internal item number', 'Internal item number', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
587
                ('877', 'b', 'Invalid or canceled internal item number', 'Invalid or canceled internal item number', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
588
                ('877', 'c', 'Cost', 'Cost', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
589
                ('877', 'd', 'Date acquired', 'Date acquired', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
590
                ('877', 'e', 'Source of acquisition', 'Source of acquisition', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
591
                ('877', 'h', 'Use restrictions', 'Use restrictions', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
592
                ('877', 'j', 'Item status', 'Item status', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
593
                ('877', 'l', 'Temporary location', 'Temporary location', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
594
                ('877', 'p', 'Piece designation', 'Piece designation', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
595
                ('877', 'r', 'Invalid or canceled piece designation', 'Invalid or canceled piece designation', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
596
                ('877', 't', 'Copy number', 'Copy number', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
597
                ('877', 'x', 'Nonpublic note', 'Nonpublic note', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
598
                ('877', 'z', 'Public note', 'Public note', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
599
                ('878', '3', 'Materials specified', 'Materials specified', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
600
                ('878', '6', 'Linkage', 'Linkage', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
601
                ('878', '8', 'Sequence number', 'Sequence number', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
602
                ('878', 'a', 'Internal item number', 'Internal item number', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
603
                ('878', 'b', 'Invalid or canceled internal item number', 'Invalid or canceled internal item number', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
604
                ('878', 'c', 'Cost', 'Cost', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
605
                ('878', 'd', 'Date acquired', 'Date acquired', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
606
                ('878', 'e', 'Source of acquisition', 'Source of acquisition', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
607
                ('878', 'h', 'Use restrictions', 'Use restrictions', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
608
                ('878', 'j', 'Item status', 'Item status', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
609
                ('878', 'l', 'Temporary location', 'Temporary location', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
610
                ('878', 'p', 'Piece designation', 'Piece designation', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
611
                ('878', 'r', 'Invalid or canceled piece designation', 'Invalid or canceled piece designation', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
612
                ('878', 't', 'Copy number', 'Copy number', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
613
                ('878', 'x', 'Nonpublic note', 'Nonpublic note', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
614
                ('878', 'z', 'Public note', 'Public note', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL);
615
    });
616
617
    # Always end with this (adjust the bug info)
618
    SetVersion( $DBversion );
619
    print "Upgrade to $DBversion done (Bug 20447 - Add holdings tables)\n";
620
}
(-)a/installer/data/mysql/en/marcflavour/marc21/mandatory/marc21_framework_DEFAULT.sql (-1 / +542 lines)
Lines 34-40 INSERT IGNORE INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblib Link Here
34
		('999', 'a', 'Item type [OBSOLETE]', 'Item type [OBSOLETE]', 0, 0, NULL, -1, NULL, NULL, '', NULL, -5, '', '', '', NULL),
34
		('999', 'a', 'Item type [OBSOLETE]', 'Item type [OBSOLETE]', 0, 0, NULL, -1, NULL, NULL, '', NULL, -5, '', '', '', NULL),
35
		('999', 'b', 'Koha Dewey Subclass [OBSOLETE]', 'Koha Dewey Subclass [OBSOLETE]', 0, 0, NULL, 0, NULL, NULL, '', NULL, -5, '', '', '', NULL),
35
		('999', 'b', 'Koha Dewey Subclass [OBSOLETE]', 'Koha Dewey Subclass [OBSOLETE]', 0, 0, NULL, 0, NULL, NULL, '', NULL, -5, '', '', '', NULL),
36
		('999', 'c', 'Koha biblionumber', 'Koha biblionumber', 0, 0, 'biblio.biblionumber', -1, NULL, NULL, '', NULL, -5, '', '', '', NULL),
36
		('999', 'c', 'Koha biblionumber', 'Koha biblionumber', 0, 0, 'biblio.biblionumber', -1, NULL, NULL, '', NULL, -5, '', '', '', NULL),
37
		('999', 'd', 'Koha biblioitemnumber', 'Koha biblioitemnumber', 0, 0, 'biblioitems.biblioitemnumber', -1, NULL, NULL, '', NULL, -5, '', '', '', NULL);
37
		('999', 'd', 'Koha biblioitemnumber', 'Koha biblioitemnumber', 0, 0, 'biblioitems.biblioitemnumber', -1, NULL, NULL, '', NULL, -5, '', '', '', NULL),
38
		('999', 'e', 'Koha holding_id', 'Koha holding_id', 0, 0, 'holdings.holding_id', -1, NULL, NULL, '', NULL, -5, '', '', '', NULL);
38
39
39
40
40
-- ******************************************************
41
-- ******************************************************
Lines 107-112 INSERT IGNORE INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblib Link Here
107
            ('952', 'h', 'Serial Enumeration / chronology', 'Serial Enumeration / chronology', 0, 0, 'items.enumchron', 10, '', '', '', 0, 0, '', '', '', NULL),
108
            ('952', 'h', 'Serial Enumeration / chronology', 'Serial Enumeration / chronology', 0, 0, 'items.enumchron', 10, '', '', '', 0, 0, '', '', '', NULL),
108
           ('952', 'i', 'Inventory number', 'Inventory number', 0, 0, 'items.stocknumber', 10, '', '', '', 0, 0, '', '', '', NULL),
109
           ('952', 'i', 'Inventory number', 'Inventory number', 0, 0, 'items.stocknumber', 10, '', '', '', 0, 0, '', '', '', NULL),
109
		('952', 'j', 'Shelving control number', 'Shelving control number', 0, 0, 'items.stack', 10, 'STACK', '', '', NULL, -1, '', '', '', NULL),
110
		('952', 'j', 'Shelving control number', 'Shelving control number', 0, 0, 'items.stack', 10, 'STACK', '', '', NULL, -1, '', '', '', NULL),
111
        ('952', 'k', 'Holding record',  'Holding record',  0, 0, 'items.holding_id', 10, 'holdings', '', '', NULL, 0,  '', '', '', NULL),
110
		('952', 'l', 'Total Checkouts', 'Total Checkouts', 0, 0, 'items.issues', 10, '', '', '', NULL, -5, '', '', '', NULL),
112
		('952', 'l', 'Total Checkouts', 'Total Checkouts', 0, 0, 'items.issues', 10, '', '', '', NULL, -5, '', '', '', NULL),
111
		('952', 'm', 'Total Renewals', 'Total Renewals', 0, 0, 'items.renewals', 10, '', '', '', NULL, -5, '', '', '', NULL),
113
		('952', 'm', 'Total Renewals', 'Total Renewals', 0, 0, 'items.renewals', 10, '', '', '', NULL, -5, '', '', '', NULL),
112
		('952', 'n', 'Total Holds', 'Total Holds', 0, 0, 'items.reserves', 10, '', '', '', NULL, -5, '', '', '', NULL),
114
		('952', 'n', 'Total Holds', 'Total Holds', 0, 0, 'items.reserves', 10, '', '', '', NULL, -5, '', '', '', NULL),
Lines 4621-4623 SELECT tagfield, tagsubfield, liblibrarian, libopac, repeatable, mandatory, koha Link Here
4621
FROM marc_subfield_structure
4623
FROM marc_subfield_structure
4622
WHERE frameworkcode=""
4624
WHERE frameworkcode=""
4623
AND kohafield IN ("biblio.title", "biblio.author", "biblioitems.publishercode", "biblioitems.editionstatement", "biblio.copyrightdate", "biblioitems.isbn", "biblio.seriestitle" );
4625
AND kohafield IN ("biblio.title", "biblio.author", "biblioitems.publishercode", "biblioitems.editionstatement", "biblio.copyrightdate", "biblioitems.isbn", "biblio.seriestitle" );
4626
4627
4628
-- HOLDINGS RECORD FRAMEWORK
4629
4630
INSERT IGNORE INTO `biblio_framework` VALUES ('HLD', 'Default holdings framework');
4631
INSERT IGNORE INTO `marc_tag_structure` (`tagfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `authorised_value`, `frameworkcode`) VALUES
4632
        ('999', 'SYSTEM CONTROL NUMBERS (KOHA)', 'SYSTEM CONTROL NUMBERS (KOHA)', 1, 0, '', 'HLD');
4633
4634
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
4635
        ('999', 'c', 'Koha biblionumber', 'Koha biblionumber', 0, 0, 'biblio.biblionumber', -1, NULL, NULL, '', NULL, -5, 'HLD', '', '', NULL),
4636
        ('999', 'e', 'Koha holding_id', 'Koha holding_id', 0, 0, 'holdings.holding_id', -1, NULL, NULL, '', NULL, -5, 'HLD', '', '', NULL);
4637
4638
4639
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
4640
        ('942', 'n', 'Suppress in OPAC', 'Suppress in OPAC', 0, 0, 'holdings.suppress', 9, '', '', '', 0, 0, 'HLD', '', '', NULL);
4641
4642
INSERT IGNORE INTO `marc_tag_structure` (`tagfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `authorised_value`, `frameworkcode`) VALUES
4643
        ('000', 'LEADER', 'LEADER', 0, 1, '', 'HLD'),
4644
        ('001', 'CONTROL NUMBER', 'CONTROL NUMBER', 0, 0, '', 'HLD'),
4645
        ('003', 'CONTROL NUMBER IDENTIFIER', 'CONTROL NUMBER IDENTIFIER', 0, 1, '', 'HLD'),
4646
        ('005', 'DATE AND TIME OF LATEST TRANSACTION', 'DATE AND TIME OF LATEST TRANSACTION', 0, 1, '', 'HLD'),
4647
        ('006', 'FIXED-LENGTH DATA ELEMENTS--ADDITIONAL MATERIAL CHARACTERISTICS', 'FIXED-LENGTH DATA ELEMENTS--ADDITIONAL MATERIAL CHARACTERISTICS', 1, 0, '', 'HLD'),
4648
        ('007', 'PHYSICAL DESCRIPTION FIXED FIELD--GENERAL INFORMATION', 'PHYSICAL DESCRIPTION FIXED FIELD--GENERAL INFORMATION', 1, 0, '', 'HLD'),
4649
        ('008', 'FIXED-LENGTH DATA ELEMENTS--GENERAL INFORMATION', 'FIXED-LENGTH DATA ELEMENTS--GENERAL INFORMATION', 0, 1, '', 'HLD');
4650
4651
INSERT IGNORE INTO `marc_tag_structure` (`tagfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `authorised_value`, `frameworkcode`) VALUES
4652
        ('010', 'LIBRARY OF CONGRESS CONTROL NUMBER', 'LIBRARY OF CONGRESS CONTROL NUMBER', 0, 0, '', 'HLD'),
4653
        ('014', 'LINKAGE NUMBER', 'LINKAGE NUMBER', 1, 0, '', 'HLD'),
4654
        ('016', 'NATIONAL BIBLIOGRAPHIC AGENCY CONTROL NUMBER', 'NATIONAL BIBLIOGRAPHIC AGENCY CONTROL NUMBER', 1, 0, '', 'HLD'),
4655
        ('017', 'COPYRIGHT OR LEGAL DEPOSIT NUMBER', 'COPYRIGHT OR LEGAL DEPOSIT NUMBER', 1, 0, '', 'HLD'),
4656
        ('020', 'INTERNATIONAL STANDARD BOOK NUMBER', 'INTERNATIONAL STANDARD BOOK NUMBER', 1, 0, NULL, 'HLD'),
4657
        ('022', 'INTERNATIONAL STANDARD SERIAL NUMBER', 'INTERNATIONAL STANDARD SERIAL NUMBER', 1, 0, NULL, 'HLD'),
4658
        ('024', 'OTHER STANDARD IDENTIFIER', 'OTHER STANDARD IDENTIFIER', 1, 0, NULL, 'HLD'),
4659
        ('027', 'STANDARD TECHNICAL REPORT NUMBER', 'STANDARD TECHNICAL REPORT NUMBER', 1, 0, '', 'HLD'),
4660
        ('030', 'CODEN DESIGNATION', 'CODEN DESIGNATION', 1, 0, '', 'HLD'),
4661
        ('035', 'SYSTEM CONTROL NUMBER', 'SYSTEM CONTROL NUMBER', 1, 0, NULL, 'HLD'),
4662
        ('040', 'CATALOGING SOURCE', 'CATALOGING SOURCE', 0, 1, NULL, 'HLD'),
4663
        ('066', 'CHARACTER SETS PRESENT', 'CHARACTER SETS PRESENT', 0, 0, NULL, 'HLD'),
4664
        ('337', 'MEDIA TYPE', 'MEDIA TYPE', 1, 0, NULL, 'HLD'),
4665
        ('338', 'CARRIER TYPE', 'CARRIER TYPE', 1, 0, NULL, 'HLD'),
4666
        ('347', 'DIGITAL FILE CHARACTERISTICS', 'DIGITAL FILE CHARACTERISTICS', 1, 0, NULL, 'HLD'),
4667
        ('506', 'RESTRICTIONS ON ACCESS NOTE', 'RESTRICTIONS ON ACCESS NOTE', 1, 0, NULL, 'HLD'),
4668
        ('538', 'SYSTEM DETAILS NOTE', 'SYSTEM DETAILS NOTE', 1, 0, NULL, 'HLD'),
4669
        ('541', 'IMMEDIATE SOURCE OF ACQUISITION NOTE', 'IMMEDIATE SOURCE OF ACQUISITION NOTE', 1, 0, NULL, 'HLD'),
4670
        ('561', 'OWNERSHIP AND CUSTODIAL HISTORY', 'OWNERSHIP AND CUSTODIAL HISTORY', 1, 0, NULL, 'HLD'),
4671
        ('562', 'COPY AND VERSION IDENTIFICATION NOTE', 'COPY AND VERSION IDENTIFICATION NOTE', 1, 0, NULL, 'HLD'),
4672
        ('563', 'BINDING INFORMATION', 'BINDING INFORMATION', 1, 0, NULL, 'HLD'),
4673
        ('583', 'ACTION NOTE', 'ACTION NOTE', 1, 0, NULL, 'HLD'),
4674
        ('842', 'TEXTUAL PHYSICAL FORM DESIGNATOR', 'TEXTUAL PHYSICAL FORM DESIGNATOR', 0, 0, NULL, 'HLD'),
4675
        ('843', 'REPRODUCTION NOTE', 'REPRODUCTION NOTE', 1, 0, NULL, 'HLD'),
4676
        ('844', 'NAME OF UNIT', 'NAME OF UNIT', 0, 0, NULL, 'HLD'),
4677
        ('845', 'TERMS GOVERNING USE AND REPRODUCTION NOTE', 'TERMS GOVERNING USE AND REPRODUCTION NOTE', 1, 0, NULL, 'HLD'),
4678
        ('850', 'HOLDING INSTITUTION', 'HOLDING INSTITUTION', 1, 0, NULL, 'HLD'),
4679
        ('852', 'LOCATION', 'LOCATION', 1, 0, NULL, 'HLD'),
4680
        ('853', 'CAPTIONS AND PATTERN--BASIC BIBLIOGRAPHIC UNIT', 'CAPTIONS AND PATTERN--BASIC BIBLIOGRAPHIC UNIT', 1, 0, NULL, 'HLD'),
4681
        ('854', 'CAPTIONS AND PATTERN--SUPPLEMENTARY MATERIAL', 'CAPTIONS AND PATTERN--SUPPLEMENTARY MATERIAL', 1, 0, NULL, 'HLD'),
4682
        ('855', 'CAPTIONS AND PATTERN--INDEXES', 'CAPTIONS AND PATTERN--INDEXES', 1, 0, NULL, 'HLD'),
4683
        ('856', 'ELECTRONIC LOCATION AND ACCESS', 'ELECTRONIC LOCATION AND ACCESS', 1, 0, NULL, 'HLD'),
4684
        ('863', 'ENUMERATION AND CHRONOLOGY--BASIC BIBLIOGRAPHIC UNIT', 'ENUMERATION AND CHRONOLOGY--BASIC BIBLIOGRAPHIC UNIT', 1, 0, NULL, 'HLD'),
4685
        ('864', 'ENUMERATION AND CHRONOLOGY--SUPPLEMENTARY MATERIAL', 'ENUMERATION AND CHRONOLOGY--SUPPLEMENTARY MATERIAL', 1, 0, NULL, 'HLD'),
4686
        ('865', 'ENUMERATION AND CHRONOLOGY--INDEXES', 'ENUMERATION AND CHRONOLOGY--INDEXES', 1, 0, NULL, 'HLD'),
4687
        ('866', 'TEXTUAL HOLDINGS--BASIC BIBLIOGRAPHIC UNIT', 'TEXTUAL HOLDINGS--BASIC BIBLIOGRAPHIC UNIT', 1, 0, NULL, 'HLD'),
4688
        ('867', 'TEXTUAL HOLDINGS--SUPPLEMENTARY MATERIAL', 'TEXTUAL HOLDINGS--SUPPLEMENTARY MATERIAL', 1, 0, NULL, 'HLD'),
4689
        ('868', 'TEXTUAL HOLDINGS--INDEXES', 'TEXTUAL HOLDINGS--INDEXES', 1, 0, NULL, 'HLD'),
4690
        ('876', 'ITEM INFORMATION--BASIC BIBLIOGRAPHIC UNIT', 'ITEM INFORMATION--BASIC BIBLIOGRAPHIC UNIT', 1, 0, NULL, 'HLD'),
4691
        ('877', 'ITEM INFORMATION--SUPPLEMENTARY MATERIAL', 'ITEM INFORMATION--SUPPLEMENTARY MATERIAL', 1, 0, NULL, 'HLD'),
4692
        ('878', 'ITEM INFORMATION--INDEXES', 'ITEM INFORMATION--INDEXES', 1, 0, NULL, 'HLD');
4693
4694
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
4695
        ('000', '@', 'fixed length control field', 'fixed length control field', 0, 1, '', 0, '', '', 'marc21_leader_holdings.pl', 0, 0, 'HLD', '', '', NULL),
4696
        ('001', '@', 'control field', 'control field', 0, 0, '', 0, '', '', '', 0, 0, 'HLD', '', '', NULL),
4697
        ('003', '@', 'control field', 'control field', 0, 1, '', 0, '', '', 'marc21_orgcode.pl', 0, 0, 'HLD', '', '', NULL),
4698
        ('005', '@', 'control field', 'control field', 0, 1, '', 0, '', '', 'marc21_field_005.pl', 0, 0, 'HLD', '', '', NULL),
4699
        ('006', '@', 'fixed length control field', 'fixed length control field', 0, 0, '', 0, '', '', 'marc21_field_006.pl', 0, -1, 'HLD', '', '', NULL),
4700
        ('007', '@', 'fixed length control field', 'fixed length control field', 0, 0, '', 0, '', '', 'marc21_field_007.pl', 0, 0, 'HLD', '', '', NULL),
4701
        ('008', '@', 'fixed length control field', 'fixed length control field', 0, 1, '', 0, '', '', 'marc21_field_008_holdings.pl', 0, 0, 'HLD', '', '', NULL),
4702
        ('010', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 0, '', '', NULL, 0, -6, 'HLD', '', '', NULL),
4703
        ('010', 'a', 'LC control number', 'LC control number', 0, 0, 'biblioitems.lccn', 0, '', '', '', 0, 0, 'HLD', '', '', NULL),
4704
        ('010', 'b', 'NUCMC control number', 'NUCMC control number', 1, 0, '', 0, '', '', '', 0, -1, '', '', '', NULL),
4705
        ('010', 'z', 'Canceled/invalid LC control number', 'Canceled/invalid LC control number', 1, 0, '', 0, '', '', '', 0, -1, 'HLD', '', '', NULL),
4706
        ('014', '6', 'Linkage', 'Linkage', 0, 0, '', 0, '', '', '', 0, -6, '', '', '', NULL),
4707
        ('014', 'a', 'Linkage number', 'Linkage number', 0, 0, '', 0, '', '', '', 0, 0, 'HLD', '', '', NULL),
4708
        ('014', 'b', 'Source of number', 'Source of number', 0, 0, '', 0, '', '', '', 0, -1, 'HLD', '', '', NULL),
4709
        ('014', 'z', 'Canceled/invalid linkage number', 'Canceled/invalid linkage number', 1, 0, '', 0, '', '', '', 0, -1, 'HLD', '', '', NULL),
4710
        ('016', '2', 'Source', 'Source', 0, 0, '', 0, '', '', '', 0, 0, '', '', '', NULL),
4711
        ('016', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 0, '', '', '', 0, -6, 'HLD', '', '', NULL),
4712
        ('016', 'a', 'Record control number', 'Record control number', 0, 0, '', 0, '', '', '', 0, 0, 'HLD', '', '', NULL),
4713
        ('016', 'z', 'Canceled/invalid control number', 'Canceled/invalid control number', 1, 0, '', 0, '', '', '', 0, -1, 'HLD', '', '', NULL),
4714
        ('017', '2', 'Source', 'Source', 0, 0, '', 0, '', '', '', 0, -6, '', '', '', NULL),
4715
        ('017', '6', 'Linkage', 'Linkage', 0, 0, '', 0, '', '', '', 0, -6, '', '', '', NULL),
4716
        ('017', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 0, '', '', '', 0, -6, 'HLD', '', '', NULL),
4717
        ('017', 'a', 'Copyright or legal deposit number', 'Copyright or legal deposit number', 1, 0, '', 0, '', '', '', 0, -6, 'HLD', '', '', NULL),
4718
        ('017', 'b', 'Assigning agency', 'Assigning agency', 0, 0, '', 0, '', '', '', 0, -6, 'HLD', '', '', NULL),
4719
        ('017', 'd', 'Date', 'Date', 0, 0, '', 0, '', '', NULL, 0, -6, 'HLD', '', '', NULL),
4720
        ('017', 'i', 'Display text', 'Display text', 0, 0, '', 0, '', '', '', 0, -6, 'HLD', '', '', NULL),
4721
        ('017', 'z', 'Canceled/invalid copyright or legal deposit number', 'Canceled/invalid copyright or legal deposit number', 1, 0, '', 0, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4722
        ('020', '6', 'Linkage', 'Linkage', 0, 0, '', 0, '', '', '', 0, -6, 'HLD', '', '', NULL),
4723
        ('020', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 0, '', '', '', 0, -6, 'HLD', '', '', NULL),
4724
        ('020', 'a', 'International Standard Book Number', 'International Standard Book Number', 0, 0, 'biblioitems.isbn', 0, '', '', '', 0, 0, 'HLD', '', '', NULL),
4725
        ('020', 'c', 'Terms of availability', 'Terms of availability', 0, 0, '', 0, '', '', '', 0, 0, 'HLD', '', '', NULL),
4726
        ('020', 'q', 'Qualifying information', 'Qualifying information', 1, 0, '', 0, '', '', '', 0, 0, 'HLD', '', '', NULL),
4727
        ('020', 'z', 'Canceled/invalid ISBN', 'Canceled/invalid ISBN', 1, 0, '', 0, '', '', '', 0, -1, 'HLD', '', '', NULL),
4728
        ('022', '2', 'Source', 'Source', 0, 0, '', 0, '', '', '', 0, 0, 'HLD', '', '', NULL),
4729
        ('022', '6', 'Linkage', 'Linkage', 0, 0, '', 0, '', '', '', 0, -6, 'HLD', '', '', NULL),
4730
        ('022', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 0, '', '', '', 0, -6, 'HLD', '', '', NULL),
4731
        ('022', 'a', 'International Standard Serial Number', 'International Standard Serial Number', 0, 0, 'biblioitems.issn', 0, '', '', '', 0, 0, 'HLD', '', '', NULL),
4732
        ('022', 'l', 'ISSN-L', 'ISSN-L', 0, 0, '', 0, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4733
        ('022', 'm', 'Canceled ISSN-L', 'Canceled ISSN-L', 1, 0, '', 0, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4734
        ('022', 'y', 'Incorrect ISSN', 'Incorrect ISSN', 1, 0, '', 0, '', '', '', 0, -1, 'HLD', '', '', NULL),
4735
        ('022', 'z', 'Canceled ISSN', 'Canceled ISSN', 1, 0, '', 0, '', '', '', 0, -1, 'HLD', '', '', NULL),
4736
        ('024', '2', 'Source of number or code', 'Source of number or code', 0, 0, '', 0, '', '', '', 0, 0, 'HLD', '', '', NULL),
4737
        ('024', '6', 'Linkage', 'Linkage', 0, 0, '', 0, '', '', '', 0, -6, 'HLD', '', '', NULL),
4738
        ('024', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 0, '', '', '', 0, -6, 'HLD', '', '', NULL),
4739
        ('024', 'a', 'Standard number or code', 'Standard number or code', 0, 0, '', 0, '', '', '', 0, 0, 'HLD', '', '', NULL),
4740
        ('024', 'b', 'Additional codes following the standard number [OBSOLETE]', 'Additional codes following the standard number [OBSOLETE]', 0, 0, '', 0, '', '', '', 0, -6, 'HLD', '', '', NULL),
4741
        ('024', 'c', 'Terms of availability', 'Terms of availability', 0, 0, '', 0, '', '', '', 0, 0, 'HLD', '', '', NULL),
4742
        ('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),
4743
        ('024', 'q', 'Qualifying information', 'Qualifying information', 1, 0, '', 0, '', '', '', 0, 0, 'HLD', '', '', NULL),
4744
        ('024', 'z', 'Canceled/invalid standard number or code', 'Canceled/invalid standard number or code', 1, 0, '', 0, '', '', '', 0, -1, 'HLD', '', '', NULL),
4745
        ('027', '6', 'Linkage', 'Linkage', 0, 0, '', 0, '', '', '', 0, -6, 'HLD', '', '', NULL),
4746
        ('027', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 0, '', '', '', 0, -6, 'HLD', '', '', NULL),
4747
        ('027', 'a', 'Standard technical report number', 'Standard technical report number', 0, 0, '', 0, '', '', '', 0, -1, 'HLD', '', '', NULL),
4748
        ('027', 'q', 'Qualifying information', 'Qualifying information', 1, 0, '', 0, '', '', '', 0, 0, 'HLD', '', '', NULL),
4749
        ('027', 'z', 'Canceled/invalid number', 'Canceled/invalid number', 1, 0, '', 0, '', '', '', 0, -1, 'HLD', '', '', NULL),
4750
        ('030', '6', 'Linkage', 'Linkage', 0, 0, '', 0, '', '', '', 0, -6, 'HLD', '', '', NULL),
4751
        ('030', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 0, '', '', '', 0, -6, 'HLD', '', '', NULL),
4752
        ('030', 'a', 'CODEN', 'CODEN', 0, 0, '', 0, '', '', '', 0, -6, 'HLD', '', '', NULL),
4753
        ('030', 'z', 'Canceled/invalid CODEN', 'Canceled/invalid CODEN', 1, 0, '', 0, '', '', '', 0, -6, 'HLD', '', '', NULL),
4754
        ('035', '6', 'Linkage', 'Linkage', 0, 0, '', 0, '', '', '', 0, -6, 'HLD', '', '', NULL),
4755
        ('035', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 0, '', '', '', 0, -6, 'HLD', '', '', NULL),
4756
        ('035', 'a', 'System control number', 'System control number', 0, 0, '', 0, '', '', '', 0, 0, 'HLD', '', '', NULL),
4757
        ('035', 'z', 'Canceled/invalid control number', 'Canceled/invalid control number', 1, 0, '', 0, '', '', '', 0, -1, 'HLD', '', '', NULL),
4758
        ('040', '6', 'Linkage', 'Linkage', 0, 0, '', 0, '', '', '', 0, -6, 'HLD', '', '', NULL),
4759
        ('040', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 0, '', '', '', 0, -6, 'HLD', '', '', NULL),
4760
        ('040', 'a', 'Original cataloging agency', 'Original cataloging agency', 0, 0, '', 0, '', '', '', 0, 0, 'HLD', '', '', NULL),
4761
        ('040', 'b', 'Language of cataloging', 'Language of cataloging', 0, 0, '', 0, '', '', '', 0, 0, 'HLD', '', '', NULL),
4762
        ('040', 'c', 'Transcribing agency', 'Transcribing agency', 0, 1, '', 0, '', '', '', 0, 0, 'HLD', '', '', NULL),
4763
        ('040', 'd', 'Modifying agency', 'Modifying agency', 1, 0, '', 0, '', '', '', 0, 0, 'HLD', '', '', NULL),
4764
        ('066', 'a', 'Primary G0 character set', 'Primary G0 character set', 0, 0, NULL, 0, NULL, NULL, '', NULL, -6, 'HLD', '', '', NULL),
4765
        ('066', 'b', 'Primary G1 character set', 'Primary G1 character set', 0, 0, NULL, 0, NULL, NULL, '', NULL, -6, 'HLD', '', '', NULL),
4766
        ('066', 'c', 'Alternate G0 or G1 character set', 'Alternate G0 or G1 character set', 1, 0, NULL, 0, NULL, NULL, '', NULL, -6, 'HLD', '', '', NULL),
4767
        ('337', '0', 'Authority record control number or standard number', 'Authority record control number or standard number', 1, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4768
        ('337', '1', 'Real World Object URI', 'Real World Object URI', 1, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4769
        ('337', '2', 'Source', 'Source', 0, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4770
        ('337', '3', 'Materials specified', 'Materials specified', 0, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4771
        ('337', '6', 'Linkage', 'Linkage', 0, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4772
        ('337', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4773
        ('337', 'a', 'Media type term', 'Media type term', 1, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4774
        ('337', 'b', 'Media type code', 'Media type code', 1, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4775
        ('338', '0', 'Authority record control number or standard number', 'Authority record control number or standard number', 1, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4776
        ('338', '1', 'Real World Object URI', 'Real World Object URI', 1, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4777
        ('338', '2', 'Source', 'Source', 0, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4778
        ('338', '3', 'Materials specified', 'Materials specified', 0, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4779
        ('338', '6', 'Linkage', 'Linkage', 0, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4780
        ('338', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4781
        ('338', 'a', 'Carrier type term', 'Carrier type term', 1, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4782
        ('338', 'b', 'Carrier type code', 'Carrier type code', 1, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4783
        ('347', 'a', 'File type', 'File type', 1, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4784
        ('347', '0', 'Authority record control number or standard number', 'Authority record control number or standard number', 1, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4785
        ('347', '1', 'Real World Object URI', 'Real World Object URI', 1, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4786
        ('347', '2', 'Source', 'Source', 0, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4787
        ('347', '3', 'Materials specified', 'Materials specified', 0, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4788
        ('347', '6', 'Linkage', 'Linkage', 0, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4789
        ('347', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4790
        ('347', 'b', 'Encoding format', 'Encoding format', 1, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4791
        ('347', 'c', 'File size', 'File size', 1, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4792
        ('347', 'd', 'Resolution', 'Resolution', 1, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4793
        ('347', 'e', 'Regional encoding', 'Regional encoding', 1, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4794
        ('347', 'f', 'Encoded bitrate', 'Encoded bitrate', 1, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4795
        ('506', '2', 'Source of term', 'Source of term', 0, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4796
        ('506', '3', 'Materials specified', 'Materials specified', 0, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4797
        ('506', '5', 'Institution to which field applies', 'Institution to which field applies', 0, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4798
        ('506', '6', 'Linkage', 'Linkage', 0, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4799
        ('506', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4800
        ('506', 'a', 'Terms governing access', 'Terms governing access', 0, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4801
        ('506', 'b', 'Jurisdiction', 'Jurisdiction', 1, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4802
        ('506', 'c', 'Physical access provisions', 'Physical access provisions', 1, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4803
        ('506', 'd', 'Authorized users', 'Authorized users', 1, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4804
        ('506', 'e', 'Authorization', 'Authorization', 1, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4805
        ('506', 'f', 'Standardized terminology for access restriction', 'Standardized terminology for access restriction', 1, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4806
        ('506', 'u', 'Uniform Resource Identifier', 'Uniform Resource Identifier', 1, 0, '', 5, '', '', '', 1, -6, 'HLD', '', '', NULL),
4807
        ('538', '3', 'Materials specified', 'Materials specified', 0, 0, NULL, 5, NULL, NULL, '', NULL, -6, 'HLD', '', '', NULL),
4808
        ('538', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4809
        ('538', '6', 'Linkage', 'Linkage', 0, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4810
        ('538', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4811
        ('538', 'a', 'System details note', 'System details note', 0, 0, '', 5, '', '', '', NULL, -1, 'HLD', '', '', NULL),
4812
        ('538', 'i', 'Display text', 'Display text', 0, 0, '', 5, '', '', '', NULL, -1, 'HLD', '', '', NULL),
4813
        ('538', 'u', 'Uniform Resource Identifier', 'Uniform Resource Identifier', 1, 0, '', 5, '', '', '', 1, -1, 'HLD', '', '', NULL),
4814
        ('541', '3', 'Materials specified', 'Materials specified', 0, 0, NULL, 5, NULL, NULL, '', NULL, -6, 'HLD', '', '', NULL),
4815
        ('541', '5', 'Institution to which field applies', 'Institution to which field applies', 0, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4816
        ('541', '6', 'Linkage', 'Linkage', 0, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4817
        ('541', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4818
        ('541', 'a', 'Source of acquisition', 'Source of acquisition', 0, 0, '', 5, '', '', '', NULL, 1, 'HLD', '', '', NULL),
4819
        ('541', 'b', 'Address', 'Address', 0, 0, '', 5, '', '', '', NULL, 1, 'HLD', '', '', NULL),
4820
        ('541', 'c', 'Method of acquisition', 'Method of acquisition', 0, 0, '', 5, '', '', '', NULL, 1, 'HLD', '', '', NULL),
4821
        ('541', 'd', 'Date of acquisition', 'Date of acquisition', 0, 0, '', 5, '', '', '', NULL, 1, 'HLD', '', '', NULL),
4822
        ('541', 'e', 'Accession number', 'Accession number', 0, 0, '', 5, '', '', '', NULL, 1, 'HLD', '', '', NULL),
4823
        ('541', 'f', 'Owner', 'Owner', 0, 0, '', 5, '', '', '', NULL, 1, 'HLD', '', '', NULL),
4824
        ('541', 'h', 'Purchase price', 'Purchase price', 0, 0, '', 5, '', '', '', NULL, 1, 'HLD', '', '', NULL),
4825
        ('541', 'n', 'Extent', 'Extent', 1, 0, '', 5, '', '', '', NULL, 1, 'HLD', '', '', NULL),
4826
        ('541', 'o', 'Type of unit', 'Type of unit', 1, 0, '', 5, '', '', '', NULL, 1, 'HLD', '', '', NULL),
4827
        ('561', '3', 'Materials specified', 'Materials specified', 0, 0, NULL, 5, NULL, NULL, '', NULL, -6, 'HLD', '', '', NULL),
4828
        ('561', '5', 'Institution to which field applies', 'Institution to which field applies', 0, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4829
        ('561', '6', 'Linkage', 'Linkage', 0, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4830
        ('561', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4831
        ('561', 'a', 'History', 'History', 0, 0, '', 5, '', '', '', NULL, 6, 'HLD', '', '', NULL),
4832
        ('561', 'b', 'Time of collation [OBSOLETE]', 'Time of collation [OBSOLETE]', 0, 0, '', 5, '', '', '', NULL, 6, 'HLD', '', '', NULL),
4833
        ('561', 'u', 'Uniform Resource Identifier', 'Uniform Resource Identifier', 1, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4834
        ('562', '3', 'Materials specified', 'Materials specified', 0, 0, NULL, 5, NULL, NULL, '', NULL, -6, 'HLD', '', '', NULL),
4835
        ('562', '5', 'Institution to which field applies', 'Institution to which field applies', 0, 0, NULL, -1, NULL, NULL, '', NULL, -6, 'HLD', '', '', NULL),
4836
        ('562', '6', 'Linkage', 'Linkage', 0, 0, NULL, 5, NULL, NULL, '', NULL, -6, 'HLD', '', '', NULL),
4837
        ('562', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, NULL, 5, NULL, NULL, '', NULL, -6, 'HLD', '', '', NULL),
4838
        ('562', 'a', 'Identifying markings', 'Identifying markings', 1, 0, NULL, 5, NULL, NULL, '', NULL, -1, 'HLD', '', '', NULL),
4839
        ('562', 'b', 'Copy identification', 'Copy identification', 1, 0, NULL, 5, NULL, NULL, '', NULL, -1, 'HLD', '', '', NULL),
4840
        ('562', 'c', 'Version identification', 'Version identification', 1, 0, NULL, 5, NULL, NULL, '', NULL, -1, 'HLD', '', '', NULL),
4841
        ('562', 'd', 'Presentation format', 'Presentation format', 1, 0, NULL, 5, NULL, NULL, '', NULL, -1, 'HLD', '', '', NULL),
4842
        ('562', 'e', 'Number of copies', 'Number of copies', 1, 0, NULL, 5, NULL, NULL, '', NULL, -1, 'HLD', '', '', NULL),
4843
        ('563', '3', 'Materials specified', 'Materials specified', 0, 0, NULL, 5, NULL, NULL, '', NULL, -6, 'HLD', '', '', NULL),
4844
        ('563', '5', 'Institution to which field applies', 'Institution to which field applies', 0, 0, NULL, -1, NULL, NULL, '', NULL, -6, 'HLD', '', '', NULL),
4845
        ('563', '6', 'Linkage', 'Linkage', 0, 0, NULL, 5, NULL, NULL, '', NULL, -6, 'HLD', '', '', NULL),
4846
        ('563', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, NULL, 5, NULL, NULL, '', NULL, -6, 'HLD', '', '', NULL),
4847
        ('563', 'a', 'Binding note', 'Binding note', 0, 0, NULL, 5, NULL, NULL, '', NULL, -1, 'HLD', '', '', NULL),
4848
        ('563', 'u', 'Uniform Resource Identifier', 'Uniform Resource Identifier', 1, 0, NULL, 5, NULL, NULL, '', 1, -1, 'HLD', '', '', NULL),
4849
        ('583', '2', 'Source of term', 'Source of term', 0, 0, NULL, 5, NULL, NULL, '', NULL, -6, 'HLD', '', '', NULL),
4850
        ('583', '3', 'Materials specified', 'Materials specified', 0, 0, NULL, 5, NULL, NULL, '', NULL, -6, 'HLD', '', '', NULL),
4851
        ('583', '5', 'Institution to which field applies', 'Institution to which field applies', 0, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4852
        ('583', '6', 'Linkage', 'Linkage', 0, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4853
        ('583', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4854
        ('583', 'a', 'Action', 'Action', 0, 0, '', 5, '', '', '', NULL, -1, 'HLD', '', '', NULL),
4855
        ('583', 'b', 'Action identification', 'Action identification', 1, 0, '', 5, '', '', '', NULL, -1, 'HLD', '', '', NULL),
4856
        ('583', 'c', 'Time/date of action', 'Time/date of action', 1, 0, '', 5, '', '', '', NULL, -1, 'HLD', '', '', NULL),
4857
        ('583', 'd', 'Action interval', 'Action interval', 1, 0, '', 5, '', '', '', NULL, -1, 'HLD', '', '', NULL),
4858
        ('583', 'e', 'Contingency for action', 'Contingency for action', 1, 0, '', 5, '', '', '', NULL, -1, 'HLD', '', '', NULL),
4859
        ('583', 'f', 'Authorization', 'Authorization', 1, 0, '', 5, '', '', '', NULL, -1, 'HLD', '', '', NULL),
4860
        ('583', 'h', 'Jurisdiction', 'Jurisdiction', 1, 0, '', 5, '', '', '', NULL, -1, 'HLD', '', '', NULL),
4861
        ('583', 'i', 'Method of action', 'Method of action', 1, 0, '', 5, '', '', '', NULL, -1, 'HLD', '', '', NULL),
4862
        ('583', 'j', 'Site of action', 'Site of action', 1, 0, '', 5, '', '', '', NULL, -1, 'HLD', '', '', NULL),
4863
        ('583', 'k', 'Action agent', 'Action agent', 1, 0, '', 5, '', '', '', NULL, -1, 'HLD', '', '', NULL),
4864
        ('583', 'l', 'Status', 'Status', 1, 0, '', 5, '', '', '', NULL, -1, 'HLD', '', '', NULL),
4865
        ('583', 'n', 'Extent', 'Extent', 1, 0, '', 5, '', '', '', NULL, -1, 'HLD', '', '', NULL),
4866
        ('583', 'o', 'Type of unit', 'Type of unit', 1, 0, '', 5, '', '', '', NULL, -1, 'HLD', '', '', NULL),
4867
        ('583', 'u', 'Uniform Resource Identifier', 'Uniform Resource Identifier', 1, 0, '', 5, '', '', '', 1, -1, 'HLD', '', '', NULL),
4868
        ('583', 'x', 'Nonpublic note', 'Nonpublic note', 1, 0, '', 5, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4869
        ('583', 'z', 'Public note', 'Public note', 1, 0, '', 5, '', '', '', NULL, -1, 'HLD', '', '', NULL),
4870
        ('842', '6', 'Linkage', 'Linkage', 0, 0, '', 8, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4871
        ('842', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 8, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4872
        ('842', 'a', 'Textual physical form designator', 'Textual physical form designator', 0, 0, '', 8, '', '', '', NULL, -1, 'HLD', '', '', NULL),
4873
        ('843', '3', 'Materials specified', 'Materials specified', 0, 0, NULL, 8, NULL, NULL, '', NULL, -6, 'HLD', '', '', NULL),
4874
        ('843', '5', 'Institution to which field applies', 'Institution to which field applies', 0, 0, NULL, -1, NULL, NULL, '', NULL, -6, 'HLD', '', '', NULL),
4875
        ('843', '6', 'Linkage', 'Linkage', 0, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4876
        ('843', '7', 'Fixed-length data elements of reproduction', 'Fixed-length data elements of reproduction', 0, 0, NULL, 8, NULL, NULL, '', NULL, -6, 'HLD', '', '', NULL),
4877
        ('843', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 8, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4878
        ('843', 'a', 'Type of reproduction', 'Type of reproduction', 0, 0, NULL, 8, NULL, NULL, '', NULL, -1, 'HLD', '', '', NULL),
4879
        ('843', 'b', 'Place of reproduction', 'Place of reproduction', 1, 0, NULL, 8, NULL, NULL, '', NULL, -1, 'HLD', '', '', NULL),
4880
        ('843', 'c', 'Agency responsible for reproduction', 'Agency responsible for reproduction', 1, 0, NULL, 8, NULL, NULL, '', NULL, -1, 'HLD', '', '', NULL),
4881
        ('843', 'd', 'Date of reproduction', 'Date of reproduction', 0, 0, NULL, 8, NULL, NULL, '', NULL, -1, 'HLD', '', '', NULL),
4882
        ('843', 'e', 'Physical description of reproduction', 'Physical description of reproduction', 0, 0, NULL, 8, NULL, NULL, '', NULL, -1, 'HLD', '', '', NULL),
4883
        ('843', 'f', 'Series statement of reproduction', 'Series statement of reproduction', 1, 0, NULL, 8, NULL, NULL, '', NULL, -1, 'HLD', '', '', NULL),
4884
        ('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),
4885
        ('843', 'n', 'Note about reproduction', 'Note about reproduction', 1, 0, NULL, 8, NULL, NULL, '', NULL, -1, 'HLD', '', '', NULL),
4886
        ('844', '6', 'Linkage', 'Linkage', 0, 0, '', 8, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4887
        ('844', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 8, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4888
        ('844', 'a', 'Name of unit', 'Name of unit', 0, 0, '', 8, '', '', '', NULL, -1, 'HLD', '', '', NULL),
4889
        ('845', 'a', 'Terms governing use and reproduction', 'Terms governing use and reproduction', 0, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4890
        ('845', 'b', 'Jurisdiction', 'Jurisdiction', 0, 0, '', 8, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4891
        ('845', 'c', 'Authorization', 'Authorization', 0, 0, '', 8, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4892
        ('845', 'd', 'Authorized users', 'Authorized users', 0, 0, '', 8, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4893
        ('845', 'u', 'Uniform Resource Identifier', 'Uniform Resource Identifier', 1, 0, '', 8, '', '', '', 1, -6, 'HLD', '', '', NULL),
4894
        ('850', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, NULL, 8, NULL, NULL, '', NULL, 4, 'HLD', '', '', NULL),
4895
        ('850', 'a', 'Holding institution', 'Holding institution', 1, 0, NULL, 8, NULL, NULL, '', NULL, 4, 'HLD', '', '', NULL),
4896
        ('850', 'b', 'Holdings (NR) (MU VM SE) [OBSOLETE]', 'Holdings (NR) (MU VM SE) [OBSOLETE]', 0, 0, NULL, 8, NULL, NULL, '', NULL, 4, 'HLD', '', '', NULL),
4897
        ('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),
4898
        ('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),
4899
        ('852', '2', 'Source of classification or shelving scheme', 'Source of classification or shelving scheme', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4900
        ('852', '3', 'Materials specified', 'Materials specified', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4901
        ('852', '6', 'Linkage', 'Linkage', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4902
        ('852', '8', 'Sequence number', 'Sequence number', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4903
        ('852', 'a', 'Location', 'Location', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4904
        ('852', 'b', 'Sublocation or collection', 'Sublocation or collection', 1, 0, 'holdings.holdingbranch', 8, 'branches', '', '', NULL, 4, 'HLD', '', '', NULL),
4905
        ('852', 'c', 'Shelving location', 'Shelving location', 1, 0, 'holdings.location', 8, 'LOC', '', '', NULL, 4, 'HLD', '', '', NULL),
4906
        ('852', 'd', 'Former shelving location', 'Former shelving location', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4907
        ('852', 'e', 'Address', 'Address', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4908
        ('852', 'f', 'Coded location qualifier', 'Coded location qualifier', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4909
        ('852', 'g', 'Non-coded location qualifier', 'Non-coded location qualifier', 1, 0, 'holdings.ccode', 8, 'CCODE', '', '', NULL, 4, 'HLD', '', '', NULL),
4910
        ('852', 'h', 'Classification part', 'Classification part', 0, 0, 'holdings.callnumber', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4911
        ('852', 'i', 'Item part', 'Item part', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4912
        ('852', 'j', 'Shelving control number', 'Shelving control number', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4913
        ('852', 'k', 'Call number prefix', 'Call number prefix', 1, 0, 'holdings.callnumber', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4914
        ('852', 'l', 'Shelving form of title', 'Shelving form of title', 0, 0, 'holdings.callnumber', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4915
        ('852', 'm', 'Call number suffix', 'Call number suffix', 1, 0, 'holdings.callnumber', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4916
        ('852', 'n', 'Country code', 'Country code', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4917
        ('852', 'p', 'Piece designation', 'Piece designation', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4918
        ('852', 'q', 'Piece physical condition', 'Piece physical condition', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4919
        ('852', 's', 'Copyright article-fee code', 'Copyright article-fee code', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4920
        ('852', 't', 'Copy number', 'Copy number', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4921
        ('852', 'u', 'Uniform Resource Identifier', 'Uniform Resource Identifier', 1, 0, '', 8, '', '', '', 1, 4, 'HLD', '', '', NULL),
4922
        ('852', 'x', 'Nonpublic note', 'Nonpublic note', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4923
        ('852', 'z', 'Public note', 'Public note', 1, 0, 'holdings.public_note', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4924
        ('853', '3', 'Materials specified', 'Materials specified', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4925
        ('853', '6', 'Linkage', 'Linkage', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4926
        ('853', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4927
        ('853', 'a', 'First level of enumeration', 'First level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4928
        ('853', 'b', 'Second level of enumeration', 'Second level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4929
        ('853', 'c', 'Third level of enumeration', 'Third level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4930
        ('853', 'd', 'Fourth level of enumeration', 'Fourth level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4931
        ('853', 'e', 'Fifth level of enumeration', 'Fifth level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4932
        ('853', 'f', 'Sixth level of enumeration', 'Sixth level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4933
        ('853', 'g', 'Alternative numbering scheme, first level of enumeration', 'Alternative numbering scheme, first level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4934
        ('853', 'h', 'Alternative numbering scheme, second level of enumeration', 'Alternative numbering scheme, second level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4935
        ('853', 'i', 'First level of chronology', 'First level of chronology', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4936
        ('853', 'j', 'Second level of chronology', 'Second level of chronology', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4937
        ('853', 'k', 'Third level of chronology', 'Third level of chronology', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4938
        ('853', 'l', 'Fourth level of chronology', 'Fourth level of chronology', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4939
        ('853', 'm', 'Alternative numbering scheme, chronology', 'Alternative numbering scheme, chronology', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4940
        ('853', 'n', 'Pattern note', 'Pattern note', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4941
        ('853', 'p', 'Number of pieces per issuance', 'Number of pieces per issuance', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4942
        ('853', 't', 'Copy', 'Copy', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4943
        ('853', 'u', 'Bibliographic units per next higher level', 'Bibliographic units per next higher level', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4944
        ('853', 'v', 'Numbering continuity', 'Numbering continuity', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4945
        ('853', 'w', 'Frequency', 'Frequency', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4946
        ('853', 'x', 'Calendar change', 'Calendar change', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4947
        ('853', 'y', 'Regularity pattern', 'Regularity pattern', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4948
        ('853', 'z', 'Numbering scheme', 'Numbering scheme', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4949
        ('854', '3', 'Materials specified', 'Materials specified', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4950
        ('854', '6', 'Linkage', 'Linkage', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4951
        ('854', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4952
        ('854', 'a', 'First level of enumeration', 'First level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4953
        ('854', 'b', 'Second level of enumeration', 'Second level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4954
        ('854', 'c', 'Third level of enumeration', 'Third level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4955
        ('854', 'd', 'Fourth level of enumeration', 'Fourth level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4956
        ('854', 'e', 'Fifth level of enumeration', 'Fifth level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4957
        ('854', 'f', 'Sixth level of enumeration', 'Sixth level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4958
        ('854', 'g', 'Alternative numbering scheme, first level of enumeration', 'Alternative numbering scheme, first level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4959
        ('854', 'h', 'Alternative numbering scheme, second level of enumeration', 'Alternative numbering scheme, second level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4960
        ('854', 'i', 'First level of chronology', 'First level of chronology', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4961
        ('854', 'j', 'Second level of chronology', 'Second level of chronology', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4962
        ('854', 'k', 'Third level of chronology', 'Third level of chronology', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4963
        ('854', 'l', 'Fourth level of chronology', 'Fourth level of chronology', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4964
        ('854', 'm', 'Alternative numbering scheme, chronology', 'Alternative numbering scheme, chronology', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4965
        ('854', 'n', 'Pattern note', 'Pattern note', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4966
        ('854', 'p', 'Number of pieces per issuance', 'Number of pieces per issuance', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4967
        ('854', 't', 'Copy', 'Copy', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4968
        ('854', 'u', 'Bibliographic units per next higher level', 'Bibliographic units per next higher level', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4969
        ('854', 'v', 'Numbering continuity', 'Numbering continuity', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4970
        ('854', 'w', 'Frequency', 'Frequency', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4971
        ('854', 'x', 'Calendar change', 'Calendar change', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4972
        ('854', 'y', 'Regularity pattern', 'Regularity pattern', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4973
        ('854', 'z', 'Numbering scheme', 'Numbering scheme', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4974
        ('855', '3', 'Materials specified', 'Materials specified', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4975
        ('855', '6', 'Linkage', 'Linkage', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4976
        ('855', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4977
        ('855', 'a', 'First level of enumeration', 'First level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4978
        ('855', 'b', 'Second level of enumeration', 'Second level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4979
        ('855', 'c', 'Third level of enumeration', 'Third level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4980
        ('855', 'd', 'Fourth level of enumeration', 'Fourth level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4981
        ('855', 'e', 'Fifth level of enumeration', 'Fifth level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4982
        ('855', 'f', 'Sixth level of enumeration', 'Sixth level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4983
        ('855', 'g', 'Alternative numbering scheme, first level of enumeration', 'Alternative numbering scheme, first level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4984
        ('855', 'h', 'Alternative numbering scheme, second level of enumeration', 'Alternative numbering scheme, second level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4985
        ('855', 'i', 'First level of chronology', 'First level of chronology', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4986
        ('855', 'j', 'Second level of chronology', 'Second level of chronology', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4987
        ('855', 'k', 'Third level of chronology', 'Third level of chronology', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4988
        ('855', 'l', 'Fourth level of chronology', 'Fourth level of chronology', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4989
        ('855', 'm', 'Alternative numbering scheme, chronology', 'Alternative numbering scheme, chronology', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4990
        ('855', 'n', 'Pattern note', 'Pattern note', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4991
        ('855', 'p', 'Number of pieces per issuance', 'Number of pieces per issuance', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4992
        ('855', 't', 'Copy', 'Copy', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4993
        ('855', 'u', 'Bibliographic units per next higher level', 'Bibliographic units per next higher level', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4994
        ('855', 'v', 'Numbering continuity', 'Numbering continuity', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4995
        ('855', 'w', 'Frequency', 'Frequency', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4996
        ('855', 'x', 'Calendar change', 'Calendar change', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4997
        ('855', 'y', 'Regularity pattern', 'Regularity pattern', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4998
        ('855', 'z', 'Numbering scheme', 'Numbering scheme', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4999
        ('856', '2', 'Access method', 'Access method', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5000
        ('856', '3', 'Materials specified', 'Materials specified', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5001
        ('856', '6', 'Linkage', 'Linkage', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5002
        ('856', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5003
        ('856', 'a', 'Host name', 'Host name', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5004
        ('856', 'b', 'Access number', 'Access number', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5005
        ('856', 'c', 'Compression information', 'Compression information', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5006
        ('856', 'd', 'Path', 'Path', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5007
        ('856', 'f', 'Electronic name', 'Electronic name', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5008
        ('856', 'h', 'Processor of request', 'Processor of request', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5009
        ('856', 'i', 'Instruction', 'Instruction', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5010
        ('856', 'j', 'Bits per second', 'Bits per second', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5011
        ('856', 'k', 'Password', 'Password', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5012
        ('856', 'l', 'Logon', 'Logon', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5013
        ('856', 'm', 'Contact for access assistance', 'Contact for access assistance', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5014
        ('856', 'n', 'Name of location of host', 'Name of location of host', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5015
        ('856', 'o', 'Operating system', 'Operating system', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5016
        ('856', 'p', 'Port', 'Port', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5017
        ('856', 'q', 'Electronic format type', 'Electronic format type', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5018
        ('856', 'r', 'Settings', 'Settings', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5019
        ('856', 's', 'File size', 'File size', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5020
        ('856', 't', 'Terminal emulation', 'Terminal emulation', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5021
        ('856', 'u', 'Uniform Resource Identifier', 'Uniform Resource Identifier', 1, 0, 'biblioitems.url', 8, '', '', '', 1, 4, 'HLD', '', '', NULL),
5022
        ('856', 'v', 'Hours access method available', 'Hours access method available', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5023
        ('856', 'w', 'Record control number', 'Record control number', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5024
        ('856', 'x', 'Nonpublic note', 'Nonpublic note', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5025
        ('856', 'y', 'Link text', 'Link text', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5026
        ('856', 'z', 'Public note', 'Public note', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5027
        ('863', '6', 'Linkage', 'Linkage', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5028
        ('863', '8', 'Field link and sequence number', 'Field link and sequence number', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5029
        ('863', 'a', 'First level of enumeration', 'First level of enumeration', 0, 0, 'holdings.summary', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5030
        ('863', 'b', 'Second level of enumeration', 'Second level of enumeration', 0, 0, 'holdings.summary', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5031
        ('863', 'c', 'Third level of enumeration', 'Third level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5032
        ('863', 'd', 'Fourth level of enumeration', 'Fourth level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5033
        ('863', 'e', 'Fifth level of enumeration', 'Fifth level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5034
        ('863', 'f', 'Sixth level of enumeration', 'Sixth level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5035
        ('863', 'g', 'Alternative numbering scheme, first level of enumeration', 'Alternative numbering scheme, first level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5036
        ('863', 'h', 'Alternative numbering scheme, second level of enumeration', 'Alternative numbering scheme, second level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5037
        ('863', 'i', 'First level of chronology', 'First level of chronology', 0, 0, 'holdings.summary', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5038
        ('863', 'j', 'Second level of chronology', 'Second level of chronology', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5039
        ('863', 'k', 'Third level of chronology', 'Third level of chronology', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5040
        ('863', 'l', 'Fourth level of chronology', 'Fourth level of chronology', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5041
        ('863', 'm', 'Alternative numbering scheme, chronology', 'Alternative numbering scheme, chronology', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5042
        ('863', 'n', 'Converted Gregorian year', 'Converted Gregorian year', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5043
        ('863', 'o', 'Type of unit', 'Type of unit', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5044
        ('863', 'p', 'Piece designation', 'Piece designation', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5045
        ('863', 'q', 'Piece physical condition', 'Piece physical condition', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5046
        ('863', 's', 'Copyright article-fee code', 'Copyright article-fee code', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5047
        ('863', 't', 'Copy number', 'Copy number', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5048
        ('863', 'v', 'Issuing date', 'Issuing date', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5049
        ('863', 'w', 'Break indicator', 'Break indicator', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5050
        ('863', 'x', 'Nonpublic note', 'Nonpublic note', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5051
        ('863', 'z', 'Public note', 'Public note', 1, 0, 'holdings.summary', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5052
        ('864', '6', 'Linkage', 'Linkage', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5053
        ('864', '8', 'Field link and sequence number', 'Field link and sequence number', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5054
        ('864', 'a', 'First level of enumeration', 'First level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5055
        ('864', 'b', 'Second level of enumeration', 'Second level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5056
        ('864', 'c', 'Third level of enumeration', 'Third level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5057
        ('864', 'd', 'Fourth level of enumeration', 'Fourth level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5058
        ('864', 'e', 'Fifth level of enumeration', 'Fifth level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5059
        ('864', 'f', 'Sixth level of enumeration', 'Sixth level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5060
        ('864', 'g', 'Alternative numbering scheme, first level of enumeration', 'Alternative numbering scheme, first level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5061
        ('864', 'h', 'Alternative numbering scheme, second level of enumeration', 'Alternative numbering scheme, second level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5062
        ('864', 'i', 'First level of chronology', 'First level of chronology', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5063
        ('864', 'j', 'Second level of chronology', 'Second level of chronology', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5064
        ('864', 'k', 'Third level of chronology', 'Third level of chronology', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5065
        ('864', 'l', 'Fourth level of chronology', 'Fourth level of chronology', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5066
        ('864', 'm', 'Alternative numbering scheme, chronology', 'Alternative numbering scheme, chronology', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5067
        ('864', 'n', 'Converted Gregorian year', 'Converted Gregorian year', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5068
        ('864', 'o', 'Type of unit', 'Type of unit', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5069
        ('864', 'p', 'Piece designation', 'Piece designation', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5070
        ('864', 'q', 'Piece physical condition', 'Piece physical condition', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5071
        ('864', 's', 'Copyright article-fee code', 'Copyright article-fee code', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5072
        ('864', 't', 'Copy number', 'Copy number', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5073
        ('864', 'v', 'Issuing date', 'Issuing date', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5074
        ('864', 'w', 'Break indicator', 'Break indicator', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5075
        ('864', 'x', 'Nonpublic note', 'Nonpublic note', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5076
        ('864', 'z', 'Public note', 'Public note', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5077
        ('865', '6', 'Linkage', 'Linkage', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5078
        ('865', '8', 'Field link and sequence number', 'Field link and sequence number', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5079
        ('865', 'a', 'First level of enumeration', 'First level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5080
        ('865', 'b', 'Second level of enumeration', 'Second level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5081
        ('865', 'c', 'Third level of enumeration', 'Third level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5082
        ('865', 'd', 'Fourth level of enumeration', 'Fourth level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5083
        ('865', 'e', 'Fifth level of enumeration', 'Fifth level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5084
        ('865', 'f', 'Sixth level of enumeration', 'Sixth level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5085
        ('865', 'g', 'Alternative numbering scheme, first level of enumeration', 'Alternative numbering scheme, first level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5086
        ('865', 'h', 'Alternative numbering scheme, second level of enumeration', 'Alternative numbering scheme, second level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5087
        ('865', 'i', 'First level of chronology', 'First level of chronology', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5088
        ('865', 'j', 'Second level of chronology', 'Second level of chronology', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5089
        ('865', 'k', 'Third level of chronology', 'Third level of chronology', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5090
        ('865', 'l', 'Fourth level of chronology', 'Fourth level of chronology', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5091
        ('865', 'm', 'Alternative numbering scheme, chronology', 'Alternative numbering scheme, chronology', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5092
        ('865', 'n', 'Converted Gregorian year', 'Converted Gregorian year', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5093
        ('865', 'o', 'Type of unit', 'Type of unit', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5094
        ('865', 'p', 'Piece designation', 'Piece designation', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5095
        ('865', 'q', 'Piece physical condition', 'Piece physical condition', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5096
        ('865', 's', 'Copyright article-fee code', 'Copyright article-fee code', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5097
        ('865', 't', 'Copy number', 'Copy number', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5098
        ('865', 'v', 'Issuing date', 'Issuing date', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5099
        ('865', 'w', 'Break indicator', 'Break indicator', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5100
        ('865', 'x', 'Nonpublic note', 'Nonpublic note', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5101
        ('865', 'z', 'Public note', 'Public note', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5102
        ('866', '6', 'Linkage', 'Linkage', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5103
        ('866', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5104
        ('866', 'a', 'Textual string', 'Textual string', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5105
        ('866', 'x', 'Nonpublic note', 'Nonpublic note', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5106
        ('866', 'z', 'Public note', 'Public note', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5107
        ('867', '6', 'Linkage', 'Linkage', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5108
        ('867', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5109
        ('867', 'a', 'Textual string', 'Textual string', 0, 0, 'holdings.supplements', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5110
        ('867', 'x', 'Nonpublic note', 'Nonpublic note', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5111
        ('867', 'z', 'Public note', 'Public note', 1, 0, 'holdings.supplements', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5112
        ('868', '6', 'Linkage', 'Linkage', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5113
        ('868', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5114
        ('868', 'a', 'Textual string', 'Textual string', 0, 0, 'holdings.indexes', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5115
        ('868', 'x', 'Nonpublic note', 'Nonpublic note', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5116
        ('868', 'z', 'Public note', 'Public note', 1, 0, 'holdings.indexes', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5117
        ('876', '3', 'Materials specified', 'Materials specified', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5118
        ('876', '6', 'Linkage', 'Linkage', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5119
        ('876', '8', 'Sequence number', 'Sequence number', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5120
        ('876', 'a', 'Internal item number', 'Internal item number', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5121
        ('876', 'b', 'Invalid or canceled internal item number', 'Invalid or canceled internal item number', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5122
        ('876', 'c', 'Cost', 'Cost', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5123
        ('876', 'd', 'Date acquired', 'Date acquired', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5124
        ('876', 'e', 'Source of acquisition', 'Source of acquisition', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5125
        ('876', 'h', 'Use restrictions', 'Use restrictions', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5126
        ('876', 'j', 'Item status', 'Item status', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5127
        ('876', 'l', 'Temporary location', 'Temporary location', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5128
        ('876', 'p', 'Piece designation', 'Piece designation', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5129
        ('876', 'r', 'Invalid or canceled piece designation', 'Invalid or canceled piece designation', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5130
        ('876', 't', 'Copy number', 'Copy number', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5131
        ('876', 'x', 'Nonpublic note', 'Nonpublic note', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5132
        ('876', 'z', 'Public note', 'Public note', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5133
        ('877', '3', 'Materials specified', 'Materials specified', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5134
        ('877', '6', 'Linkage', 'Linkage', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5135
        ('877', '8', 'Sequence number', 'Sequence number', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5136
        ('877', 'a', 'Internal item number', 'Internal item number', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5137
        ('877', 'b', 'Invalid or canceled internal item number', 'Invalid or canceled internal item number', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5138
        ('877', 'c', 'Cost', 'Cost', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5139
        ('877', 'd', 'Date acquired', 'Date acquired', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5140
        ('877', 'e', 'Source of acquisition', 'Source of acquisition', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5141
        ('877', 'h', 'Use restrictions', 'Use restrictions', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5142
        ('877', 'j', 'Item status', 'Item status', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5143
        ('877', 'l', 'Temporary location', 'Temporary location', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5144
        ('877', 'p', 'Piece designation', 'Piece designation', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5145
        ('877', 'r', 'Invalid or canceled piece designation', 'Invalid or canceled piece designation', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5146
        ('877', 't', 'Copy number', 'Copy number', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5147
        ('877', 'x', 'Nonpublic note', 'Nonpublic note', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5148
        ('877', 'z', 'Public note', 'Public note', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5149
        ('878', '3', 'Materials specified', 'Materials specified', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5150
        ('878', '6', 'Linkage', 'Linkage', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5151
        ('878', '8', 'Sequence number', 'Sequence number', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5152
        ('878', 'a', 'Internal item number', 'Internal item number', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5153
        ('878', 'b', 'Invalid or canceled internal item number', 'Invalid or canceled internal item number', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5154
        ('878', 'c', 'Cost', 'Cost', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5155
        ('878', 'd', 'Date acquired', 'Date acquired', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5156
        ('878', 'e', 'Source of acquisition', 'Source of acquisition', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5157
        ('878', 'h', 'Use restrictions', 'Use restrictions', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5158
        ('878', 'j', 'Item status', 'Item status', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5159
        ('878', 'l', 'Temporary location', 'Temporary location', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5160
        ('878', 'p', 'Piece designation', 'Piece designation', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5161
        ('878', 'r', 'Invalid or canceled piece designation', 'Invalid or canceled piece designation', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5162
        ('878', 't', 'Copy number', 'Copy number', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5163
        ('878', 'x', 'Nonpublic note', 'Nonpublic note', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5164
        ('878', 'z', 'Public note', 'Public note', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL);
(-)a/installer/data/mysql/kohastructure.sql (-2 / +48 lines)
Lines 698-703 CREATE TABLE `deleteditems` ( Link Here
698
  `copynumber` varchar(32) default NULL, -- copy number (MARC21 952$t)
698
  `copynumber` varchar(32) default NULL, -- copy number (MARC21 952$t)
699
  `stocknumber` varchar(32) default NULL, -- inventory number (MARC21 952$i)
699
  `stocknumber` varchar(32) default NULL, -- inventory number (MARC21 952$i)
700
  `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.
700
  `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.
701
  `holding_id` int(11) default NULL, -- foreign key from holdings table used to link this item to the right holdings record
701
  PRIMARY KEY  (`itemnumber`),
702
  PRIMARY KEY  (`itemnumber`),
702
  KEY `delitembarcodeidx` (`barcode`),
703
  KEY `delitembarcodeidx` (`barcode`),
703
  KEY `delitemstocknumberidx` (`stocknumber`),
704
  KEY `delitemstocknumberidx` (`stocknumber`),
Lines 910-921 CREATE TABLE `refund_lost_item_fee_rules` ( -- refund lost item fee rules tbale Link Here
910
  PRIMARY KEY  (`branchcode`)
911
  PRIMARY KEY  (`branchcode`)
911
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
912
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
912
913
914
--
915
-- Table structure for table `holdings`
916
--
917
918
DROP TABLE IF EXISTS `holdings`;
919
CREATE TABLE `holdings` ( -- table that stores summary holdings information
920
  `holding_id` int(11) NOT NULL auto_increment, -- unique identifier assigned to each holdings record
921
  `biblionumber` int(11) NOT NULL default 0, -- foreign key from biblio table used to link this record to the right bib record
922
  `frameworkcode` varchar(4) NOT NULL default '', -- foreign key from the biblio_framework table to identify which framework was used in cataloging this record
923
  `holdingbranch` varchar(10) default NULL, -- foreign key from the branches table for the library that owns this record (MARC21 852$a)
924
  `location` varchar(80) default NULL, -- authorized value for the shelving location for this record (MARC21 852$b)
925
  `ccode` varchar(80) default NULL, -- authorized value for the collection code associated with this item (MARC21 852$g)
926
  `callnumber` varchar(255) default NULL, -- call number (852$h+$i in MARC21)
927
  `suppress` tinyint(1) default NULL, -- Boolean indicating whether the record is suppressed in OPAC
928
  `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, -- date and time this record was last touched
929
  `datecreated` DATE NOT NULL, -- the date this record was added to Koha
930
	`deleted_on` DATETIME DEFAULT NULL, -- the date this record was deleted
931
  PRIMARY KEY  (`holding_id`),
932
  KEY `hldnoidx` (`holding_id`),
933
  KEY `hldbibnoidx` (`biblionumber`),
934
  CONSTRAINT `holdings_ibfk_1` FOREIGN KEY (`biblionumber`) REFERENCES `biblio` (`biblionumber`) ON DELETE CASCADE ON UPDATE CASCADE,
935
  CONSTRAINT `holdings_ibfk_2` FOREIGN KEY (`holdingbranch`) REFERENCES `branches` (`branchcode`) ON UPDATE CASCADE
936
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
937
938
--
939
-- Table structure for table `holdings_metadata`
940
--
941
942
DROP TABLE IF EXISTS `holdings_metadata`;
943
CREATE TABLE `holdings_metadata` (
944
  `id` INT(11) NOT NULL AUTO_INCREMENT,
945
  `holding_id` INT(11) NOT NULL,
946
  `format` VARCHAR(16) NOT NULL,
947
  `schema` VARCHAR(16) NOT NULL,
948
  `metadata` LONGTEXT NOT NULL,
949
	`deleted_on` DATETIME DEFAULT NULL, -- the date this record was deleted
950
  PRIMARY KEY(id),
951
  UNIQUE KEY `holdings_metadata_uniq_key` (`holding_id`,`format`,`schema`),
952
  KEY `hldnoidx` (`holding_id`),
953
  CONSTRAINT `holdings_metadata_fk_1` FOREIGN KEY (`holding_id`) REFERENCES `holdings` (`holding_id`) ON DELETE CASCADE ON UPDATE CASCADE
954
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
955
913
--
956
--
914
-- Table structure for table `items`
957
-- Table structure for table `items`
915
--
958
--
916
959
917
DROP TABLE IF EXISTS `items`;
960
DROP TABLE IF EXISTS `items`;
918
CREATE TABLE `items` ( -- holdings/item information
961
CREATE TABLE `items` ( -- item information
919
  `itemnumber` int(11) NOT NULL auto_increment, -- primary key and unique identifier added by Koha
962
  `itemnumber` int(11) NOT NULL auto_increment, -- primary key and unique identifier added by Koha
920
  `biblionumber` int(11) NOT NULL default 0, -- foreign key from biblio table used to link this item to the right bib record
963
  `biblionumber` int(11) NOT NULL default 0, -- foreign key from biblio table used to link this item to the right bib record
921
  `biblioitemnumber` int(11) NOT NULL default 0, -- foreign key from the biblioitems table to link to item to additional information
964
  `biblioitemnumber` int(11) NOT NULL default 0, -- foreign key from the biblioitems table to link to item to additional information
Lines 961-966 CREATE TABLE `items` ( -- holdings/item information Link Here
961
  `copynumber` varchar(32) default NULL, -- copy number (MARC21 952$t)
1004
  `copynumber` varchar(32) default NULL, -- copy number (MARC21 952$t)
962
  `stocknumber` varchar(32) default NULL, -- inventory number (MARC21 952$i)
1005
  `stocknumber` varchar(32) default NULL, -- inventory number (MARC21 952$i)
963
  `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.
1006
  `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.
1007
  `holding_id` int(11) default NULL, -- foreign key from holdings table used to link this item to the right holdings record
964
  PRIMARY KEY  (`itemnumber`),
1008
  PRIMARY KEY  (`itemnumber`),
965
  UNIQUE KEY `itembarcodeidx` (`barcode`),
1009
  UNIQUE KEY `itembarcodeidx` (`barcode`),
966
  KEY `itemstocknumberidx` (`stocknumber`),
1010
  KEY `itemstocknumberidx` (`stocknumber`),
Lines 973-982 CREATE TABLE `items` ( -- holdings/item information Link Here
973
  KEY `items_ccode` (`ccode`),
1017
  KEY `items_ccode` (`ccode`),
974
  KEY `itype_idx` (`itype`),
1018
  KEY `itype_idx` (`itype`),
975
  KEY `timestamp` (`timestamp`),
1019
  KEY `timestamp` (`timestamp`),
1020
  KEY `hldid_idx` (`holding_id`),
976
  CONSTRAINT `items_ibfk_1` FOREIGN KEY (`biblioitemnumber`) REFERENCES `biblioitems` (`biblioitemnumber`) ON DELETE CASCADE ON UPDATE CASCADE,
1021
  CONSTRAINT `items_ibfk_1` FOREIGN KEY (`biblioitemnumber`) REFERENCES `biblioitems` (`biblioitemnumber`) ON DELETE CASCADE ON UPDATE CASCADE,
977
  CONSTRAINT `items_ibfk_2` FOREIGN KEY (`homebranch`) REFERENCES `branches` (`branchcode`) ON UPDATE CASCADE,
1022
  CONSTRAINT `items_ibfk_2` FOREIGN KEY (`homebranch`) REFERENCES `branches` (`branchcode`) ON UPDATE CASCADE,
978
  CONSTRAINT `items_ibfk_3` FOREIGN KEY (`holdingbranch`) REFERENCES `branches` (`branchcode`) ON UPDATE CASCADE,
1023
  CONSTRAINT `items_ibfk_3` FOREIGN KEY (`holdingbranch`) REFERENCES `branches` (`branchcode`) ON UPDATE CASCADE,
979
  CONSTRAINT `items_ibfk_4` FOREIGN KEY (`biblionumber`) REFERENCES `biblio` (`biblionumber`) ON DELETE CASCADE ON UPDATE CASCADE
1024
  CONSTRAINT `items_ibfk_4` FOREIGN KEY (`biblionumber`) REFERENCES `biblio` (`biblionumber`) ON DELETE CASCADE ON UPDATE CASCADE,
1025
  CONSTRAINT `items_ibfk_5` FOREIGN KEY (`holding_id`) REFERENCES `holdings` (`holding_id`) ON DELETE CASCADE ON UPDATE CASCADE
980
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
1026
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
981
1027
982
--
1028
--
(-)a/installer/data/mysql/mandatory/auth_val_cat.sql (+1 lines)
Lines 22-27 INSERT IGNORE INTO authorised_value_categories( category_name ) Link Here
22
INSERT IGNORE INTO authorised_value_categories( category_name )
22
INSERT IGNORE INTO authorised_value_categories( category_name )
23
    VALUES
23
    VALUES
24
    ('branches'),
24
    ('branches'),
25
    ('holdings'),
25
    ('itemtypes'),
26
    ('itemtypes'),
26
    ('cn_source');
27
    ('cn_source');
27
28
(-)a/installer/data/mysql/sysprefs.sql (+1 lines)
Lines 560-565 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
560
('SubscriptionHistory','simplified','simplified|full','Define the display preference for serials issue history in OPAC','Choice'),
560
('SubscriptionHistory','simplified','simplified|full','Define the display preference for serials issue history in OPAC','Choice'),
561
('SubscriptionLog','1',NULL,'If ON, enables subscriptions log','YesNo'),
561
('SubscriptionLog','1',NULL,'If ON, enables subscriptions log','YesNo'),
562
('suggestion','1','','If ON, enables patron suggestions feature in OPAC','YesNo'),
562
('suggestion','1','','If ON, enables patron suggestions feature in OPAC','YesNo'),
563
('SummaryHoldings', '0', NULL, 'If ON, enables support for holdings records.', 'YesNo'),
563
('SuspendHoldsIntranet','1','Allow holds to be suspended from the intranet.',NULL,'YesNo'),
564
('SuspendHoldsIntranet','1','Allow holds to be suspended from the intranet.',NULL,'YesNo'),
564
('SuspendHoldsOpac','1','Allow holds to be suspended from the OPAC.',NULL,'YesNo'),
565
('SuspendHoldsOpac','1','Allow holds to be suspended from the OPAC.',NULL,'YesNo'),
565
('SvcMaxReportRows','10',NULL,'Maximum number of rows to return via the report web service.','Integer'),
566
('SvcMaxReportRows','10',NULL,'Maximum number of rows to return via the report web service.','Integer'),
(-)a/koha-tmpl/intranet-tmpl/prog/css/addholding.css (+171 lines)
Line 0 Link Here
1
#addholdingtabs {
2
	margin-top : 1em;
3
}
4
5
#addholdingtabs .ui-tabs-panel {
6
	float : left;
7
}
8
9
.buttonPlus {
10
	font-weight : bold;
11
	text-decoration : none;
12
}
13
14
.buttonMinus {
15
	font-weight : bold;
16
	text-decoration : none;
17
}
18
19
a.expandfield {
20
	text-decoration : none;
21
}
22
23
#authoritytabs {
24
	margin-top : 1em;
25
	margin-bottom : 1em;
26
}
27
28
.toptabs .ui-tabs-nav li a {
29
	padding : .2em 1.2em;
30
}
31
32
div.tag {
33
    clear: both;
34
}
35
36
div.subfield_line {
37
    padding-bottom: .3em;
38
    float: left;
39
    clear: left;
40
    width: 100%;
41
}
42
43
div.subfield_line label {
44
    font-size:89%;
45
    float: left;
46
	 padding-right : .4em;
47
    width: 16em;
48
    text-align: left;
49
    clear:left;
50
}
51
52
.subfieldcode img {
53
    cursor: pointer;
54
}
55
56
.tag_title {
57
	font-size : 90%;
58
	padding : .2em 0;
59
}
60
61
.tagnum {
62
	font-size : 110%;
63
	font-weight : bold;
64
	color : #000;
65
	padding : .1em .3em .1em 0;
66
}
67
68
a.tagnum {
69
	font-size : 110%;
70
	font-weight : bold;
71
	color : #000;
72
	padding : .1em .3em .1em 0;
73
	text-decoration : none;
74
}
75
76
.subfield {
77
	color : #00698a;
78
	float: left;
79
	width: 10em;
80
	text-align:right;
81
}
82
83
.subfieldcode {
84
	display: block;
85
	float: left;
86
}
87
88
.labelsubfield {
89
	float:left;
90
}
91
92
.input_marceditor {
93
	float:left;
94
	width:30em;
95
}
96
97
.indicator {
98
    width: 1em;
99
    box-sizing: content-box;
100
}
101
102
*html .input_marceditor {
103
	width : 15em;
104
}
105
106
#cataloguing_additem_newitem fieldset.rows label, #cataloguing_additem_newitem fieldset.rows span.label {
107
	font-size : 100%;
108
	width : 25%;
109
}
110
111
#cataloguing_additem_newitem fieldset.rows li {
112
	padding-bottom : 3px;
113
}
114
#cataloguing_additem_newitem .input_marceditor {
115
	width : auto;
116
}
117
118
#cataloguing_additem_newitem textarea.input_marceditor {
119
     width : 31em;
120
}
121
122
.mandatory_marker {
123
	color: red;
124
}
125
.linktools { display: block; white-space: nowrap; }
126
.linktools a { font-size : 75%; display:block;text-decoration:none;}
127
.linktools a {margin:0 2px;padding:2px;background-color:#FFF;text-align:center; }
128
.linktools a:first-child { border-bottom: 1px solid #DDD; }
129
.linktools a:hover { background-color: #FFC; }
130
.subfield_controls { margin : 0 .5em; }
131
.readonly { border-width : 1px; border-style: inset; padding-left : 15px; background: #EEE url(../img/locked.png) center left no-repeat; width:29em; }
132
133
#cataloguing_additem_itemlist {
134
	margin-bottom : 1em;
135
}
136
.yui-gf div.first {
137
	width : 19%;
138
}
139
140
.yui-gf .yui-u {
141
	width: 79.2%;
142
}
143
144
tbody tr.active:nth-child(2n+1) td,
145
tbody tr.active td {
146
    background-color: #FFFFCC;
147
}
148
149
#loading {
150
    background-color: #FFF;
151
    cursor: wait;
152
    height: 100%;
153
    left: 0;
154
    opacity: .7;
155
    position: fixed;
156
    top: 0;
157
    width: 100%;
158
    z-index: 1000;
159
}
160
#loading div {
161
    background : transparent url(../img/loading.gif) top left no-repeat;
162
    font-size : 175%;
163
    font-weight: bold;
164
    height: 2em;
165
    left: 50%;
166
    margin: -1em 0 0 -2.5em;
167
    padding-left : 50px;
168
    position: absolute;
169
    top: 50%;
170
    width: 15em;
171
}
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc (+4 lines)
Lines 10-15 CAN_user_serials_create_subscription ) %] Link Here
10
             <li><a id="newbiblio" href="/cgi-bin/koha/cataloguing/addbiblio.pl">New record</a></li>
10
             <li><a id="newbiblio" href="/cgi-bin/koha/cataloguing/addbiblio.pl">New record</a></li>
11
            [% END %]
11
            [% END %]
12
12
13
            [% IF ( show_summary_holdings && CAN_user_editcatalogue_edit_items ) %]
14
            <li><a id="newholding" href="/cgi-bin/koha/cataloguing/addholding.pl?biblionumber=[% biblionumber %]#addholding">New holdings record</a></li>
15
            [% END %]
16
13
            [% IF ( CAN_user_editcatalogue_edit_items ) %]
17
            [% IF ( CAN_user_editcatalogue_edit_items ) %]
14
             <li><a id="newitem" href="/cgi-bin/koha/cataloguing/additem.pl?biblionumber=[% biblionumber | html %]#additema">New item</a></li>
18
             <li><a id="newitem" href="/cgi-bin/koha/cataloguing/additem.pl?biblionumber=[% biblionumber | html %]#additema">New item</a></li>
15
            [% END %]
19
            [% END %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/biblio_framework.tt (-2 / +1 lines)
Lines 132-138 Link Here
132
    <tbody>
132
    <tbody>
133
    <tr>
133
    <tr>
134
        <td>&nbsp;</td>
134
        <td>&nbsp;</td>
135
        <td>Default framework</td>
135
        <td>Default bibliographic framework</td>
136
        <td>
136
        <td>
137
          <div class="dropdown">
137
          <div class="dropdown">
138
            <a class="btn btn-default btn-xs dropdown-toggle" id="frameworkactions[% loo.frameworkcode | html %]" role="button" data-toggle="dropdown" href="#">
138
            <a class="btn btn-default btn-xs dropdown-toggle" id="frameworkactions[% loo.frameworkcode | html %]" role="button" data-toggle="dropdown" href="#">
Lines 197-203 Link Here
197
          </div>
197
          </div>
198
        </td>
198
        </td>
199
    </tr>
199
    </tr>
200
201
    [% FOREACH loo IN frameworks %]
200
    [% FOREACH loo IN frameworks %]
202
        <tr>
201
        <tr>
203
            <td>[% loo.frameworkcode | html %]</td>
202
            <td>[% loo.frameworkcode | html %]</td>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref (+7 lines)
Lines 291-293 Cataloging: Link Here
291
            - "All values of repeating tags and subfields will be printed with the given RIS tag."
291
            - "All values of repeating tags and subfields will be printed with the given RIS tag."
292
            - "<br/>"
292
            - "<br/>"
293
            - "Use of TY ( record type ) as a key will <i>replace</i> the default TY with the field value of your choosing."
293
            - "Use of TY ( record type ) as a key will <i>replace</i> the default TY with the field value of your choosing."
294
    Holdings:
295
        -
296
            - pref: SummaryHoldings
297
              choices:
298
                  yes: Use
299
                  no: "Don't use"
300
            - summary holdings records.
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt (-4 / +64 lines)
Lines 6-11 Link Here
6
[% USE Branches %]
6
[% USE Branches %]
7
[% USE Biblio %]
7
[% USE Biblio %]
8
[% USE ColumnsSettings %]
8
[% USE ColumnsSettings %]
9
[% USE Holdings %]
9
[% SET AdlibrisEnabled = Koha.Preference('AdlibrisCoversEnabled') %]
10
[% SET AdlibrisEnabled = Koha.Preference('AdlibrisCoversEnabled') %]
10
[% SET AdlibrisURL = Koha.Preference('AdlibrisCoversURL') %]
11
[% SET AdlibrisURL = Koha.Preference('AdlibrisCoversURL') %]
11
12
Lines 301-316 Link Here
301
<div id="bibliodetails" class="toptabs">
302
<div id="bibliodetails" class="toptabs">
302
303
303
<ul>
304
<ul>
305
    [% IF (show_summary_holdings) %]
306
        <li><a href="#summaryholdings">Holdings ([% summary_holdings.size() || 0 | html %])</a></li>
307
    [% END %]
304
    [% IF (SeparateHoldings) %]
308
    [% IF (SeparateHoldings) %]
305
        <li>
309
        <li>
306
            <a href="#holdings">[% LoginBranchname | html %] holdings ([% itemloop.size() || 0 | html %])</a>
310
            <a href="#holdings">[% LoginBranchname | html %] [% IF (show_summary_holdings) %]items[% ELSE %]holdings[% END %] ([% itemloop.size() || 0 | html %])</a>
307
        </li>
311
        </li>
308
        <li>
312
        <li>
309
            <a href="#otherholdings">Other holdings ([% otheritemloop.size() || 0 | html %])</a>
313
            <a href="#otherholdings">[% IF (show_summary_holdings) %]Other items[% ELSE %]Other holdings[% END %] ([% otheritemloop.size() || 0 | html %])</a>
310
        </li>
314
        </li>
311
    [% ELSE %]
315
    [% ELSE %]
312
        <li>
316
        <li>
313
            <a href="#holdings">Holdings ([% itemloop.size() || 0 | html %])</a>
317
            <a href="#holdings">[% IF (show_summary_holdings) %]Items[% ELSE %]Holdings[% END %] ([% itemloop.size() || 0 | html %])</a>
314
        </li>
318
        </li>
315
    [% END %]
319
    [% END %]
316
[% IF ( MARCNOTES || notes ) %]<li><a href="#description">Descriptions</a></li>[% END %]
320
[% IF ( MARCNOTES || notes ) %]<li><a href="#description">Descriptions</a></li>[% END %]
Lines 330-335 Link Here
330
[% END %]
334
[% END %]
331
</ul>
335
</ul>
332
336
337
[% IF ( show_summary_holdings ) %]
338
    <div id="summaryholdings">
339
340
    [% IF ( summary_holdings ) %]
341
        <div class="summaryholdings_table_controls">
342
        </div>
343
        <table class="summaryholdings_table">
344
            <thead>
345
                <tr>
346
                    <th>Library</th>
347
                    <th>Location</th>
348
                    <th>Collection</th>
349
                    <th>Call number</th>
350
                    <th>Status</th>
351
                    [% IF ( CAN_user_editcatalogue_edit_items ) %]<th class="NoSort">&nbsp;</th>[% END %]
352
                </tr>
353
            </thead>
354
            <tbody>
355
                [% FOREACH holding IN summary_holdings %]
356
                    <tr>
357
                        <td class="branch">[% UNLESS ( singlebranchmode ) %][% Branches.GetName( holding.holdingbranch ) | html %] [% END %]</td>
358
                        <td class="location"><span class="shelvingloc">[% holding.location | html %][% IF ( holding.sub_location ) %] ([% holding.sub_location | html %])[% END %]</span>
359
                        <td class="collection">[% holding.ccode | html %]</span>
360
                        <td class="itemcallnumber">[% IF ( holding.callnumber ) %] [% holding.callnumber | html %][% END %]</td>
361
                        <td class="status">
362
                            [% IF ( holding.suppress ) %]
363
                                <span class="suppressed">Suppressed in OPAC</span>
364
                            [% END %]
365
                        </td>
366
                    [% IF CAN_user_editcatalogue_edit_items %]
367
                        <td class="actions">
368
                            <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>
369
                            <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>
370
                            <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>
371
                            <a class="btn btn-default btn-xs previewMARC" href="/cgi-bin/koha/catalogue/showmarc.pl?holding_id=[% holding.holding_id | uri %]&amp;viewas=html" title="MARC">Show MARC</a>
372
                        </td>
373
                    [% END %]
374
                    </tr>
375
                [% END %]
376
            </tbody>
377
        </table>
378
    [% ELSE %]
379
        <div id="noitems">No holdings records</div>
380
    [% END %]
381
382
    </div>
383
[% END %]
384
333
[% items_table_block_iter = 0 %]
385
[% items_table_block_iter = 0 %]
334
[% BLOCK items_table %]
386
[% BLOCK items_table %]
335
    [% items_table_block_iter = items_table_block_iter + 1 %]
387
    [% items_table_block_iter = items_table_block_iter + 1 %]
Lines 353-358 Link Here
353
            <tr>
405
            <tr>
354
                [% IF (StaffDetailItemSelection) %]<th class="NoSort"></th>[% END %]
406
                [% IF (StaffDetailItemSelection) %]<th class="NoSort"></th>[% END %]
355
                [% IF ( item_level_itypes ) %]<th>Item type</th>[% END %]
407
                [% IF ( item_level_itypes ) %]<th>Item type</th>[% END %]
408
                [% IF ( show_summary_holdings ) %]<th>Holding</th>[% END %]
356
                <th>Current location</th>
409
                <th>Current location</th>
357
                <th>Home library</th>
410
                <th>Home library</th>
358
                [% IF ( itemdata_ccode ) %]<th>Collection</th>[% END %]
411
                [% IF ( itemdata_ccode ) %]<th>Collection</th>[% END %]
Lines 391-396 Link Here
391
                            [% item.translated_description | html %]
444
                            [% item.translated_description | html %]
392
                        </td>
445
                        </td>
393
                    [% END %]
446
                    [% END %]
447
                    [% IF ( show_summary_holdings ) %]
448
                        <td class="holding">[% Holdings.GetLocation(item.holding_id) | html %]</td>
449
                    [% END %]
394
                    <td class="location">[% UNLESS ( singlebranchmode ) %][% Branches.GetName( item.branchcode ) | html %] [% END %]</td>
450
                    <td class="location">[% UNLESS ( singlebranchmode ) %][% Branches.GetName( item.branchcode ) | html %] [% END %]</td>
395
                    <td class="homebranch">[% Branches.GetName(item.homebranch) | html %]<span class="shelvingloc">[% item.location | html %]</span> </td>
451
                    <td class="homebranch">[% Branches.GetName(item.homebranch) | html %]<span class="shelvingloc">[% item.location | html %]</span> </td>
396
                    [% IF ( itemdata_ccode ) %]<td>[% item.ccode | html %]</td>[% END %]
452
                    [% IF ( itemdata_ccode ) %]<td>[% item.ccode | html %]</td>[% END %]
Lines 1027-1038 Link Here
1027
                    $("input[name='itemnumber'][type='checkbox']", $("#"+tab)).prop('checked', false);
1083
                    $("input[name='itemnumber'][type='checkbox']", $("#"+tab)).prop('checked', false);
1028
                    itemSelectionBuildActionLinks(tab);
1084
                    itemSelectionBuildActionLinks(tab);
1029
                });
1085
                });
1086
1087
                $('a.delete').click(function() {
1088
                    return confirm(_("Are you sure?"));
1089
                });
1030
            });
1090
            });
1031
        [% END %]
1091
        [% END %]
1032
1092
1033
        $(document).ready(function() {
1093
        $(document).ready(function() {
1034
            $('#bibliodetails').tabs();
1094
            $('#bibliodetails').tabs();
1035
            [% IF count == 0 %]
1095
            [% IF count == 0 and not show_summary_holdings %]
1036
                $('#bibliodetails').tabs("option", "active", 3);
1096
                $('#bibliodetails').tabs("option", "active", 3);
1037
            [% END %]
1097
            [% END %]
1038
            $('#search-form').focus();
1098
            $('#search-form').focus();
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt (+2 lines)
Lines 3-8 Link Here
3
[% USE Koha %]
3
[% USE Koha %]
4
[% USE Branches %]
4
[% USE Branches %]
5
[% USE Price %]
5
[% USE Price %]
6
[% USE Holdings %]
6
[% SET footerjs = 1 %]
7
[% SET footerjs = 1 %]
7
[% INCLUDE 'doc-head-open.inc' %]
8
[% INCLUDE 'doc-head-open.inc' %]
8
<title>Koha &rsaquo; Catalog &rsaquo; Item details for [% title | html %] [% FOREACH subtitl IN subtitle %] [% subtitl.subfield | html %][% END %]</title>
9
<title>Koha &rsaquo; Catalog &rsaquo; Item details for [% title | html %] [% FOREACH subtitl IN subtitle %] [% subtitl.subfield | html %][% END %]</title>
Lines 56-61 Link Here
56
         [% END %]
57
         [% END %]
57
         [% END %][% END %]</h4>
58
         [% END %][% END %]</h4>
58
            <ol class="bibliodetails">
59
            <ol class="bibliodetails">
60
            <li><span class="label">Holding:</span> [% Holdings.GetLocation( ITEM_DAT.holding_id ) | html %]&nbsp;</li>
59
            <li><span class="label">Home library:</span> [% Branches.GetName( ITEM_DAT.homebranch ) | html %]&nbsp;</li>
61
            <li><span class="label">Home library:</span> [% Branches.GetName( ITEM_DAT.homebranch ) | html %]&nbsp;</li>
60
	    [% IF ( item_level_itypes ) %]
62
	    [% IF ( item_level_itypes ) %]
61
            <li><span class="label">Item type:</span> [% ITEM_DAT.itype | html %]&nbsp;</li>
63
            <li><span class="label">Item type:</span> [% ITEM_DAT.itype | html %]&nbsp;</li>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt (+14 lines)
Lines 2-7 Link Here
2
[% USE Asset %]
2
[% USE Asset %]
3
[% USE Koha %]
3
[% USE Koha %]
4
[% USE Biblio %]
4
[% USE Biblio %]
5
[% USE Holdings %]
5
[% USE KohaDates %]
6
[% USE KohaDates %]
6
[% PROCESS 'i18n.inc' %]
7
[% PROCESS 'i18n.inc' %]
7
[% SET footerjs = 1 %]
8
[% SET footerjs = 1 %]
Lines 484-489 Link Here
484
                                </td>
485
                                </td>
485
486
486
                                <td><div class="availability">
487
                                <td><div class="availability">
488
                                    [% IF ( SEARCH_RESULT.summary_holdings ) %]
489
                                        <div class="holdings">
490
                                            <strong>Holdings</strong>
491
                                            <ul>
492
                                            [% FOREACH holding IN SEARCH_RESULT.summary_holdings %]
493
                                                <li>
494
                                                    [% Holdings.GetLocation(holding) | html %]
495
                                                </li>
496
                                            [% END %]
497
                                            </ul>
498
                                        </div>
499
                                    [% END %]
500
487
                                    [% IF ( SEARCH_RESULT.items_count ) %]
501
                                    [% IF ( SEARCH_RESULT.items_count ) %]
488
                                        <strong>
502
                                        <strong>
489
                                            [% IF MaxSearchResultsItemsPerRecordStatusCheck && SEARCH_RESULT.items_count > MaxSearchResultsItemsPerRecordStatusCheck %]
503
                                            [% IF MaxSearchResultsItemsPerRecordStatusCheck && SEARCH_RESULT.items_count > MaxSearchResultsItemsPerRecordStatusCheck %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addholding.tt (+624 lines)
Line 0 Link Here
1
[% USE raw %]
2
[% USE Asset %]
3
[% USE Koha %]
4
[% INCLUDE 'doc-head-open.inc' %]
5
<title>Koha &rsaquo; Cataloging &rsaquo; [% title | html %] [% IF ( author ) %] by [% author | html %][% END %] (Record #[% biblionumber | html %]) &rsaquo; Holdings</title>
6
[% INCLUDE 'doc-head-close.inc' %]
7
 [% Asset.js("lib/hc-sticky.js") | $raw %]
8
 [% Asset.js("js/cataloging.js") | $raw %]
9
[% INCLUDE 'browser-strings.inc' %]
10
[% Asset.js("js/browser.js") | $raw %]
11
<script type="text/javascript">
12
//<![CDATA[
13
    var browser = KOHA.browser('[% searchid | html %]', parseInt('[% biblionumber | html %]', 10));
14
    browser.show();
15
16
    $(window).load(function() {
17
        $("#loading").hide();
18
    });
19
    var Sticky;
20
    $(document).ready(function() {
21
        $('#addholdingtabs').tabs().bind('show.ui-tabs', function(e, ui) {
22
            $("#"+ui.panel.id+" input:eq(0)").focus();
23
        });
24
25
        [% IF tab %]
26
            $('#addholdingtabs').selectTabByID("#[% tab | html %]");
27
        [% END %]
28
29
        Sticky = $("#toolbar");
30
        Sticky.hcSticky({
31
            stickTo: ".main",
32
            stickyClass: "floating"
33
        });
34
35
        /* check cookie to hide/show marcdocs*/
36
        if($.cookie("marcdocs_[% borrowernumber | html %]") == 'hide'){
37
            toggleMARCdocLinks(false);
38
        } else {
39
            toggleMARCdocLinks(true);
40
        }
41
42
        $("#marcDocsSelect").click(function(){
43
            if($.cookie("marcdocs_[% borrowernumber | html %]") == 'hide'){
44
                toggleMARCdocLinks(true);
45
            } else {
46
                toggleMARCdocLinks(false);
47
            }
48
        });
49
50
        /* check cookie to hide/show marc tags*/
51
        var marctags_cookie = $.cookie("marctags_[% borrowernumber | html %]");
52
        if (marctags_cookie == 'hide'){
53
            toggleMARCTagLinks(false);
54
        } else if( marctags_cookie == 'show'){
55
            toggleMARCTagLinks(true)
56
        } else {
57
            [% UNLESS Koha.Preference("hide_marc") %]
58
                toggleMARCTagLinks(true)
59
            [% ELSE %]
60
                toggleMARCTagLinks(false);
61
            [% END %]
62
        }
63
64
        $("#marcTagsSelect").click(function(){
65
            if( $.cookie("marctags_[% borrowernumber | html %]") == 'hide'){
66
                toggleMARCTagLinks(true)
67
            } else {
68
                toggleMARCTagLinks(false);
69
            }
70
        });
71
72
        $("#saverecord").click(function(){
73
            $(".btn-group").removeClass("open");
74
            onOption();
75
            return false;
76
        });
77
78
        $("#saveandview").click(function(){
79
            $(".btn-group").removeClass("open");
80
            redirect("view");
81
            return false;
82
        });
83
84
        $("#saveanditems").click(function(){
85
            $(".btn-group").removeClass("open");
86
            redirect("items");
87
            return false;
88
        });
89
        $("#saveandcontinue").click(function(){
90
            $(".btn-group").removeClass("open");
91
            var tab = $("#addholdingtabs li.ui-tabs-active:first a").attr('href');
92
            tab = tab.replace('#', '');
93
            $("#current_tab").val(tab);
94
            redirect("just_save", tab);
95
            return false;
96
        });
97
98
        $( '#switcheditor' ).click( function() {
99
100
            if ( !confirm( _("Any changes will not be saved. Continue?") ) ) return false;
101
102
            $.cookie( 'catalogue_editor_[% USER_INFO.borrowernumber | html %]', 'advanced', { expires: 365, path: '/' } );
103
104
            var holding_id = [% holding_id || "''" | html %];
105
            window.location = '/cgi-bin/koha/cataloguing/editor.pl#catalog/' + biblionumber + '/holdings/' + holding_id;
106
107
            return false;
108
        } );
109
        $(".change-framework").on("click", function(){
110
            var frameworkcode = $(this).data("frameworkcode");
111
            $("#frameworkcode").val( frameworkcode );
112
            Changefwk();
113
        });
114
    });
115
116
function redirect(dest){
117
    $("#redirect").attr("value",dest);
118
    return Check();
119
}
120
121
[% IF ( CAN_user_editcatalogue_edit_items ) %]
122
    var onOption = function () {
123
        return Check();
124
    }
125
[% END %]
126
127
function Dopop(link,i) {
128
    defaultvalue = document.getElementById(i).value;
129
    window.open(link+"&result="+defaultvalue,"valuebuilder",'width=700,height=550,toolbar=false,scrollbars=yes');
130
}
131
132
function PopupMARCFieldDoc(field) {
133
    [% IF ( marcflavour == 'MARC21' ) %]
134
        _MARC21FieldDoc(field);
135
    [% ELSIF ( marcflavour == 'UNIMARC' ) %]
136
        _UNIMARCFieldDoc(field);
137
    [% END %]
138
}
139
140
function _MARC21FieldDoc(field) {
141
    if(field == 0) {
142
        window.open("http://www.loc.gov/marc/holdings/hdleader.html");
143
    } else if (field < 900) {
144
        window.open("http://www.loc.gov/marc/holdings/hd" + ("000"+field).slice(-3) + ".html");
145
    } else {
146
        window.open("http://www.loc.gov/marc/holdings/hd9xx.html");
147
    }
148
}
149
150
function _UNIMARCFieldDoc(field) {
151
    /* http://archive.ifla.org/VI/3/p1996-1/ is an outdated version of UNIMARC, but
152
       seems to be the only version available that can be linked to per tag.  More recent
153
       versions of the UNIMARC standard are available on the IFLA website only as
154
       PDFs!
155
    */
156
    var url;
157
    if (field == 0) {
158
        url = "http://archive.ifla.org/VI/3/p1996-1/uni.htm";
159
    } else {
160
        var first = field.substring(0,1);
161
        url = "http://archive.ifla.org/VI/3/p1996-1/uni" + first + ".htm#";
162
        if (first == 0) url = url + "b";
163
        url = first == 9
164
              ? "http://archive.ifla.org/VI/3/p1996-1/uni9.htm"
165
              : url + field;
166
    }
167
    window.open(url);
168
}
169
170
/*
171
 * Functions to hide/show marc docs and tags links
172
 */
173
174
function toggleMARCdocLinks(flag){
175
    if( flag === true ){
176
        $(".marcdocs").show();
177
        $.cookie("marcdocs_[% borrowernumber | html %]",'show', { path: "/", expires: 365 });
178
        $("#marcDocsSelect i").addClass('fa-check-square-o').removeClass('fa-square-o');
179
    } else {
180
        $(".marcdocs").hide();
181
        $.cookie("marcdocs_[% borrowernumber | html %]",'hide', { path: "/", expires: 365 });
182
        $("#marcDocsSelect i").removeClass('fa-check-square-o').addClass('fa-square-o');
183
    }
184
}
185
186
function toggleMARCTagLinks(flag){
187
    if( flag === true ){
188
        $(".tagnum").show();
189
        $(".subfieldcode").show();
190
        $.cookie("marctags_[% borrowernumber | html %]",'show', { path: "/", expires: 365 });
191
        $("#marcTagsSelect i").addClass('fa-check-square-o').removeClass('fa-square-o');
192
    } else {
193
        $(".tagnum").hide();
194
        $(".subfieldcode").hide();
195
        $.cookie("marctags_[% borrowernumber | html %]",'hide', { path: "/", expires: 365 });
196
        $("#marcTagsSelect i").removeClass('fa-check-square-o').addClass('fa-square-o');
197
    }
198
}
199
200
/**
201
 * check if mandatory subfields are written
202
 */
203
function AreMandatoriesNotOk(){
204
    var mandatories = new Array();
205
    var mandatoriesfields = new Array();
206
    var tab = new Array();
207
    var label = new Array();
208
    var flag=0;
209
    var tabflag= new Array();
210
    [% FOREACH BIG_LOO IN BIG_LOOP %]
211
        [% FOREACH innerloo IN BIG_LOO.innerloop %]
212
            [% IF ( innerloo.mandatory ) %]
213
                mandatoriesfields.push(new Array("[% innerloo.tag | html %]","[% innerloo.index | html %][% innerloo.random | html %]","[% innerloo.index | html %]"));
214
            [% END %]
215
            [% FOREACH subfield_loo IN innerloo.subfield_loop %]
216
                [% IF ( subfield_loo.mandatory ) %]
217
                    mandatories.push("[% subfield_loo.id | html %]");
218
                    tab.push("[% BIG_LOO.number | html %]");
219
                    label.push("[% subfield_loo.marc_lib | $raw %]");
220
                [% END %]
221
            [% END %]
222
        [% END %]
223
    [% END %]
224
    var StrAlert = _("Can't save this record because the following field aren't filled:");
225
    StrAlert += "\n\n";
226
    for (var i=0,len=mandatories.length; i<len ; i++) {
227
        var tag=mandatories[i].substr(4,3);
228
        var subfield=mandatories[i].substr(17,1);
229
        var tagnumber=mandatories[i].substr(19,mandatories[i].lastIndexOf("_")-19);
230
        if (tabflag[tag+subfield+tagnumber] ==  null) {
231
            tabflag[tag+subfield+tagnumber]=new Array();
232
            tabflag[tag+subfield+tagnumber][0]=0;
233
        }
234
        if (tabflag[tag+subfield+tagnumber][0] != 1 && (document.getElementById(mandatories[i]) != null && ! document.getElementById(mandatories[i]).value || document.getElementById(mandatories[i]) == null)) {
235
            tabflag[tag+subfield+tagnumber][0] = 0 + tabflag[tag+subfield+tagnumber] ;
236
            document.getElementById(mandatories[i]).setAttribute('class','subfield_not_filled');
237
            $('#' + mandatories[i]).focus();
238
            tabflag[tag+subfield+tagnumber][1]=label[i];
239
            tabflag[tag+subfield+tagnumber][2]=tab[i];
240
        } else {
241
            tabflag[tag+subfield+tagnumber][0] = 1;
242
        }
243
    }
244
    for (var tagsubfieldid in tabflag) {
245
      if (tabflag[tagsubfieldid][0]==0) {
246
        var tag=tagsubfieldid.substr(0,3);
247
        var subfield=tagsubfieldid.substr(3,1);
248
        StrAlert += "\t* "+_("tag %s subfield %s %s in tab %s").format(tag, subfield, tabflag[tagsubfieldid][1], tabflag[tagsubfieldid][2]) + "\n";
249
        flag=1;
250
      }
251
    }
252
253
    /* Check for mandatories field(not subfields) */
254
    for (var i=0,len=mandatoriesfields.length; i<len; i++) {
255
        isempty  = true;
256
        arr      = mandatoriesfields[i];
257
        divid    = "tag_" + arr[0] + "_" + arr[1];
258
        varegexp = new RegExp("^tag_" + arr[0] + "_code_");
259
260
        if(parseInt(arr[0]) >= 10) {
261
            elem = document.getElementById(divid);
262
            eleminputs = elem.getElementsByTagName('input');
263
264
            for(var j=0,len2=eleminputs.length; j<len2; j++){
265
266
                if(eleminputs[j].name.match(varegexp) && eleminputs[j].value){
267
                        inputregexp = new RegExp("^tag_" + arr[0] + "_subfield_" + eleminputs[j].value + "_" + arr[2]);
268
269
                        for( var k=0; k<len2; k++){
270
                            if(eleminputs[k].id.match(inputregexp) && eleminputs[k].value){
271
                                isempty = false
272
                            }
273
                        }
274
275
                        elemselect = elem.getElementsByTagName('select');
276
                        for( var k=0; k<elemselect.length; k++){
277
                            if(elemselect[k].id.match(inputregexp) && elemselect[k].value){
278
                                isempty = false
279
                            }
280
                        }
281
                }
282
            }
283
284
            elemtextareas = elem.getElementsByTagName('textarea');
285
            for(var j=0,len2=elemtextareas.length; j<len2; j++){
286
                // this bit assumes that the only textareas in this context would be for subfields
287
                if (elemtextareas[j].value) {
288
                    isempty = false;
289
                }
290
            }
291
        } else {
292
            isempty = false;
293
        }
294
295
        if (isempty) {
296
            flag = 1;
297
                    StrAlert += "\t* " + _("Field %s is mandatory, at least one of its subfields must be filled.").format(arr[0]) + "\n";
298
        }
299
    }
300
301
    if (flag) {
302
        return StrAlert;
303
    } else {
304
        return flag;
305
    }
306
}
307
308
/**
309
 *
310
 *
311
 */
312
function Check(){
313
    var StrAlert = AreMandatoriesNotOk();
314
    if( ! StrAlert ){
315
        document.f.submit();
316
        return true;
317
    } else {
318
        alert(StrAlert);
319
        return false;
320
    }
321
}
322
323
function Changefwk() {
324
    var f = document.f;
325
    f.op.value = "[% op | html %]";
326
    f.biblionumber.value = "[% biblionumber | html %]";
327
    f.holding_id.value = "[% holding_iddata | html %]";
328
    f.changed_framework.value = "changed";
329
    f.submit();
330
}
331
332
//]]>
333
</script>
334
[% Asset.css("css/addholding.css") | $raw %]
335
336
[% INCLUDE 'select2.inc' %]
337
<script>
338
  $(document).ready(function() {
339
    $('.subfield_line select').select2();
340
  });
341
</script>
342
343
[% IF ( bidi ) %]
344
   [% Asset.css("css/right-to-left.css") | $raw %]
345
[% END %]
346
</head>
347
<body id="cat_addholding" class="cat">
348
349
   <div id="loading">
350
       <div>Loading, please wait...</div>
351
   </div>
352
353
[% INCLUDE 'header.inc' %]
354
355
<div id="breadcrumbs">
356
          <a href="/cgi-bin/koha/mainpage.pl">Home</a>
357
 &rsaquo; <a href="/cgi-bin/koha/cataloguing/addbooks.pl">Cataloging</a>
358
 &rsaquo; Edit <a href="/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=[% biblionumber | html %]">[% title | html %] [% IF ( author ) %] by [% author | html %][% END %] (Record #[% biblionumber | html %])</a>
359
 &rsaquo; <a href="/cgi-bin/koha/cataloguing/addholding.pl?biblionumber=[% biblionumber | html %]">Holdings</a>
360
</div>
361
362
<div class="main container-fluid">
363
    <div class="row">
364
        <div class="col-md-10 col-md-offset-1">
365
366
<h1>
367
[% IF ( holding_id ) %]Editing holdings record number [% holding_id | html %]
368
[% ELSE %]Add holdings record
369
[% END %]
370
</h1>
371
372
[% IF ( error_items_exist ) %]<div class="dialog alert"><strong>This holdings record has items attached.</strong> Please delete them first.</div>[% END %]
373
[% IF ( error_delete_failed ) %]<div class="dialog alert"><strong>Error deleting the record.</strong></div>[% END %]
374
375
[% IF ( done ) %]
376
    <script type="text/javascript">
377
        opener.document.forms['f'].holding_id.value=[% holding_id | html %];
378
        window.close();
379
    </script>
380
[% ELSE %]
381
    <form method="post" name="f" id="f" action="/cgi-bin/koha/cataloguing/addholding.pl" onsubmit="return Check();">
382
    <input type="hidden" value="[% IF ( holding_id ) %]view[% ELSE %]holdings[% END %]" id="redirect" name="redirect" />
383
    <input type="hidden" value="" id="current_tab" name="current_tab" />
384
[% END %]
385
386
<div id="toolbar" class="btn-toolbar">
387
    [% IF CAN_user_editcatalogue_edit_items %]
388
        <div class="btn-group">
389
            <button class="btn btn-default btn-sm" id="saverecord"><i class="fa fa-save"></i> Save</button>
390
            <button class="btn btn-default btn-sm dropdown-toggle" data-toggle="dropdown">
391
            <span class="caret"></span>
392
            </button>
393
            <ul class="dropdown-menu">
394
                <li><a id="saveandview" href="#">Save and view record</a></li>
395
                <li><a id="saveanditems" href="#">Save and edit items</a></li>
396
                <li><a id="saveandcontinue" href="#">Save and continue editing</a></li>
397
            </ul>
398
        </div>
399
    [% END %]
400
401
    <div class="btn-group">
402
        <button class="btn btn-default btn-sm dropdown-toggle" data-toggle="dropdown"><i class="fa fa-cog"></i> Settings <span class="caret"></span></button>
403
        <ul id="settings-menu" class="dropdown-menu">
404
            [% IF Koha.Preference( 'EnableAdvancedCatalogingEditor' ) == 1 %]
405
                [% # disabled until supported <li><a href="#" id="switcheditor">Switch to advanced editor</a></li> %]
406
            [% END %]
407
            [% IF marcflavour != 'NORMARC' AND NOT advancedMARCEditor %]
408
                <li>
409
                    <a href="#" id="marcDocsSelect"><i class="fa fa-check-square-o"></i> Show MARC tag documentation links</a>
410
                <li>
411
                    <a href="#" id="marcTagsSelect"><i class="fa fa-check-square-o"></i> Show tags</a>
412
                </li>
413
            [% END %]
414
            <li class="divider"></li>
415
            <li class="nav-header">Change framework</li>
416
            <li>
417
                <a href="#" class="change-framework" data-frameworkcode="">
418
                    [% IF ( frameworkcode ) %]
419
                       <i class="fa fa-fw">&nbsp;</i>
420
                    [% ELSE %]
421
                        <i class="fa fa-fw fa-check"></i>
422
                    [% END %]
423
                    Default
424
                </a>
425
            </li>
426
            [% FOREACH framework IN frameworks%]
427
                <li>
428
                    <a href="#" class="change-framework" data-frameworkcode="[% framework.frameworkcode | html %]">
429
                        [% IF framework.frameworkcode == frameworkcode %]
430
                            <i class="fa fa-fw fa-check"></i>
431
                        [% ELSE %]
432
                            <i class="fa fa-fw">&nbsp;</i>
433
                        [% END %]
434
                        [% framework.frameworktext | html %]
435
                    </a>
436
                </li>
437
            [% END %]
438
        </ul>
439
    </div>
440
    <div class="btn-group">
441
        <a class="btn btn-default btn-sm" id="cancel" href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblionumber | url %]">Cancel</a>
442
    </div>
443
</div>
444
445
[% IF ( popup ) %]
446
        <input type="hidden" name="mode" value="popup" />
447
[% END %]
448
        <input type="hidden" name="op" value="add" />
449
        <input type="hidden" id="frameworkcode" name="frameworkcode" value="[% frameworkcode | html %]" />
450
        <input type="hidden" name="biblionumber" value="[% biblionumber | html %]" />
451
        <input type="hidden" name="holding_id" value="[% holding_id | html %]" />
452
        <input type="hidden" name="changed_framework" value="" />
453
454
<div id="addholdingtabs" class="toptabs numbered">
455
    <ul>
456
        [% FOREACH BIG_LOO IN BIG_LOOP %]
457
        <li><a href="#tab[% BIG_LOO.number | html %]XX">[% BIG_LOO.number | html %]</a></li>
458
        [% END %]
459
    </ul>
460
461
[% FOREACH BIG_LOO IN BIG_LOOP %]
462
    <div id="tab[% BIG_LOO.number | html %]XX">
463
464
    [% FOREACH innerloo IN BIG_LOO.innerloop %]
465
    [% IF ( innerloo.tag ) %]
466
    <div class="tag" id="tag_[% innerloo.tag | html %]_[% innerloo.index | html %][% innerloo.random | html %]">
467
        <div class="tag_title" id="div_indicator_tag_[% innerloo.tag | html %]_[% innerloo.index | html %][% innerloo.random | html %]">
468
            [% IF advancedMARCEditor %]
469
                <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>
470
            [% ELSE %]
471
                <span class="tagnum" title="[% innerloo.tag_lib %]">[% innerloo.tag | html %]</span>
472
                [% IF marcflavour != 'NORMARC' %]<a href="#" class="marcdocs" onclick="PopupMARCFieldDoc('[% innerloo.tag | html %]'); return false;">&nbsp;?</a>[% END %]
473
            [% END %]
474
                [% IF ( innerloo.fixedfield ) %]
475
                    <input type="text"
476
                        tabindex="1"
477
                        class="indicator flat"
478
                        style="display:none;"
479
                        name="tag_[% innerloo.tag | html %]_indicator1_[% innerloo.index | html %][% innerloo.random | html %]"
480
                        size="1"
481
                        maxlength="1"
482
                        value="[% innerloo.indicator1 | html %]" />
483
                    <input type="text"
484
                        tabindex="1"
485
                        class="indicator flat"
486
                        style="display:none;"
487
                        name="tag_[% innerloo.tag | html %]_indicator2_[% innerloo.index | html %][% innerloo.random | html %]"
488
                        size="1"
489
                        maxlength="1"
490
                        value="[% innerloo.indicator2 | html %]" />
491
                [% ELSE %]
492
                    <input type="text"
493
                        tabindex="1"
494
                        class="indicator flat"
495
                        name="tag_[% innerloo.tag | html %]_indicator1_[% innerloo.index | html %][% innerloo.random | html %]"
496
                        size="1"
497
                        maxlength="1"
498
                        value="[% innerloo.indicator1 | html %]" />
499
                    <input type="text"
500
                        tabindex="1"
501
                        class="indicator flat"
502
                        name="tag_[% innerloo.tag | html %]_indicator2_[% innerloo.index | html %][% innerloo.random | html %]"
503
                        size="1"
504
                        maxlength="1"
505
                        value="[% innerloo.indicator2 | html %]" />
506
                [% END %] -
507
508
            [% UNLESS advancedMARCEditor %]
509
                <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>
510
            [% END %]
511
                <span class="field_controls">
512
                [% IF ( innerloo.repeatable ) %]
513
                    <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">
514
                        <img src="[% interface | html %]/[% theme | html %]/img/repeat-tag.png" alt="Repeat this Tag" />
515
                    </a>
516
                [% END %]
517
                    <a href="#" tabindex="1" class="buttonMinus" onclick="UnCloneField('tag_[% innerloo.tag | html %]_[% innerloo.index | html %][% innerloo.random | html %]'); return false;" title="Delete this Tag">
518
                        <img src="[% interface | html %]/[% theme | html %]/img/delete-tag.png" alt="Delete this Tag" />
519
                    </a>
520
                </span>
521
522
        </div>
523
524
        [% FOREACH subfield_loo IN innerloo.subfield_loop %]
525
            <!--  One line on the marc editor -->
526
            <div class="subfield_line" style="[% subfield_loo.visibility | html %]" id="subfield[% subfield_loo.tag | html %][% subfield_loo.subfield | html %][% subfield_loo.random | html %]">
527
528
                [% UNLESS advancedMARCEditor %]
529
                    [% 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">
530
                    [% ELSE %]<label for="tag_[% subfield_loo.tag | html %]_subfield_[% subfield_loo.subfield | html %]_[% subfield_loo.index | html %]_[% subfield_loo.index_subfield | html %]" class="labelsubfield">
531
                    [% END %]
532
                [% END %]
533
534
                <span class="subfieldcode">
535
                    [% IF ( subfield_loo.fixedfield ) %]
536
                        <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" />
537
                    [% ELSE %]
538
                        <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" />
539
                    [% END %]
540
                        <input type="text"
541
                            title="[% subfield_loo.marc_lib | html %]"
542
                            style=" [% IF ( subfield_loo.fixedfield ) %]display:none; [% END %]border:0;"
543
                            name="tag_[% subfield_loo.tag | html %]_code_[% subfield_loo.subfield | html %]_[% subfield_loo.index | html %]_[% subfield_loo.index_subfield | html %]"
544
                            value="[% subfield_loo.subfield | html %]"
545
                            size="1"
546
                            maxlength="1"
547
                            class="flat"
548
                            tabindex="0" />
549
                </span>
550
551
                [% UNLESS advancedMARCEditor %]
552
                    [% IF ( subfield_loo.mandatory ) %]<span class="subfield subfield_mandatory">[% ELSE %]<span class="subfield">[% END %]
553
                        [% subfield_loo.marc_lib %]
554
                        [% IF ( subfield_loo.mandatory ) %]<span class="mandatory_marker" title="This field is mandatory">*</span>[% END %]
555
                    </span>
556
                    </label>
557
                [% END %]
558
559
                [% SET mv = subfield_loo.marc_value %]
560
                [% IF ( mv.type == 'text' ) %]
561
                    [% IF ( mv.readonly == 1 ) %]
562
                    <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" />
563
                    [% ELSE %]
564
                    <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 -%]" />
565
                    [% END %]
566
                    [% IF ( mv.authtype ) %]
567
                    <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>
568
                    [% END %]
569
                [% ELSIF ( mv.type == 'text_complex' ) %]
570
                    <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 -%]" />
571
                    <span class="subfield_controls">
572
                        [% IF mv.noclick %]
573
                            <a href="#" class="buttonDot tag_editor disabled" tabindex="-1" title="No popup"></a>
574
                        [% ELSE %]
575
                            <a href="#" id="buttonDot_[% mv.id | html %]" class="buttonDot tag_editor framework_plugin" tabindex="1" title="Tag editor">Tag editor</a>
576
                        [% END %]
577
                    </span>
578
                    [% mv.javascript %]
579
                [% ELSIF ( mv.type == 'hidden' ) %]
580
                    <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 -%]" />
581
                [% ELSIF ( mv.type == 'textarea' ) %]
582
                    <textarea cols="70" rows="4" id="[%- mv.id | html -%]" name="[%- mv.name | html -%]" class="input_marceditor" tabindex="1">[%- mv.value -%]</textarea>
583
                [% ELSIF ( mv.type == 'select' ) %]
584
                    <select name="[%- mv.name | html -%]" tabindex="1" size="1" class="input_marceditor" id="[%- mv.id | html -%]">
585
                    [% FOREACH aval IN mv.values %]
586
                        [% IF aval == mv.default %]
587
                        <option value="[%- aval | html -%]" selected="selected">[%- mv.labels.$aval | html -%]</option>
588
                        [% ELSE %]
589
                        <option value="[%- aval | html -%]">[%- mv.labels.$aval | html -%]</option>
590
                        [% END %]
591
                    [% END %]
592
                    </select>
593
                [% END %]
594
595
                <span class="subfield_controls">
596
                [% IF ( subfield_loo.repeatable ) %]
597
                    <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;">
598
                        <img src="[% interface | html %]/[% theme | html %]/img/clone-subfield.png" alt="Clone" title="Clone this subfield" />
599
                    </a>
600
                    <a href="#" class="buttonMinus" tabindex="1" onclick="UnCloneField('subfield[% subfield_loo.tag | html %][% subfield_loo.subfield | html %][% subfield_loo.random | html %]'); return false;">
601
                        <img src="[% interface | html %]/[% theme | html %]/img/delete-subfield.png" alt="Delete" title="Delete this subfield" />
602
                    </a>
603
                [% END %]
604
                </span>
605
606
            </div>
607
            <!-- End of the line -->
608
        [% END %]
609
610
    </div>
611
    [% END %]<!-- if innerloo.tag -->
612
    [% END %]<!-- BIG_LOO.innerloop -->
613
    </div>
614
[% END %]<!-- BIG_LOOP -->
615
616
</div><!-- tabs -->
617
618
</form>
619
620
</div>
621
</div>
622
</div>
623
624
[% INCLUDE 'intranet-bottom.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_008_holdings.tt (+194 lines)
Line 0 Link Here
1
[% USE raw %]
2
[% INCLUDE 'doc-head-open.inc' %]
3
<title>Koha &rsaquo; Holdings &rsaquo; 008 builder</title>
4
[% INCLUDE 'doc-head-close.inc' %]
5
</head>
6
<body id="cat_marc21_field_008_holdings" class="cat" style="padding:1em;">
7
<h3> 008 Fixed-length data elements</h3>
8
<form name="f_pop" onsubmit="report()" action="">
9
<input type="hidden" name="plugin_name" value="marc21_field_008_holdings.pl" />
10
<input name="f1" value="[% f1 | html %]" type="hidden" />
11
<table>
12
    <tr>
13
        <td>00-05 - Date entered on file</td>
14
        <td>[% f1 | html %]</td>
15
    </tr>
16
    <tr>
17
        <td><label for="f6">06 - Receipt or acquisition status</label></td>
18
        <td>
19
            <select name="f6" id="f6" size="1">
20
                <option value="0"[%- IF ( f60 ) -%] selected="selected"[%- END -%]>0 - Unknown</option>
21
                <option value="1"[%- IF ( f61 ) -%] selected="selected"[%- END -%]>1 - Other receipt or acquisition status</option>
22
                <option value="2"[%- IF ( f62 ) -%] selected="selected"[%- END -%]>2 - Received and complete or ceased</option>
23
                <option value="3"[%- IF ( f63 ) -%] selected="selected"[%- END -%]>3 - On order</option>
24
                <option value="4"[%- IF ( f64 ) -%] selected="selected"[%- END -%]>4 - Currently received</option>
25
                <option value="5"[%- IF ( f65 ) -%] selected="selected"[%- END -%]>5 - Not currently received</option>
26
            </select>
27
        </td>
28
    </tr>
29
    <tr>
30
        <td><label for="f7">07 - Method of acquisition</label></td>
31
        <td>
32
            <select name="f7" id="f7" size="1">
33
                <option value="c"[%- IF ( f7c ) -%] selected="selected"[%- END -%]>c - Cooperative or consortial purchase</option>
34
                <option value="d"[%- IF ( f7d ) -%] selected="selected"[%- END -%]>d - Deposit</option>
35
                <option value="e"[%- IF ( f7e ) -%] selected="selected"[%- END -%]>e - Exchange</option>
36
                <option value="f"[%- IF ( f7f ) -%] selected="selected"[%- END -%]>f - Free</option>
37
                <option value="g"[%- IF ( f7g ) -%] selected="selected"[%- END -%]>g - Gift</option>
38
                <option value="l"[%- IF ( f7l ) -%] selected="selected"[%- END -%]>l - Legal deposit</option>
39
                <option value="m"[%- IF ( f7m ) -%] selected="selected"[%- END -%]>m - Membership</option>
40
                <option value="n"[%- IF ( f7n ) -%] selected="selected"[%- END -%]>n - Non-library purchase</option>
41
                <option value="p"[%- IF ( f7p ) -%] selected="selected"[%- END -%]>p - Purchase</option>
42
                <option value="q"[%- IF ( f7q ) -%] selected="selected"[%- END -%]>q - Lease</option>
43
                <option value="u"[%- IF ( f7u ) -%] selected="selected"[%- END -%]>u - Unknown</option>
44
                <option value="z"[%- IF ( f7z ) -%] selected="selected"[%- END -%]>z - Other method of acquisition</option>
45
            </select>
46
        </td>
47
    </tr>
48
    <tr>
49
        <td><label for="f8">08-11 - Expected acquisition end date</label></td>
50
        <td><input type="text" name="f8" id="f8" maxlength="4" size="5" value="[% f8 | html %]" /></td>
51
    </tr>
52
    <tr>
53
        <td><label for="f12">12- General retention policy</label></td>
54
        <td>
55
            <select name="f12" id="f12" size="1">
56
                <option value="0"[%- IF ( f120 ) -%] selected="selected"[%- END -%]>0 - Unknown</option>
57
                <option value="1"[%- IF ( f121 ) -%] selected="selected"[%- END -%]>1 - Other general retention policy</option>
58
                <option value="2"[%- IF ( f122 ) -%] selected="selected"[%- END -%]>2 - Retained except as replaced by updates</option>
59
                <option value="3"[%- IF ( f123 ) -%] selected="selected"[%- END -%]>3 - Sample issue retained</option>
60
                <option value="4"[%- IF ( f124 ) -%] selected="selected"[%- END -%]>4 - Retained until replaced by microform</option>
61
                <option value="5"[%- IF ( f125 ) -%] selected="selected"[%- END -%]>5 - Retained until replaced by cumulation, replacement volume, or revision</option>
62
                <option value="6"[%- IF ( f126 ) -%] selected="selected"[%- END -%]>6 - Retained for a limited period</option>
63
                <option value="7"[%- IF ( f127 ) -%] selected="selected"[%- END -%]>7 - Not retained</option>
64
                <option value="8"[%- IF ( f128 ) -%] selected="selected"[%- END -%]>8 - Permanently retained</option>
65
            </select>
66
        </td>
67
    </tr>
68
    <tr>
69
        <td><label for="f13">13 - Policy type</label></td>
70
        <td>
71
            <select name="f13" id="f13" size="1">
72
                <option value=" "[%- IF ( f13 ) -%] selected="selected"[%- END -%]># - No information provided</option>
73
                <option value="l"[%- IF ( f13l ) -%] selected="selected"[%- END -%]>l - Latest</option>
74
                <option value="p"[%- IF ( f13p ) -%] selected="selected"[%- END -%]>p - Previous</option>
75
            </select>
76
        </td>
77
    </tr>
78
    <tr>
79
        <td><label for="f14">14 - Number of units</label></td>
80
        <td>
81
            <select name="f14" id="f14" size="1">
82
                <option value=" "[%- IF ( f14 ) -%] selected="selected"[%- END -%]># - No information provided</option>
83
                <option value="1"[%- IF ( f141 ) -%] selected="selected"[%- END -%]>1</option>
84
                <option value="2"[%- IF ( f142 ) -%] selected="selected"[%- END -%]>2</option>
85
                <option value="3"[%- IF ( f143 ) -%] selected="selected"[%- END -%]>3</option>
86
                <option value="4"[%- IF ( f144 ) -%] selected="selected"[%- END -%]>4</option>
87
                <option value="5"[%- IF ( f145 ) -%] selected="selected"[%- END -%]>5</option>
88
                <option value="6"[%- IF ( f146 ) -%] selected="selected"[%- END -%]>6</option>
89
                <option value="7"[%- IF ( f147 ) -%] selected="selected"[%- END -%]>7</option>
90
                <option value="8"[%- IF ( f148 ) -%] selected="selected"[%- END -%]>8</option>
91
                <option value="9"[%- IF ( f149 ) -%] selected="selected"[%- END -%]>9 </option>
92
            </select>
93
        </td>
94
    </tr>
95
    <tr>
96
        <td><label for="f15">15 - Unit type</label></td>
97
        <td>
98
            <select name="f15" id="f15" size="1">
99
                <option value=" "[%- IF ( f15 ) -%] selected="selected"[%- END -%]># - No information provided</option>
100
                <option value="m"[%- IF ( f15m ) -%] selected="selected"[%- END -%]>m - Month(s)</option>
101
                <option value="w"[%- IF ( f15w ) -%] selected="selected"[%- END -%]>w - Week(s)</option>
102
                <option value="y"[%- IF ( f15y ) -%] selected="selected"[%- END -%]>y - Year(s)</option>
103
                <option value="e"[%- IF ( f15e ) -%] selected="selected"[%- END -%]>e - Edition(s)</option>
104
                <option value="i"[%- IF ( f15i ) -%] selected="selected"[%- END -%]>i - Issue(s)</option>
105
                <option value="s"[%- IF ( f15s ) -%] selected="selected"[%- END -%]>s - Supplement(s)</option>
106
            </select>
107
        </td>
108
    </tr>
109
    <tr>
110
        <td><label for="f16">16 - Completeness</label></td>
111
        <td>
112
            <select name="f16" id="f16" size="1">
113
                <option value="0"[%- IF ( f160 ) -%] selected="selected"[%- END -%]>0 - Other</option>
114
                <option value="1"[%- IF ( f161 ) -%] selected="selected"[%- END -%]>1 - Complete</option>
115
                <option value="2"[%- IF ( f162 ) -%] selected="selected"[%- END -%]>2 - Incomplete</option>
116
                <option value="3"[%- IF ( f163 ) -%] selected="selected"[%- END -%]>3 - Scattered</option>
117
                <option value="4"[%- IF ( f164 ) -%] selected="selected"[%- END -%]>4 - Not applicable</option>
118
            </select>
119
        </td>
120
    </tr>
121
    <tr>
122
        <td><label for="f17">17-19 - Number of copies reported</label></td>
123
        <td><input type="text" name="f17" id="f17" maxlength="3" size="4" value="[% f17 | html %]" /></td>
124
    </tr>
125
    <tr>
126
        <td><label for="f20">20 - Lending policy</label></td>
127
        <td>
128
            <select name="f20" id="f20" size="1">
129
                <option value="a"[%- IF ( f20a ) -%] selected="selected"[%- END -%]>a - Will lend</option>
130
                <option value="b"[%- IF ( f20b ) -%] selected="selected"[%- END -%]>b - Will not lend</option>
131
                <option value="c"[%- IF ( f20c ) -%] selected="selected"[%- END -%]>c - Will lend hard copy only</option>
132
                <option value="l"[%- IF ( f20l ) -%] selected="selected"[%- END -%]>l - Limited lending policy</option>
133
                <option value="u"[%- IF ( f20u ) -%] selected="selected"[%- END -%]>u - Unknown</option>
134
            </select>
135
        </td>
136
    </tr>
137
    <tr>
138
        <td><label for="f21">21 - Reproduction policy</label></td>
139
        <td>
140
            <select name="f21" id="f21" size="1">
141
                <option value="a"[%- IF ( f21a ) -%] selected="selected"[%- END -%]>a - Will reproduce</option>
142
                <option value="b"[%- IF ( f21b ) -%] selected="selected"[%- END -%]>b - Will not reproduce</option>
143
                <option value="u"[%- IF ( f21u ) -%] selected="selected"[%- END -%]>u - Unknown</option>
144
            </select>
145
        </td>
146
    </tr>
147
    <tr>
148
        <td><label for="f22">22-24 - Language</label></td>
149
        <td><input type="text" name="f22" id="f22" maxlength="3" size="4" value="[% f22 | html %]" /></td>
150
    </tr>
151
    <tr>
152
        <td><label for="f25">25 - Separate or composite copy report</label></td>
153
        <td>
154
            <select name="f25" id="f25" size="1">
155
                <option value="0"[%- IF ( f250 ) -%] selected="selected"[%- END -%]>0 - Separate copy report</option>
156
                <option value="1"[%- IF ( f251 ) -%] selected="selected"[%- END -%]>1 - Composite copy report</option>
157
            </select>
158
        </td>
159
    </tr>
160
    <tr>
161
        <td><label for="f26">26-31 - Date of report</label></td>
162
        <td><input type="text" name="f26" id="f26" maxlength="6" size="7" value="[% f26 | html %]" /></td>
163
    </tr>
164
</table>
165
<fieldset class="action"><input type="submit" value="OK" /> <a href="#" class="cancel close">Cancel</a></fieldset>
166
</form>
167
<script type="text/javascript">//<![CDATA[
168
    function report() {
169
            var doc   = opener.document;
170
            var field = doc.getElementById("[% index | html %]");
171
172
            field.value =
173
            document.f_pop.f1.value+
174
            document.f_pop.f6.value+
175
            document.f_pop.f7.value+
176
            (document.f_pop.f8.value + '    ').substr(0, 4)+
177
            document.f_pop.f12.value+
178
            document.f_pop.f13.value+
179
            document.f_pop.f14.value+
180
            document.f_pop.f15.value+
181
            document.f_pop.f16.value+
182
            (document.f_pop.f17.value + '   ').substr(0, 3)+
183
            document.f_pop.f20.value+
184
            document.f_pop.f21.value+
185
            (document.f_pop.f22.value + '   ').substr(0, 3)+
186
            document.f_pop.f25.value+
187
            document.f_pop.f26.value;
188
        self.close();
189
        return false;
190
    }
191
    //]]>
192
</script>
193
194
[% INCLUDE 'popup-bottom.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_leader_holdings.tt (+105 lines)
Line 0 Link Here
1
[% INCLUDE 'doc-head-open.inc' %]
2
<title>Koha &rsaquo; Holdings &rsaquo; 000 - Leader builder</title>
3
[% INCLUDE 'doc-head-close.inc' %]
4
</head>
5
<body id="cat_marc21_leader_holdings" class="cat" style="padding:1em;">
6
<form name="f_pop" onsubmit="report()" action="">
7
<input type="hidden" name="plugin_name" value="marc21_leader_holdings.pl" />
8
<h3>000 - Leader</h3>
9
<table>
10
    <tr>
11
        <td><span class="label">0-4 Record size</span></td>
12
        <td>(auto-filled)</td>
13
    </tr>
14
    <tr>
15
        <td><label for="f5">5 - Record status</label></td>
16
        <td>
17
            <select name="f5" id="f5" size="1">
18
                <option value="c"[%- IF ( f5c ) -%] selected="selected"[%- END -%]>c - Corrected or revised</option>
19
                <option value="d"[%- IF ( f5d ) -%] selected="selected"[%- END -%]>d - Deleted</option>
20
                <option value="n"[%- IF ( f5n ) -%] selected="selected"[%- END -%]>n - New</option>
21
            </select>
22
        </td>
23
    </tr>
24
    <tr>
25
        <td><label for="f6">6 - Type of record</label></td>
26
        <td>
27
            <select name="f6" id="f6" size="1">
28
                <option value="u"[%- IF ( f6u ) -%] selected="selected"[%- END -%]>u - Unknown</option>
29
                <option value="v"[%- IF ( f6v ) -%] selected="selected"[%- END -%]>v - Multipart item holdings</option>
30
                <option value="x"[%- IF ( f6x ) -%] selected="selected"[%- END -%]>x - Single-part item holdings</option>
31
                <option value="y"[%- IF ( f6y ) -%] selected="selected"[%- END -%]>y - Serial item holdings</option>
32
            </select>
33
        </td>
34
    </tr>
35
    <tr>
36
        <tr>07-08 - Undefined</tr>
37
        <tr>  </tr>
38
    </tr>
39
    <tr>
40
        <td>9 - Character coding scheme</td>
41
        <td>a - UCS/Unicode (auto-filled)</td>
42
    </tr>
43
    <tr>
44
        <td>10-16 - indicator/subfields/size</td>
45
        <td>(auto-filled)</td>
46
    </tr>
47
    <tr>
48
        <td><label for="f17">17 - Encoding level</label></td>
49
        <td>
50
            <select name="f17" id="f17" size="1">
51
                <option value="1"[%- IF ( f171 ) -%] selected="selected"[%- END -%]>1 - Holdings level 1</option>
52
                <option value="2"[%- IF ( f172 ) -%] selected="selected"[%- END -%]>2 - Holdings level 2</option>
53
                <option value="3"[%- IF ( f173 ) -%] selected="selected"[%- END -%]>3 - Holdings level 3</option>
54
                <option value="4"[%- IF ( f174 ) -%] selected="selected"[%- END -%]>4 - Holdings level 4</option>
55
                <option value="5"[%- IF ( f175 ) -%] selected="selected"[%- END -%]>5 - Holdings level 4 with piece designation</option>
56
                <option value="m"[%- IF ( f17m ) -%] selected="selected"[%- END -%]>m - Mixed level</option>
57
                <option value="u"[%- IF ( f17u ) -%] selected="selected"[%- END -%]>u - Unknown</option>
58
                <option value="z"[%- IF ( f17z ) -%] selected="selected"[%- END -%]>z - Other level</option>
59
            </select>
60
        </td>
61
    </tr>
62
    <tr>
63
        <td><label for="f18">18 - Item information in record</label></td>
64
        <td>
65
            <select name="f18" id="f18" size="1">
66
                <option value="i"[%- IF ( f18i ) -%] selected="selected"[%- END -%]>i - Item information</option>
67
                <option value="n"[%- IF ( f18n ) -%] selected="selected"[%- END -%]>n - No item information</option>
68
            </select>
69
        </td>
70
    </tr>
71
    <tr>
72
        <td>19 - Undefined</td>
73
        <td></td>
74
    </tr>
75
    <tr>
76
        <td>20-24 - entry map &amp; lengths</td>
77
        <td>(auto-filled)</td>
78
    </tr>
79
80
</table>
81
<fieldset class="action"><input type="submit" value="OK" /> <a href="#" class="cancel close">Cancel</a></fieldset>
82
</form>
83
<script type="text/javascript">
84
//<![CDATA[
85
function report() {
86
            var doc   = opener.document;
87
            var field = doc.getElementById("[% index | html %]");
88
89
            field.value =
90
            '     '+
91
            document.f_pop.f5.value+
92
            document.f_pop.f6.value+
93
            '  '+
94
            'a'+ // MARC21 UNICODE flag - must be 'a' for Koha
95
            '22     '+
96
            document.f_pop.f17.value+
97
            document.f_pop.f18.value+
98
            ' '+
99
            '4500';
100
        self.close();
101
        return false;
102
    }
103
    //]]>
104
</script>
105
[% INCLUDE 'popup-bottom.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tt (+2 lines)
Lines 231-236 Link Here
231
                                                        <a href="/cgi-bin/koha/catalogue/moredetail.pl?item=[% loopro.object | uri %]&amp;biblionumber=[% loopro.biblionumber | uri %]&amp;bi=[% loopro.biblioitemnumber | uri %]#item[% loopro.object | uri %]">Item [% loopro.object | html %]</a>
231
                                                        <a href="/cgi-bin/koha/catalogue/moredetail.pl?item=[% loopro.object | uri %]&amp;biblionumber=[% loopro.biblionumber | uri %]&amp;bi=[% loopro.biblioitemnumber | uri %]#item[% loopro.object | uri %]">Item [% loopro.object | html %]</a>
232
                                                    [% ELSIF ( loopro.info.substr(0, 6) == 'biblio' ) %]
232
                                                    [% ELSIF ( loopro.info.substr(0, 6) == 'biblio' ) %]
233
                                                        <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% loopro.object | uri %]" title="Display detail for this biblio">Biblio [% loopro.object | html %]</a>
233
                                                        <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% loopro.object | uri %]" title="Display detail for this biblio">Biblio [% loopro.object | html %]</a>
234
                                                    [% ELSIF ( loopro.info.substr(0, 7) == 'holding' ) %]
235
                                                        <a href="/cgi-bin/koha/cataloguing/addholding.pl?op=edit&amp;holding_id=[% loopro.object | uri %]" title="Display detail for this holding">Holding [% loopro.object | html %]</a>
234
                                                    [% ELSE %]
236
                                                    [% ELSE %]
235
                                                        [% loopro.object | html %]
237
                                                        [% loopro.object | html %]
236
                                                    [% END %]
238
                                                    [% END %]
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt (+28 lines)
Lines 6-11 Link Here
6
[% USE Branches %]
6
[% USE Branches %]
7
[% USE ColumnsSettings %]
7
[% USE ColumnsSettings %]
8
[% USE AuthorisedValues %]
8
[% USE AuthorisedValues %]
9
[% USE Holdings %]
9
[% SET TagsShowEnabled = ( ( Koha.Preference( 'TagsEnabled' ) == 1 ) && TagsShowOnDetail ) %]
10
[% SET TagsShowEnabled = ( ( Koha.Preference( 'TagsEnabled' ) == 1 ) && TagsShowOnDetail ) %]
10
[% SET TagsInputEnabled = ( ( Koha.Preference( 'opacuserlogin' ) == 1 ) && ( Koha.Preference( 'TagsEnabled' ) == 1 ) && TagsInputOnDetail ) %]
11
[% SET TagsInputEnabled = ( ( Koha.Preference( 'opacuserlogin' ) == 1 ) && ( Koha.Preference( 'TagsEnabled' ) == 1 ) && TagsInputOnDetail ) %]
11
[% IF Koha.Preference('AmazonAssocTag') %]
12
[% IF Koha.Preference('AmazonAssocTag') %]
Lines 685-690 Link Here
685
                                [% END %]
686
                                [% END %]
686
                            [% END %]
687
                            [% END %]
687
                        [% END # IF itemloop.size %]
688
                        [% END # IF itemloop.size %]
689
                        [% IF summary_holdings %]
690
                            [% FOREACH holding IN summary_holdings %]
691
                                [% UNLESS holding.suppress %]
692
                                    [% holding_details = Holdings.GetDetails(holding) %]
693
                                    [% IF holding_details.public_note || holding_details.summary || holding_details.supplements || holding_details.indexes %]
694
                                        <span class="summary-holdings">
695
                                            <br>
696
                                            <strong>Additional information for [% Holdings.GetLocation(holding, 1) | html %]</strong>
697
                                            <ul>
698
                                                [% IF holding_details.public_note %]
699
                                                    <li>Public note: [% holding_details.public_note | html %]</li>
700
                                                [% END %]
701
                                                [% IF holding_details.summary %]
702
                                                    <li>Summary: [% holding_details.summary | html %]</li>
703
                                                [% END %]
704
                                                [% IF holding_details.supplements %]
705
                                                    <li>Supplements: [% holding_details.supplements | html %]</li>
706
                                                [% END %]
707
                                                [% IF holding_details.indexes %]
708
                                                    <li>Indexes: [% holding_details.indexes | html %]</li>
709
                                                [% END %]
710
                                            </ul>
711
                                        </span>
712
                                    [% END %]
713
                                [% END %]
714
                            [% END %]
715
                        [% END %]
688
                        [% PROCESS 'shelfbrowser.inc' %]
716
                        [% PROCESS 'shelfbrowser.inc' %]
689
                        [% INCLUDE shelfbrowser tab='holdings' %]
717
                        [% INCLUDE shelfbrowser tab='holdings' %]
690
                        <br style="clear:both;" />
718
                        <br style="clear:both;" />
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt (+10 lines)
Lines 1-6 Link Here
1
[% USE raw %]
1
[% USE raw %]
2
[% USE Asset %]
2
[% USE Asset %]
3
[% USE Koha %]
3
[% USE Koha %]
4
[% USE Holdings %]
4
[% SET TagsShowEnabled = ( ( Koha.Preference( 'TagsEnabled' ) == 1 ) && TagsShowOnList ) %]
5
[% SET TagsShowEnabled = ( ( Koha.Preference( 'TagsEnabled' ) == 1 ) && TagsShowOnList ) %]
5
[% SET TagsInputEnabled = ( ( Koha.Preference( 'opacuserlogin' ) == 1 ) && ( Koha.Preference( 'TagsEnabled' ) == 1 ) && TagsInputOnList ) %]
6
[% SET TagsInputEnabled = ( ( Koha.Preference( 'opacuserlogin' ) == 1 ) && ( Koha.Preference( 'TagsEnabled' ) == 1 ) && TagsInputOnList ) %]
6
[% SET AdlibrisEnabled = Koha.Preference('AdlibrisCoversEnabled') %]
7
[% SET AdlibrisEnabled = Koha.Preference('AdlibrisCoversEnabled') %]
Lines 417-422 Link Here
417
                                                                    [% END %]
418
                                                                    [% END %]
418
                                                                [% ELSE %]
419
                                                                [% ELSE %]
419
                                                                    <span class="unavailable">No items available:</span>
420
                                                                    <span class="unavailable">No items available:</span>
421
                                                                    [% IF ( SEARCH_RESULT.summary_holdings ) %]
422
                                                                        <span class="summary-holdings">
423
                                                                            [% FOREACH holding IN SEARCH_RESULT.summary_holdings %]
424
                                                                                [% UNLESS holding.suppress %]
425
                                                                                    [% Holdings.GetLocation(holding, 1) | html %],
426
                                                                                [% END %]
427
                                                                            [% END %]
428
                                                                        </span>
429
                                                                    [% END %]
420
                                                                [% END %]
430
                                                                [% END %]
421
                                                            [% END # / IF SEARCH_RESULT.available_items_loop.size %]
431
                                                            [% END # / IF SEARCH_RESULT.available_items_loop.size %]
422
432
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl (-2 / +17 lines)
Lines 4-12 Link Here
4
<xsl:stylesheet version="1.0"
4
<xsl:stylesheet version="1.0"
5
  xmlns:marc="http://www.loc.gov/MARC21/slim"
5
  xmlns:marc="http://www.loc.gov/MARC21/slim"
6
  xmlns:items="http://www.koha-community.org/items"
6
  xmlns:items="http://www.koha-community.org/items"
7
  xmlns:holdings="http://www.koha-community.org/holdings"
7
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
8
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
8
  xmlns:str="http://exslt.org/strings"
9
  xmlns:str="http://exslt.org/strings"
9
  exclude-result-prefixes="marc items">
10
  exclude-result-prefixes="marc items holdings">
10
    <xsl:import href="MARC21slimUtils.xsl"/>
11
    <xsl:import href="MARC21slimUtils.xsl"/>
11
    <xsl:output method = "html" indent="yes" omit-xml-declaration = "yes" encoding="UTF-8"/>
12
    <xsl:output method = "html" indent="yes" omit-xml-declaration = "yes" encoding="UTF-8"/>
12
    <xsl:key name="item-by-status" match="items:item" use="items:status"/>
13
    <xsl:key name="item-by-status" match="items:item" use="items:status"/>
Lines 1162-1168 Link Here
1162
                            </xsl:for-each>
1163
                            </xsl:for-each>
1163
                            (<xsl:value-of select="$AlternateHoldingsCount"/>)
1164
                            (<xsl:value-of select="$AlternateHoldingsCount"/>)
1164
                            </xsl:when>
1165
                            </xsl:when>
1165
                            <xsl:otherwise>No items available </xsl:otherwise>
1166
                            <xsl:otherwise>
1167
                                <xsl:text>No items available</xsl:text>
1168
                                <xsl:if test="//holdings:holdings/holdings:holding/holdings:suppress[.='0']">:
1169
                                    <xsl:for-each select="//holdings:holdings/holdings:holding[./holdings:suppress='0']">
1170
                                        <xsl:if test="position() > 1">, </xsl:if>
1171
                                        <xsl:value-of select="./holdings:holdingbranch"/>
1172
                                        <xsl:if test="string-length(./holdings:location) > 0">
1173
                                        - <xsl:value-of select="./holdings:location"/>
1174
                                        </xsl:if>
1175
                                        <xsl:if test="string-length(./holdings:callnumber) > 0">
1176
                                        - <xsl:value-of select="./holdings:callnumber"/>
1177
                                        </xsl:if>
1178
                                    </xsl:for-each>
1179
                                </xsl:if>
1180
                            </xsl:otherwise>
1166
                        </xsl:choose>
1181
                        </xsl:choose>
1167
				   </xsl:when>
1182
				   </xsl:when>
1168
                   <xsl:when test="count(key('item-by-status', 'available'))>0">
1183
                   <xsl:when test="count(key('item-by-status', 'available'))>0">
(-)a/opac/opac-detail.pl (+7 lines)
Lines 747-752 if (scalar(@itemloop) == 0 || scalar(@otheritemloop) == 0) { Link Here
747
    }
747
    }
748
}
748
}
749
749
750
# Fetch summary holdings
751
if (C4::Context->preference('SummaryHoldings')) {
752
    my $summary_holdings = Koha::Holdings->search({ biblionumber => $biblionumber, deleted_on => undef })->unblessed;
753
    $template->param( summary_holdings => $summary_holdings );
754
}
755
756
750
## get notes and subjects from MARC record
757
## get notes and subjects from MARC record
751
if (!C4::Context->preference("OPACXSLTDetailsDisplay") ) {
758
if (!C4::Context->preference("OPACXSLTDetailsDisplay") ) {
752
    my $marcisbnsarray   = GetMarcISBN    ($record,$marcflavour);
759
    my $marcisbnsarray   = GetMarcISBN    ($record,$marcflavour);
(-)a/t/db_dependent/Koha/Holding.t (+154 lines)
Line 0 Link Here
1
#!/usr/bin/perl
2
3
# This file is part of Koha.
4
#
5
# Koha is free software; you can redistribute it and/or modify it
6
# under the terms of the GNU General Public License as published by
7
# the Free Software Foundation; either version 3 of the License, or
8
# (at your option) any later version.
9
#
10
# Koha is distributed in the hope that it will be useful, but
11
# WITHOUT ANY WARRANTY; without even the implied warranty of
12
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
# GNU General Public License for more details.
14
#
15
# You should have received a copy of the GNU General Public License
16
# along with Koha; if not, see <http://www.gnu.org/licenses>.
17
18
use Modern::Perl;
19
20
use Test::More tests => 3;
21
22
use t::lib::TestBuilder;
23
24
use C4::Biblio;
25
26
use Koha::BiblioFramework;
27
use Koha::BiblioFrameworks;
28
use Koha::Database;
29
use Koha::Libraries;
30
use Koha::Library;
31
use Koha::MarcSubfieldStructure;
32
use Koha::MarcSubfieldStructures;
33
34
BEGIN {
35
    use_ok('Koha::Holding');
36
    use_ok('Koha::Holdings');
37
}
38
39
my $schema = Koha::Database->new->schema;
40
41
subtest 'Koha::Holding tests' => sub {
42
43
    plan tests => 17;
44
45
    $schema->storage->txn_begin;
46
47
    # Add a framework
48
    my $frameworkcode = 'HLD';
49
    my $existing_mss = Koha::MarcSubfieldStructures->search({frameworkcode => $frameworkcode});
50
    $existing_mss->delete() if $existing_mss;
51
    my $existing_fw = Koha::BiblioFrameworks->find({frameworkcode => $frameworkcode});
52
    $existing_fw->delete() if $existing_fw;
53
    Koha::BiblioFramework->new({
54
        frameworkcode => $frameworkcode,
55
        frameworktext => 'Holdings'
56
    })->store();
57
    Koha::MarcSubfieldStructure->new({
58
        frameworkcode => $frameworkcode,
59
        tagfield => 852,
60
        tagsubfield => 'b',
61
        kohafield => 'holdings.holdingbranch'
62
    })->store();
63
    Koha::MarcSubfieldStructure->new({
64
        frameworkcode => $frameworkcode,
65
        tagfield => 852,
66
        tagsubfield => 'c',
67
        kohafield => 'holdings.location'
68
    })->store();
69
    Koha::MarcSubfieldStructure->new({
70
        frameworkcode => $frameworkcode,
71
        tagfield => 942,
72
        tagsubfield => 'n',
73
        kohafield => 'holdings.suppress'
74
    })->store();
75
    Koha::MarcSubfieldStructure->new({
76
        frameworkcode => $frameworkcode,
77
        tagfield => 999,
78
        tagsubfield => 'c',
79
        kohafield => 'biblio.biblionumber'
80
    })->store();
81
    Koha::MarcSubfieldStructure->new({
82
        frameworkcode => $frameworkcode,
83
        tagfield => 999,
84
        tagsubfield => 'e',
85
        kohafield => 'holdings.holding_id'
86
    })->store();
87
88
    # Add a branch
89
    Koha::Library->new({ branchcode => 'ABC', branchname => 'Abc' })->store() unless Koha::Libraries->find({ branchcode => 'ABC' });
90
91
    # Add a biblio
92
    my $title = 'Oranges and Peaches';
93
    my $record = MARC::Record->new();
94
    my $field = MARC::Field->new('245','','','a' => $title);
95
    $record->append_fields( $field );
96
    my ($biblionumber) = C4::Biblio::AddBiblio($record, '');
97
98
    # Add a holdings record
99
    my $holding_marc = MARC::Record->new();
100
    $holding_marc->append_fields(MARC::Field->new('852','','','b' => 'ABC', 'c' => 'DEF'));
101
    my $new_holding = Koha::Holding->new({ biblionumber => $biblionumber, frameworkcode => $frameworkcode });
102
    is ($new_holding->set_marc({record => $holding_marc}), $new_holding, 'set_marc() returns the object');
103
    is($new_holding->store(), $new_holding, 'store() returns the object on create');
104
    is(defined $new_holding->holding_id(), 1, 'Newly added holdings record has a holding_id');
105
106
    # Check that the added record can be found and looks right
107
    my $holding = Koha::Holdings->find($new_holding->holding_id());
108
    is(ref $holding, 'Koha::Holding', 'Found a Koha::Holding object');
109
    is($holding->frameworkcode(), $frameworkcode, 'Framework code correct in Koha::Holding object');
110
    is($holding->holdingbranch(), 'ABC', 'Location correct in Koha::Holding object');
111
112
    my $metadata = $holding->metadata;
113
    is( ref $metadata, 'Koha::Holdings::Metadata', 'Method metadata() returned a Koha::Holdings::Metadata object');
114
115
    my $holding_marc2 = $metadata->record;
116
    is(ref $holding_marc2, 'MARC::Record', 'Method record() returned a MARC::Record object');
117
    is($holding_marc2->field('852')->subfield('b'), 'ABC', 'Location in 852$b matches location from original record object');
118
119
    # Test updating the record
120
    $holding_marc2->append_fields(MARC::Field->new('942','','','n' => '1'));
121
    is($holding->set_marc({record => $holding_marc2}), $holding, 'set_marc() returns the object on update');
122
    is($holding->store(), $holding, 'store() returns the object on update');
123
124
    is($holding->suppress(), 1, 'Holdings record is suppressed');
125
126
    # Test misc methods
127
    my %mapping = Koha::Holding->get_marc_field_mapping({ field => 'holdings.location' });
128
    is_deeply(
129
        \%mapping,
130
        {852 => 'c'},
131
        'get_marc_field_mapping returns correct data'
132
    );
133
134
    my $fields = Koha::Holding->marc_to_koha_fields({ record => $holding_marc2 });
135
    is_deeply(
136
        $fields,
137
        {
138
            holdingbranch => 'ABC',
139
            location => 'DEF',
140
            suppress => 1,
141
            holding_id => $new_holding->holding_id()
142
        },
143
        'marc_to_koha_fields returns correct data'
144
    );
145
146
    # Test deletion
147
    is(defined $holding->deleted_on(), '', 'Holdings record not marked as deleted');
148
    $holding->delete();
149
    $holding = Koha::Holdings->find($new_holding->holding_id());
150
    is(defined $holding->deleted_on(), 1, 'Holdings record marked as deleted');
151
    is(defined $holding->metadata()->deleted_on(), 1, 'Holdings metadata record marked as deleted');
152
153
    $schema->storage->txn_rollback;
154
};
(-)a/t/db_dependent/Koha/Holdings.t (+108 lines)
Line 0 Link Here
1
#!/usr/bin/perl
2
3
# This file is part of Koha.
4
#
5
# Koha is free software; you can redistribute it and/or modify it
6
# under the terms of the GNU General Public License as published by
7
# the Free Software Foundation; either version 3 of the License, or
8
# (at your option) any later version.
9
#
10
# Koha is distributed in the hope that it will be useful, but
11
# WITHOUT ANY WARRANTY; without even the implied warranty of
12
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
# GNU General Public License for more details.
14
#
15
# You should have received a copy of the GNU General Public License
16
# along with Koha; if not, see <http://www.gnu.org/licenses>.
17
18
use Modern::Perl;
19
20
use Test::More tests => 2;
21
22
use t::lib::TestBuilder;
23
24
use C4::Biblio;
25
26
use Koha::BiblioFramework;
27
use Koha::BiblioFrameworks;
28
use Koha::Database;
29
use Koha::MarcSubfieldStructure;
30
use Koha::MarcSubfieldStructures;
31
32
BEGIN {
33
    use_ok('Koha::Holdings');
34
}
35
36
my $schema = Koha::Database->new->schema;
37
38
subtest 'Koha::Holdings tests' => sub {
39
40
    plan tests => 3;
41
42
    $schema->storage->txn_begin;
43
44
    # Add a framework
45
    my $frameworkcode = 'HLD';
46
    my $existing_mss = Koha::MarcSubfieldStructures->search({frameworkcode => $frameworkcode});
47
    $existing_mss->delete() if $existing_mss;
48
    my $existing_fw = Koha::BiblioFrameworks->find({frameworkcode => $frameworkcode});
49
    $existing_fw->delete() if $existing_fw;
50
    Koha::BiblioFramework->new({
51
        frameworkcode => $frameworkcode,
52
        frameworktext => 'Holdings'
53
    })->store();
54
    Koha::MarcSubfieldStructure->new({
55
        frameworkcode => $frameworkcode,
56
        tagfield => 852,
57
        tagsubfield => 'b',
58
        kohafield => 'holdings.holdingbranch'
59
    })->store();
60
    Koha::MarcSubfieldStructure->new({
61
        frameworkcode => $frameworkcode,
62
        tagfield => 852,
63
        tagsubfield => 'c',
64
        kohafield => 'holdings.location'
65
    })->store();
66
    Koha::MarcSubfieldStructure->new({
67
        frameworkcode => $frameworkcode,
68
        tagfield => 999,
69
        tagsubfield => 'c',
70
        kohafield => 'biblio.biblionumber'
71
    })->store();
72
    Koha::MarcSubfieldStructure->new({
73
        frameworkcode => $frameworkcode,
74
        tagfield => 999,
75
        tagsubfield => 'e',
76
        kohafield => 'holdings.holding_id'
77
    })->store();
78
79
    # Add branches
80
    Koha::Library->new({ branchcode => 'ABC', branchname => 'Abc' })->store() unless Koha::Libraries->find({ branchcode => 'ABC' });
81
    Koha::Library->new({ branchcode => 'BCD', branchname => 'Bcd' })->store() unless Koha::Libraries->find({ branchcode => 'BCD' });
82
83
    # Add a biblio
84
    my $title = 'Oranges and Peaches';
85
    my $record = MARC::Record->new();
86
    my $field = MARC::Field->new('245','','','a' => $title);
87
    $record->append_fields( $field );
88
    my ($biblionumber) = C4::Biblio::AddBiblio($record, '');
89
90
    # Add a couple of holdings records
91
    my $holding_marc = MARC::Record->new();
92
    $holding_marc->append_fields(MARC::Field->new('852','','','b' => 'ABC', 'c' => 'DEF'));
93
    my $new_holding = Koha::Holding->new({ biblionumber => $biblionumber, frameworkcode => $frameworkcode });
94
    $new_holding->set_marc({record => $holding_marc})->store();
95
96
    $holding_marc = MARC::Record->new();
97
    $holding_marc->append_fields(MARC::Field->new('852','','','b' => 'BCD', 'c' => 'DEF'));
98
    $new_holding = Koha::Holding->new({ biblionumber => $biblionumber, frameworkcode => $frameworkcode });
99
    $new_holding->set_marc({record => $holding_marc})->store();
100
101
    # Test results
102
    my $fields = Koha::Holdings->get_embeddable_marc_fields({ biblionumber => $biblionumber});
103
    is(scalar(@{$fields}), 2, 'get_embeddable_marc_fields returns two fields');
104
    is($fields->[0]->as_string, 'ABC DEF', 'get_embeddable_marc_fields returns correct data in first field');
105
    is($fields->[1]->as_string, 'BCD DEF', 'get_embeddable_marc_fields returns correct data in second field');
106
107
    $schema->storage->txn_rollback;
108
};
(-)a/tools/stage-marc-import.pl (-2 / +1 lines)
Lines 93-99 if ($completedJobID) { Link Here
93
93
94
    my ( $errors, $marcrecords );
94
    my ( $errors, $marcrecords );
95
    if( $format eq 'MARCXML' ) {
95
    if( $format eq 'MARCXML' ) {
96
        ( $errors, $marcrecords ) = C4::ImportBatch::RecordsFromMARCXMLFile( $file, $encoding);
96
        ( $errors, $marcrecords ) = C4::ImportBatch::RecordsFromMARCXMLFile( $file, $record_type, $encoding);
97
    } elsif( $format eq 'ISO2709' ) {
97
    } elsif( $format eq 'ISO2709' ) {
98
        ( $errors, $marcrecords ) = C4::ImportBatch::RecordsFromISO2709File( $file, $record_type, $encoding );
98
        ( $errors, $marcrecords ) = C4::ImportBatch::RecordsFromISO2709File( $file, $record_type, $encoding );
99
    } else { # plugin based
99
    } else { # plugin based
100
- 

Return to bug 20447