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

(-)a/C4/Biblio.pm (-6 / +35 lines)
Lines 100-105 use Koha::Caches; Link Here
100
use Koha::Authority::Types;
100
use Koha::Authority::Types;
101
use Koha::Acquisition::Currencies;
101
use Koha::Acquisition::Currencies;
102
use Koha::Biblio::Metadatas;
102
use Koha::Biblio::Metadatas;
103
use Koha::Holdings;
103
use Koha::Holds;
104
use Koha::Holds;
104
use Koha::ItemTypes;
105
use Koha::ItemTypes;
105
use Koha::Plugins;
106
use Koha::Plugins;
Lines 1380-1385 sub GetAuthorisedValueDesc { Link Here
1380
            return $itemtype ? $itemtype->translated_description : q||;
1381
            return $itemtype ? $itemtype->translated_description : q||;
1381
        }
1382
        }
1382
1383
1384
        #---- holdings
1385
        if ( $tagslib->{$tag}->{$subfield}->{'authorised_value'} eq "holdings" ) {
1386
            my $holding = Koha::Holdings->find( $value );
1387
            if ( $holding ) {
1388
                my @parts;
1389
1390
                push @parts, $value;
1391
                push @parts, $holding->holdingbranch() if $holding->holdingbranch();
1392
                push @parts, $holding->location() if $holding->location();
1393
                push @parts, $holding->ccode() if $holding->ccode();
1394
                push @parts, $holding->callnumber() if $holding->callnumber();
1395
1396
                return join(' ', @parts);
1397
            }
1398
            return q||;
1399
        }
1400
1383
        #---- "true" authorized value
1401
        #---- "true" authorized value
1384
        $category = $tagslib->{$tag}->{$subfield}->{'authorised_value'};
1402
        $category = $tagslib->{$tag}->{$subfield}->{'authorised_value'};
1385
    }
1403
    }
Lines 2588-2601 sub ModZebra { Link Here
2588
=head2 EmbedItemsInMarcBiblio
2606
=head2 EmbedItemsInMarcBiblio
2589
2607
2590
    EmbedItemsInMarcBiblio({
2608
    EmbedItemsInMarcBiblio({
2591
        marc_record  => $marc,
2609
        marc_record   => $marc,
2592
        biblionumber => $biblionumber,
2610
        biblionumber  => $biblionumber,
2593
        item_numbers => $itemnumbers,
2611
        item_numbers  => $itemnumbers,
2594
        opac         => $opac });
2612
        opac          => $opac,
2613
        skip_holdings => 1 });
2595
2614
2596
Given a MARC::Record object containing a bib record,
2615
Given a MARC::Record object containing a bib record,
2597
modify it to include the items attached to it as 9XX
2616
modify it to include the items attached to it as 9XX
2598
per the bib's MARC framework.
2617
per the bib's MARC framework and any holdings location information.
2599
if $itemnumbers is defined, only specified itemnumbers are embedded.
2618
if $itemnumbers is defined, only specified itemnumbers are embedded.
2600
2619
2601
If $opac is true, then opac-relevant suppressions are included.
2620
If $opac is true, then opac-relevant suppressions are included.
Lines 2603-2613 If $opac is true, then opac-relevant suppressions are included. Link Here
2603
If opac filtering will be done, borcat should be passed to properly
2622
If opac filtering will be done, borcat should be passed to properly
2604
override if necessary.
2623
override if necessary.
2605
2624
2625
If $skip_holdings is set, it overrides the default of embedding basic
2626
location information from holdings records if summary holdings are
2627
enabled.
2628
2606
=cut
2629
=cut
2607
2630
2608
sub EmbedItemsInMarcBiblio {
2631
sub EmbedItemsInMarcBiblio {
2609
    my ($params) = @_;
2632
    my ($params) = @_;
2610
    my ($marc, $biblionumber, $itemnumbers, $opac, $borcat);
2633
    my ($marc, $biblionumber, $itemnumbers, $opac, $borcat, $skip_holdings);
2611
    $marc = $params->{marc_record};
2634
    $marc = $params->{marc_record};
2612
    if ( !$marc ) {
2635
    if ( !$marc ) {
2613
        carp 'EmbedItemsInMarcBiblio: No MARC record passed';
2636
        carp 'EmbedItemsInMarcBiblio: No MARC record passed';
Lines 2617-2625 sub EmbedItemsInMarcBiblio { Link Here
2617
    $itemnumbers = $params->{item_numbers};
2640
    $itemnumbers = $params->{item_numbers};
2618
    $opac = $params->{opac};
2641
    $opac = $params->{opac};
2619
    $borcat = $params->{borcat} // q{};
2642
    $borcat = $params->{borcat} // q{};
2643
    $skip_holdings = $params->{skip_holdings} // 0;
2620
2644
2621
    $itemnumbers = [] unless defined $itemnumbers;
2645
    $itemnumbers = [] unless defined $itemnumbers;
2622
2646
2647
    if ( !$skip_holdings && C4::Context->preference('SummaryHoldings') && !@$itemnumbers ) {
2648
        my $holdings_fields = Koha::Holdings->get_embeddable_marc_fields({ biblionumber => $biblionumber });
2649
        $marc->append_fields(@$holdings_fields) if ( @$holdings_fields );
2650
    }
2651
2623
    my $frameworkcode = GetFrameworkCode($biblionumber);
2652
    my $frameworkcode = GetFrameworkCode($biblionumber);
2624
    _strip_item_fields($marc, $frameworkcode);
2653
    _strip_item_fields($marc, $frameworkcode);
2625
2654
(-)a/C4/ImportBatch.pm (-2 / +26 lines)
Lines 1503-1515 sub RecordsFromISO2709File { Link Here
1503
1503
1504
    open IN, "<$input_file" or die "$0: cannot open input file $input_file: $!\n";
1504
    open IN, "<$input_file" or die "$0: cannot open input file $input_file: $!\n";
1505
    my @marc_records;
1505
    my @marc_records;
1506
    my $count = 0;
1506
    $/ = "\035";
1507
    $/ = "\035";
1507
    while (<IN>) {
1508
    while (<IN>) {
1508
        s/^\s+//;
1509
        s/^\s+//;
1509
        s/\s+$//;
1510
        s/\s+$//;
1510
        next unless $_; # skip if record has only whitespace, as might occur
1511
        next unless $_; # skip if record has only whitespace, as might occur
1511
                        # if file includes newlines between each MARC record
1512
                        # if file includes newlines between each MARC record
1513
        ++$count;
1512
        my ($marc_record, $charset_guessed, $char_errors) = MarcToUTF8Record($_, $marc_type, $encoding);
1514
        my ($marc_record, $charset_guessed, $char_errors) = MarcToUTF8Record($_, $marc_type, $encoding);
1515
        # Ignore holdings records
1516
        if ($record_type eq 'biblio' && $marc_type eq 'MARC21') {
1517
            my $leader = $marc_record->leader();
1518
            if ($leader =~ /^.{6}[uvxy]/) {
1519
                push @errors, "Ignoring record $count (holdings record)";
1520
                next;
1521
            }
1522
        }
1523
1513
        push @marc_records, $marc_record;
1524
        push @marc_records, $marc_record;
1514
        if ($charset_guessed ne $encoding) {
1525
        if ($charset_guessed ne $encoding) {
1515
            push @errors,
1526
            push @errors,
Lines 1534-1548 Returns two array refs. Link Here
1534
=cut
1545
=cut
1535
1546
1536
sub RecordsFromMARCXMLFile {
1547
sub RecordsFromMARCXMLFile {
1537
    my ( $filename, $encoding ) = @_;
1548
    my ( $filename, $record_type, $encoding ) = @_;
1549
1550
    my $marcflavour = C4::Context->preference('marcflavour');
1538
    my $batch = MARC::File::XML->in( $filename );
1551
    my $batch = MARC::File::XML->in( $filename );
1539
    my ( @marcRecords, @errors, $record );
1552
    my ( @marcRecords, @errors, $record );
1553
    my $count = 0;
1540
    do {
1554
    do {
1555
        ++$count;
1541
        eval { $record = $batch->next( $encoding ); };
1556
        eval { $record = $batch->next( $encoding ); };
1542
        if ($@) {
1557
        if ($@) {
1543
            push @errors, $@;
1558
            push @errors, $@;
1544
        }
1559
        }
1545
        push @marcRecords, $record if $record;
1560
        # Ignore holdings records
1561
        my $valid = 1;
1562
        if ($record && $record_type eq 'biblio' && $marcflavour eq 'MARC21') {
1563
            my $leader = $record->leader();
1564
            if ($leader =~ /^.{6}[uvxy]/) {
1565
                push @errors, "Ignoring record $count (holdings record)";
1566
                $valid = 0;
1567
            }
1568
        }
1569
        push @marcRecords, $record if $record && $valid;
1546
    } while( $record );
1570
    } while( $record );
1547
    return (\@errors, \@marcRecords);
1571
    return (\@errors, \@marcRecords);
1548
}
1572
}
(-)a/C4/Items.pm (-2 / +6 lines)
Lines 74-79 use Koha::Database; Link Here
74
74
75
use Koha::Biblios;
75
use Koha::Biblios;
76
use Koha::Biblioitems;
76
use Koha::Biblioitems;
77
use Koha::Holdings;
77
use Koha::Items;
78
use Koha::Items;
78
use Koha::ItemTypes;
79
use Koha::ItemTypes;
79
use Koha::SearchEngine;
80
use Koha::SearchEngine;
Lines 401-406 sub _build_default_values_for_mod_marc { Link Here
401
        stocknumber              => undef,
402
        stocknumber              => undef,
402
        uri                      => undef,
403
        uri                      => undef,
403
        withdrawn                => 0,
404
        withdrawn                => 0,
405
        holding_id               => undef,
404
    };
406
    };
405
    my %default_values_for_mod_from_marc;
407
    my %default_values_for_mod_from_marc;
406
    while ( my ( $field, $default_value ) = each %$default_values ) {
408
    while ( my ( $field, $default_value ) = each %$default_values ) {
Lines 1067-1073 Item's itemcallnumber Link Here
1067
Item's call number normalized for sorting
1069
Item's call number normalized for sorting
1068
1070
1069
=back
1071
=back
1070
  
1072
1071
=cut
1073
=cut
1072
1074
1073
sub GetItemsLocationInfo {
1075
sub GetItemsLocationInfo {
Lines 1594-1600 sub _koha_new_item { Link Here
1594
            more_subfields_xml  = ?,
1596
            more_subfields_xml  = ?,
1595
            copynumber          = ?,
1597
            copynumber          = ?,
1596
            stocknumber         = ?,
1598
            stocknumber         = ?,
1597
            new_status          = ?
1599
            new_status          = ?,
1600
            holding_id          = ?
1598
          ";
1601
          ";
1599
    my $sth = $dbh->prepare($query);
1602
    my $sth = $dbh->prepare($query);
1600
    my $today = output_pref({ dt => dt_from_string, dateformat => 'iso', dateonly => 1 });
1603
    my $today = output_pref({ dt => dt_from_string, dateformat => 'iso', dateonly => 1 });
Lines 1638-1643 sub _koha_new_item { Link Here
1638
            $item->{'copynumber'},
1641
            $item->{'copynumber'},
1639
            $item->{'stocknumber'},
1642
            $item->{'stocknumber'},
1640
            $item->{'new_status'},
1643
            $item->{'new_status'},
1644
            $item->{'holding_id'},
1641
    );
1645
    );
1642
1646
1643
    my $itemnumber;
1647
    my $itemnumber;
(-)a/C4/Search.pm (+8 lines)
Lines 30-35 use C4::Reserves; # GetReserveStatus Link Here
30
use C4::Debug;
30
use C4::Debug;
31
use C4::Charset;
31
use C4::Charset;
32
use Koha::AuthorisedValues;
32
use Koha::AuthorisedValues;
33
use Koha::Holdings;
33
use Koha::ItemTypes;
34
use Koha::ItemTypes;
34
use Koha::Libraries;
35
use Koha::Libraries;
35
use Koha::Patrons;
36
use Koha::Patrons;
Lines 2058-2063 sub searchResults { Link Here
2058
        my $maxitems_pref = C4::Context->preference('maxItemsinSearchResults');
2059
        my $maxitems_pref = C4::Context->preference('maxItemsinSearchResults');
2059
        my $maxitems = $maxitems_pref ? $maxitems_pref - 1 : 1;
2060
        my $maxitems = $maxitems_pref ? $maxitems_pref - 1 : 1;
2060
        my @hiddenitems; # hidden itemnumbers based on OpacHiddenItems syspref
2061
        my @hiddenitems; # hidden itemnumbers based on OpacHiddenItems syspref
2062
        my $summary_holdings;
2061
2063
2062
        # loop through every item
2064
        # loop through every item
2063
        foreach my $field (@fields) {
2065
        foreach my $field (@fields) {
Lines 2239-2244 sub searchResults { Link Here
2239
            push @available_items_loop, $available_items->{$key}
2241
            push @available_items_loop, $available_items->{$key}
2240
        }
2242
        }
2241
2243
2244
        # Fetch summary holdings
2245
        if (C4::Context->preference('SummaryHoldings')) {
2246
            $summary_holdings = Koha::Holdings->search({ biblionumber => $oldbiblio->{biblionumber}, deleted_on => undef });
2247
        }
2248
2242
        # XSLT processing of some stuff
2249
        # XSLT processing of some stuff
2243
        # we fetched the sysprefs already before the loop through all retrieved record!
2250
        # we fetched the sysprefs already before the loop through all retrieved record!
2244
        if (!$scan && $xslfile) {
2251
        if (!$scan && $xslfile) {
Lines 2269-2274 sub searchResults { Link Here
2269
        $oldbiblio->{onholdcount}          = $item_onhold_count;
2276
        $oldbiblio->{onholdcount}          = $item_onhold_count;
2270
        $oldbiblio->{orderedcount}         = $ordered_count;
2277
        $oldbiblio->{orderedcount}         = $ordered_count;
2271
        $oldbiblio->{notforloancount}      = $notforloan_count;
2278
        $oldbiblio->{notforloancount}      = $notforloan_count;
2279
        $oldbiblio->{summary_holdings}     = $summary_holdings;
2272
2280
2273
        if (C4::Context->preference("AlternateHoldingsField") && $items_count == 0) {
2281
        if (C4::Context->preference("AlternateHoldingsField") && $items_count == 0) {
2274
            my $fieldspec = C4::Context->preference("AlternateHoldingsField");
2282
            my $fieldspec = C4::Context->preference("AlternateHoldingsField");
(-)a/C4/XSLT.pm (-2 / +49 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 243-252 sub XSLTParse4Display { Link Here
243
    # grab the XML, run it through our stylesheet, push it out to the browser
249
    # grab the XML, run it through our stylesheet, push it out to the browser
244
    my $record = transformMARCXML4XSLT($biblionumber, $orig_record);
250
    my $record = transformMARCXML4XSLT($biblionumber, $orig_record);
245
    my $itemsxml;
251
    my $itemsxml;
252
    my $holdingsxml;
246
    if ( $xslsyspref eq "OPACXSLTDetailsDisplay" || $xslsyspref eq "XSLTDetailsDisplay" || $xslsyspref eq "XSLTResultsDisplay" ) {
253
    if ( $xslsyspref eq "OPACXSLTDetailsDisplay" || $xslsyspref eq "XSLTDetailsDisplay" || $xslsyspref eq "XSLTResultsDisplay" ) {
247
        $itemsxml = ""; #We don't use XSLT for items display on these pages
254
        # We don't use XSLT for items or holdings display on these pages
255
        $itemsxml = ""; 
256
        $holdingsxml = "";
248
    } else {
257
    } else {
249
        $itemsxml = buildKohaItemsNamespace($biblionumber, $hidden_items);
258
        $itemsxml = buildKohaItemsNamespace($biblionumber, $hidden_items);
259
        $holdingsxml = buildKohaHoldingsNamespace($biblionumber);
250
    }
260
    }
251
    my $xmlrecord = $record->as_xml(C4::Context->preference('marcflavour'));
261
    my $xmlrecord = $record->as_xml(C4::Context->preference('marcflavour'));
252
262
Lines 272-278 sub XSLTParse4Display { Link Here
272
    }
282
    }
273
    $varxml .= "</variables>\n";
283
    $varxml .= "</variables>\n";
274
284
275
    $xmlrecord =~ s/\<\/record\>/$itemsxml$sysxml$varxml\<\/record\>/;
285
    $xmlrecord =~ s/\<\/record\>/$itemsxml$holdingsxml$sysxml$varxml\<\/record\>/;
276
    if ($fixamps) { # We need to correct the ampersand entities that Zebra outputs
286
    if ($fixamps) { # We need to correct the ampersand entities that Zebra outputs
277
        $xmlrecord =~ s/\&amp;amp;/\&amp;/g;
287
        $xmlrecord =~ s/\&amp;amp;/\&amp;/g;
278
        $xmlrecord =~ s/\&amp\;lt\;/\&lt\;/g;
288
        $xmlrecord =~ s/\&amp\;lt\;/\&lt\;/g;
Lines 377-382 sub buildKohaItemsNamespace { Link Here
377
    return $xml;
387
    return $xml;
378
}
388
}
379
389
390
=head2 buildKohaHoldingsNamespace
391
392
Returns XML for holdings records.
393
Is only used in this module currently.
394
395
=cut
396
397
sub buildKohaHoldingsNamespace {
398
    my ($biblionumber) = @_;
399
400
    my $holdings = Koha::Holdings->search({ biblionumber => $biblionumber, deleted_on => undef })->as_list;
401
402
    my $shelflocations =
403
      { map { $_->{authorised_value} => $_->{opac_description} } Koha::AuthorisedValues->get_descriptions_by_koha_field( { frameworkcode => 'HLD', kohafield => 'holdings.location' } ) };
404
405
    my %branches = map { $_->branchcode => $_->branchname } Koha::Libraries->search({}, { order_by => 'branchname' });
406
407
    my $location = "";
408
    my $ccode = "";
409
    my $xml = '';
410
    foreach my $holding ( @{$holdings} ) {
411
        my $holdingbranch = $holding->{holdingbranch} ? xml_escape($branches{$holding->{holdingbranch}}) : '';
412
        my $location = $holding->{location} ? xml_escape($shelflocations->{$holding->{location}} || $holding->{location}) : '';
413
        my $callnumber = xml_escape($holding->{callnumber});
414
        my $suppress = $holding->{suppress} || '0';
415
        $xml .=
416
            "<holding>"
417
          . "<holdingbranch>$holdingbranch</holdingbranch>"
418
          . "<location>$location</location>"
419
          . "<callnumber>$callnumber</callnumber>"
420
          . "<suppress>$suppress</suppress>"
421
          . "</holding>";
422
    }
423
    $xml = "<holdings xmlns=\"http://www.koha-community.org/holdings\">$xml</holdings>";
424
    return $xml;
425
}
426
380
=head2 engine
427
=head2 engine
381
428
382
Returns reference to XSLT handler object.
429
Returns reference to XSLT handler object.
(-)a/Koha/Biblio.pm (-4 / +36 lines)
Lines 38-43 use Koha::ArticleRequests; Link Here
38
use Koha::Biblio::Metadatas;
38
use Koha::Biblio::Metadatas;
39
use Koha::Biblioitems;
39
use Koha::Biblioitems;
40
use Koha::CirculationRules;
40
use Koha::CirculationRules;
41
use Koha::Holdings;
41
use Koha::Item::Transfer::Limits;
42
use Koha::Item::Transfer::Limits;
42
use Koha::Items;
43
use Koha::Items;
43
use Koha::Libraries;
44
use Koha::Libraries;
Lines 509-514 sub subscriptions { Link Here
509
    return $self->{_subscriptions};
510
    return $self->{_subscriptions};
510
}
511
}
511
512
513
=head3 holdings
514
515
my $holdings = $self->holdings
516
517
Returns the related Koha::Holdings object for this Biblio object
518
519
=cut
520
521
sub holdings {
522
    my ($self) = @_;
523
524
    $self->{_holdings} ||= Koha::Holdings->search( { biblionumber => $self->biblionumber } );
525
526
    return $self->{_holdings};
527
}
528
529
512
=head3 has_items_waiting_or_intransit
530
=head3 has_items_waiting_or_intransit
513
531
514
my $itemsWaitingOrInTransit = $biblio->has_items_waiting_or_intransit
532
my $itemsWaitingOrInTransit = $biblio->has_items_waiting_or_intransit
Lines 815-839 sub to_api_mapping { Link Here
815
    };
833
    };
816
}
834
}
817
835
818
=head3 adopt_items_from_biblio
836
=head3 adopt_holdings_from_biblio
819
837
820
$biblio->adopt_items_from_biblio($from_biblio);
838
$biblio->adopt_holdings_from_biblio($from_biblio);
821
839
822
Move items from the given biblio to this one.
840
Move holdings and item records from the given biblio to this one.
823
841
824
=cut
842
=cut
825
843
826
sub adopt_items_from_biblio {
844
sub adopt_holdings_from_biblio {
827
    my ( $self, $from_biblio ) = @_;
845
    my ( $self, $from_biblio ) = @_;
828
846
847
    my $schema = Koha::Database->new()->schema();
848
849
    $schema->storage->txn_begin;
850
851
    # Move holdings records. This will also move any items attached to the holdings.
852
    my $holdings = $from_biblio->holdings;
853
    while (my $holding = $holdings->next()) {
854
        $holding->move_to_biblio($self);
855
    }
856
    # Move any items not already moved.
829
    my $items = $from_biblio->items;
857
    my $items = $from_biblio->items;
830
    if ($items) {
858
    if ($items) {
831
        while (my $item = $items->next()) {
859
        while (my $item = $items->next()) {
832
            $item->move_to_biblio($self);
860
            $item->move_to_biblio($self);
833
        }
861
        }
862
    }
863
    if ($items || $holdings) {
834
        C4::Biblio::ModZebra( $self->biblionumber, "specialUpdate", "biblioserver" );
864
        C4::Biblio::ModZebra( $self->biblionumber, "specialUpdate", "biblioserver" );
835
        C4::Biblio::ModZebra( $from_biblio->biblionumber, "specialUpdate", "biblioserver" );
865
        C4::Biblio::ModZebra( $from_biblio->biblionumber, "specialUpdate", "biblioserver" );
836
    }
866
    }
867
868
    $schema->storage->txn_commit;
837
}
869
}
838
870
839
871
(-)a/Koha/Holding.pm (+390 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
use Koha::Items;
32
33
use base qw(Koha::Object);
34
35
=head1 NAME
36
37
Koha::Holding - Koha Holding Object class
38
39
=head1 API
40
41
=head2 Class Methods
42
43
=cut
44
45
=head3 holding_branch
46
47
my $branch = $hold->holding_branch();
48
49
Returns the holding branch for this record.
50
51
=cut
52
53
sub holding_branch {
54
    my ($self) = @_;
55
56
    my $branch = $self->_result->holdingbranch();
57
    return Koha::Library->_new_from_dbic($branch);
58
}
59
60
=head3 metadata
61
62
my $metadata = $holding->metadata();
63
64
Returns a Koha::Holding::Metadata object
65
66
=cut
67
68
sub metadata {
69
    my ($self) = @_;
70
71
    my $metadata = $self->_result()->metadata();
72
    return unless $metadata;
73
    return Koha::Holdings::Metadata->_new_from_dbic($metadata);
74
}
75
76
=head3 set_marc
77
78
$holding->set_marc({ record => $record });
79
80
Updates the MARC format metadata from a Marc::Record.
81
Does not store the results in the database.
82
83
If passed an undefined record will log the error.
84
85
Returns $self
86
87
=cut
88
89
sub set_marc {
90
    my ($self, $params) = @_;
91
92
    if (!defined $params->{record}) {
93
        carp('set_marc called with undefined record');
94
        return $self;
95
    }
96
97
    # Clone record as it gets modified
98
    my $record = $params->{record}->clone();
99
    SetUTF8Flag($record);
100
    my $encoding = C4::Context->preference('marcflavour');
101
    if ($encoding eq 'MARC21' || $encoding eq 'UNIMARC') {
102
      # YY MM DD HH MM SS (update year and month)
103
      my @a = (localtime) [5,4,3,2,1,0]; $a[0] += 1900; $a[1]++;
104
      my $f005 = $record->field('005');
105
      $f005->update(sprintf('%4d%02d%02d%02d%02d%04.1f', @a)) if $f005;
106
    }
107
108
    $self->{_marcxml} = $record->as_xml_record($encoding);
109
    my $fields = $self->marc_to_koha_fields({ record => $record });
110
    delete $fields->{holding_id};
111
    # Filter the columns since we have e.g. public_note that's not stored in the database
112
    my $columns = [$self->_result()->result_source()->columns()];
113
    my $db_fields = {};
114
    foreach my $key (keys %{$fields}) {
115
        if (grep {/^$key$/} @{$columns}) {
116
            $db_fields->{$key} = $fields->{$key};
117
        }
118
    }
119
    $self->set($db_fields);
120
121
    return $self;
122
}
123
124
=head3 items
125
126
my @items = $holding->items();
127
my $items = $holding->items();
128
129
Returns the related Koha::Items object for this holding in scalar context,
130
or list of Koha::Item objects in list context.
131
132
=cut
133
134
sub items {
135
    my ($self) = @_;
136
137
    my $items_rs = $self->_result->items;
138
139
    return
140
        wantarray
141
        ? Koha::Items->_new_from_dbic($items_rs)->as_list
142
        : Koha::Items->_new_from_dbic($items_rs);
143
}
144
145
=head3 store
146
147
    $holding->store();
148
149
Saves the holdings record.
150
151
Returns:
152
    $self  if the store was a success
153
    undef  if the store failed
154
155
=cut
156
157
sub store {
158
    my ($self) = @_;
159
160
    my $action = $self->holding_id() ? 'UPDATE' : 'ADD';
161
162
    $self->datecreated(dt_from_string('', 'sql')) unless $self->datecreated();
163
164
    my $schema = Koha::Database->new()->schema();
165
    # Use a transaction only if AutoCommit is enabled - otherwise handled outside of this sub
166
    my $guard = C4::Context->dbh->{AutoCommit} ? $schema->txn_scope_guard() : undef;
167
168
    my $result = $self->SUPER::store();
169
170
    return $result unless $result;
171
172
    # Create or update the metadata record
173
    my $marcflavour = C4::Context->preference('marcflavour');
174
    my $marc_record = $self->{_marcxml}
175
        ? MARC::Record::new_from_xml($self->{_marcxml}, 'utf-8', $marcflavour)
176
        : $self->metadata()->record();
177
178
    $self->_update_marc_ids($marc_record);
179
180
    my $metadata = {
181
        holding_id => $self->holding_id(),
182
        format     => 'marcxml',
183
        schema     => $marcflavour,
184
    };
185
    my $metadata_record = Koha::Holdings::Metadatas->find_or_new($metadata);
186
    $metadata_record->metadata($marc_record->as_xml_record($marcflavour));
187
188
    $result = $metadata_record->store() ? $self : undef;
189
190
    if ($result) {
191
        $guard->commit() if defined $guard;
192
193
        # request that bib be reindexed so that any holdings-derived fields are updated
194
        C4::Biblio::ModZebra( $self->biblionumber(), 'specialUpdate', 'biblioserver' );
195
196
        logaction('CATALOGUING', $action, $self->holding_id(), 'holding') if C4::Context->preference('CataloguingLog');
197
    }
198
199
    return $result;
200
}
201
202
=head3 delete
203
204
    $holding->delete();
205
206
Marks the holdings record deleted.
207
208
Returns:
209
    1  if the deletion was a success
210
    0  if the deletion failed
211
    -1 if the object was never in storage
212
213
=cut
214
215
sub delete {
216
    my ($self) = @_;
217
218
    return -1 unless $self->_result()->in_storage();
219
220
    if ($self->items()->count()) {
221
        return 0;
222
    }
223
224
    my $schema = Koha::Database->new()->schema();
225
    # Use a transaction only if AutoCommit is enabled - otherwise handled outside of this sub
226
    my $guard = C4::Context->dbh->{AutoCommit} ? $schema->txn_scope_guard() : undef;
227
228
    my $now = dt_from_string('', 'sql');
229
    $self->deleted_on($now)->store();
230
    Koha::Holdings::Metadatas->find({ holding_id => $self->holding_id() })->update({ deleted_on => $now });
231
232
    $guard->commit() if defined $guard;
233
234
    logaction('CATALOGUING', 'DELETE', $self->holding_id(), 'holding') if C4::Context->preference('CataloguingLog');
235
236
    return 1;
237
}
238
239
=head3 move_to_biblio
240
241
  $holding->move_to_biblio($to_biblio);
242
243
Move the holdings record and any of its related records to another biblio.
244
245
=cut
246
247
sub move_to_biblio {
248
    my ( $self, $to_biblio ) = @_;
249
250
    my $biblionumber = $to_biblio->biblionumber;
251
252
    # Own biblionumber
253
    $self->set({
254
        biblionumber => $biblionumber,
255
    })->store();
256
257
    # Items
258
    my $items => $self->items;
259
    if ($items) {
260
        while (my $item = $items->next()) {
261
            $item->move_to_biblio($to_biblio);
262
        }
263
    }
264
}
265
266
=head3 type
267
268
=cut
269
270
sub _type {
271
    return 'Holding';
272
}
273
274
=head2 marc_to_koha_fields
275
276
    $result = Koha::Holding->marc_to_koha_fields({ record => $record })
277
278
Extract data from a MARC::Record holdings record into a hashref representing
279
Koha holdings fields.
280
281
If passed an undefined record will log the error and return an empty
282
hash_ref.
283
284
=cut
285
286
sub marc_to_koha_fields {
287
    my ($class, $params) = @_;
288
289
    my $result = {};
290
    if (!defined $params->{record}) {
291
        carp('marc_to_koha_fields called with undefined record');
292
        return $result;
293
    }
294
    my $record = $params->{record};
295
296
    # The next call uses the HLD framework since it is AUTHORITATIVE
297
    # for all Koha to MARC mappings for holdings.
298
    my $mss = C4::Biblio::GetMarcSubfieldStructure('HLD', { unsafe => 1 }); # Do not change framework
299
    foreach my $kohafield (keys %{ $mss }) {
300
        my ($table, $column) = split /[.]/, $kohafield, 2;
301
        next unless $table eq 'holdings' && $mss->{$kohafield};
302
303
        my @values;
304
        foreach my $field (@{$mss->{$kohafield}}) {
305
            my $tag = $field->{tagfield};
306
            my $sub = $field->{tagsubfield};
307
            foreach my $fld ($record->field($tag)) {
308
                if( $sub eq '@' || $fld->is_control_field ) {
309
                    push @values, $fld->data if $fld->data;
310
                } else {
311
                    push @values, grep { $_ } $fld->subfield($sub);
312
                }
313
            }
314
        }
315
        $result->{$column} = join(' | ', @values) if (@values);
316
    }
317
    return $result;
318
}
319
320
=head3 get_marc_field_mapping
321
322
    ($field, $subfield) = Koha::Holding->get_marc_field_mapping({ field => $kohafield });
323
    @fields = Koha::Holding->get_marc_field_mapping({ field => $kohafield });
324
    $field = Koha::Holding->get_marc_field_mapping({ field => $kohafield });
325
326
    Returns the MARC fields & subfields mapped to $kohafield.
327
    Uses the HLD framework that is considered as authoritative.
328
329
    In list context all mappings are returned; there can be multiple
330
    mappings. Note that in the above example you could miss a second
331
    mapping in the first call.
332
    In scalar context only the field tag of the first mapping is returned.
333
334
=cut
335
336
sub get_marc_field_mapping {
337
    my ($class, $params) = @_;
338
339
    return unless $params->{field};
340
341
    # The next call uses the HLD framework since it is AUTHORITATIVE
342
    # for all Koha to MARC mappings for holdings.
343
    my $mss = C4::Biblio::GetMarcSubfieldStructure('HLD', { unsafe => 1 }); # Do not change framework
344
    my @retval;
345
    foreach (@{ $mss->{$params->{field}} }) {
346
        push @retval, $_->{tagfield}, $_->{tagsubfield};
347
    }
348
    return wantarray ? @retval : ( @retval ? $retval[0] : undef );
349
}
350
351
=head2 Internal methods
352
353
=head3 _update_marc_ids
354
355
  $self->_update_marc_ids($record);
356
357
Internal function to add or update holding_id, biblionumber and biblioitemnumber to
358
the MARC record.
359
360
=cut
361
362
sub _update_marc_ids {
363
    my ($self, $record) = @_;
364
365
    my ($holding_tag, $holding_subfield) = $self->get_marc_field_mapping({ field => 'holdings.holding_id' });
366
    die qq{No holding_id tag for framework "HLD"} unless $holding_tag;
367
    if ($holding_tag < 10) {
368
        C4::Biblio::UpsertMarcControlField($record, $holding_tag, $self->holding_id);
369
    } else {
370
        C4::Biblio::UpsertMarcSubfield($record, $holding_tag, $holding_subfield, $self->holding_id);
371
    }
372
373
    my ($biblio_tag, $biblio_subfield) = $self->get_marc_field_mapping({ field => 'biblio.biblionumber' });
374
    die qq{No biblionumber tag for framework "HLD"} unless $biblio_tag;
375
    if ($biblio_tag < 10) {
376
        C4::Biblio::UpsertMarcControlField($record, $biblio_tag, $self->biblionumber);
377
    } else {
378
        C4::Biblio::UpsertMarcSubfield($record, $biblio_tag, $biblio_subfield, $self->biblionumber);
379
    }
380
}
381
382
383
=head1 AUTHOR
384
385
Kyle M Hall <kyle@bywatersolutions.com>
386
Ere Maijala <ere.maijala@helsinki.fi>
387
388
=cut
389
390
1;
(-)a/Koha/Holdings.pm (+145 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
    my ($holdingstag, $holdingssubfield) = Koha::Holding->get_marc_field_mapping({ field => 'holdings.holdingbranch' });
77
    my $holdings = $class->search({ biblionumber => $params->{biblionumber}, deleted_on => undef })->unblessed();
78
    foreach my $holding (@$holdings) {
79
        my $mungedholding = {
80
            map {
81
                defined($holding->{$_}) && $holding->{$_} ne '' ? ("holdings.$_" => $holding->{$_}) : ()
82
            } keys %{ $holding }
83
        };
84
        my $marc = $class->_holding_to_marc($mungedholding);
85
        push @holdings_fields, $marc->field($holdingstag);
86
    }
87
    return \@holdings_fields;
88
}
89
90
=head2 _holding_to_marc
91
92
    $record = $class->_holding_to_marc($hash)
93
94
This function builds partial MARC::Record from holdings hash entries.
95
This function is called when embedding holdings into a biblio record.
96
97
=cut
98
99
sub _holding_to_marc {
100
    my ($class, $hash, $params) = @_;
101
102
    my $record = MARC::Record->new();
103
    SetMarcUnicodeFlag($record, C4::Context->preference('marcflavour'));
104
105
    # The next call uses the HLD framework since it is AUTHORITATIVE
106
    # for all Koha to MARC mappings for holdings.
107
    my $mss = C4::Biblio::GetMarcSubfieldStructure('HLD', { unsafe => 1 }); # do not change framewok
108
    my $tag_hr = {};
109
    while (my ($kohafield, $value) = each %$hash) {
110
        foreach my $fld (@{$mss->{$kohafield}}) {
111
            my $tagfield    = $fld->{tagfield};
112
            my $tagsubfield = $fld->{tagsubfield};
113
            next if !$tagfield;
114
            my @values = $params->{no_split}
115
                ? ( $value )
116
                : split(/\s?\|\s?/, $value, -1);
117
            foreach my $value (@values) {
118
                next if $value eq '';
119
                $tag_hr->{$tagfield} //= [];
120
                push @{$tag_hr->{$tagfield}}, [($tagsubfield, $value)];
121
            }
122
        }
123
    }
124
    foreach my $tag (sort keys %$tag_hr) {
125
        my @sfl = @{$tag_hr->{$tag}};
126
        @sfl = sort { $a->[0] cmp $b->[0]; } @sfl;
127
        @sfl = map { @{$_}; } @sfl;
128
        # Special care for control fields: remove the subfield indication @
129
        # and do not insert indicators.
130
        my @ind = $tag < 10 ? () : ( " ", " " );
131
        @sfl = grep { $_ ne '@' } @sfl if $tag < 10;
132
        $record->insert_fields_ordered(MARC::Field->new($tag, @ind, @sfl));
133
    }
134
    return $record;
135
}
136
137
138
=head1 AUTHOR
139
140
Kyle M Hall <kyle@bywatersolutions.com>
141
Ere Maijala <ere.maijala@helsinki.fi>
142
143
=cut
144
145
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/Item.pm (-1 / +49 lines)
Lines 30-35 use C4::Circulation; Link Here
30
use C4::Reserves;
30
use C4::Reserves;
31
use Koha::Checkouts;
31
use Koha::Checkouts;
32
use Koha::CirculationRules;
32
use Koha::CirculationRules;
33
use Koha::Holdings;
33
use Koha::Item::Transfer::Limits;
34
use Koha::Item::Transfer::Limits;
34
use Koha::Item::Transfers;
35
use Koha::Item::Transfers;
35
use Koha::Patrons;
36
use Koha::Patrons;
Lines 113-118 sub biblioitem { Link Here
113
    return Koha::Biblioitem->_new_from_dbic( $biblioitem_rs );
114
    return Koha::Biblioitem->_new_from_dbic( $biblioitem_rs );
114
}
115
}
115
116
117
=head3 holding
118
119
my $holding = $item->holding;
120
121
Return the holdings record of this item
122
123
=cut
124
125
sub holding {
126
    my ( $self ) = @_;
127
    my $holding_rs = $self->_result->holding;
128
    return Koha::Holding->_new_from_dbic( $holding_rs );
129
}
130
116
=head3 checkout
131
=head3 checkout
117
132
118
my $checkout = $item->checkout;
133
my $checkout = $item->checkout;
Lines 564-570 sub move_to_biblio { Link Here
564
    $self->set({
579
    $self->set({
565
        biblionumber => $biblionumber,
580
        biblionumber => $biblionumber,
566
        biblioitemnumber => $to_biblio->biblioitem->biblioitemnumber
581
        biblioitemnumber => $to_biblio->biblioitem->biblioitemnumber
567
    })->store();
582
    });
568
583
569
    my $schema = Koha::Database->new()->schema();
584
    my $schema = Koha::Database->new()->schema();
570
585
Lines 601-606 sub move_to_biblio { Link Here
601
    # linktrackers
616
    # linktrackers
602
    my $linktrackers = $schema->resultset('Linktracker')->search({ itemnumber => $self->itemnumber });
617
    my $linktrackers = $schema->resultset('Linktracker')->search({ itemnumber => $self->itemnumber });
603
    $linktrackers->update_all({ biblionumber => $biblionumber });
618
    $linktrackers->update_all({ biblionumber => $biblionumber });
619
620
    # holdings
621
    my $holding = $self->holding;
622
    if ($holding) {
623
        # Check if there's a suitable holdings record in the new biblio.
624
        # This is not perfect, but at least we try.
625
        my $candidates = Koha::Holdings->search(
626
            {
627
                biblionumber     => $biblionumber,
628
                frameworkcode    => $holding->frameworkcode(),
629
                holdingbranch    => $holding->holdingbranch(),
630
                location         => $holding->location(),
631
                callnumber       => $holding->callnumber(),
632
                suppress         => $holding->suppress(),
633
                deleted_on       => undef
634
            }
635
        );
636
        my $newHolding = $candidates->next();
637
        if (!$newHolding) {
638
            # No existing holdings record, make a copy of the old one.
639
            $newHolding = Koha::Holding->new({
640
                biblionumber => $biblionumber,
641
                frameworkcode => $holding->frameworkcode()
642
            });
643
            $newHolding->set_marc({ record => $holding->metadata()->record() });
644
            $newHolding->store();
645
        }
646
        $self->set({
647
            holding_id => $newHolding->holding_id()
648
        });
649
    }
650
651
    $self->store();
604
}
652
}
605
653
606
=head2 Internal methods
654
=head2 Internal methods
(-)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 117-122 sub find_or_create { Link Here
117
    return $object;
117
    return $object;
118
}
118
}
119
119
120
=head3 Koha::Objects->find_or_new();
121
122
my $object = Koha::Objects->find_or_new( $attrs );
123
124
=cut
125
126
sub find_or_new {
127
    my ( $self, $params ) = @_;
128
129
    my $result = $self->_resultset->find_or_new($params);
130
131
    return unless $result;
132
133
    my $object = $self->object_class->_new_from_dbic($result);
134
135
    return $object;
136
}
137
120
=head3 Koha::Objects->search();
138
=head3 Koha::Objects->search();
121
139
122
my @objects = Koha::Objects->search($params);
140
my @objects = Koha::Objects->search($params);
(-)a/Koha/Template/Plugin/Holdings.pm (+116 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 'Koha::Holding') {
60
        $holding = Koha::Holdings->find($holding);
61
        if (!$holding) {
62
            return '';
63
        }
64
    }
65
66
    my @parts;
67
68
    if ($opac) {
69
        if (my $branch = $holding->holding_branch()) {
70
            push @parts, $branch->branchname();
71
        }
72
        if ($holding->location()) {
73
            my $av = Koha::AuthorisedValues->search({ category => 'LOC', authorised_value => $holding->location() });
74
            push @parts, $av->next()->opac_description() if $av->count;
75
        }
76
        push @parts, $holding->callnumber() if $holding->callnumber();
77
        return join(' - ', @parts);
78
    }
79
80
    push @parts, $holding->holding_id();
81
    push @parts, $holding->holdingbranch() if $holding->holdingbranch();
82
    push @parts, $holding->location() if $holding->location();
83
    push @parts, $holding->ccode() if $holding->ccode();
84
    push @parts, $holding->callnumber() if $holding->callnumber();
85
    return join(' ', @parts);
86
}
87
88
=head2 GetDetails
89
90
Get the Koha fields for a holdings record
91
92
    [% details = Holdings.GetDetails(holding) %]
93
94
=cut
95
96
sub GetDetails {
97
    my ($self, $holding) = @_;
98
    my $opac = shift || 0;
99
100
    if (!$holding) {
101
        return '';
102
    }
103
104
    if (ref($holding) ne 'Koha::Holding') {
105
        $holding = Koha::Holdings->find($holding);
106
        if (!$holding) {
107
            return '';
108
        }
109
    }
110
111
    my $holding_marc = $holding->metadata()->record();
112
113
    return Koha::Holding->marc_to_koha_fields({ record => $holding_marc });
114
}
115
116
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 43-48 use C4::CourseReserves qw(GetItemCourseReservesInfo); Link Here
43
use C4::Acquisition qw(GetOrdersByBiblionumber);
43
use C4::Acquisition qw(GetOrdersByBiblionumber);
44
use Koha::AuthorisedValues;
44
use Koha::AuthorisedValues;
45
use Koha::Biblios;
45
use Koha::Biblios;
46
use Koha::Holdings;
46
use Koha::Items;
47
use Koha::Items;
47
use Koha::ItemTypes;
48
use Koha::ItemTypes;
48
use Koha::Patrons;
49
use Koha::Patrons;
Lines 231-236 foreach my $subscription (@subscriptions) { Link Here
231
    push @subs, \%cell;
232
    push @subs, \%cell;
232
}
233
}
233
234
235
# Summary holdings
236
my $summary_holdings;
237
if (C4::Context->preference('SummaryHoldings')) {
238
    $summary_holdings = Koha::Holdings->search({ biblionumber => $biblionumber, deleted_on => undef });
239
}
234
240
235
# Get acquisition details
241
# Get acquisition details
236
if ( C4::Context->preference('AcquisitionDetails') ) {
242
if ( C4::Context->preference('AcquisitionDetails') ) {
Lines 418-430 $template->param( Link Here
418
    itemdata_stocknumber => $itemfields{stocknumber},
424
    itemdata_stocknumber => $itemfields{stocknumber},
419
    itemdata_publisheddate => $itemfields{publisheddate},
425
    itemdata_publisheddate => $itemfields{publisheddate},
420
    volinfo                => $itemfields{enumchron},
426
    volinfo                => $itemfields{enumchron},
421
        itemdata_itemnotes  => $itemfields{itemnotes},
427
    itemdata_itemnotes  => $itemfields{itemnotes},
422
        itemdata_nonpublicnotes => $itemfields{itemnotes_nonpublic},
428
    itemdata_nonpublicnotes => $itemfields{itemnotes_nonpublic},
423
    z3950_search_params    => C4::Search::z3950_search_args($dat),
429
    z3950_search_params    => C4::Search::z3950_search_args($dat),
424
        hostrecords         => $hostrecords,
430
    hostrecords         => $hostrecords,
425
    analytics_flag    => $analytics_flag,
431
    analytics_flag      => $analytics_flag,
426
    C4::Search::enabled_staff_search_views,
432
    C4::Search::enabled_staff_search_views,
427
        materials       => $materials_flag,
433
    materials       => $materials_flag,
434
    show_summary_holdings => C4::Context->preference('SummaryHoldings') ? 1 : 0,
435
    summary_holdings    => $summary_holdings,
428
);
436
);
429
437
430
if (C4::Context->preference("AlternateHoldingsField") && scalar @items == 0) {
438
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 holdings 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 221-226 sub generate_subfield_form { Link Here
221
        
222
        
222
                  #---- "true" authorised value
223
                  #---- "true" authorised value
223
            }
224
            }
225
            elsif ( $subfieldlib->{authorised_value} eq "holdings" ) {
226
                push @authorised_values, "" unless ( $subfieldlib->{mandatory} );
227
                my $holdings = Koha::Holdings->search({ biblionumber => $biblionumber, deleted_on => undef }, { order_by => ['holdingbranch'] })->unblessed;
228
                for my $holding ( @$holdings ) {
229
                    push @authorised_values, $holding->{holding_id};
230
                    $authorised_lib{$holding->{holding_id}} = $holding->{holding_id} . ' ' . $holding->{holdingbranch} . ' ' . $holding->{location} . ' ' . $holding->{ccode} . ' ' . $holding->{callnumber};
231
                }
232
                my $input = new CGI;
233
                $value = $input->param('holding_id') unless ($value);
234
            }
224
            else {
235
            else {
225
                  push @authorised_values, qq{};
236
                  push @authorised_values, qq{};
226
                  my $av = GetAuthorisedValues( $subfieldlib->{authorised_value} );
237
                  my $av = GetAuthorisedValues( $subfieldlib->{authorised_value} );
(-)a/cataloguing/merge.pl (-2 / +2 lines)
Lines 90-96 if ($merge) { Link Here
90
    my $biblio = Koha::Biblios->find($ref_biblionumber);
90
    my $biblio = Koha::Biblios->find($ref_biblionumber);
91
    foreach my $biblionumber (@biblionumbers) {
91
    foreach my $biblionumber (@biblionumbers) {
92
        my $from_biblio = Koha::Biblios->find($biblionumber);
92
        my $from_biblio = Koha::Biblios->find($biblionumber);
93
        $biblio->adopt_items_from_biblio($from_biblio);
93
        $biblio->adopt_holdings_from_biblio($from_biblio);
94
    }
94
    }
95
95
96
    my $sth_subscription = $dbh->prepare("
96
    my $sth_subscription = $dbh->prepare("
Lines 160-166 if ($merge) { Link Here
160
    # Moving article requests
160
    # Moving article requests
161
    $sth_articlerequests->execute($ref_biblionumber, $biblionumber);
161
    $sth_articlerequests->execute($ref_biblionumber, $biblionumber);
162
162
163
    # Moving orders (orders linked to items of frombiblio have already been moved by adopt_items_from_biblio)
163
    # Moving orders (orders linked to items of frombiblio have already been moved by adopt_holdings_from_biblio)
164
    my @allorders = GetOrdersByBiblionumber($biblionumber);
164
    my @allorders = GetOrdersByBiblionumber($biblionumber);
165
    foreach my $myorder (@allorders) {
165
    foreach my $myorder (@allorders) {
166
        $myorder->{'biblionumber'} = $ref_biblionumber;
166
        $myorder->{'biblionumber'} = $ref_biblionumber;
(-)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', 'Holdings record',  'Holdings 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 4679-4681 SELECT tagfield, tagsubfield, liblibrarian, libopac, repeatable, mandatory, koha Link Here
4679
FROM marc_subfield_structure
4681
FROM marc_subfield_structure
4680
WHERE frameworkcode=""
4682
WHERE frameworkcode=""
4681
AND kohafield IN ("biblio.title", "biblio.author", "biblioitems.publishercode", "biblioitems.editionstatement", "biblio.copyrightdate", "biblioitems.isbn", "biblio.seriestitle" );
4683
AND kohafield IN ("biblio.title", "biblio.author", "biblioitems.publishercode", "biblioitems.editionstatement", "biblio.copyrightdate", "biblioitems.isbn", "biblio.seriestitle" );
4684
4685
4686
-- HOLDINGS RECORD FRAMEWORK
4687
4688
INSERT IGNORE INTO `biblio_framework` VALUES ('HLD', 'Default holdings framework');
4689
INSERT IGNORE INTO `marc_tag_structure` (`tagfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `authorised_value`, `frameworkcode`) VALUES
4690
        ('999', 'SYSTEM CONTROL NUMBERS (KOHA)', 'SYSTEM CONTROL NUMBERS (KOHA)', 1, 0, '', 'HLD');
4691
4692
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
4693
        ('999', 'c', 'Koha biblionumber', 'Koha biblionumber', 0, 0, 'biblio.biblionumber', -1, NULL, NULL, '', NULL, -5, 'HLD', '', '', NULL),
4694
        ('999', 'e', 'Koha holding_id', 'Koha holding_id', 0, 0, 'holdings.holding_id', -1, NULL, NULL, '', NULL, -5, 'HLD', '', '', NULL);
4695
4696
4697
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
4698
        ('942', 'n', 'Suppress in OPAC', 'Suppress in OPAC', 0, 0, 'holdings.suppress', 9, '', '', '', 0, 0, 'HLD', '', '', NULL);
4699
4700
INSERT IGNORE INTO `marc_tag_structure` (`tagfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `authorised_value`, `frameworkcode`) VALUES
4701
        ('000', 'LEADER', 'LEADER', 0, 1, '', 'HLD'),
4702
        ('001', 'CONTROL NUMBER', 'CONTROL NUMBER', 0, 0, '', 'HLD'),
4703
        ('003', 'CONTROL NUMBER IDENTIFIER', 'CONTROL NUMBER IDENTIFIER', 0, 1, '', 'HLD'),
4704
        ('005', 'DATE AND TIME OF LATEST TRANSACTION', 'DATE AND TIME OF LATEST TRANSACTION', 0, 1, '', 'HLD'),
4705
        ('006', 'FIXED-LENGTH DATA ELEMENTS--ADDITIONAL MATERIAL CHARACTERISTICS', 'FIXED-LENGTH DATA ELEMENTS--ADDITIONAL MATERIAL CHARACTERISTICS', 1, 0, '', 'HLD'),
4706
        ('007', 'PHYSICAL DESCRIPTION FIXED FIELD--GENERAL INFORMATION', 'PHYSICAL DESCRIPTION FIXED FIELD--GENERAL INFORMATION', 1, 0, '', 'HLD'),
4707
        ('008', 'FIXED-LENGTH DATA ELEMENTS--GENERAL INFORMATION', 'FIXED-LENGTH DATA ELEMENTS--GENERAL INFORMATION', 0, 1, '', 'HLD');
4708
4709
INSERT IGNORE INTO `marc_tag_structure` (`tagfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `authorised_value`, `frameworkcode`) VALUES
4710
        ('010', 'LIBRARY OF CONGRESS CONTROL NUMBER', 'LIBRARY OF CONGRESS CONTROL NUMBER', 0, 0, '', 'HLD'),
4711
        ('014', 'LINKAGE NUMBER', 'LINKAGE NUMBER', 1, 0, '', 'HLD'),
4712
        ('016', 'NATIONAL BIBLIOGRAPHIC AGENCY CONTROL NUMBER', 'NATIONAL BIBLIOGRAPHIC AGENCY CONTROL NUMBER', 1, 0, '', 'HLD'),
4713
        ('017', 'COPYRIGHT OR LEGAL DEPOSIT NUMBER', 'COPYRIGHT OR LEGAL DEPOSIT NUMBER', 1, 0, '', 'HLD'),
4714
        ('020', 'INTERNATIONAL STANDARD BOOK NUMBER', 'INTERNATIONAL STANDARD BOOK NUMBER', 1, 0, NULL, 'HLD'),
4715
        ('022', 'INTERNATIONAL STANDARD SERIAL NUMBER', 'INTERNATIONAL STANDARD SERIAL NUMBER', 1, 0, NULL, 'HLD'),
4716
        ('024', 'OTHER STANDARD IDENTIFIER', 'OTHER STANDARD IDENTIFIER', 1, 0, NULL, 'HLD'),
4717
        ('027', 'STANDARD TECHNICAL REPORT NUMBER', 'STANDARD TECHNICAL REPORT NUMBER', 1, 0, '', 'HLD'),
4718
        ('030', 'CODEN DESIGNATION', 'CODEN DESIGNATION', 1, 0, '', 'HLD'),
4719
        ('035', 'SYSTEM CONTROL NUMBER', 'SYSTEM CONTROL NUMBER', 1, 0, NULL, 'HLD'),
4720
        ('040', 'CATALOGING SOURCE', 'CATALOGING SOURCE', 0, 1, NULL, 'HLD'),
4721
        ('066', 'CHARACTER SETS PRESENT', 'CHARACTER SETS PRESENT', 0, 0, NULL, 'HLD'),
4722
        ('337', 'MEDIA TYPE', 'MEDIA TYPE', 1, 0, NULL, 'HLD'),
4723
        ('338', 'CARRIER TYPE', 'CARRIER TYPE', 1, 0, NULL, 'HLD'),
4724
        ('347', 'DIGITAL FILE CHARACTERISTICS', 'DIGITAL FILE CHARACTERISTICS', 1, 0, NULL, 'HLD'),
4725
        ('506', 'RESTRICTIONS ON ACCESS NOTE', 'RESTRICTIONS ON ACCESS NOTE', 1, 0, NULL, 'HLD'),
4726
        ('538', 'SYSTEM DETAILS NOTE', 'SYSTEM DETAILS NOTE', 1, 0, NULL, 'HLD'),
4727
        ('541', 'IMMEDIATE SOURCE OF ACQUISITION NOTE', 'IMMEDIATE SOURCE OF ACQUISITION NOTE', 1, 0, NULL, 'HLD'),
4728
        ('561', 'OWNERSHIP AND CUSTODIAL HISTORY', 'OWNERSHIP AND CUSTODIAL HISTORY', 1, 0, NULL, 'HLD'),
4729
        ('562', 'COPY AND VERSION IDENTIFICATION NOTE', 'COPY AND VERSION IDENTIFICATION NOTE', 1, 0, NULL, 'HLD'),
4730
        ('563', 'BINDING INFORMATION', 'BINDING INFORMATION', 1, 0, NULL, 'HLD'),
4731
        ('583', 'ACTION NOTE', 'ACTION NOTE', 1, 0, NULL, 'HLD'),
4732
        ('842', 'TEXTUAL PHYSICAL FORM DESIGNATOR', 'TEXTUAL PHYSICAL FORM DESIGNATOR', 0, 0, NULL, 'HLD'),
4733
        ('843', 'REPRODUCTION NOTE', 'REPRODUCTION NOTE', 1, 0, NULL, 'HLD'),
4734
        ('844', 'NAME OF UNIT', 'NAME OF UNIT', 0, 0, NULL, 'HLD'),
4735
        ('845', 'TERMS GOVERNING USE AND REPRODUCTION NOTE', 'TERMS GOVERNING USE AND REPRODUCTION NOTE', 1, 0, NULL, 'HLD'),
4736
        ('850', 'HOLDING INSTITUTION', 'HOLDING INSTITUTION', 1, 0, NULL, 'HLD'),
4737
        ('852', 'LOCATION', 'LOCATION', 1, 0, NULL, 'HLD'),
4738
        ('853', 'CAPTIONS AND PATTERN--BASIC BIBLIOGRAPHIC UNIT', 'CAPTIONS AND PATTERN--BASIC BIBLIOGRAPHIC UNIT', 1, 0, NULL, 'HLD'),
4739
        ('854', 'CAPTIONS AND PATTERN--SUPPLEMENTARY MATERIAL', 'CAPTIONS AND PATTERN--SUPPLEMENTARY MATERIAL', 1, 0, NULL, 'HLD'),
4740
        ('855', 'CAPTIONS AND PATTERN--INDEXES', 'CAPTIONS AND PATTERN--INDEXES', 1, 0, NULL, 'HLD'),
4741
        ('856', 'ELECTRONIC LOCATION AND ACCESS', 'ELECTRONIC LOCATION AND ACCESS', 1, 0, NULL, 'HLD'),
4742
        ('863', 'ENUMERATION AND CHRONOLOGY--BASIC BIBLIOGRAPHIC UNIT', 'ENUMERATION AND CHRONOLOGY--BASIC BIBLIOGRAPHIC UNIT', 1, 0, NULL, 'HLD'),
4743
        ('864', 'ENUMERATION AND CHRONOLOGY--SUPPLEMENTARY MATERIAL', 'ENUMERATION AND CHRONOLOGY--SUPPLEMENTARY MATERIAL', 1, 0, NULL, 'HLD'),
4744
        ('865', 'ENUMERATION AND CHRONOLOGY--INDEXES', 'ENUMERATION AND CHRONOLOGY--INDEXES', 1, 0, NULL, 'HLD'),
4745
        ('866', 'TEXTUAL HOLDINGS--BASIC BIBLIOGRAPHIC UNIT', 'TEXTUAL HOLDINGS--BASIC BIBLIOGRAPHIC UNIT', 1, 0, NULL, 'HLD'),
4746
        ('867', 'TEXTUAL HOLDINGS--SUPPLEMENTARY MATERIAL', 'TEXTUAL HOLDINGS--SUPPLEMENTARY MATERIAL', 1, 0, NULL, 'HLD'),
4747
        ('868', 'TEXTUAL HOLDINGS--INDEXES', 'TEXTUAL HOLDINGS--INDEXES', 1, 0, NULL, 'HLD'),
4748
        ('876', 'ITEM INFORMATION--BASIC BIBLIOGRAPHIC UNIT', 'ITEM INFORMATION--BASIC BIBLIOGRAPHIC UNIT', 1, 0, NULL, 'HLD'),
4749
        ('877', 'ITEM INFORMATION--SUPPLEMENTARY MATERIAL', 'ITEM INFORMATION--SUPPLEMENTARY MATERIAL', 1, 0, NULL, 'HLD'),
4750
        ('878', 'ITEM INFORMATION--INDEXES', 'ITEM INFORMATION--INDEXES', 1, 0, NULL, 'HLD');
4751
4752
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
4753
        ('000', '@', 'fixed length control field', 'fixed length control field', 0, 1, '', 0, '', '', 'marc21_leader_holdings.pl', 0, 0, 'HLD', '', '', NULL),
4754
        ('001', '@', 'control field', 'control field', 0, 0, '', 0, '', '', '', 0, 0, 'HLD', '', '', NULL),
4755
        ('003', '@', 'control field', 'control field', 0, 1, '', 0, '', '', 'marc21_orgcode.pl', 0, 0, 'HLD', '', '', NULL),
4756
        ('005', '@', 'control field', 'control field', 0, 1, '', 0, '', '', 'marc21_field_005.pl', 0, 0, 'HLD', '', '', NULL),
4757
        ('006', '@', 'fixed length control field', 'fixed length control field', 0, 0, '', 0, '', '', 'marc21_field_006.pl', 0, -1, 'HLD', '', '', NULL),
4758
        ('007', '@', 'fixed length control field', 'fixed length control field', 0, 0, '', 0, '', '', 'marc21_field_007.pl', 0, 0, 'HLD', '', '', NULL),
4759
        ('008', '@', 'fixed length control field', 'fixed length control field', 0, 1, '', 0, '', '', 'marc21_field_008_holdings.pl', 0, 0, 'HLD', '', '', NULL),
4760
        ('010', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 0, '', '', NULL, 0, -6, 'HLD', '', '', NULL),
4761
        ('010', 'a', 'LC control number', 'LC control number', 0, 0, 'biblioitems.lccn', 0, '', '', '', 0, 0, 'HLD', '', '', NULL),
4762
        ('010', 'b', 'NUCMC control number', 'NUCMC control number', 1, 0, '', 0, '', '', '', 0, -1, '', '', '', NULL),
4763
        ('010', 'z', 'Canceled/invalid LC control number', 'Canceled/invalid LC control number', 1, 0, '', 0, '', '', '', 0, -1, 'HLD', '', '', NULL),
4764
        ('014', '6', 'Linkage', 'Linkage', 0, 0, '', 0, '', '', '', 0, -6, '', '', '', NULL),
4765
        ('014', 'a', 'Linkage number', 'Linkage number', 0, 0, '', 0, '', '', '', 0, 0, 'HLD', '', '', NULL),
4766
        ('014', 'b', 'Source of number', 'Source of number', 0, 0, '', 0, '', '', '', 0, -1, 'HLD', '', '', NULL),
4767
        ('014', 'z', 'Canceled/invalid linkage number', 'Canceled/invalid linkage number', 1, 0, '', 0, '', '', '', 0, -1, 'HLD', '', '', NULL),
4768
        ('016', '2', 'Source', 'Source', 0, 0, '', 0, '', '', '', 0, 0, '', '', '', NULL),
4769
        ('016', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 0, '', '', '', 0, -6, 'HLD', '', '', NULL),
4770
        ('016', 'a', 'Record control number', 'Record control number', 0, 0, '', 0, '', '', '', 0, 0, 'HLD', '', '', NULL),
4771
        ('016', 'z', 'Canceled/invalid control number', 'Canceled/invalid control number', 1, 0, '', 0, '', '', '', 0, -1, 'HLD', '', '', NULL),
4772
        ('017', '2', 'Source', 'Source', 0, 0, '', 0, '', '', '', 0, -6, '', '', '', NULL),
4773
        ('017', '6', 'Linkage', 'Linkage', 0, 0, '', 0, '', '', '', 0, -6, '', '', '', NULL),
4774
        ('017', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 0, '', '', '', 0, -6, 'HLD', '', '', NULL),
4775
        ('017', 'a', 'Copyright or legal deposit number', 'Copyright or legal deposit number', 1, 0, '', 0, '', '', '', 0, -6, 'HLD', '', '', NULL),
4776
        ('017', 'b', 'Assigning agency', 'Assigning agency', 0, 0, '', 0, '', '', '', 0, -6, 'HLD', '', '', NULL),
4777
        ('017', 'd', 'Date', 'Date', 0, 0, '', 0, '', '', NULL, 0, -6, 'HLD', '', '', NULL),
4778
        ('017', 'i', 'Display text', 'Display text', 0, 0, '', 0, '', '', '', 0, -6, 'HLD', '', '', NULL),
4779
        ('017', 'z', 'Canceled/invalid copyright or legal deposit number', 'Canceled/invalid copyright or legal deposit number', 1, 0, '', 0, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4780
        ('020', '6', 'Linkage', 'Linkage', 0, 0, '', 0, '', '', '', 0, -6, 'HLD', '', '', NULL),
4781
        ('020', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 0, '', '', '', 0, -6, 'HLD', '', '', NULL),
4782
        ('020', 'a', 'International Standard Book Number', 'International Standard Book Number', 0, 0, 'biblioitems.isbn', 0, '', '', '', 0, 0, 'HLD', '', '', NULL),
4783
        ('020', 'c', 'Terms of availability', 'Terms of availability', 0, 0, '', 0, '', '', '', 0, 0, 'HLD', '', '', NULL),
4784
        ('020', 'q', 'Qualifying information', 'Qualifying information', 1, 0, '', 0, '', '', '', 0, 0, 'HLD', '', '', NULL),
4785
        ('020', 'z', 'Canceled/invalid ISBN', 'Canceled/invalid ISBN', 1, 0, '', 0, '', '', '', 0, -1, 'HLD', '', '', NULL),
4786
        ('022', '2', 'Source', 'Source', 0, 0, '', 0, '', '', '', 0, 0, 'HLD', '', '', NULL),
4787
        ('022', '6', 'Linkage', 'Linkage', 0, 0, '', 0, '', '', '', 0, -6, 'HLD', '', '', NULL),
4788
        ('022', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 0, '', '', '', 0, -6, 'HLD', '', '', NULL),
4789
        ('022', 'a', 'International Standard Serial Number', 'International Standard Serial Number', 0, 0, 'biblioitems.issn', 0, '', '', '', 0, 0, 'HLD', '', '', NULL),
4790
        ('022', 'l', 'ISSN-L', 'ISSN-L', 0, 0, '', 0, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4791
        ('022', 'm', 'Canceled ISSN-L', 'Canceled ISSN-L', 1, 0, '', 0, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4792
        ('022', 'y', 'Incorrect ISSN', 'Incorrect ISSN', 1, 0, '', 0, '', '', '', 0, -1, 'HLD', '', '', NULL),
4793
        ('022', 'z', 'Canceled ISSN', 'Canceled ISSN', 1, 0, '', 0, '', '', '', 0, -1, 'HLD', '', '', NULL),
4794
        ('024', '2', 'Source of number or code', 'Source of number or code', 0, 0, '', 0, '', '', '', 0, 0, 'HLD', '', '', NULL),
4795
        ('024', '6', 'Linkage', 'Linkage', 0, 0, '', 0, '', '', '', 0, -6, 'HLD', '', '', NULL),
4796
        ('024', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 0, '', '', '', 0, -6, 'HLD', '', '', NULL),
4797
        ('024', 'a', 'Standard number or code', 'Standard number or code', 0, 0, '', 0, '', '', '', 0, 0, 'HLD', '', '', NULL),
4798
        ('024', 'b', 'Additional codes following the standard number [OBSOLETE]', 'Additional codes following the standard number [OBSOLETE]', 0, 0, '', 0, '', '', '', 0, -6, 'HLD', '', '', NULL),
4799
        ('024', 'c', 'Terms of availability', 'Terms of availability', 0, 0, '', 0, '', '', '', 0, 0, 'HLD', '', '', NULL),
4800
        ('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),
4801
        ('024', 'q', 'Qualifying information', 'Qualifying information', 1, 0, '', 0, '', '', '', 0, 0, 'HLD', '', '', NULL),
4802
        ('024', 'z', 'Canceled/invalid standard number or code', 'Canceled/invalid standard number or code', 1, 0, '', 0, '', '', '', 0, -1, 'HLD', '', '', NULL),
4803
        ('027', '6', 'Linkage', 'Linkage', 0, 0, '', 0, '', '', '', 0, -6, 'HLD', '', '', NULL),
4804
        ('027', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 0, '', '', '', 0, -6, 'HLD', '', '', NULL),
4805
        ('027', 'a', 'Standard technical report number', 'Standard technical report number', 0, 0, '', 0, '', '', '', 0, -1, 'HLD', '', '', NULL),
4806
        ('027', 'q', 'Qualifying information', 'Qualifying information', 1, 0, '', 0, '', '', '', 0, 0, 'HLD', '', '', NULL),
4807
        ('027', 'z', 'Canceled/invalid number', 'Canceled/invalid number', 1, 0, '', 0, '', '', '', 0, -1, 'HLD', '', '', NULL),
4808
        ('030', '6', 'Linkage', 'Linkage', 0, 0, '', 0, '', '', '', 0, -6, 'HLD', '', '', NULL),
4809
        ('030', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 0, '', '', '', 0, -6, 'HLD', '', '', NULL),
4810
        ('030', 'a', 'CODEN', 'CODEN', 0, 0, '', 0, '', '', '', 0, -6, 'HLD', '', '', NULL),
4811
        ('030', 'z', 'Canceled/invalid CODEN', 'Canceled/invalid CODEN', 1, 0, '', 0, '', '', '', 0, -6, 'HLD', '', '', NULL),
4812
        ('035', '6', 'Linkage', 'Linkage', 0, 0, '', 0, '', '', '', 0, -6, 'HLD', '', '', NULL),
4813
        ('035', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 0, '', '', '', 0, -6, 'HLD', '', '', NULL),
4814
        ('035', 'a', 'System control number', 'System control number', 0, 0, '', 0, '', '', '', 0, 0, 'HLD', '', '', NULL),
4815
        ('035', 'z', 'Canceled/invalid control number', 'Canceled/invalid control number', 1, 0, '', 0, '', '', '', 0, -1, 'HLD', '', '', NULL),
4816
        ('040', '6', 'Linkage', 'Linkage', 0, 0, '', 0, '', '', '', 0, -6, 'HLD', '', '', NULL),
4817
        ('040', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 0, '', '', '', 0, -6, 'HLD', '', '', NULL),
4818
        ('040', 'a', 'Original cataloging agency', 'Original cataloging agency', 0, 0, '', 0, '', '', '', 0, 0, 'HLD', '', '', NULL),
4819
        ('040', 'b', 'Language of cataloging', 'Language of cataloging', 0, 0, '', 0, '', '', '', 0, 0, 'HLD', '', '', NULL),
4820
        ('040', 'c', 'Transcribing agency', 'Transcribing agency', 0, 1, '', 0, '', '', '', 0, 0, 'HLD', '', '', NULL),
4821
        ('040', 'd', 'Modifying agency', 'Modifying agency', 1, 0, '', 0, '', '', '', 0, 0, 'HLD', '', '', NULL),
4822
        ('066', 'a', 'Primary G0 character set', 'Primary G0 character set', 0, 0, NULL, 0, NULL, NULL, '', NULL, -6, 'HLD', '', '', NULL),
4823
        ('066', 'b', 'Primary G1 character set', 'Primary G1 character set', 0, 0, NULL, 0, NULL, NULL, '', NULL, -6, 'HLD', '', '', NULL),
4824
        ('066', 'c', 'Alternate G0 or G1 character set', 'Alternate G0 or G1 character set', 1, 0, NULL, 0, NULL, NULL, '', NULL, -6, 'HLD', '', '', NULL),
4825
        ('337', '0', 'Authority record control number or standard number', 'Authority record control number or standard number', 1, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4826
        ('337', '1', 'Real World Object URI', 'Real World Object URI', 1, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4827
        ('337', '2', 'Source', 'Source', 0, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4828
        ('337', '3', 'Materials specified', 'Materials specified', 0, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4829
        ('337', '6', 'Linkage', 'Linkage', 0, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4830
        ('337', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4831
        ('337', 'a', 'Media type term', 'Media type term', 1, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4832
        ('337', 'b', 'Media type code', 'Media type code', 1, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4833
        ('338', '0', 'Authority record control number or standard number', 'Authority record control number or standard number', 1, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4834
        ('338', '1', 'Real World Object URI', 'Real World Object URI', 1, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4835
        ('338', '2', 'Source', 'Source', 0, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4836
        ('338', '3', 'Materials specified', 'Materials specified', 0, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4837
        ('338', '6', 'Linkage', 'Linkage', 0, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4838
        ('338', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4839
        ('338', 'a', 'Carrier type term', 'Carrier type term', 1, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4840
        ('338', 'b', 'Carrier type code', 'Carrier type code', 1, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4841
        ('347', 'a', 'File type', 'File type', 1, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4842
        ('347', '0', 'Authority record control number or standard number', 'Authority record control number or standard number', 1, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4843
        ('347', '1', 'Real World Object URI', 'Real World Object URI', 1, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4844
        ('347', '2', 'Source', 'Source', 0, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4845
        ('347', '3', 'Materials specified', 'Materials specified', 0, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4846
        ('347', '6', 'Linkage', 'Linkage', 0, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4847
        ('347', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4848
        ('347', 'b', 'Encoding format', 'Encoding format', 1, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4849
        ('347', 'c', 'File size', 'File size', 1, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4850
        ('347', 'd', 'Resolution', 'Resolution', 1, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4851
        ('347', 'e', 'Regional encoding', 'Regional encoding', 1, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4852
        ('347', 'f', 'Encoded bitrate', 'Encoded bitrate', 1, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4853
        ('506', '2', 'Source of term', 'Source of term', 0, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4854
        ('506', '3', 'Materials specified', 'Materials specified', 0, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4855
        ('506', '5', 'Institution to which field applies', 'Institution to which field applies', 0, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4856
        ('506', '6', 'Linkage', 'Linkage', 0, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4857
        ('506', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4858
        ('506', 'a', 'Terms governing access', 'Terms governing access', 0, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4859
        ('506', 'b', 'Jurisdiction', 'Jurisdiction', 1, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4860
        ('506', 'c', 'Physical access provisions', 'Physical access provisions', 1, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4861
        ('506', 'd', 'Authorized users', 'Authorized users', 1, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4862
        ('506', 'e', 'Authorization', 'Authorization', 1, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4863
        ('506', 'f', 'Standardized terminology for access restriction', 'Standardized terminology for access restriction', 1, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4864
        ('506', 'u', 'Uniform Resource Identifier', 'Uniform Resource Identifier', 1, 0, '', 5, '', '', '', 1, -6, 'HLD', '', '', NULL),
4865
        ('538', '3', 'Materials specified', 'Materials specified', 0, 0, NULL, 5, NULL, NULL, '', NULL, -6, 'HLD', '', '', NULL),
4866
        ('538', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4867
        ('538', '6', 'Linkage', 'Linkage', 0, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4868
        ('538', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4869
        ('538', 'a', 'System details note', 'System details note', 0, 0, '', 5, '', '', '', NULL, -1, 'HLD', '', '', NULL),
4870
        ('538', 'i', 'Display text', 'Display text', 0, 0, '', 5, '', '', '', NULL, -1, 'HLD', '', '', NULL),
4871
        ('538', 'u', 'Uniform Resource Identifier', 'Uniform Resource Identifier', 1, 0, '', 5, '', '', '', 1, -1, 'HLD', '', '', NULL),
4872
        ('541', '3', 'Materials specified', 'Materials specified', 0, 0, NULL, 5, NULL, NULL, '', NULL, -6, 'HLD', '', '', NULL),
4873
        ('541', '5', 'Institution to which field applies', 'Institution to which field applies', 0, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4874
        ('541', '6', 'Linkage', 'Linkage', 0, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4875
        ('541', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4876
        ('541', 'a', 'Source of acquisition', 'Source of acquisition', 0, 0, '', 5, '', '', '', NULL, 1, 'HLD', '', '', NULL),
4877
        ('541', 'b', 'Address', 'Address', 0, 0, '', 5, '', '', '', NULL, 1, 'HLD', '', '', NULL),
4878
        ('541', 'c', 'Method of acquisition', 'Method of acquisition', 0, 0, '', 5, '', '', '', NULL, 1, 'HLD', '', '', NULL),
4879
        ('541', 'd', 'Date of acquisition', 'Date of acquisition', 0, 0, '', 5, '', '', '', NULL, 1, 'HLD', '', '', NULL),
4880
        ('541', 'e', 'Accession number', 'Accession number', 0, 0, '', 5, '', '', '', NULL, 1, 'HLD', '', '', NULL),
4881
        ('541', 'f', 'Owner', 'Owner', 0, 0, '', 5, '', '', '', NULL, 1, 'HLD', '', '', NULL),
4882
        ('541', 'h', 'Purchase price', 'Purchase price', 0, 0, '', 5, '', '', '', NULL, 1, 'HLD', '', '', NULL),
4883
        ('541', 'n', 'Extent', 'Extent', 1, 0, '', 5, '', '', '', NULL, 1, 'HLD', '', '', NULL),
4884
        ('541', 'o', 'Type of unit', 'Type of unit', 1, 0, '', 5, '', '', '', NULL, 1, 'HLD', '', '', NULL),
4885
        ('561', '3', 'Materials specified', 'Materials specified', 0, 0, NULL, 5, NULL, NULL, '', NULL, -6, 'HLD', '', '', NULL),
4886
        ('561', '5', 'Institution to which field applies', 'Institution to which field applies', 0, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4887
        ('561', '6', 'Linkage', 'Linkage', 0, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4888
        ('561', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4889
        ('561', 'a', 'History', 'History', 0, 0, '', 5, '', '', '', NULL, 6, 'HLD', '', '', NULL),
4890
        ('561', 'b', 'Time of collation [OBSOLETE]', 'Time of collation [OBSOLETE]', 0, 0, '', 5, '', '', '', NULL, 6, 'HLD', '', '', NULL),
4891
        ('561', 'u', 'Uniform Resource Identifier', 'Uniform Resource Identifier', 1, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4892
        ('562', '3', 'Materials specified', 'Materials specified', 0, 0, NULL, 5, NULL, NULL, '', NULL, -6, 'HLD', '', '', NULL),
4893
        ('562', '5', 'Institution to which field applies', 'Institution to which field applies', 0, 0, NULL, -1, NULL, NULL, '', NULL, -6, 'HLD', '', '', NULL),
4894
        ('562', '6', 'Linkage', 'Linkage', 0, 0, NULL, 5, NULL, NULL, '', NULL, -6, 'HLD', '', '', NULL),
4895
        ('562', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, NULL, 5, NULL, NULL, '', NULL, -6, 'HLD', '', '', NULL),
4896
        ('562', 'a', 'Identifying markings', 'Identifying markings', 1, 0, NULL, 5, NULL, NULL, '', NULL, -1, 'HLD', '', '', NULL),
4897
        ('562', 'b', 'Copy identification', 'Copy identification', 1, 0, NULL, 5, NULL, NULL, '', NULL, -1, 'HLD', '', '', NULL),
4898
        ('562', 'c', 'Version identification', 'Version identification', 1, 0, NULL, 5, NULL, NULL, '', NULL, -1, 'HLD', '', '', NULL),
4899
        ('562', 'd', 'Presentation format', 'Presentation format', 1, 0, NULL, 5, NULL, NULL, '', NULL, -1, 'HLD', '', '', NULL),
4900
        ('562', 'e', 'Number of copies', 'Number of copies', 1, 0, NULL, 5, NULL, NULL, '', NULL, -1, 'HLD', '', '', NULL),
4901
        ('563', '3', 'Materials specified', 'Materials specified', 0, 0, NULL, 5, NULL, NULL, '', NULL, -6, 'HLD', '', '', NULL),
4902
        ('563', '5', 'Institution to which field applies', 'Institution to which field applies', 0, 0, NULL, -1, NULL, NULL, '', NULL, -6, 'HLD', '', '', NULL),
4903
        ('563', '6', 'Linkage', 'Linkage', 0, 0, NULL, 5, NULL, NULL, '', NULL, -6, 'HLD', '', '', NULL),
4904
        ('563', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, NULL, 5, NULL, NULL, '', NULL, -6, 'HLD', '', '', NULL),
4905
        ('563', 'a', 'Binding note', 'Binding note', 0, 0, NULL, 5, NULL, NULL, '', NULL, -1, 'HLD', '', '', NULL),
4906
        ('563', 'u', 'Uniform Resource Identifier', 'Uniform Resource Identifier', 1, 0, NULL, 5, NULL, NULL, '', 1, -1, 'HLD', '', '', NULL),
4907
        ('583', '2', 'Source of term', 'Source of term', 0, 0, NULL, 5, NULL, NULL, '', NULL, -6, 'HLD', '', '', NULL),
4908
        ('583', '3', 'Materials specified', 'Materials specified', 0, 0, NULL, 5, NULL, NULL, '', NULL, -6, 'HLD', '', '', NULL),
4909
        ('583', '5', 'Institution to which field applies', 'Institution to which field applies', 0, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4910
        ('583', '6', 'Linkage', 'Linkage', 0, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4911
        ('583', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4912
        ('583', 'a', 'Action', 'Action', 0, 0, '', 5, '', '', '', NULL, -1, 'HLD', '', '', NULL),
4913
        ('583', 'b', 'Action identification', 'Action identification', 1, 0, '', 5, '', '', '', NULL, -1, 'HLD', '', '', NULL),
4914
        ('583', 'c', 'Time/date of action', 'Time/date of action', 1, 0, '', 5, '', '', '', NULL, -1, 'HLD', '', '', NULL),
4915
        ('583', 'd', 'Action interval', 'Action interval', 1, 0, '', 5, '', '', '', NULL, -1, 'HLD', '', '', NULL),
4916
        ('583', 'e', 'Contingency for action', 'Contingency for action', 1, 0, '', 5, '', '', '', NULL, -1, 'HLD', '', '', NULL),
4917
        ('583', 'f', 'Authorization', 'Authorization', 1, 0, '', 5, '', '', '', NULL, -1, 'HLD', '', '', NULL),
4918
        ('583', 'h', 'Jurisdiction', 'Jurisdiction', 1, 0, '', 5, '', '', '', NULL, -1, 'HLD', '', '', NULL),
4919
        ('583', 'i', 'Method of action', 'Method of action', 1, 0, '', 5, '', '', '', NULL, -1, 'HLD', '', '', NULL),
4920
        ('583', 'j', 'Site of action', 'Site of action', 1, 0, '', 5, '', '', '', NULL, -1, 'HLD', '', '', NULL),
4921
        ('583', 'k', 'Action agent', 'Action agent', 1, 0, '', 5, '', '', '', NULL, -1, 'HLD', '', '', NULL),
4922
        ('583', 'l', 'Status', 'Status', 1, 0, '', 5, '', '', '', NULL, -1, 'HLD', '', '', NULL),
4923
        ('583', 'n', 'Extent', 'Extent', 1, 0, '', 5, '', '', '', NULL, -1, 'HLD', '', '', NULL),
4924
        ('583', 'o', 'Type of unit', 'Type of unit', 1, 0, '', 5, '', '', '', NULL, -1, 'HLD', '', '', NULL),
4925
        ('583', 'u', 'Uniform Resource Identifier', 'Uniform Resource Identifier', 1, 0, '', 5, '', '', '', 1, -1, 'HLD', '', '', NULL),
4926
        ('583', 'x', 'Nonpublic note', 'Nonpublic note', 1, 0, '', 5, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4927
        ('583', 'z', 'Public note', 'Public note', 1, 0, '', 5, '', '', '', NULL, -1, 'HLD', '', '', NULL),
4928
        ('842', '6', 'Linkage', 'Linkage', 0, 0, '', 8, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4929
        ('842', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 8, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4930
        ('842', 'a', 'Textual physical form designator', 'Textual physical form designator', 0, 0, '', 8, '', '', '', NULL, -1, 'HLD', '', '', NULL),
4931
        ('843', '3', 'Materials specified', 'Materials specified', 0, 0, NULL, 8, NULL, NULL, '', NULL, -6, 'HLD', '', '', NULL),
4932
        ('843', '5', 'Institution to which field applies', 'Institution to which field applies', 0, 0, NULL, -1, NULL, NULL, '', NULL, -6, 'HLD', '', '', NULL),
4933
        ('843', '6', 'Linkage', 'Linkage', 0, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4934
        ('843', '7', 'Fixed-length data elements of reproduction', 'Fixed-length data elements of reproduction', 0, 0, NULL, 8, NULL, NULL, '', NULL, -6, 'HLD', '', '', NULL),
4935
        ('843', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 8, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4936
        ('843', 'a', 'Type of reproduction', 'Type of reproduction', 0, 0, NULL, 8, NULL, NULL, '', NULL, -1, 'HLD', '', '', NULL),
4937
        ('843', 'b', 'Place of reproduction', 'Place of reproduction', 1, 0, NULL, 8, NULL, NULL, '', NULL, -1, 'HLD', '', '', NULL),
4938
        ('843', 'c', 'Agency responsible for reproduction', 'Agency responsible for reproduction', 1, 0, NULL, 8, NULL, NULL, '', NULL, -1, 'HLD', '', '', NULL),
4939
        ('843', 'd', 'Date of reproduction', 'Date of reproduction', 0, 0, NULL, 8, NULL, NULL, '', NULL, -1, 'HLD', '', '', NULL),
4940
        ('843', 'e', 'Physical description of reproduction', 'Physical description of reproduction', 0, 0, NULL, 8, NULL, NULL, '', NULL, -1, 'HLD', '', '', NULL),
4941
        ('843', 'f', 'Series statement of reproduction', 'Series statement of reproduction', 1, 0, NULL, 8, NULL, NULL, '', NULL, -1, 'HLD', '', '', NULL),
4942
        ('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),
4943
        ('843', 'n', 'Note about reproduction', 'Note about reproduction', 1, 0, NULL, 8, NULL, NULL, '', NULL, -1, 'HLD', '', '', NULL),
4944
        ('844', '6', 'Linkage', 'Linkage', 0, 0, '', 8, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4945
        ('844', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 8, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4946
        ('844', 'a', 'Name of unit', 'Name of unit', 0, 0, '', 8, '', '', '', NULL, -1, 'HLD', '', '', NULL),
4947
        ('845', 'a', 'Terms governing use and reproduction', 'Terms governing use and reproduction', 0, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4948
        ('845', 'b', 'Jurisdiction', 'Jurisdiction', 0, 0, '', 8, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4949
        ('845', 'c', 'Authorization', 'Authorization', 0, 0, '', 8, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4950
        ('845', 'd', 'Authorized users', 'Authorized users', 0, 0, '', 8, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4951
        ('845', 'u', 'Uniform Resource Identifier', 'Uniform Resource Identifier', 1, 0, '', 8, '', '', '', 1, -6, 'HLD', '', '', NULL),
4952
        ('850', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, NULL, 8, NULL, NULL, '', NULL, 4, 'HLD', '', '', NULL),
4953
        ('850', 'a', 'Holding institution', 'Holding institution', 1, 0, NULL, 8, NULL, NULL, '', NULL, 4, 'HLD', '', '', NULL),
4954
        ('850', 'b', 'Holdings (NR) (MU VM SE) [OBSOLETE]', 'Holdings (NR) (MU VM SE) [OBSOLETE]', 0, 0, NULL, 8, NULL, NULL, '', NULL, 4, 'HLD', '', '', NULL),
4955
        ('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),
4956
        ('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),
4957
        ('852', '2', 'Source of classification or shelving scheme', 'Source of classification or shelving scheme', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4958
        ('852', '3', 'Materials specified', 'Materials specified', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4959
        ('852', '6', 'Linkage', 'Linkage', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4960
        ('852', '8', 'Sequence number', 'Sequence number', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4961
        ('852', 'a', 'Location', 'Location', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4962
        ('852', 'b', 'Sublocation or collection', 'Sublocation or collection', 1, 0, 'holdings.holdingbranch', 8, 'branches', '', '', NULL, 4, 'HLD', '', '', NULL),
4963
        ('852', 'c', 'Shelving location', 'Shelving location', 1, 0, 'holdings.location', 8, 'LOC', '', '', NULL, 4, 'HLD', '', '', NULL),
4964
        ('852', 'd', 'Former shelving location', 'Former shelving location', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4965
        ('852', 'e', 'Address', 'Address', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4966
        ('852', 'f', 'Coded location qualifier', 'Coded location qualifier', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4967
        ('852', 'g', 'Non-coded location qualifier', 'Non-coded location qualifier', 1, 0, 'holdings.ccode', 8, 'CCODE', '', '', NULL, 4, 'HLD', '', '', NULL),
4968
        ('852', 'h', 'Classification part', 'Classification part', 0, 0, 'holdings.callnumber', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4969
        ('852', 'i', 'Item part', 'Item part', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4970
        ('852', 'j', 'Shelving control number', 'Shelving control number', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4971
        ('852', 'k', 'Call number prefix', 'Call number prefix', 1, 0, 'holdings.callnumber', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4972
        ('852', 'l', 'Shelving form of title', 'Shelving form of title', 0, 0, 'holdings.callnumber', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4973
        ('852', 'm', 'Call number suffix', 'Call number suffix', 1, 0, 'holdings.callnumber', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4974
        ('852', 'n', 'Country code', 'Country code', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4975
        ('852', 'p', 'Piece designation', 'Piece designation', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4976
        ('852', 'q', 'Piece physical condition', 'Piece physical condition', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4977
        ('852', 's', 'Copyright article-fee code', 'Copyright article-fee code', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4978
        ('852', 't', 'Copy number', 'Copy number', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4979
        ('852', 'u', 'Uniform Resource Identifier', 'Uniform Resource Identifier', 1, 0, '', 8, '', '', '', 1, 4, 'HLD', '', '', NULL),
4980
        ('852', 'x', 'Nonpublic note', 'Nonpublic note', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4981
        ('852', 'z', 'Public note', 'Public note', 1, 0, 'holdings.public_note', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4982
        ('853', '3', 'Materials specified', 'Materials specified', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4983
        ('853', '6', 'Linkage', 'Linkage', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4984
        ('853', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4985
        ('853', 'a', 'First level of enumeration', 'First level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4986
        ('853', 'b', 'Second level of enumeration', 'Second level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4987
        ('853', 'c', 'Third level of enumeration', 'Third level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4988
        ('853', 'd', 'Fourth level of enumeration', 'Fourth level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4989
        ('853', 'e', 'Fifth level of enumeration', 'Fifth level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4990
        ('853', 'f', 'Sixth level of enumeration', 'Sixth level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4991
        ('853', 'g', 'Alternative numbering scheme, first level of enumeration', 'Alternative numbering scheme, first level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4992
        ('853', 'h', 'Alternative numbering scheme, second level of enumeration', 'Alternative numbering scheme, second level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4993
        ('853', 'i', 'First level of chronology', 'First level of chronology', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4994
        ('853', 'j', 'Second level of chronology', 'Second level of chronology', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4995
        ('853', 'k', 'Third level of chronology', 'Third level of chronology', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4996
        ('853', 'l', 'Fourth level of chronology', 'Fourth level of chronology', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4997
        ('853', 'm', 'Alternative numbering scheme, chronology', 'Alternative numbering scheme, chronology', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4998
        ('853', 'n', 'Pattern note', 'Pattern note', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4999
        ('853', 'p', 'Number of pieces per issuance', 'Number of pieces per issuance', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5000
        ('853', 't', 'Copy', 'Copy', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5001
        ('853', 'u', 'Bibliographic units per next higher level', 'Bibliographic units per next higher level', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5002
        ('853', 'v', 'Numbering continuity', 'Numbering continuity', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5003
        ('853', 'w', 'Frequency', 'Frequency', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5004
        ('853', 'x', 'Calendar change', 'Calendar change', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5005
        ('853', 'y', 'Regularity pattern', 'Regularity pattern', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5006
        ('853', 'z', 'Numbering scheme', 'Numbering scheme', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5007
        ('854', '3', 'Materials specified', 'Materials specified', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5008
        ('854', '6', 'Linkage', 'Linkage', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5009
        ('854', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5010
        ('854', 'a', 'First level of enumeration', 'First level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5011
        ('854', 'b', 'Second level of enumeration', 'Second level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5012
        ('854', 'c', 'Third level of enumeration', 'Third level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5013
        ('854', 'd', 'Fourth level of enumeration', 'Fourth level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5014
        ('854', 'e', 'Fifth level of enumeration', 'Fifth level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5015
        ('854', 'f', 'Sixth level of enumeration', 'Sixth level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5016
        ('854', 'g', 'Alternative numbering scheme, first level of enumeration', 'Alternative numbering scheme, first level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5017
        ('854', 'h', 'Alternative numbering scheme, second level of enumeration', 'Alternative numbering scheme, second level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5018
        ('854', 'i', 'First level of chronology', 'First level of chronology', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5019
        ('854', 'j', 'Second level of chronology', 'Second level of chronology', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5020
        ('854', 'k', 'Third level of chronology', 'Third level of chronology', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5021
        ('854', 'l', 'Fourth level of chronology', 'Fourth level of chronology', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5022
        ('854', 'm', 'Alternative numbering scheme, chronology', 'Alternative numbering scheme, chronology', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5023
        ('854', 'n', 'Pattern note', 'Pattern note', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5024
        ('854', 'p', 'Number of pieces per issuance', 'Number of pieces per issuance', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5025
        ('854', 't', 'Copy', 'Copy', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5026
        ('854', 'u', 'Bibliographic units per next higher level', 'Bibliographic units per next higher level', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5027
        ('854', 'v', 'Numbering continuity', 'Numbering continuity', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5028
        ('854', 'w', 'Frequency', 'Frequency', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5029
        ('854', 'x', 'Calendar change', 'Calendar change', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5030
        ('854', 'y', 'Regularity pattern', 'Regularity pattern', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5031
        ('854', 'z', 'Numbering scheme', 'Numbering scheme', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5032
        ('855', '3', 'Materials specified', 'Materials specified', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5033
        ('855', '6', 'Linkage', 'Linkage', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5034
        ('855', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5035
        ('855', 'a', 'First level of enumeration', 'First level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5036
        ('855', 'b', 'Second level of enumeration', 'Second level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5037
        ('855', 'c', 'Third level of enumeration', 'Third level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5038
        ('855', 'd', 'Fourth level of enumeration', 'Fourth level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5039
        ('855', 'e', 'Fifth level of enumeration', 'Fifth level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5040
        ('855', 'f', 'Sixth level of enumeration', 'Sixth level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5041
        ('855', 'g', 'Alternative numbering scheme, first level of enumeration', 'Alternative numbering scheme, first level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5042
        ('855', 'h', 'Alternative numbering scheme, second level of enumeration', 'Alternative numbering scheme, second level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5043
        ('855', 'i', 'First level of chronology', 'First level of chronology', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5044
        ('855', 'j', 'Second level of chronology', 'Second level of chronology', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5045
        ('855', 'k', 'Third level of chronology', 'Third level of chronology', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5046
        ('855', 'l', 'Fourth level of chronology', 'Fourth level of chronology', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5047
        ('855', 'm', 'Alternative numbering scheme, chronology', 'Alternative numbering scheme, chronology', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5048
        ('855', 'n', 'Pattern note', 'Pattern note', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5049
        ('855', 'p', 'Number of pieces per issuance', 'Number of pieces per issuance', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5050
        ('855', 't', 'Copy', 'Copy', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5051
        ('855', 'u', 'Bibliographic units per next higher level', 'Bibliographic units per next higher level', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5052
        ('855', 'v', 'Numbering continuity', 'Numbering continuity', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5053
        ('855', 'w', 'Frequency', 'Frequency', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5054
        ('855', 'x', 'Calendar change', 'Calendar change', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5055
        ('855', 'y', 'Regularity pattern', 'Regularity pattern', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5056
        ('855', 'z', 'Numbering scheme', 'Numbering scheme', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5057
        ('856', '2', 'Access method', 'Access method', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5058
        ('856', '3', 'Materials specified', 'Materials specified', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5059
        ('856', '6', 'Linkage', 'Linkage', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5060
        ('856', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5061
        ('856', 'a', 'Host name', 'Host name', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5062
        ('856', 'b', 'Access number', 'Access number', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5063
        ('856', 'c', 'Compression information', 'Compression information', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5064
        ('856', 'd', 'Path', 'Path', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5065
        ('856', 'f', 'Electronic name', 'Electronic name', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5066
        ('856', 'h', 'Processor of request', 'Processor of request', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5067
        ('856', 'i', 'Instruction', 'Instruction', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5068
        ('856', 'j', 'Bits per second', 'Bits per second', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5069
        ('856', 'k', 'Password', 'Password', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5070
        ('856', 'l', 'Logon', 'Logon', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5071
        ('856', 'm', 'Contact for access assistance', 'Contact for access assistance', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5072
        ('856', 'n', 'Name of location of host', 'Name of location of host', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5073
        ('856', 'o', 'Operating system', 'Operating system', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5074
        ('856', 'p', 'Port', 'Port', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5075
        ('856', 'q', 'Electronic format type', 'Electronic format type', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5076
        ('856', 'r', 'Settings', 'Settings', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5077
        ('856', 's', 'File size', 'File size', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5078
        ('856', 't', 'Terminal emulation', 'Terminal emulation', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5079
        ('856', 'u', 'Uniform Resource Identifier', 'Uniform Resource Identifier', 1, 0, 'biblioitems.url', 8, '', '', '', 1, 4, 'HLD', '', '', NULL),
5080
        ('856', 'v', 'Hours access method available', 'Hours access method available', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5081
        ('856', 'w', 'Record control number', 'Record control number', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5082
        ('856', 'x', 'Nonpublic note', 'Nonpublic note', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5083
        ('856', 'y', 'Link text', 'Link text', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5084
        ('856', 'z', 'Public note', 'Public note', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5085
        ('863', '6', 'Linkage', 'Linkage', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5086
        ('863', '8', 'Field link and sequence number', 'Field link and sequence number', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5087
        ('863', 'a', 'First level of enumeration', 'First level of enumeration', 0, 0, 'holdings.summary', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5088
        ('863', 'b', 'Second level of enumeration', 'Second level of enumeration', 0, 0, 'holdings.summary', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5089
        ('863', 'c', 'Third level of enumeration', 'Third level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5090
        ('863', 'd', 'Fourth level of enumeration', 'Fourth level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5091
        ('863', 'e', 'Fifth level of enumeration', 'Fifth level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5092
        ('863', 'f', 'Sixth level of enumeration', 'Sixth level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5093
        ('863', 'g', 'Alternative numbering scheme, first level of enumeration', 'Alternative numbering scheme, first level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5094
        ('863', 'h', 'Alternative numbering scheme, second level of enumeration', 'Alternative numbering scheme, second level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5095
        ('863', 'i', 'First level of chronology', 'First level of chronology', 0, 0, 'holdings.summary', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5096
        ('863', 'j', 'Second level of chronology', 'Second level of chronology', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5097
        ('863', 'k', 'Third level of chronology', 'Third level of chronology', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5098
        ('863', 'l', 'Fourth level of chronology', 'Fourth level of chronology', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5099
        ('863', 'm', 'Alternative numbering scheme, chronology', 'Alternative numbering scheme, chronology', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5100
        ('863', 'n', 'Converted Gregorian year', 'Converted Gregorian year', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5101
        ('863', 'o', 'Type of unit', 'Type of unit', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5102
        ('863', 'p', 'Piece designation', 'Piece designation', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5103
        ('863', 'q', 'Piece physical condition', 'Piece physical condition', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5104
        ('863', 's', 'Copyright article-fee code', 'Copyright article-fee code', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5105
        ('863', 't', 'Copy number', 'Copy number', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5106
        ('863', 'v', 'Issuing date', 'Issuing date', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5107
        ('863', 'w', 'Break indicator', 'Break indicator', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5108
        ('863', 'x', 'Nonpublic note', 'Nonpublic note', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5109
        ('863', 'z', 'Public note', 'Public note', 1, 0, 'holdings.summary', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5110
        ('864', '6', 'Linkage', 'Linkage', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5111
        ('864', '8', 'Field link and sequence number', 'Field link and sequence number', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5112
        ('864', 'a', 'First level of enumeration', 'First level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5113
        ('864', 'b', 'Second level of enumeration', 'Second level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5114
        ('864', 'c', 'Third level of enumeration', 'Third level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5115
        ('864', 'd', 'Fourth level of enumeration', 'Fourth level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5116
        ('864', 'e', 'Fifth level of enumeration', 'Fifth level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5117
        ('864', 'f', 'Sixth level of enumeration', 'Sixth level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5118
        ('864', 'g', 'Alternative numbering scheme, first level of enumeration', 'Alternative numbering scheme, first level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5119
        ('864', 'h', 'Alternative numbering scheme, second level of enumeration', 'Alternative numbering scheme, second level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5120
        ('864', 'i', 'First level of chronology', 'First level of chronology', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5121
        ('864', 'j', 'Second level of chronology', 'Second level of chronology', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5122
        ('864', 'k', 'Third level of chronology', 'Third level of chronology', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5123
        ('864', 'l', 'Fourth level of chronology', 'Fourth level of chronology', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5124
        ('864', 'm', 'Alternative numbering scheme, chronology', 'Alternative numbering scheme, chronology', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5125
        ('864', 'n', 'Converted Gregorian year', 'Converted Gregorian year', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5126
        ('864', 'o', 'Type of unit', 'Type of unit', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5127
        ('864', 'p', 'Piece designation', 'Piece designation', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5128
        ('864', 'q', 'Piece physical condition', 'Piece physical condition', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5129
        ('864', 's', 'Copyright article-fee code', 'Copyright article-fee code', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5130
        ('864', 't', 'Copy number', 'Copy number', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5131
        ('864', 'v', 'Issuing date', 'Issuing date', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5132
        ('864', 'w', 'Break indicator', 'Break indicator', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5133
        ('864', 'x', 'Nonpublic note', 'Nonpublic note', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5134
        ('864', 'z', 'Public note', 'Public note', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5135
        ('865', '6', 'Linkage', 'Linkage', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5136
        ('865', '8', 'Field link and sequence number', 'Field link and sequence number', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5137
        ('865', 'a', 'First level of enumeration', 'First level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5138
        ('865', 'b', 'Second level of enumeration', 'Second level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5139
        ('865', 'c', 'Third level of enumeration', 'Third level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5140
        ('865', 'd', 'Fourth level of enumeration', 'Fourth level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5141
        ('865', 'e', 'Fifth level of enumeration', 'Fifth level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5142
        ('865', 'f', 'Sixth level of enumeration', 'Sixth level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5143
        ('865', 'g', 'Alternative numbering scheme, first level of enumeration', 'Alternative numbering scheme, first level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5144
        ('865', 'h', 'Alternative numbering scheme, second level of enumeration', 'Alternative numbering scheme, second level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5145
        ('865', 'i', 'First level of chronology', 'First level of chronology', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5146
        ('865', 'j', 'Second level of chronology', 'Second level of chronology', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5147
        ('865', 'k', 'Third level of chronology', 'Third level of chronology', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5148
        ('865', 'l', 'Fourth level of chronology', 'Fourth level of chronology', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5149
        ('865', 'm', 'Alternative numbering scheme, chronology', 'Alternative numbering scheme, chronology', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5150
        ('865', 'n', 'Converted Gregorian year', 'Converted Gregorian year', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5151
        ('865', 'o', 'Type of unit', 'Type of unit', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5152
        ('865', 'p', 'Piece designation', 'Piece designation', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5153
        ('865', 'q', 'Piece physical condition', 'Piece physical condition', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5154
        ('865', 's', 'Copyright article-fee code', 'Copyright article-fee code', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5155
        ('865', 't', 'Copy number', 'Copy number', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5156
        ('865', 'v', 'Issuing date', 'Issuing date', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5157
        ('865', 'w', 'Break indicator', 'Break indicator', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5158
        ('865', 'x', 'Nonpublic note', 'Nonpublic note', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5159
        ('865', 'z', 'Public note', 'Public note', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5160
        ('866', '6', 'Linkage', 'Linkage', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5161
        ('866', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5162
        ('866', 'a', 'Textual string', 'Textual string', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5163
        ('866', 'x', 'Nonpublic note', 'Nonpublic note', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5164
        ('866', 'z', 'Public note', 'Public note', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5165
        ('867', '6', 'Linkage', 'Linkage', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5166
        ('867', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5167
        ('867', 'a', 'Textual string', 'Textual string', 0, 0, 'holdings.supplements', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5168
        ('867', 'x', 'Nonpublic note', 'Nonpublic note', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5169
        ('867', 'z', 'Public note', 'Public note', 1, 0, 'holdings.supplements', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5170
        ('868', '6', 'Linkage', 'Linkage', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5171
        ('868', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5172
        ('868', 'a', 'Textual string', 'Textual string', 0, 0, 'holdings.indexes', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5173
        ('868', 'x', 'Nonpublic note', 'Nonpublic note', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5174
        ('868', 'z', 'Public note', 'Public note', 1, 0, 'holdings.indexes', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5175
        ('876', '3', 'Materials specified', 'Materials specified', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5176
        ('876', '6', 'Linkage', 'Linkage', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5177
        ('876', '8', 'Sequence number', 'Sequence number', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5178
        ('876', 'a', 'Internal item number', 'Internal item number', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5179
        ('876', 'b', 'Invalid or canceled internal item number', 'Invalid or canceled internal item number', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5180
        ('876', 'c', 'Cost', 'Cost', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5181
        ('876', 'd', 'Date acquired', 'Date acquired', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5182
        ('876', 'e', 'Source of acquisition', 'Source of acquisition', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5183
        ('876', 'h', 'Use restrictions', 'Use restrictions', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5184
        ('876', 'j', 'Item status', 'Item status', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5185
        ('876', 'l', 'Temporary location', 'Temporary location', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5186
        ('876', 'p', 'Piece designation', 'Piece designation', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5187
        ('876', 'r', 'Invalid or canceled piece designation', 'Invalid or canceled piece designation', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5188
        ('876', 't', 'Copy number', 'Copy number', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5189
        ('876', 'x', 'Nonpublic note', 'Nonpublic note', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5190
        ('876', 'z', 'Public note', 'Public note', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5191
        ('877', '3', 'Materials specified', 'Materials specified', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5192
        ('877', '6', 'Linkage', 'Linkage', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5193
        ('877', '8', 'Sequence number', 'Sequence number', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5194
        ('877', 'a', 'Internal item number', 'Internal item number', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5195
        ('877', 'b', 'Invalid or canceled internal item number', 'Invalid or canceled internal item number', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5196
        ('877', 'c', 'Cost', 'Cost', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5197
        ('877', 'd', 'Date acquired', 'Date acquired', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5198
        ('877', 'e', 'Source of acquisition', 'Source of acquisition', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5199
        ('877', 'h', 'Use restrictions', 'Use restrictions', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5200
        ('877', 'j', 'Item status', 'Item status', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5201
        ('877', 'l', 'Temporary location', 'Temporary location', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5202
        ('877', 'p', 'Piece designation', 'Piece designation', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5203
        ('877', 'r', 'Invalid or canceled piece designation', 'Invalid or canceled piece designation', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5204
        ('877', 't', 'Copy number', 'Copy number', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5205
        ('877', 'x', 'Nonpublic note', 'Nonpublic note', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5206
        ('877', 'z', 'Public note', 'Public note', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5207
        ('878', '3', 'Materials specified', 'Materials specified', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5208
        ('878', '6', 'Linkage', 'Linkage', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5209
        ('878', '8', 'Sequence number', 'Sequence number', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5210
        ('878', 'a', 'Internal item number', 'Internal item number', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5211
        ('878', 'b', 'Invalid or canceled internal item number', 'Invalid or canceled internal item number', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5212
        ('878', 'c', 'Cost', 'Cost', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5213
        ('878', 'd', 'Date acquired', 'Date acquired', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5214
        ('878', 'e', 'Source of acquisition', 'Source of acquisition', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5215
        ('878', 'h', 'Use restrictions', 'Use restrictions', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5216
        ('878', 'j', 'Item status', 'Item status', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5217
        ('878', 'l', 'Temporary location', 'Temporary location', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5218
        ('878', 'p', 'Piece designation', 'Piece designation', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5219
        ('878', 'r', 'Invalid or canceled piece designation', 'Invalid or canceled piece designation', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5220
        ('878', 't', 'Copy number', 'Copy number', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5221
        ('878', 'x', 'Nonpublic note', 'Nonpublic note', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5222
        ('878', 'z', 'Public note', 'Public note', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL);
(-)a/installer/data/mysql/kohastructure.sql (-2 / +49 lines)
Lines 646-651 CREATE TABLE `deleteditems` ( Link Here
646
  `copynumber` varchar(32) default NULL, -- copy number (MARC21 952$t)
646
  `copynumber` varchar(32) default NULL, -- copy number (MARC21 952$t)
647
  `stocknumber` varchar(32) default NULL, -- inventory number (MARC21 952$i)
647
  `stocknumber` varchar(32) default NULL, -- inventory number (MARC21 952$i)
648
  `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.
648
  `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.
649
  `holding_id` int(11) default NULL, -- foreign key from holdings table used to link this item to the right holdings record
649
  PRIMARY KEY  (`itemnumber`),
650
  PRIMARY KEY  (`itemnumber`),
650
  KEY `delitembarcodeidx` (`barcode`),
651
  KEY `delitembarcodeidx` (`barcode`),
651
  KEY `delitemstocknumberidx` (`stocknumber`),
652
  KEY `delitemstocknumberidx` (`stocknumber`),
Lines 800-811 CREATE TABLE `import_items` ( Link Here
800
  KEY `branchcode` (`branchcode`)
801
  KEY `branchcode` (`branchcode`)
801
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
802
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
802
803
804
--
805
-- Table structure for table `holdings`
806
--
807
808
DROP TABLE IF EXISTS `holdings`;
809
CREATE TABLE `holdings` ( -- table that stores summary holdings information
810
  `holding_id` int(11) NOT NULL auto_increment, -- unique identifier assigned to each holdings record
811
  `biblionumber` int(11) NOT NULL default 0, -- foreign key from biblio table used to link this record to the right bib record
812
  `frameworkcode` varchar(4) NOT NULL default '', -- foreign key from the biblio_framework table to identify which framework was used in cataloging this record
813
  `holdingbranch` varchar(10) default NULL, -- foreign key from the branches table for the library that owns this record (MARC21 852$a)
814
  `location` varchar(80) default NULL, -- authorized value for the shelving location for this record (MARC21 852$b)
815
  `ccode` varchar(80) default NULL, -- authorized value for the collection code associated with this item (MARC21 852$g)
816
  `callnumber` varchar(255) default NULL, -- call number (852$h+$i in MARC21)
817
  `suppress` tinyint(1) default NULL, -- Boolean indicating whether the record is suppressed in OPAC
818
  `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, -- date and time this record was last touched
819
  `datecreated` DATE NOT NULL, -- the date this record was added to Koha
820
	`deleted_on` DATETIME DEFAULT NULL, -- the date this record was deleted
821
  PRIMARY KEY  (`holding_id`),
822
  KEY `hldnoidx` (`holding_id`),
823
  KEY `hldbibnoidx` (`biblionumber`),
824
  KEY `timestamp` (`timestamp`),
825
  CONSTRAINT `holdings_ibfk_1` FOREIGN KEY (`biblionumber`) REFERENCES `biblio` (`biblionumber`) ON DELETE CASCADE ON UPDATE CASCADE,
826
  CONSTRAINT `holdings_ibfk_2` FOREIGN KEY (`holdingbranch`) REFERENCES `branches` (`branchcode`) ON UPDATE CASCADE
827
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
828
829
--
830
-- Table structure for table `holdings_metadata`
831
--
832
833
DROP TABLE IF EXISTS `holdings_metadata`;
834
CREATE TABLE `holdings_metadata` (
835
  `id` INT(11) NOT NULL AUTO_INCREMENT,
836
  `holding_id` INT(11) NOT NULL,
837
  `format` VARCHAR(16) NOT NULL,
838
  `schema` VARCHAR(16) NOT NULL,
839
  `metadata` LONGTEXT NOT NULL,
840
	`deleted_on` DATETIME DEFAULT NULL, -- the date this record was deleted
841
  PRIMARY KEY(id),
842
  UNIQUE KEY `holdings_metadata_uniq_key` (`holding_id`,`format`,`schema`),
843
  KEY `hldnoidx` (`holding_id`),
844
  CONSTRAINT `holdings_metadata_fk_1` FOREIGN KEY (`holding_id`) REFERENCES `holdings` (`holding_id`) ON DELETE CASCADE ON UPDATE CASCADE
845
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
846
803
--
847
--
804
-- Table structure for table `items`
848
-- Table structure for table `items`
805
--
849
--
806
850
807
DROP TABLE IF EXISTS `items`;
851
DROP TABLE IF EXISTS `items`;
808
CREATE TABLE `items` ( -- holdings/item information
852
CREATE TABLE `items` ( -- item information
809
  `itemnumber` int(11) NOT NULL auto_increment, -- primary key and unique identifier added by Koha
853
  `itemnumber` int(11) NOT NULL auto_increment, -- primary key and unique identifier added by Koha
810
  `biblionumber` int(11) NOT NULL default 0, -- foreign key from biblio table used to link this item to the right bib record
854
  `biblionumber` int(11) NOT NULL default 0, -- foreign key from biblio table used to link this item to the right bib record
811
  `biblioitemnumber` int(11) NOT NULL default 0, -- foreign key from the biblioitems table to link to item to additional information
855
  `biblioitemnumber` int(11) NOT NULL default 0, -- foreign key from the biblioitems table to link to item to additional information
Lines 851-856 CREATE TABLE `items` ( -- holdings/item information Link Here
851
  `copynumber` varchar(32) default NULL, -- copy number (MARC21 952$t)
895
  `copynumber` varchar(32) default NULL, -- copy number (MARC21 952$t)
852
  `stocknumber` varchar(32) default NULL, -- inventory number (MARC21 952$i)
896
  `stocknumber` varchar(32) default NULL, -- inventory number (MARC21 952$i)
853
  `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.
897
  `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.
898
  `holding_id` int(11) default NULL, -- foreign key from holdings table used to link this item to the right holdings record
854
  PRIMARY KEY  (`itemnumber`),
899
  PRIMARY KEY  (`itemnumber`),
855
  UNIQUE KEY `itembarcodeidx` (`barcode`),
900
  UNIQUE KEY `itembarcodeidx` (`barcode`),
856
  KEY `itemstocknumberidx` (`stocknumber`),
901
  KEY `itemstocknumberidx` (`stocknumber`),
Lines 863-872 CREATE TABLE `items` ( -- holdings/item information Link Here
863
  KEY `items_ccode` (`ccode`),
908
  KEY `items_ccode` (`ccode`),
864
  KEY `itype_idx` (`itype`),
909
  KEY `itype_idx` (`itype`),
865
  KEY `timestamp` (`timestamp`),
910
  KEY `timestamp` (`timestamp`),
911
  KEY `hldid_idx` (`holding_id`),
866
  CONSTRAINT `items_ibfk_1` FOREIGN KEY (`biblioitemnumber`) REFERENCES `biblioitems` (`biblioitemnumber`) ON DELETE CASCADE ON UPDATE CASCADE,
912
  CONSTRAINT `items_ibfk_1` FOREIGN KEY (`biblioitemnumber`) REFERENCES `biblioitems` (`biblioitemnumber`) ON DELETE CASCADE ON UPDATE CASCADE,
867
  CONSTRAINT `items_ibfk_2` FOREIGN KEY (`homebranch`) REFERENCES `branches` (`branchcode`) ON UPDATE CASCADE,
913
  CONSTRAINT `items_ibfk_2` FOREIGN KEY (`homebranch`) REFERENCES `branches` (`branchcode`) ON UPDATE CASCADE,
868
  CONSTRAINT `items_ibfk_3` FOREIGN KEY (`holdingbranch`) REFERENCES `branches` (`branchcode`) ON UPDATE CASCADE,
914
  CONSTRAINT `items_ibfk_3` FOREIGN KEY (`holdingbranch`) REFERENCES `branches` (`branchcode`) ON UPDATE CASCADE,
869
  CONSTRAINT `items_ibfk_4` FOREIGN KEY (`biblionumber`) REFERENCES `biblio` (`biblionumber`) ON DELETE CASCADE ON UPDATE CASCADE
915
  CONSTRAINT `items_ibfk_4` FOREIGN KEY (`biblionumber`) REFERENCES `biblio` (`biblionumber`) ON DELETE CASCADE ON UPDATE CASCADE,
916
  CONSTRAINT `items_ibfk_5` FOREIGN KEY (`holding_id`) REFERENCES `holdings` (`holding_id`) ON DELETE CASCADE ON UPDATE CASCADE
870
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
917
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
871
918
872
--
919
--
(-)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 600-605 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
600
('SubscriptionHistory','simplified','simplified|full','Define the display preference for serials issue history in OPAC','Choice'),
600
('SubscriptionHistory','simplified','simplified|full','Define the display preference for serials issue history in OPAC','Choice'),
601
('SubscriptionLog','1',NULL,'If ON, enables subscriptions log','YesNo'),
601
('SubscriptionLog','1',NULL,'If ON, enables subscriptions log','YesNo'),
602
('suggestion','1','','If ON, enables patron suggestions feature in OPAC','YesNo'),
602
('suggestion','1','','If ON, enables patron suggestions feature in OPAC','YesNo'),
603
('SummaryHoldings', '0', NULL, 'If ON, enables support for holdings records.', 'YesNo'),
603
('SuspendHoldsIntranet','1','Allow holds to be suspended from the intranet.',NULL,'YesNo'),
604
('SuspendHoldsIntranet','1','Allow holds to be suspended from the intranet.',NULL,'YesNo'),
604
('SuspendHoldsOpac','1','Allow holds to be suspended from the OPAC.',NULL,'YesNo'),
605
('SuspendHoldsOpac','1','Allow holds to be suspended from the OPAC.',NULL,'YesNo'),
605
('SuspensionsCalendar','noSuspensionsWhenClosed','ignoreCalendar|noSuspensionsWhenClosed','Specify whether to use the Calendar in calculating suspension expiration','Choice'),
606
('SuspensionsCalendar','noSuspensionsWhenClosed','ignoreCalendar|noSuspensionsWhenClosed','Specify whether to use the Calendar in calculating suspension expiration','Choice'),
(-)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 | uri %]#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 196-202 Link Here
196
          </div>
196
          </div>
197
        </td>
197
        </td>
198
    </tr>
198
    </tr>
199
200
    [% FOREACH loo IN frameworks %]
199
    [% FOREACH loo IN frameworks %]
201
        <tr>
200
        <tr>
202
            <td>[% loo.frameworkcode | html %]</td>
201
            <td>[% loo.frameworkcode | html %]</td>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref (+7 lines)
Lines 296-298 Cataloging: Link Here
296
            - "All values of repeating tags and subfields will be printed with the given RIS tag."
296
            - "All values of repeating tags and subfields will be printed with the given RIS tag."
297
            - "<br/>"
297
            - "<br/>"
298
            - "Use of TY ( record type ) as a key will <i>replace</i> the default TY with the field value of your choosing."
298
            - "Use of TY ( record type ) as a key will <i>replace</i> the default TY with the field value of your choosing."
299
    Holdings:
300
        -
301
            - pref: SummaryHoldings
302
              choices:
303
                  yes: Use
304
                  no: "Don't use"
305
            - 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 172-187 Link Here
172
<ul>
173
<ul>
173
    [% IF (SeparateHoldings) %]
174
    [% IF (SeparateHoldings) %]
174
        <li>
175
        <li>
175
            <a href="#holdings">[% LoginBranchname | html %] holdings ([% itemloop.size() || 0 | html %])</a>
176
            <a href="#holdings">[% LoginBranchname | html %] [% IF (show_summary_holdings) %]items[% ELSE %]holdings[% END %] ([% itemloop.size() || 0 | html %])</a>
176
        </li>
177
        </li>
177
        <li>
178
        <li>
178
            <a href="#otherholdings">Other holdings ([% otheritemloop.size() || 0 | html %])</a>
179
            <a href="#otherholdings">[% IF (show_summary_holdings) %]Other items[% ELSE %]Other holdings[% END %] ([% otheritemloop.size() || 0 | html %])</a>
179
        </li>
180
        </li>
180
    [% ELSE %]
181
    [% ELSE %]
181
        <li>
182
        <li>
182
            <a href="#holdings">Holdings ([% itemloop.size() || 0 | html %])</a>
183
            <a href="#holdings">[% IF (show_summary_holdings) %]Items[% ELSE %]Holdings[% END %] ([% itemloop.size() || 0 | html %])</a>
183
        </li>
184
        </li>
184
    [% END %]
185
    [% END %]
186
    [% IF (show_summary_holdings) %]
187
        <li><a href="#summaryholdings">Holdings ([% summary_holdings.count() || 0 | html %])</a></li>
188
    [% END %]
185
[% IF ( MARCNOTES || notes ) %]<li><a href="#description">Descriptions</a></li>[% END %]
189
[% IF ( MARCNOTES || notes ) %]<li><a href="#description">Descriptions</a></li>[% END %]
186
[% IF ( subscriptionsnumber ) %]<li><a href="#subscriptions">Subscriptions</a></li>[% END %]
190
[% IF ( subscriptionsnumber ) %]<li><a href="#subscriptions">Subscriptions</a></li>[% END %]
187
[% IF Koha.Preference('AcquisitionDetails') %]<li><a href="#acq_details">Acquisition details</a></li>[% END %]
191
[% IF Koha.Preference('AcquisitionDetails') %]<li><a href="#acq_details">Acquisition details</a></li>[% END %]
Lines 202-207 Link Here
202
[% END %]
206
[% END %]
203
</ul>
207
</ul>
204
208
209
[% IF ( show_summary_holdings ) %]
210
    <div id="summaryholdings">
211
212
    [% IF ( summary_holdings ) %]
213
        <div class="summaryholdings_table_controls">
214
        </div>
215
        <table class="summaryholdings_table">
216
            <thead>
217
                <tr>
218
                    <th>Library</th>
219
                    <th>Location</th>
220
                    <th>Collection</th>
221
                    <th>Call number</th>
222
                    <th>Status</th>
223
                    [% IF ( CAN_user_editcatalogue_edit_items ) %]<th class="NoSort">&nbsp;</th>[% END %]
224
                </tr>
225
            </thead>
226
            <tbody>
227
                [% FOREACH holding IN summary_holdings %]
228
                    <tr>
229
                        <td class="branch">[% UNLESS ( singlebranchmode ) %][% Branches.GetName( holding.holdingbranch ) | html %] [% END %]</td>
230
                        <td class="location"><span class="shelvingloc">[% holding.location | html %]</span>
231
                        <td class="collection">[% holding.ccode | html %]</span>
232
                        <td class="itemcallnumber">[% IF ( holding.callnumber ) %] [% holding.callnumber | html %][% END %]</td>
233
                        <td class="status">
234
                            [% IF ( holding.suppress ) %]
235
                                <span class="suppressed">Suppressed in OPAC</span>
236
                            [% END %]
237
                        </td>
238
                    [% IF CAN_user_editcatalogue_edit_items %]
239
                        <td class="actions">
240
                            <a class="btn btn-default btn-xs" href="/cgi-bin/koha/cataloguing/addholding.pl?op=edit&biblionumber=[% holding.biblionumber | uri %]&holding_id=[% holding.holding_id | uri %]#editholding"><i class="fa fa-pencil"></i> Edit</a>
241
                            <a class="btn btn-default btn-xs delete" href="/cgi-bin/koha/cataloguing/addholding.pl?op=delete&biblionumber=[% holding.biblionumber | uri %]&holding_id=[% holding.holding_id | uri %]"><i class="fa fa-eraser"></i> Delete</a>
242
                            <a class="btn btn-default btn-xs" href="/cgi-bin/koha/cataloguing/additem.pl?biblionumber=[% holding.biblionumber | uri %]&holding_id=[% holding.holding_id | uri %]#additema"><i class="fa fa-plus"></i> Add item</a>
243
                            <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>
244
                        </td>
245
                    [% END %]
246
                    </tr>
247
                [% END %]
248
            </tbody>
249
        </table>
250
    [% ELSE %]
251
        <div id="noitems">No holdings records</div>
252
    [% END %]
253
254
    </div>
255
[% END %]
256
205
[% items_table_block_iter = 0 %]
257
[% items_table_block_iter = 0 %]
206
[% BLOCK items_table %]
258
[% BLOCK items_table %]
207
    [% items_table_block_iter = items_table_block_iter + 1 %]
259
    [% items_table_block_iter = items_table_block_iter + 1 %]
Lines 225-230 Link Here
225
            <tr>
277
            <tr>
226
                [% IF (StaffDetailItemSelection) %]<th class="NoSort"></th>[% END %]
278
                [% IF (StaffDetailItemSelection) %]<th class="NoSort"></th>[% END %]
227
                [% IF ( item_level_itypes ) %]<th>Item type</th>[% END %]
279
                [% IF ( item_level_itypes ) %]<th>Item type</th>[% END %]
280
                [% IF ( show_summary_holdings ) %]<th>Holdings record</th>[% END %]
228
                <th>Current location</th>
281
                <th>Current location</th>
229
                <th>Home library</th>
282
                <th>Home library</th>
230
                [% IF ( itemdata_ccode ) %]<th>Collection</th>[% END %]
283
                [% IF ( itemdata_ccode ) %]<th>Collection</th>[% END %]
Lines 269-274 Link Here
269
                            [% item.translated_description | html %]
322
                            [% item.translated_description | html %]
270
                        </td>
323
                        </td>
271
                    [% END %]
324
                    [% END %]
325
                    [% IF ( show_summary_holdings ) %]
326
                        <td class="holding">[% Holdings.GetLocation(item.holding_id) | html %]</td>
327
                    [% END %]
272
                    <td class="location">[% UNLESS ( singlebranchmode ) %][% Branches.GetName( item.branchcode ) | html %] [% END %]</td>
328
                    <td class="location">[% UNLESS ( singlebranchmode ) %][% Branches.GetName( item.branchcode ) | html %] [% END %]</td>
273
                    <td class="homebranch">
329
                    <td class="homebranch">
274
                        [% Branches.GetName(item.homebranch) | html %]
330
                        [% Branches.GetName(item.homebranch) | html %]
Lines 963-974 Note that permanent location is a code, and location may be an authval. Link Here
963
                    $("input[name='itemnumber'][type='checkbox']", $("#"+tab)).prop('checked', false);
1019
                    $("input[name='itemnumber'][type='checkbox']", $("#"+tab)).prop('checked', false);
964
                    itemSelectionBuildActionLinks(tab);
1020
                    itemSelectionBuildActionLinks(tab);
965
                });
1021
                });
1022
1023
                $('a.delete').click(function() {
1024
                    return confirm(_("Are you sure?"));
1025
                });
966
            });
1026
            });
967
        [% END %]
1027
        [% END %]
968
1028
969
        $(document).ready(function() {
1029
        $(document).ready(function() {
970
            $('#bibliodetails').tabs();
1030
            $('#bibliodetails').tabs();
971
        [% IF count == 0 and ( Koha.Preference('HTML5MediaEnabled') == 'staff' or Koha.Preference('HTML5MediaEnabled') == 'both' ) %]
1031
        [% IF count == 0 and not show_summary_holdings and ( Koha.Preference('HTML5MediaEnabled') == 'staff' or Koha.Preference('HTML5MediaEnabled') == 'both' ) %]
972
            $('#bibliodetails').tabs("option", "active", $('#media_tab').index() );
1032
            $('#bibliodetails').tabs("option", "active", $('#media_tab').index() );
973
        [% END %]
1033
        [% END %]
974
            $('#search-form').focus();
1034
            $('#search-form').focus();
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt (+2 lines)
Lines 4-9 Link Here
4
[% USE Koha %]
4
[% USE Koha %]
5
[% USE Branches %]
5
[% USE Branches %]
6
[% USE Price %]
6
[% USE Price %]
7
[% USE Holdings %]
7
[% SET footerjs = 1 %]
8
[% SET footerjs = 1 %]
8
[% INCLUDE 'doc-head-open.inc' %]
9
[% INCLUDE 'doc-head-open.inc' %]
9
<title>Koha &rsaquo; Catalog &rsaquo; Item details for [% INCLUDE 'biblio-title-head.inc' %]</title>
10
<title>Koha &rsaquo; Catalog &rsaquo; Item details for [% INCLUDE 'biblio-title-head.inc' %]</title>
Lines 62-67 Link Here
62
         [% END %][% END %]</h4>
63
         [% END %][% END %]</h4>
63
            <div class="rows">
64
            <div class="rows">
64
            <ol class="bibliodetails">
65
            <ol class="bibliodetails">
66
            <li><span class="label">Holdings record:</span> [% Holdings.GetLocation( ITEM_DAT.holding_id ) | html %]&nbsp;</li>
65
            <li><span class="label">Home library:</span> [% Branches.GetName( ITEM_DAT.homebranch ) | html %]&nbsp;</li>
67
            <li><span class="label">Home library:</span> [% Branches.GetName( ITEM_DAT.homebranch ) | html %]&nbsp;</li>
66
	    [% IF ( item_level_itypes ) %]
68
	    [% IF ( item_level_itypes ) %]
67
            <li><span class="label">Item type:</span> [% ITEM_DAT.itype | html %]&nbsp;</li>
69
            <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 489-494 Link Here
489
490
490
                                            <td>
491
                                            <td>
491
                                                <div class="availability">
492
                                                <div class="availability">
493
                                                    [% IF ( SEARCH_RESULT.summary_holdings ) %]
494
                                                        <div class="holdings">
495
                                                            <strong>Holdings</strong>
496
                                                            <ul>
497
                                                            [% FOREACH holding IN SEARCH_RESULT.summary_holdings %]
498
                                                                <li>
499
                                                                    [% Holdings.GetLocation(holding) | html %]
500
                                                                </li>
501
                                                            [% END %]
502
                                                            </ul>
503
                                                        </div>
504
                                                    [% END %]
505
492
                                                    [% IF ( SEARCH_RESULT.items_count ) %]
506
                                                    [% IF ( SEARCH_RESULT.items_count ) %]
493
                                                        <strong>
507
                                                        <strong>
494
                                                            [% IF MaxSearchResultsItemsPerRecordStatusCheck && SEARCH_RESULT.items_count > MaxSearchResultsItemsPerRecordStatusCheck %]
508
                                                            [% IF MaxSearchResultsItemsPerRecordStatusCheck && SEARCH_RESULT.items_count > MaxSearchResultsItemsPerRecordStatusCheck %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addholding.tt (+617 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 'strings.inc' %]
10
[% Asset.js("js/browser.js") | $raw %]
11
[% Asset.css("css/addholding.css") | $raw %]
12
[% INCLUDE 'select2.inc' %]
13
</head>
14
<body id="cat_addholding" class="cat">
15
16
   <div id="loading">
17
       <div>Loading, please wait...</div>
18
   </div>
19
20
[% INCLUDE 'header.inc' %]
21
22
<div id="breadcrumbs">
23
          <a href="/cgi-bin/koha/mainpage.pl">Home</a>
24
 &rsaquo; <a href="/cgi-bin/koha/cataloguing/addbooks.pl">Cataloging</a>
25
 &rsaquo; Edit <a href="/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=[% biblionumber | uri %]">[% title | html %] [% IF ( author ) %] by [% author | html %][% END %] (Record #[% biblionumber | html %])</a>
26
 &rsaquo; <a href="/cgi-bin/koha/cataloguing/addholding.pl?biblionumber=[% biblionumber | uri %]">Holdings</a>
27
</div>
28
29
<div class="main container-fluid">
30
    <div class="row">
31
        <div class="col-md-10 col-md-offset-1">
32
33
<h1>
34
[% IF ( holding_id ) %]Editing holdings record number [% holding_id | html %]
35
[% ELSE %]Add holdings record
36
[% END %]
37
</h1>
38
39
[% IF ( error_items_exist ) %]<div class="dialog alert"><strong>This holdings record has items attached.</strong> Please delete them first.</div>[% END %]
40
[% IF ( error_delete_failed ) %]<div class="dialog alert"><strong>Error deleting the record.</strong></div>[% END %]
41
42
[% IF ( done ) %]
43
    <script>
44
        opener.document.forms['f'].holding_id.value=[% holding_id | html %];
45
        window.close();
46
    </script>
47
[% ELSE %]
48
    <form method="post" name="f" id="f" action="/cgi-bin/koha/cataloguing/addholding.pl" onsubmit="return Check();">
49
    <input type="hidden" value="[% IF ( holding_id ) %]view[% ELSE %]holdings[% END %]" id="redirect" name="redirect" />
50
    <input type="hidden" value="" id="current_tab" name="current_tab" />
51
[% END %]
52
53
<div id="toolbar" class="btn-toolbar">
54
    [% IF CAN_user_editcatalogue_edit_items %]
55
        <div class="btn-group">
56
            <button class="btn btn-default btn-sm" id="saverecord"><i class="fa fa-save"></i> Save</button>
57
            <button class="btn btn-default btn-sm dropdown-toggle" data-toggle="dropdown">
58
            <span class="caret"></span>
59
            </button>
60
            <ul class="dropdown-menu">
61
                <li><a id="saveandview" href="#">Save and view record</a></li>
62
                <li><a id="saveanditems" href="#">Save and edit items</a></li>
63
                <li><a id="saveandcontinue" href="#">Save and continue editing</a></li>
64
            </ul>
65
        </div>
66
    [% END %]
67
68
    <div class="btn-group">
69
        <button class="btn btn-default btn-sm dropdown-toggle" data-toggle="dropdown"><i class="fa fa-cog"></i> Settings <span class="caret"></span></button>
70
        <ul id="settings-menu" class="dropdown-menu">
71
            [% IF Koha.Preference( 'EnableAdvancedCatalogingEditor' ) == 1 %]
72
                [% # disabled until supported <li><a href="#" id="switcheditor">Switch to advanced editor</a></li> %]
73
            [% END %]
74
            [% IF marcflavour != 'NORMARC' AND NOT advancedMARCEditor %]
75
                <li>
76
                    <a href="#" id="marcDocsSelect"><i class="fa fa-check-square-o"></i> Show MARC tag documentation links</a>
77
                <li>
78
                    <a href="#" id="marcTagsSelect"><i class="fa fa-check-square-o"></i> Show tags</a>
79
                </li>
80
            [% END %]
81
            <li class="divider"></li>
82
            <li class="nav-header">Change framework</li>
83
            <li>
84
                <a href="#" class="change-framework" data-frameworkcode="">
85
                    [% IF ( frameworkcode ) %]
86
                       <i class="fa fa-fw">&nbsp;</i>
87
                    [% ELSE %]
88
                        <i class="fa fa-fw fa-check"></i>
89
                    [% END %]
90
                    Default
91
                </a>
92
            </li>
93
            [% FOREACH framework IN frameworks%]
94
                <li>
95
                    <a href="#" class="change-framework" data-frameworkcode="[% framework.frameworkcode | html %]">
96
                        [% IF framework.frameworkcode == frameworkcode %]
97
                            <i class="fa fa-fw fa-check"></i>
98
                        [% ELSE %]
99
                            <i class="fa fa-fw">&nbsp;</i>
100
                        [% END %]
101
                        [% framework.frameworktext | html %]
102
                    </a>
103
                </li>
104
            [% END %]
105
        </ul>
106
    </div>
107
    <div class="btn-group">
108
        <a class="btn btn-default btn-sm" id="cancel" href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblionumber | url %]">Cancel</a>
109
    </div>
110
</div>
111
112
[% IF ( popup ) %]
113
        <input type="hidden" name="mode" value="popup" />
114
[% END %]
115
        <input type="hidden" name="op" value="add" />
116
        <input type="hidden" id="frameworkcode" name="frameworkcode" value="[% frameworkcode | html %]" />
117
        <input type="hidden" name="biblionumber" value="[% biblionumber | html %]" />
118
        <input type="hidden" name="holding_id" value="[% holding_id | html %]" />
119
        <input type="hidden" name="changed_framework" value="" />
120
121
<div id="addholdingtabs" class="toptabs numbered">
122
    <ul>
123
        [% FOREACH BIG_LOO IN BIG_LOOP %]
124
        <li><a href="#tab[% BIG_LOO.number | uri %]XX">[% BIG_LOO.number | html %]</a></li>
125
        [% END %]
126
    </ul>
127
128
[% FOREACH BIG_LOO IN BIG_LOOP %]
129
    <div id="tab[% BIG_LOO.number | html %]XX">
130
131
    [% FOREACH innerloo IN BIG_LOO.innerloop %]
132
    [% IF ( innerloo.tag ) %]
133
    <div class="tag" id="tag_[% innerloo.tag | html %]_[% innerloo.index | html %][% innerloo.random | html %]">
134
        <div class="tag_title" id="div_indicator_tag_[% innerloo.tag | html %]_[% innerloo.index | html %][% innerloo.random | html %]">
135
            [% IF advancedMARCEditor %]
136
                <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 | html %]</a>
137
            [% ELSE %]
138
                <span class="tagnum" title="[% innerloo.tag_lib | html %]">[% innerloo.tag | html %]</span>
139
                [% IF marcflavour != 'NORMARC' %]<a href="#" class="marcdocs" onclick="PopupMARCFieldDoc('[% innerloo.tag | html %]'); return false;">&nbsp;?</a>[% END %]
140
            [% END %]
141
                [% IF ( innerloo.fixedfield ) %]
142
                    <input type="text"
143
                        tabindex="1"
144
                        class="indicator flat"
145
                        style="display:none;"
146
                        name="tag_[% innerloo.tag | html %]_indicator1_[% innerloo.index | html %][% innerloo.random | html %]"
147
                        size="1"
148
                        maxlength="1"
149
                        value="[% innerloo.indicator1 | html %]" />
150
                    <input type="text"
151
                        tabindex="1"
152
                        class="indicator flat"
153
                        style="display:none;"
154
                        name="tag_[% innerloo.tag | html %]_indicator2_[% innerloo.index | html %][% innerloo.random | html %]"
155
                        size="1"
156
                        maxlength="1"
157
                        value="[% innerloo.indicator2 | html %]" />
158
                [% ELSE %]
159
                    <input type="text"
160
                        tabindex="1"
161
                        class="indicator flat"
162
                        name="tag_[% innerloo.tag | html %]_indicator1_[% innerloo.index | html %][% innerloo.random | html %]"
163
                        size="1"
164
                        maxlength="1"
165
                        value="[% innerloo.indicator1 | html %]" />
166
                    <input type="text"
167
                        tabindex="1"
168
                        class="indicator flat"
169
                        name="tag_[% innerloo.tag | html %]_indicator2_[% innerloo.index | html %][% innerloo.random | html %]"
170
                        size="1"
171
                        maxlength="1"
172
                        value="[% innerloo.indicator2 | html %]" />
173
                [% END %] -
174
175
            [% UNLESS advancedMARCEditor %]
176
                <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>
177
            [% END %]
178
                <span class="field_controls">
179
                [% IF ( innerloo.repeatable ) %]
180
                    <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">
181
                        <img src="[% interface | html %]/[% theme | html %]/img/repeat-tag.png" alt="Repeat this Tag" />
182
                    </a>
183
                [% END %]
184
                    <a href="#" tabindex="1" class="buttonMinus" onclick="UnCloneField('tag_[% innerloo.tag | html %]_[% innerloo.index | html %][% innerloo.random | html %]'); return false;" title="Delete this Tag">
185
                        <img src="[% interface | html %]/[% theme | html %]/img/delete-tag.png" alt="Delete this Tag" />
186
                    </a>
187
                </span>
188
189
        </div>
190
191
        [% FOREACH subfield_loo IN innerloo.subfield_loop %]
192
            <!--  One line on the marc editor -->
193
            <div class="subfield_line" style="[% subfield_loo.visibility | html %]" id="subfield[% subfield_loo.tag | html %][% subfield_loo.subfield | html %][% subfield_loo.random | html %]">
194
195
                [% UNLESS advancedMARCEditor %]
196
                    [% 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">
197
                    [% ELSE %]<label for="tag_[% subfield_loo.tag | html %]_subfield_[% subfield_loo.subfield | html %]_[% subfield_loo.index | html %]_[% subfield_loo.index_subfield | html %]" class="labelsubfield">
198
                    [% END %]
199
                [% END %]
200
201
                <span class="subfieldcode">
202
                    [% IF ( subfield_loo.fixedfield ) %]
203
                        <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" />
204
                    [% ELSE %]
205
                        <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" />
206
                    [% END %]
207
                        <input type="text"
208
                            title="[% subfield_loo.marc_lib | html %]"
209
                            style=" [% IF ( subfield_loo.fixedfield ) %]display:none; [% END %]border:0;"
210
                            name="tag_[% subfield_loo.tag | html %]_code_[% subfield_loo.subfield | html %]_[% subfield_loo.index | html %]_[% subfield_loo.index_subfield | html %]"
211
                            value="[% subfield_loo.subfield | html %]"
212
                            size="1"
213
                            maxlength="1"
214
                            class="flat"
215
                            tabindex="0" />
216
                </span>
217
218
                [% UNLESS advancedMARCEditor %]
219
                    [% IF ( subfield_loo.mandatory ) %]<span class="subfield subfield_mandatory">[% ELSE %]<span class="subfield">[% END %]
220
                        [% subfield_loo.marc_lib | html %]
221
                        [% IF ( subfield_loo.mandatory ) %]<span class="mandatory_marker" title="This field is mandatory">*</span>[% END %]
222
                    </span>
223
                    </label>
224
                [% END %]
225
226
                [% SET mv = subfield_loo.marc_value %]
227
                [% IF ( mv.type == 'text' ) %]
228
                    [% IF ( mv.readonly == 1 ) %]
229
                    <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" />
230
                    [% ELSE %]
231
                    <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 -%]" />
232
                    [% END %]
233
                    [% IF ( mv.authtype ) %]
234
                    <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>
235
                    [% END %]
236
                [% ELSIF ( mv.type == 'text_complex' ) %]
237
                    <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 -%]" />
238
                    <span class="subfield_controls">
239
                        [% IF mv.noclick %]
240
                            <a href="#" class="buttonDot tag_editor disabled" tabindex="-1" title="No popup"></a>
241
                        [% ELSE %]
242
                            <a href="#" id="buttonDot_[% mv.id | html %]" class="buttonDot tag_editor framework_plugin" tabindex="1" title="Tag editor">Tag editor</a>
243
                        [% END %]
244
                    </span>
245
                    [% mv.javascript | $raw %]
246
                [% ELSIF ( mv.type == 'hidden' ) %]
247
                    <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 -%]" />
248
                [% ELSIF ( mv.type == 'textarea' ) %]
249
                    <textarea cols="70" rows="4" id="[%- mv.id | html -%]" name="[%- mv.name | html -%]" class="input_marceditor" tabindex="1">[%- mv.value | html -%]</textarea>
250
                [% ELSIF ( mv.type == 'select' ) %]
251
                    <select name="[%- mv.name | html -%]" tabindex="1" size="1" class="input_marceditor" id="[%- mv.id | html -%]">
252
                    [% FOREACH aval IN mv.values %]
253
                        [% IF aval == mv.default %]
254
                        <option value="[%- aval | html -%]" selected="selected">[%- mv.labels.$aval | html -%]</option>
255
                        [% ELSE %]
256
                        <option value="[%- aval | html -%]">[%- mv.labels.$aval | html -%]</option>
257
                        [% END %]
258
                    [% END %]
259
                    </select>
260
                [% END %]
261
262
                <span class="subfield_controls">
263
                [% IF ( subfield_loo.repeatable ) %]
264
                    <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;">
265
                        <img src="[% interface | html %]/[% theme | html %]/img/clone-subfield.png" alt="Clone" title="Clone this subfield" />
266
                    </a>
267
                    <a href="#" class="buttonMinus" tabindex="1" onclick="UnCloneField('subfield[% subfield_loo.tag | html %][% subfield_loo.subfield | html %][% subfield_loo.random | html %]'); return false;">
268
                        <img src="[% interface | html %]/[% theme | html %]/img/delete-subfield.png" alt="Delete" title="Delete this subfield" />
269
                    </a>
270
                [% END %]
271
                </span>
272
273
            </div>
274
            <!-- End of the line -->
275
        [% END %]
276
277
    </div>
278
    [% END %]<!-- if innerloo.tag -->
279
    [% END %]<!-- BIG_LOO.innerloop -->
280
    </div>
281
[% END %]<!-- BIG_LOOP -->
282
283
</div><!-- tabs -->
284
285
</form>
286
287
</div>
288
</div>
289
</div>
290
291
<script>
292
    var browser = KOHA.browser('[% searchid | html %]', parseInt('[% biblionumber | html %]', 10));
293
    browser.show();
294
295
    $(window).load(function() {
296
        $("#loading").hide();
297
    });
298
    var Sticky;
299
    $(document).ready(function() {
300
        $('#addholdingtabs').tabs().bind('show.ui-tabs', function(e, ui) {
301
            $("#"+ui.panel.id+" input:eq(0)").focus();
302
        });
303
304
        [% IF tab %]
305
            $('#addholdingtabs').selectTabByID("#[% tab | html %]");
306
        [% END %]
307
308
        Sticky = $("#toolbar");
309
        Sticky.hcSticky({
310
            stickTo: ".main",
311
            stickyClass: "floating"
312
        });
313
314
        /* check cookie to hide/show marcdocs*/
315
        if($.cookie("marcdocs_[% borrowernumber | html %]") == 'hide'){
316
            toggleMARCdocLinks(false);
317
        } else {
318
            toggleMARCdocLinks(true);
319
        }
320
321
        $("#marcDocsSelect").click(function(){
322
            if($.cookie("marcdocs_[% borrowernumber | html %]") == 'hide'){
323
                toggleMARCdocLinks(true);
324
            } else {
325
                toggleMARCdocLinks(false);
326
            }
327
        });
328
329
        /* check cookie to hide/show marc tags*/
330
        var marctags_cookie = $.cookie("marctags_[% borrowernumber | html %]");
331
        if (marctags_cookie == 'hide'){
332
            toggleMARCTagLinks(false);
333
        } else if( marctags_cookie == 'show'){
334
            toggleMARCTagLinks(true)
335
        } else {
336
            [% UNLESS Koha.Preference("hide_marc") %]
337
                toggleMARCTagLinks(true)
338
            [% ELSE %]
339
                toggleMARCTagLinks(false);
340
            [% END %]
341
        }
342
343
        $("#marcTagsSelect").click(function(){
344
            if( $.cookie("marctags_[% borrowernumber | html %]") == 'hide'){
345
                toggleMARCTagLinks(true)
346
            } else {
347
                toggleMARCTagLinks(false);
348
            }
349
        });
350
351
        $("#saverecord").click(function(){
352
            $(".btn-group").removeClass("open");
353
            onOption();
354
            return false;
355
        });
356
357
        $("#saveandview").click(function(){
358
            $(".btn-group").removeClass("open");
359
            redirect("view");
360
            return false;
361
        });
362
363
        $("#saveanditems").click(function(){
364
            $(".btn-group").removeClass("open");
365
            redirect("items");
366
            return false;
367
        });
368
        $("#saveandcontinue").click(function(){
369
            $(".btn-group").removeClass("open");
370
            var tab = $("#addholdingtabs li.ui-tabs-active:first a").attr('href');
371
            tab = tab.replace('#', '');
372
            $("#current_tab").val(tab);
373
            redirect("just_save", tab);
374
            return false;
375
        });
376
377
        $( '#switcheditor' ).click( function() {
378
379
            if ( !confirm( _("Any changes will not be saved. Continue?") ) ) return false;
380
381
            $.cookie( 'catalogue_editor_[% USER_INFO.borrowernumber | html %]', 'advanced', { expires: 365, path: '/' } );
382
383
            var holding_id = [% holding_id || "''" | html %];
384
            window.location = '/cgi-bin/koha/cataloguing/editor.pl#catalog/' + biblionumber + '/holdings/' + holding_id;
385
386
            return false;
387
        } );
388
        $(".change-framework").on("click", function(){
389
            var frameworkcode = $(this).data("frameworkcode");
390
            $("#frameworkcode").val( frameworkcode );
391
            Changefwk();
392
        });
393
    });
394
395
function redirect(dest){
396
    $("#redirect").attr("value",dest);
397
    return Check();
398
}
399
400
[% IF ( CAN_user_editcatalogue_edit_items ) %]
401
    var onOption = function () {
402
        return Check();
403
    }
404
[% END %]
405
406
function Dopop(link,i) {
407
    defaultvalue = document.getElementById(i).value;
408
    window.open(link+"&result="+defaultvalue,"valuebuilder",'width=700,height=550,toolbar=false,scrollbars=yes');
409
}
410
411
function PopupMARCFieldDoc(field) {
412
    [% IF ( marcflavour == 'MARC21' ) %]
413
        _MARC21FieldDoc(field);
414
    [% ELSIF ( marcflavour == 'UNIMARC' ) %]
415
        _UNIMARCFieldDoc(field);
416
    [% END %]
417
}
418
419
function _MARC21FieldDoc(field) {
420
    if(field == 0) {
421
        window.open("http://www.loc.gov/marc/holdings/hdleader.html");
422
    } else if (field < 900) {
423
        window.open("http://www.loc.gov/marc/holdings/hd" + ("000"+field).slice(-3) + ".html");
424
    } else {
425
        window.open("http://www.loc.gov/marc/holdings/hd9xx.html");
426
    }
427
}
428
429
function _UNIMARCFieldDoc(field) {
430
    /* http://archive.ifla.org/VI/3/p1996-1/ is an outdated version of UNIMARC, but
431
       seems to be the only version available that can be linked to per tag.  More recent
432
       versions of the UNIMARC standard are available on the IFLA website only as
433
       PDFs!
434
    */
435
    var url;
436
    if (field == 0) {
437
        url = "http://archive.ifla.org/VI/3/p1996-1/uni.htm";
438
    } else {
439
        var first = field.substring(0,1);
440
        url = "http://archive.ifla.org/VI/3/p1996-1/uni" + first + ".htm#";
441
        if (first == 0) url = url + "b";
442
        url = first == 9
443
              ? "http://archive.ifla.org/VI/3/p1996-1/uni9.htm"
444
              : url + field;
445
    }
446
    window.open(url);
447
}
448
449
/*
450
 * Functions to hide/show marc docs and tags links
451
 */
452
453
function toggleMARCdocLinks(flag){
454
    if( flag === true ){
455
        $(".marcdocs").show();
456
        $.cookie("marcdocs_[% borrowernumber | html %]",'show', { path: "/", expires: 365 });
457
        $("#marcDocsSelect i").addClass('fa-check-square-o').removeClass('fa-square-o');
458
    } else {
459
        $(".marcdocs").hide();
460
        $.cookie("marcdocs_[% borrowernumber | html %]",'hide', { path: "/", expires: 365 });
461
        $("#marcDocsSelect i").removeClass('fa-check-square-o').addClass('fa-square-o');
462
    }
463
}
464
465
function toggleMARCTagLinks(flag){
466
    if( flag === true ){
467
        $(".tagnum").show();
468
        $(".subfieldcode").show();
469
        $.cookie("marctags_[% borrowernumber | html %]",'show', { path: "/", expires: 365 });
470
        $("#marcTagsSelect i").addClass('fa-check-square-o').removeClass('fa-square-o');
471
    } else {
472
        $(".tagnum").hide();
473
        $(".subfieldcode").hide();
474
        $.cookie("marctags_[% borrowernumber | html %]",'hide', { path: "/", expires: 365 });
475
        $("#marcTagsSelect i").removeClass('fa-check-square-o').addClass('fa-square-o');
476
    }
477
}
478
479
/**
480
 * check if mandatory subfields are written
481
 */
482
function AreMandatoriesNotOk(){
483
    var mandatories = new Array();
484
    var mandatoriesfields = new Array();
485
    var tab = new Array();
486
    var label = new Array();
487
    var flag=0;
488
    var tabflag= new Array();
489
    [% FOREACH BIG_LOO IN BIG_LOOP %]
490
        [% FOREACH innerloo IN BIG_LOO.innerloop %]
491
            [% IF ( innerloo.mandatory ) %]
492
                mandatoriesfields.push(new Array("[% innerloo.tag | html %]","[% innerloo.index | html %][% innerloo.random | html %]","[% innerloo.index | html %]"));
493
            [% END %]
494
            [% FOREACH subfield_loo IN innerloo.subfield_loop %]
495
                [% IF ( subfield_loo.mandatory ) %]
496
                    mandatories.push("[% subfield_loo.id | html %]");
497
                    tab.push("[% BIG_LOO.number | html %]");
498
                    label.push("[% subfield_loo.marc_lib | $raw %]");
499
                [% END %]
500
            [% END %]
501
        [% END %]
502
    [% END %]
503
    var StrAlert = _("Can't save this record because the following field aren't filled:");
504
    StrAlert += "\n\n";
505
    for (var i=0,len=mandatories.length; i<len ; i++) {
506
        var tag=mandatories[i].substr(4,3);
507
        var subfield=mandatories[i].substr(17,1);
508
        var tagnumber=mandatories[i].substr(19,mandatories[i].lastIndexOf("_")-19);
509
        if (tabflag[tag+subfield+tagnumber] ==  null) {
510
            tabflag[tag+subfield+tagnumber]=new Array();
511
            tabflag[tag+subfield+tagnumber][0]=0;
512
        }
513
        if (tabflag[tag+subfield+tagnumber][0] != 1 && (document.getElementById(mandatories[i]) != null && ! document.getElementById(mandatories[i]).value || document.getElementById(mandatories[i]) == null)) {
514
            tabflag[tag+subfield+tagnumber][0] = 0 + tabflag[tag+subfield+tagnumber] ;
515
            document.getElementById(mandatories[i]).setAttribute('class','subfield_not_filled');
516
            $('#' + mandatories[i]).focus();
517
            tabflag[tag+subfield+tagnumber][1]=label[i];
518
            tabflag[tag+subfield+tagnumber][2]=tab[i];
519
        } else {
520
            tabflag[tag+subfield+tagnumber][0] = 1;
521
        }
522
    }
523
    for (var tagsubfieldid in tabflag) {
524
      if (tabflag[tagsubfieldid][0]==0) {
525
        var tag=tagsubfieldid.substr(0,3);
526
        var subfield=tagsubfieldid.substr(3,1);
527
        StrAlert += "\t* "+_("tag %s subfield %s %s in tab %s").format(tag, subfield, tabflag[tagsubfieldid][1], tabflag[tagsubfieldid][2]) + "\n";
528
        flag=1;
529
      }
530
    }
531
532
    /* Check for mandatories field(not subfields) */
533
    for (var i=0,len=mandatoriesfields.length; i<len; i++) {
534
        isempty  = true;
535
        arr      = mandatoriesfields[i];
536
        divid    = "tag_" + arr[0] + "_" + arr[1];
537
        varegexp = new RegExp("^tag_" + arr[0] + "_code_");
538
539
        if(parseInt(arr[0]) >= 10) {
540
            elem = document.getElementById(divid);
541
            eleminputs = elem.getElementsByTagName('input');
542
543
            for(var j=0,len2=eleminputs.length; j<len2; j++){
544
545
                if(eleminputs[j].name.match(varegexp) && eleminputs[j].value){
546
                        inputregexp = new RegExp("^tag_" + arr[0] + "_subfield_" + eleminputs[j].value + "_" + arr[2]);
547
548
                        for( var k=0; k<len2; k++){
549
                            if(eleminputs[k].id.match(inputregexp) && eleminputs[k].value){
550
                                isempty = false
551
                            }
552
                        }
553
554
                        elemselect = elem.getElementsByTagName('select');
555
                        for( var k=0; k<elemselect.length; k++){
556
                            if(elemselect[k].id.match(inputregexp) && elemselect[k].value){
557
                                isempty = false
558
                            }
559
                        }
560
                }
561
            }
562
563
            elemtextareas = elem.getElementsByTagName('textarea');
564
            for(var j=0,len2=elemtextareas.length; j<len2; j++){
565
                // this bit assumes that the only textareas in this context would be for subfields
566
                if (elemtextareas[j].value) {
567
                    isempty = false;
568
                }
569
            }
570
        } else {
571
            isempty = false;
572
        }
573
574
        if (isempty) {
575
            flag = 1;
576
                    StrAlert += "\t* " + _("Field %s is mandatory, at least one of its subfields must be filled.").format(arr[0]) + "\n";
577
        }
578
    }
579
580
    if (flag) {
581
        return StrAlert;
582
    } else {
583
        return flag;
584
    }
585
}
586
587
/**
588
 *
589
 *
590
 */
591
function Check(){
592
    var StrAlert = AreMandatoriesNotOk();
593
    if( ! StrAlert ){
594
        document.f.submit();
595
        return true;
596
    } else {
597
        alert(StrAlert);
598
        return false;
599
    }
600
}
601
602
function Changefwk() {
603
    var f = document.f;
604
    f.op.value = "[% op | html %]";
605
    f.biblionumber.value = "[% biblionumber | html %]";
606
    f.holding_id.value = "[% holding_iddata | html %]";
607
    f.changed_framework.value = "changed";
608
    f.submit();
609
}
610
611
$(document).ready(function() {
612
    $('.subfield_line select').select2();
613
});
614
</script>
615
616
617
[% INCLUDE 'intranet-bottom.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_008_holdings.tt (+193 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>
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
</script>
192
193
[% INCLUDE 'popup-bottom.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_leader_holdings.tt (+103 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>
84
    function report() {
85
        var doc   = opener.document;
86
        var field = doc.getElementById("[% index | html %]");
87
88
        field.value =
89
        '     '+
90
        document.f_pop.f5.value+
91
        document.f_pop.f6.value+
92
        '  '+
93
        'a'+ // MARC21 UNICODE flag - must be 'a' for Koha
94
        '22     '+
95
        document.f_pop.f17.value+
96
        document.f_pop.f18.value+
97
        ' '+
98
        '4500';
99
        self.close();
100
        return false;
101
    }
102
</script>
103
[% INCLUDE 'popup-bottom.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tt (+2 lines)
Lines 236-241 Link Here
236
                                                        <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% loopro.biblionumber | uri %]" title="Display detail for this biblio">Biblio [% loopro.biblionumber | html %]</a>
236
                                                        <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% loopro.biblionumber | uri %]" title="Display detail for this biblio">Biblio [% loopro.biblionumber | html %]</a>
237
                                                    [% ELSIF ( loopro.info.substr(0, 6) == 'biblio' ) %]
237
                                                    [% ELSIF ( loopro.info.substr(0, 6) == 'biblio' ) %]
238
                                                        <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% loopro.object | uri %]" title="Display detail for this biblio">Biblio [% loopro.object | html %]</a>
238
                                                        <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% loopro.object | uri %]" title="Display detail for this biblio">Biblio [% loopro.object | html %]</a>
239
                                                    [% ELSIF ( loopro.info.substr(0, 7) == 'holding' ) %]
240
                                                        <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>
239
                                                    [% ELSE %]
241
                                                    [% ELSE %]
240
                                                        [% loopro.object | html %]
242
                                                        [% loopro.object | html %]
241
                                                    [% END %]
243
                                                    [% 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 704-709 Link Here
704
                                [% END %]
705
                                [% END %]
705
                            [% END %]
706
                            [% END %]
706
                        [% END # IF itemloop.size %]
707
                        [% END # IF itemloop.size %]
708
                        [% IF summary_holdings %]
709
                            [% FOREACH holding IN summary_holdings %]
710
                                [% UNLESS holding.suppress %]
711
                                    [% holding_details = Holdings.GetDetails(holding) %]
712
                                    [% IF holding_details.public_note || holding_details.summary || holding_details.supplements || holding_details.indexes %]
713
                                        <span class="summary-holdings">
714
                                            <br>
715
                                            <strong>Additional information for [% Holdings.GetLocation(holding, 1) | html %]</strong>
716
                                            <ul>
717
                                                [% IF holding_details.public_note %]
718
                                                    <li>Public note: [% holding_details.public_note | html %]</li>
719
                                                [% END %]
720
                                                [% IF holding_details.summary %]
721
                                                    <li>Summary: [% holding_details.summary | html %]</li>
722
                                                [% END %]
723
                                                [% IF holding_details.supplements %]
724
                                                    <li>Supplements: [% holding_details.supplements | html %]</li>
725
                                                [% END %]
726
                                                [% IF holding_details.indexes %]
727
                                                    <li>Indexes: [% holding_details.indexes | html %]</li>
728
                                                [% END %]
729
                                            </ul>
730
                                        </span>
731
                                    [% END %]
732
                                [% END %]
733
                            [% END %]
734
                        [% END %]
707
                        [% PROCESS 'shelfbrowser.inc' %]
735
                        [% PROCESS 'shelfbrowser.inc' %]
708
                        [% INCLUDE shelfbrowser tab='holdings' %]
736
                        [% INCLUDE shelfbrowser tab='holdings' %]
709
                        <br style="clear:both;" />
737
                        <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 430-435 Link Here
430
                                                                    [% END %]
431
                                                                    [% END %]
431
                                                                [% ELSE %]
432
                                                                [% ELSE %]
432
                                                                    <span class="unavailable">No items available:</span>
433
                                                                    <span class="unavailable">No items available:</span>
434
                                                                    [% IF ( SEARCH_RESULT.summary_holdings ) %]
435
                                                                        <span class="summary-holdings">
436
                                                                            [% FOREACH holding IN SEARCH_RESULT.summary_holdings %]
437
                                                                                [% UNLESS holding.suppress %]
438
                                                                                    [% Holdings.GetLocation(holding, 1) | html %],
439
                                                                                [% END %]
440
                                                                            [% END %]
441
                                                                        </span>
442
                                                                    [% END %]
433
                                                                [% END %]
443
                                                                [% END %]
434
                                                            [% END # / IF SEARCH_RESULT.available_items_loop.size %]
444
                                                            [% END # / IF SEARCH_RESULT.available_items_loop.size %]
435
445
(-)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 1229-1235 Link Here
1229
                            </xsl:for-each>
1230
                            </xsl:for-each>
1230
                            (<xsl:value-of select="$AlternateHoldingsCount"/>)
1231
                            (<xsl:value-of select="$AlternateHoldingsCount"/>)
1231
                            </xsl:when>
1232
                            </xsl:when>
1232
                            <xsl:otherwise><span class="noitems">No items available </span> </xsl:otherwise>
1233
                            <xsl:otherwise>
1234
                                <span class="noitems">No items available </span>
1235
                                <xsl:if test="//holdings:holdings/holdings:holding/holdings:suppress[.='0']">:
1236
                                    <xsl:for-each select="//holdings:holdings/holdings:holding[./holdings:suppress='0']">
1237
                                        <xsl:if test="position() > 1">, </xsl:if>
1238
                                        <xsl:value-of select="./holdings:holdingbranch"/>
1239
                                        <xsl:if test="string-length(./holdings:location) > 0">
1240
                                        - <xsl:value-of select="./holdings:location"/>
1241
                                        </xsl:if>
1242
                                        <xsl:if test="string-length(./holdings:callnumber) > 0">
1243
                                        - <xsl:value-of select="./holdings:callnumber"/>
1244
                                        </xsl:if>
1245
                                    </xsl:for-each>
1246
                                </xsl:if>
1247
                            </xsl:otherwise>
1233
                        </xsl:choose>
1248
                        </xsl:choose>
1234
				   </xsl:when>
1249
				   </xsl:when>
1235
                   <xsl:when test="count(key('item-by-status', 'available'))>0">
1250
                   <xsl:when test="count(key('item-by-status', 'available'))>0">
(-)a/opac/opac-detail.pl (+7 lines)
Lines 749-754 if (scalar(@itemloop) == 0 || scalar(@otheritemloop) == 0) { Link Here
749
    }
749
    }
750
}
750
}
751
751
752
# Fetch summary holdings
753
if (C4::Context->preference('SummaryHoldings')) {
754
    my $summary_holdings = Koha::Holdings->search({ biblionumber => $biblionumber, deleted_on => undef });
755
    $template->param( summary_holdings => $summary_holdings );
756
}
757
758
752
## get notes and subjects from MARC record
759
## get notes and subjects from MARC record
753
if (!C4::Context->preference("OPACXSLTDetailsDisplay") ) {
760
if (!C4::Context->preference("OPACXSLTDetailsDisplay") ) {
754
    my $marcisbnsarray   = GetMarcISBN    ($record,$marcflavour);
761
    my $marcisbnsarray   = GetMarcISBN    ($record,$marcflavour);
(-)a/t/db_dependent/Koha/Holding.t (+156 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::BiblioFrameworks;
27
use Koha::Database;
28
use Koha::Libraries;
29
use Koha::Library;
30
use Koha::MarcSubfieldStructures;
31
32
BEGIN {
33
    use_ok('Koha::Holding');
34
    use_ok('Koha::Holdings');
35
}
36
37
my $schema = Koha::Database->new->schema;
38
39
subtest 'Koha::Holding tests' => sub {
40
41
    plan tests => 19;
42
43
    $schema->storage->txn_begin;
44
45
    # Add a framework
46
    my $frameworkcode = 'HLD';
47
    my $existing_mss = Koha::MarcSubfieldStructures->search({frameworkcode => $frameworkcode});
48
    $existing_mss->delete() if $existing_mss;
49
    my $existing_fw = Koha::BiblioFrameworks->find({frameworkcode => $frameworkcode});
50
    $existing_fw->delete() if $existing_fw;
51
    Koha::BiblioFramework->new({
52
        frameworkcode => $frameworkcode,
53
        frameworktext => 'Holdings'
54
    })->store();
55
    Koha::MarcSubfieldStructure->new({
56
        frameworkcode => $frameworkcode,
57
        tagfield => 852,
58
        tagsubfield => 'b',
59
        kohafield => 'holdings.holdingbranch'
60
    })->store();
61
    Koha::MarcSubfieldStructure->new({
62
        frameworkcode => $frameworkcode,
63
        tagfield => 852,
64
        tagsubfield => 'c',
65
        kohafield => 'holdings.location'
66
    })->store();
67
    Koha::MarcSubfieldStructure->new({
68
        frameworkcode => $frameworkcode,
69
        tagfield => 942,
70
        tagsubfield => 'n',
71
        kohafield => 'holdings.suppress'
72
    })->store();
73
    Koha::MarcSubfieldStructure->new({
74
        frameworkcode => $frameworkcode,
75
        tagfield => 999,
76
        tagsubfield => 'c',
77
        kohafield => 'biblio.biblionumber'
78
    })->store();
79
    Koha::MarcSubfieldStructure->new({
80
        frameworkcode => $frameworkcode,
81
        tagfield => 999,
82
        tagsubfield => 'e',
83
        kohafield => 'holdings.holding_id'
84
    })->store();
85
86
    # Add a branch
87
    Koha::Library->new({ branchcode => 'ABC', branchname => 'Abc' })->store() unless Koha::Libraries->find({ branchcode => 'ABC' });
88
89
    # Add a biblio
90
    my $title = 'Oranges and Peaches';
91
    my $record = MARC::Record->new();
92
    my $field = MARC::Field->new('245','','','a' => $title);
93
    $record->append_fields( $field );
94
    my ($biblionumber) = C4::Biblio::AddBiblio($record, '');
95
96
    # Add a holdings record
97
    my $holding_marc = MARC::Record->new();
98
    $holding_marc->append_fields(MARC::Field->new('852','','','b' => 'ABC', 'c' => 'DEF'));
99
    my $new_holding = Koha::Holding->new({ biblionumber => $biblionumber, frameworkcode => $frameworkcode });
100
    is ($new_holding->set_marc({record => $holding_marc}), $new_holding, 'set_marc() returns the object');
101
    is($new_holding->store(), $new_holding, 'store() returns the object on create');
102
    is(defined $new_holding->holding_id(), 1, 'Newly added holdings record has a holding_id');
103
104
    # Check that the added record can be found and looks right
105
    my $holding = Koha::Holdings->find($new_holding->holding_id());
106
    is(ref $holding, 'Koha::Holding', 'Found a Koha::Holding object');
107
    is($holding->frameworkcode(), $frameworkcode, 'Framework code correct in Koha::Holding object');
108
    is($holding->holdingbranch(), 'ABC', 'Location correct in Koha::Holding object');
109
110
    my $branch = $holding->holding_branch();
111
    is(ref $branch, 'Koha::Library', 'holding_branch() returns a Koha::Library object');
112
    is($branch->branchname(), 'Abc', 'holding_branch() returns correct library');
113
114
    my $metadata = $holding->metadata;
115
    is( ref $metadata, 'Koha::Holdings::Metadata', 'Method metadata() returned a Koha::Holdings::Metadata object');
116
117
    my $holding_marc2 = $metadata->record;
118
    is(ref $holding_marc2, 'MARC::Record', 'Method record() returned a MARC::Record object');
119
    is($holding_marc2->field('852')->subfield('b'), 'ABC', 'Location in 852$b matches location from original record object');
120
121
    # Test updating the record
122
    $holding_marc2->append_fields(MARC::Field->new('942','','','n' => '1'));
123
    is($holding->set_marc({record => $holding_marc2}), $holding, 'set_marc() returns the object on update');
124
    is($holding->store(), $holding, 'store() returns the object on update');
125
126
    is($holding->suppress(), 1, 'Holdings record is suppressed');
127
128
    # Test misc methods
129
    my %mapping = Koha::Holding->get_marc_field_mapping({ field => 'holdings.location' });
130
    is_deeply(
131
        \%mapping,
132
        {852 => 'c'},
133
        'get_marc_field_mapping returns correct data'
134
    );
135
136
    my $fields = Koha::Holding->marc_to_koha_fields({ record => $holding_marc2 });
137
    is_deeply(
138
        $fields,
139
        {
140
            holdingbranch => 'ABC',
141
            location => 'DEF',
142
            suppress => 1,
143
            holding_id => $new_holding->holding_id()
144
        },
145
        'marc_to_koha_fields returns correct data'
146
    );
147
148
    # Test deletion
149
    is(defined $holding->deleted_on(), '', 'Holdings record not marked as deleted');
150
    $holding->delete();
151
    $holding = Koha::Holdings->find($new_holding->holding_id());
152
    is(defined $holding->deleted_on(), 1, 'Holdings record marked as deleted');
153
    is(defined $holding->metadata()->deleted_on(), 1, 'Holdings metadata record marked as deleted');
154
155
    $schema->storage->txn_rollback;
156
};
(-)a/t/db_dependent/Koha/Holdings.t (+113 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::BiblioFrameworks;
27
use Koha::Database;
28
use Koha::MarcSubfieldStructures;
29
30
BEGIN {
31
    use_ok('Koha::Holdings');
32
}
33
34
my $schema = Koha::Database->new->schema;
35
36
subtest 'Koha::Holdings tests' => sub {
37
38
    plan tests => 3;
39
40
    $schema->storage->txn_begin;
41
42
    # Add a framework
43
    my $frameworkcode = 'HLD';
44
    my $existing_mss = Koha::MarcSubfieldStructures->search({frameworkcode => $frameworkcode});
45
    $existing_mss->delete() if $existing_mss;
46
    my $existing_fw = Koha::BiblioFrameworks->find({frameworkcode => $frameworkcode});
47
    $existing_fw->delete() if $existing_fw;
48
    Koha::BiblioFramework->new({
49
        frameworkcode => $frameworkcode,
50
        frameworktext => 'Holdings'
51
    })->store();
52
    Koha::MarcSubfieldStructure->new({
53
        frameworkcode => $frameworkcode,
54
        tagfield => 852,
55
        tagsubfield => 'b',
56
        kohafield => 'holdings.holdingbranch'
57
    })->store();
58
    Koha::MarcSubfieldStructure->new({
59
        frameworkcode => $frameworkcode,
60
        tagfield => 852,
61
        tagsubfield => 'c',
62
        kohafield => 'holdings.location'
63
    })->store();
64
    Koha::MarcSubfieldStructure->new({
65
        frameworkcode => $frameworkcode,
66
        tagfield => 999,
67
        tagsubfield => 'c',
68
        kohafield => 'biblio.biblionumber'
69
    })->store();
70
    Koha::MarcSubfieldStructure->new({
71
        frameworkcode => $frameworkcode,
72
        tagfield => 999,
73
        tagsubfield => 'e',
74
        kohafield => 'holdings.holding_id'
75
    })->store();
76
77
    # Add branches
78
    Koha::Library->new({ branchcode => 'ABC', branchname => 'Abc' })->store() unless Koha::Libraries->find({ branchcode => 'ABC' });
79
    Koha::Library->new({ branchcode => 'BCD', branchname => 'Bcd' })->store() unless Koha::Libraries->find({ branchcode => 'BCD' });
80
81
    # Add a biblio
82
    my $title = 'Oranges and Peaches';
83
    my $record = MARC::Record->new();
84
    my $field = MARC::Field->new('245','','','a' => $title);
85
    $record->append_fields( $field );
86
    my ($biblionumber) = C4::Biblio::AddBiblio($record, '');
87
88
    # Add a couple of holdings records
89
    my $holding_marc = MARC::Record->new();
90
    $holding_marc->append_fields(MARC::Field->new('852','','','b' => 'ABC', 'c' => 'DEF'));
91
    my $new_holding = Koha::Holding->new({ biblionumber => $biblionumber, frameworkcode => $frameworkcode });
92
    $new_holding->set_marc({record => $holding_marc})->store();
93
94
    $holding_marc = MARC::Record->new();
95
    $holding_marc->append_fields(MARC::Field->new('852','','','b' => 'BCD', 'c' => 'DEF'));
96
    $new_holding = Koha::Holding->new({ biblionumber => $biblionumber, frameworkcode => $frameworkcode });
97
    $new_holding->set_marc({record => $holding_marc})->store();
98
99
    # Add and delete a holdings record
100
    $holding_marc = MARC::Record->new();
101
    $holding_marc->append_fields(MARC::Field->new('852','','','b' => 'BCD', 'c' => 'DEF'));
102
    $new_holding = Koha::Holding->new({ biblionumber => $biblionumber, frameworkcode => $frameworkcode });
103
    $new_holding->set_marc({record => $holding_marc})->store();
104
    $new_holding->delete();
105
106
    # Test results
107
    my $fields = Koha::Holdings->get_embeddable_marc_fields({ biblionumber => $biblionumber});
108
    is(scalar(@{$fields}), 2, 'get_embeddable_marc_fields returns two fields');
109
    is($fields->[0]->as_string, 'ABC DEF', 'get_embeddable_marc_fields returns correct data in first field');
110
    is($fields->[1]->as_string, 'BCD DEF', 'get_embeddable_marc_fields returns correct data in second field');
111
112
    $schema->storage->txn_rollback;
113
};
(-)a/t/db_dependent/Koha/Item.t (-4 / +41 lines)
Lines 23-28 use Test::More tests => 5; Link Here
23
23
24
use C4::Biblio;
24
use C4::Biblio;
25
25
26
use Koha::Holdings;
26
use Koha::Items;
27
use Koha::Items;
27
use Koha::Database;
28
use Koha::Database;
28
29
Lines 333-341 subtest 'pickup_locations' => sub { Link Here
333
    $schema->storage->txn_rollback;
334
    $schema->storage->txn_rollback;
334
};
335
};
335
336
336
subtest 'move_to_biblio() tests' => sub {
337
subtest 'adopt_holdings_from_biblio() tests' => sub {
337
338
338
    plan tests => 12;
339
    plan tests => 19;
339
340
340
    $schema->storage->txn_begin;
341
    $schema->storage->txn_begin;
341
342
Lines 346-359 subtest 'move_to_biblio() tests' => sub { Link Here
346
347
347
    my $source_biblionumber = $source_biblio->biblionumber;
348
    my $source_biblionumber = $source_biblio->biblionumber;
348
349
350
    my $library = $builder->build_object({ class => 'Koha::Libraries' });
351
352
    my $holding_marc = MARC::Record->new();
353
    $holding_marc->append_fields(MARC::Field->new('852','','','b' => $library->branchcode));
354
    my $source_holding = Koha::Holding->new({ biblionumber => $source_biblionumber, frameworkcode => '' });
355
    $source_holding->set_marc({record => $holding_marc});
356
    $source_holding->store();
357
358
    my $standalone_holding = Koha::Holding->new({ biblionumber => $source_biblionumber, frameworkcode => '' });
359
    $standalone_holding->set_marc({record => $holding_marc});
360
    $standalone_holding->store();
361
349
    my $item1 = $builder->build_sample_item({ biblionumber => $source_biblionumber });
362
    my $item1 = $builder->build_sample_item({ biblionumber => $source_biblionumber });
363
    $item1->set({ holding_id => $source_holding->holding_id() })->store();
350
    my $item2 = $builder->build_sample_item({ biblionumber => $source_biblionumber });
364
    my $item2 = $builder->build_sample_item({ biblionumber => $source_biblionumber });
365
    $item2->set({ holding_id => $source_holding->holding_id() })->store();
351
366
352
    my $itemnumber1 = $item1->itemnumber;
367
    my $itemnumber1 = $item1->itemnumber;
353
    my $itemnumber2 = $item2->itemnumber;
368
    my $itemnumber2 = $item2->itemnumber;
354
369
355
    my $library = $builder->build_object({ class => 'Koha::Libraries' });
356
357
    my $patron = $builder->build_object({
370
    my $patron = $builder->build_object({
358
        class => 'Koha::Patrons',
371
        class => 'Koha::Patrons',
359
        value => { branchcode => $library->branchcode, }
372
        value => { branchcode => $library->branchcode, }
Lines 404-409 subtest 'move_to_biblio() tests' => sub { Link Here
404
    @result = $dbh->selectrow_array('SELECT biblionumber FROM items WHERE itemnumber = ?', undef, $itemnumber2);
417
    @result = $dbh->selectrow_array('SELECT biblionumber FROM items WHERE itemnumber = ?', undef, $itemnumber2);
405
    is($result[0], $source_biblionumber, 'Correct biblionumber in the unmoved item');
418
    is($result[0], $source_biblionumber, 'Correct biblionumber in the unmoved item');
406
419
420
    my $target_holdings = $target_biblio->holdings();
421
    is($target_holdings->count, 1, 'Holdings record created in target biblio');
422
423
    @result = $dbh->selectrow_array('SELECT holding_id FROM items WHERE itemnumber = ?', undef, $itemnumber1);
424
    is($result[0], $target_holdings->next()->holding_id(), 'Correct holding_id in the moved item');
425
426
    @result = $dbh->selectrow_array('SELECT holding_id FROM items WHERE itemnumber = ?', undef, $itemnumber2);
427
    is($result[0], $source_holding->holding_id(), 'Correct holding_id in the unmoved item');
428
407
    @result = $dbh->selectrow_array('SELECT biblionumber FROM aqorders WHERE ordernumber = ?', undef, $ordernumber1);
429
    @result = $dbh->selectrow_array('SELECT biblionumber FROM aqorders WHERE ordernumber = ?', undef, $ordernumber1);
408
    is($result[0], $target_biblio->biblionumber, 'Correct biblionumber in aqorders for order with the moved item');
430
    is($result[0], $target_biblio->biblionumber, 'Correct biblionumber in aqorders for order with the moved item');
409
431
Lines 434-438 subtest 'move_to_biblio() tests' => sub { Link Here
434
    @result = $dbh->selectrow_array('SELECT biblionumber FROM linktracker WHERE itemnumber = ?', undef, $itemnumber2);
456
    @result = $dbh->selectrow_array('SELECT biblionumber FROM linktracker WHERE itemnumber = ?', undef, $itemnumber2);
435
    is($result[0], $source_biblionumber, 'Correct biblionumber in linktracker for unmoved item');
457
    is($result[0], $source_biblionumber, 'Correct biblionumber in linktracker for unmoved item');
436
458
459
    @result = $dbh->selectrow_array('SELECT biblionumber FROM linktracker WHERE itemnumber = ?', undef, $itemnumber1);
460
    is($result[0], $target_biblio->biblionumber, 'Correct biblionumber in linktracker for moved item');
461
462
    @result = $dbh->selectrow_array('SELECT biblionumber FROM linktracker WHERE itemnumber = ?', undef, $itemnumber2);
463
    is($result[0], $source_biblionumber, 'Correct biblionumber in linktracker for unmoved item');
464
465
    # Move everything
466
    $target_biblio->adopt_holdings_from_biblio($source_biblio);
467
468
    @result = $dbh->selectrow_array('SELECT biblionumber FROM holdings WHERE holding_id = ?', undef, $standalone_holding->holding_id);
469
    is($result[0], $target_biblio->biblionumber, 'Correct biblionumber in the standalone holdings record');
470
471
    @result = $dbh->selectrow_array('SELECT holding_id FROM items WHERE itemnumber = ?', undef, $itemnumber2);
472
    is($result[0], $source_holding->holding_id(), 'Correct holding_id in the second moved item');
473
437
    $schema->storage->txn_rollback;
474
    $schema->storage->txn_rollback;
438
};
475
};
(-)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