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

(-)a/C4/Biblio.pm (-6 / +35 lines)
Lines 101-106 use Koha::Caches; Link Here
101
use Koha::Authority::Types;
101
use Koha::Authority::Types;
102
use Koha::Acquisition::Currencies;
102
use Koha::Acquisition::Currencies;
103
use Koha::Biblio::Metadatas;
103
use Koha::Biblio::Metadatas;
104
use Koha::Holdings;
104
use Koha::Holds;
105
use Koha::Holds;
105
use Koha::ItemTypes;
106
use Koha::ItemTypes;
106
use Koha::Plugins;
107
use Koha::Plugins;
Lines 1379-1384 sub GetAuthorisedValueDesc { Link Here
1379
            return $itemtype ? $itemtype->translated_description : q||;
1380
            return $itemtype ? $itemtype->translated_description : q||;
1380
        }
1381
        }
1381
1382
1383
        #---- holdings
1384
        if ( $tagslib->{$tag}->{$subfield}->{'authorised_value'} eq "holdings" ) {
1385
            my $holding = Koha::Holdings->find( $value );
1386
            if ( $holding ) {
1387
                my @parts;
1388
1389
                push @parts, $value;
1390
                push @parts, $holding->holdingbranch() if $holding->holdingbranch();
1391
                push @parts, $holding->location() if $holding->location();
1392
                push @parts, $holding->ccode() if $holding->ccode();
1393
                push @parts, $holding->callnumber() if $holding->callnumber();
1394
1395
                return join(' ', @parts);
1396
            }
1397
            return q||;
1398
        }
1399
1382
        #---- "true" authorized value
1400
        #---- "true" authorized value
1383
        $category = $tagslib->{$tag}->{$subfield}->{'authorised_value'};
1401
        $category = $tagslib->{$tag}->{$subfield}->{'authorised_value'};
1384
    }
1402
    }
Lines 2576-2589 sub ModZebra { Link Here
2576
=head2 EmbedItemsInMarcBiblio
2594
=head2 EmbedItemsInMarcBiblio
2577
2595
2578
    EmbedItemsInMarcBiblio({
2596
    EmbedItemsInMarcBiblio({
2579
        marc_record  => $marc,
2597
        marc_record   => $marc,
2580
        biblionumber => $biblionumber,
2598
        biblionumber  => $biblionumber,
2581
        item_numbers => $itemnumbers,
2599
        item_numbers  => $itemnumbers,
2582
        opac         => $opac });
2600
        opac          => $opac,
2601
        skip_holdings => 1 });
2583
2602
2584
Given a MARC::Record object containing a bib record,
2603
Given a MARC::Record object containing a bib record,
2585
modify it to include the items attached to it as 9XX
2604
modify it to include the items attached to it as 9XX
2586
per the bib's MARC framework.
2605
per the bib's MARC framework and any holdings location information.
2587
if $itemnumbers is defined, only specified itemnumbers are embedded.
2606
if $itemnumbers is defined, only specified itemnumbers are embedded.
2588
2607
2589
If $opac is true, then opac-relevant suppressions are included.
2608
If $opac is true, then opac-relevant suppressions are included.
Lines 2591-2601 If $opac is true, then opac-relevant suppressions are included. Link Here
2591
If opac filtering will be done, borcat should be passed to properly
2610
If opac filtering will be done, borcat should be passed to properly
2592
override if necessary.
2611
override if necessary.
2593
2612
2613
If $skip_holdings is set, it overrides the default of embedding basic
2614
location information from holdings records if summary holdings are
2615
enabled.
2616
2594
=cut
2617
=cut
2595
2618
2596
sub EmbedItemsInMarcBiblio {
2619
sub EmbedItemsInMarcBiblio {
2597
    my ($params) = @_;
2620
    my ($params) = @_;
2598
    my ($marc, $biblionumber, $itemnumbers, $opac, $borcat);
2621
    my ($marc, $biblionumber, $itemnumbers, $opac, $borcat, $skip_holdings);
2599
    $marc = $params->{marc_record};
2622
    $marc = $params->{marc_record};
2600
    if ( !$marc ) {
2623
    if ( !$marc ) {
2601
        carp 'EmbedItemsInMarcBiblio: No MARC record passed';
2624
        carp 'EmbedItemsInMarcBiblio: No MARC record passed';
Lines 2605-2613 sub EmbedItemsInMarcBiblio { Link Here
2605
    $itemnumbers = $params->{item_numbers};
2628
    $itemnumbers = $params->{item_numbers};
2606
    $opac = $params->{opac};
2629
    $opac = $params->{opac};
2607
    $borcat = $params->{borcat} // q{};
2630
    $borcat = $params->{borcat} // q{};
2631
    $skip_holdings = $params->{skip_holdings} // 0;
2608
2632
2609
    $itemnumbers = [] unless defined $itemnumbers;
2633
    $itemnumbers = [] unless defined $itemnumbers;
2610
2634
2635
    if ( !$skip_holdings && C4::Context->preference('SummaryHoldings') && !@$itemnumbers ) {
2636
        my $holdings_fields = Koha::Holdings->get_embeddable_marc_fields({ biblionumber => $biblionumber });
2637
        $marc->append_fields(@$holdings_fields) if ( @$holdings_fields );
2638
    }
2639
2611
    my $frameworkcode = GetFrameworkCode($biblionumber);
2640
    my $frameworkcode = GetFrameworkCode($biblionumber);
2612
    _strip_item_fields($marc, $frameworkcode);
2641
    _strip_item_fields($marc, $frameworkcode);
2613
2642
(-)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 75-80 use Koha::Database; Link Here
75
75
76
use Koha::Biblios;
76
use Koha::Biblios;
77
use Koha::Biblioitems;
77
use Koha::Biblioitems;
78
use Koha::Holdings;
78
use Koha::Items;
79
use Koha::Items;
79
use Koha::ItemTypes;
80
use Koha::ItemTypes;
80
use Koha::SearchEngine;
81
use Koha::SearchEngine;
Lines 402-407 sub _build_default_values_for_mod_marc { Link Here
402
        stocknumber              => undef,
403
        stocknumber              => undef,
403
        uri                      => undef,
404
        uri                      => undef,
404
        withdrawn                => 0,
405
        withdrawn                => 0,
406
        holding_id               => undef,
405
    };
407
    };
406
    my %default_values_for_mod_from_marc;
408
    my %default_values_for_mod_from_marc;
407
    while ( my ( $field, $default_value ) = each %$default_values ) {
409
    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 1592-1598 sub _koha_new_item { Link Here
1592
            more_subfields_xml  = ?,
1594
            more_subfields_xml  = ?,
1593
            copynumber          = ?,
1595
            copynumber          = ?,
1594
            stocknumber         = ?,
1596
            stocknumber         = ?,
1595
            new_status          = ?
1597
            new_status          = ?,
1598
            holding_id          = ?
1596
          ";
1599
          ";
1597
    my $sth = $dbh->prepare($query);
1600
    my $sth = $dbh->prepare($query);
1598
    my $today = output_pref({ dt => dt_from_string, dateformat => 'iso', dateonly => 1 });
1601
    my $today = output_pref({ dt => dt_from_string, dateformat => 'iso', dateonly => 1 });
Lines 1636-1641 sub _koha_new_item { Link Here
1636
            $item->{'copynumber'},
1639
            $item->{'copynumber'},
1637
            $item->{'stocknumber'},
1640
            $item->{'stocknumber'},
1638
            $item->{'new_status'},
1641
            $item->{'new_status'},
1642
            $item->{'holding_id'},
1639
    );
1643
    );
1640
1644
1641
    my $itemnumber;
1645
    my $itemnumber;
(-)a/C4/Search.pm (+8 lines)
Lines 31-36 use C4::Reserves; # GetReserveStatus Link Here
31
use C4::Debug;
31
use C4::Debug;
32
use C4::Charset;
32
use C4::Charset;
33
use Koha::AuthorisedValues;
33
use Koha::AuthorisedValues;
34
use Koha::Holdings;
34
use Koha::ItemTypes;
35
use Koha::ItemTypes;
35
use Koha::Libraries;
36
use Koha::Libraries;
36
use Koha::Patrons;
37
use Koha::Patrons;
Lines 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 (-1 / +45 lines)
Lines 160-165 sub _get_best_default_xslt_filename { Link Here
160
    return $xslfilename;
160
    return $xslfilename;
161
}
161
}
162
162
163
=head2 get_xslt_sysprefs
164
165
Returns XML for system preferences.
166
167
=cut
168
163
sub get_xslt_sysprefs {
169
sub get_xslt_sysprefs {
164
    my $sysxml = "<sysprefs>\n";
170
    my $sysxml = "<sysprefs>\n";
165
    foreach my $syspref ( qw/ hidelostitems OPACURLOpenInNewWindow
171
    foreach my $syspref ( qw/ hidelostitems OPACURLOpenInNewWindow
Lines 243-248 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  = buildKohaItemsNamespace($biblionumber, $hidden_items);
251
    my $itemsxml  = buildKohaItemsNamespace($biblionumber, $hidden_items);
252
    my $holdingsxml  = buildKohaHoldingsNamespace($biblionumber);
246
    my $xmlrecord = $record->as_xml(C4::Context->preference('marcflavour'));
253
    my $xmlrecord = $record->as_xml(C4::Context->preference('marcflavour'));
247
254
248
    $variables ||= {};
255
    $variables ||= {};
Lines 267-273 sub XSLTParse4Display { Link Here
267
    }
274
    }
268
    $varxml .= "</variables>\n";
275
    $varxml .= "</variables>\n";
269
276
270
    $xmlrecord =~ s/\<\/record\>/$itemsxml$sysxml$varxml\<\/record\>/;
277
    $xmlrecord =~ s/\<\/record\>/$itemsxml$holdingsxml$sysxml$varxml\<\/record\>/;
271
    if ($fixamps) { # We need to correct the ampersand entities that Zebra outputs
278
    if ($fixamps) { # We need to correct the ampersand entities that Zebra outputs
272
        $xmlrecord =~ s/\&amp;amp;/\&amp;/g;
279
        $xmlrecord =~ s/\&amp;amp;/\&amp;/g;
273
        $xmlrecord =~ s/\&amp\;lt\;/\&lt\;/g;
280
        $xmlrecord =~ s/\&amp\;lt\;/\&lt\;/g;
Lines 369-374 sub buildKohaItemsNamespace { Link Here
369
    return $xml;
376
    return $xml;
370
}
377
}
371
378
379
=head2 buildKohaHoldingsNamespace
380
381
Returns XML for holdings records.
382
Is only used in this module currently.
383
384
=cut
385
386
sub buildKohaHoldingsNamespace {
387
    my ($biblionumber) = @_;
388
389
    my $holdings = Koha::Holdings->search({ biblionumber => $biblionumber, deleted_on => undef })->as_list;
390
391
    my $shelflocations =
392
      { map { $_->{authorised_value} => $_->{opac_description} } Koha::AuthorisedValues->get_descriptions_by_koha_field( { frameworkcode => 'HLD', kohafield => 'holdings.location' } ) };
393
394
    my %branches = map { $_->branchcode => $_->branchname } Koha::Libraries->search({}, { order_by => 'branchname' });
395
396
    my $location = "";
397
    my $ccode = "";
398
    my $xml = '';
399
    foreach my $holding ( @{$holdings} ) {
400
        my $holdingbranch = $holding->{holdingbranch} ? xml_escape($branches{$holding->{holdingbranch}}) : '';
401
        my $location = $holding->{location} ? xml_escape($shelflocations->{$holding->{location}} || $holding->{location}) : '';
402
        my $callnumber = xml_escape($holding->{callnumber});
403
        my $suppress = $holding->{suppress} || '0';
404
        $xml .=
405
            "<holding>"
406
          . "<holdingbranch>$holdingbranch</holdingbranch>"
407
          . "<location>$location</location>"
408
          . "<callnumber>$callnumber</callnumber>"
409
          . "<suppress>$suppress</suppress>"
410
          . "</holding>";
411
    }
412
    $xml = "<holdings xmlns=\"http://www.koha-community.org/holdings\">$xml</holdings>";
413
    return $xml;
414
}
415
372
=head2 engine
416
=head2 engine
373
417
374
Returns reference to XSLT handler object.
418
Returns reference to XSLT handler object.
(-)a/Koha/Biblio.pm (-4 / +36 lines)
Lines 35-40 use Koha::ArticleRequest::Status; Link Here
35
use Koha::ArticleRequests;
35
use Koha::ArticleRequests;
36
use Koha::Biblio::Metadatas;
36
use Koha::Biblio::Metadatas;
37
use Koha::Biblioitems;
37
use Koha::Biblioitems;
38
use Koha::Holdings;
38
use Koha::IssuingRules;
39
use Koha::IssuingRules;
39
use Koha::Item::Transfer::Limits;
40
use Koha::Item::Transfer::Limits;
40
use Koha::Items;
41
use Koha::Items;
Lines 427-432 sub subscriptions { Link Here
427
    return $self->{_subscriptions};
428
    return $self->{_subscriptions};
428
}
429
}
429
430
431
=head3 holdings
432
433
my $holdings = $self->holdings
434
435
Returns the related Koha::Holdings object for this Biblio object
436
437
=cut
438
439
sub holdings {
440
    my ($self) = @_;
441
442
    $self->{_holdings} ||= Koha::Holdings->search( { biblionumber => $self->biblionumber } );
443
444
    return $self->{_holdings};
445
}
446
447
430
=head3 has_items_waiting_or_intransit
448
=head3 has_items_waiting_or_intransit
431
449
432
my $itemsWaitingOrInTransit = $biblio->has_items_waiting_or_intransit
450
my $itemsWaitingOrInTransit = $biblio->has_items_waiting_or_intransit
Lines 659-683 sub is_serial { Link Here
659
    return 0;
677
    return 0;
660
}
678
}
661
679
662
=head3 move_items_from_biblio
680
=head3 move_holdings_from_biblio
663
681
664
$biblio->move_items_from_biblio($from_biblio);
682
$biblio->move_holdings_from_biblio($from_biblio);
665
683
666
Move items from the given biblio
684
Move holdings and item records from the given biblio
667
685
668
=cut
686
=cut
669
687
670
sub move_items_from_biblio {
688
sub move_holdings_from_biblio {
671
    my ( $self, $from_biblio ) = @_;
689
    my ( $self, $from_biblio ) = @_;
672
690
691
    my $schema = Koha::Database->new()->schema();
692
693
    $schema->storage->txn_begin;
694
695
    # Move holdings records. This will also move any items attached to the holdings.
696
    my $holdings = $from_biblio->holdings;
697
    while (my $holding = $holdings->next()) {
698
        $holding->move_to_biblio($self);
699
    }
700
    # Move any items not already moved.
673
    my $items = $from_biblio->items;
701
    my $items = $from_biblio->items;
674
    if ($items) {
702
    if ($items) {
675
        while (my $item = $items->next()) {
703
        while (my $item = $items->next()) {
676
            $item->move_to_biblio($self);
704
            $item->move_to_biblio($self);
677
        }
705
        }
706
    }
707
    if ($items || $holdings) {
678
        C4::Biblio::ModZebra( $self->biblionumber, "specialUpdate", "biblioserver" );
708
        C4::Biblio::ModZebra( $self->biblionumber, "specialUpdate", "biblioserver" );
679
        C4::Biblio::ModZebra( $from_biblio->biblionumber, "specialUpdate", "biblioserver" );
709
        C4::Biblio::ModZebra( $from_biblio->biblionumber, "specialUpdate", "biblioserver" );
680
    }
710
    }
711
712
    $schema->storage->txn_commit;
681
}
713
}
682
714
683
=head3 type
715
=head3 type
(-)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 28-33 use Koha::DateUtils qw( dt_from_string ); Link Here
28
use C4::Context;
28
use C4::Context;
29
29
30
use Koha::Checkouts;
30
use Koha::Checkouts;
31
use Koha::Holdings;
31
use Koha::IssuingRules;
32
use Koha::IssuingRules;
32
use Koha::Item::Transfer::Limits;
33
use Koha::Item::Transfer::Limits;
33
use Koha::Item::Transfers;
34
use Koha::Item::Transfers;
Lines 112-117 sub biblioitem { Link Here
112
    return Koha::Biblioitem->_new_from_dbic( $biblioitem_rs );
113
    return Koha::Biblioitem->_new_from_dbic( $biblioitem_rs );
113
}
114
}
114
115
116
=head3 holding
117
118
my $holding = $item->holding;
119
120
Return the holdings record of this item
121
122
=cut
123
124
sub holding {
125
    my ( $self ) = @_;
126
    my $holding_rs = $self->_result->holding;
127
    return Koha::Holding->_new_from_dbic( $holding_rs );
128
}
129
115
=head3 checkout
130
=head3 checkout
116
131
117
my $checkout = $item->checkout;
132
my $checkout = $item->checkout;
Lines 446-452 sub move_to_biblio { Link Here
446
    $self->set({
461
    $self->set({
447
        biblionumber => $biblionumber,
462
        biblionumber => $biblionumber,
448
        biblioitemnumber => $to_biblio->biblioitem->biblioitemnumber
463
        biblioitemnumber => $to_biblio->biblioitem->biblioitemnumber
449
    })->store();
464
    });
450
465
451
    my $schema = Koha::Database->new()->schema();
466
    my $schema = Koha::Database->new()->schema();
452
467
Lines 483-488 sub move_to_biblio { Link Here
483
    # linktrackers
498
    # linktrackers
484
    my $linktrackers = $schema->resultset('Linktracker')->search({ itemnumber => $self->itemnumber });
499
    my $linktrackers = $schema->resultset('Linktracker')->search({ itemnumber => $self->itemnumber });
485
    $linktrackers->update_all({ biblionumber => $biblionumber });
500
    $linktrackers->update_all({ biblionumber => $biblionumber });
501
502
    # holdings
503
    my $holding = $self->holding;
504
    if ($holding) {
505
        # Check if there's a suitable holdings record in the new biblio.
506
        # This is not perfect, but at least we try.
507
        my $candidates = Koha::Holdings->search(
508
            {
509
                biblionumber     => $biblionumber,
510
                frameworkcode    => $holding->frameworkcode(),
511
                holdingbranch    => $holding->holdingbranch(),
512
                location         => $holding->location(),
513
                callnumber       => $holding->callnumber(),
514
                suppress         => $holding->suppress(),
515
                deleted_on       => undef
516
            }
517
        );
518
        my $newHolding = $candidates->next();
519
        if (!$newHolding) {
520
            # No existing holdings record, make a copy of the old one.
521
            $newHolding = Koha::Holding->new({
522
                biblionumber => $biblionumber,
523
                frameworkcode => $holding->frameworkcode()
524
            });
525
            $newHolding->set_marc({ record => $holding->metadata()->record() });
526
            $newHolding->store();
527
        }
528
        $self->set({
529
            holding_id => $newHolding->holding_id()
530
        });
531
    }
532
533
    $self->store();
486
}
534
}
487
535
488
=head2 Internal methods
536
=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 116-121 sub find_or_create { Link Here
116
    return $object;
116
    return $object;
117
}
117
}
118
118
119
=head3 Koha::Objects->find_or_new();
120
121
my $object = Koha::Objects->find_or_new( $attrs );
122
123
=cut
124
125
sub find_or_new {
126
    my ( $self, $params ) = @_;
127
128
    my $result = $self->_resultset->find_or_new($params);
129
130
    return unless $result;
131
132
    my $object = $self->object_class->_new_from_dbic($result);
133
134
    return $object;
135
}
136
119
=head3 Koha::Objects->search();
137
=head3 Koha::Objects->search();
120
138
121
my @objects = Koha::Objects->search($params);
139
my @objects = Koha::Objects->search($params);
(-)a/Koha/Template/Plugin/Holdings.pm (+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 42-47 use C4::CourseReserves qw(GetItemCourseReservesInfo); Link Here
42
use C4::Acquisition qw(GetOrdersByBiblionumber);
42
use C4::Acquisition qw(GetOrdersByBiblionumber);
43
use Koha::AuthorisedValues;
43
use Koha::AuthorisedValues;
44
use Koha::Biblios;
44
use Koha::Biblios;
45
use Koha::Holdings;
45
use Koha::Items;
46
use Koha::Items;
46
use Koha::ItemTypes;
47
use Koha::ItemTypes;
47
use Koha::Patrons;
48
use Koha::Patrons;
Lines 192-197 foreach my $subscription (@subscriptions) { Link Here
192
    push @subs, \%cell;
193
    push @subs, \%cell;
193
}
194
}
194
195
196
# Summary holdings
197
my $summary_holdings;
198
if (C4::Context->preference('SummaryHoldings')) {
199
    $summary_holdings = Koha::Holdings->search({ biblionumber => $biblionumber, deleted_on => undef });
200
}
195
201
196
# Get acquisition details
202
# Get acquisition details
197
if ( C4::Context->preference('AcquisitionDetails') ) {
203
if ( C4::Context->preference('AcquisitionDetails') ) {
Lines 384-396 $template->param( Link Here
384
    itemdata_copynumber => $itemfields{copynumber},
390
    itemdata_copynumber => $itemfields{copynumber},
385
    itemdata_stocknumber => $itemfields{stocknumber},
391
    itemdata_stocknumber => $itemfields{stocknumber},
386
    volinfo                => $itemfields{enumchron},
392
    volinfo                => $itemfields{enumchron},
387
        itemdata_itemnotes  => $itemfields{itemnotes},
393
    itemdata_itemnotes  => $itemfields{itemnotes},
388
        itemdata_nonpublicnotes => $itemfields{itemnotes_nonpublic},
394
    itemdata_nonpublicnotes => $itemfields{itemnotes_nonpublic},
389
    z3950_search_params    => C4::Search::z3950_search_args($dat),
395
    z3950_search_params    => C4::Search::z3950_search_args($dat),
390
        hostrecords         => $hostrecords,
396
    hostrecords         => $hostrecords,
391
    analytics_flag    => $analytics_flag,
397
    analytics_flag      => $analytics_flag,
392
    C4::Search::enabled_staff_search_views,
398
    C4::Search::enabled_staff_search_views,
393
        materials       => $materials_flag,
399
    materials       => $materials_flag,
400
    show_summary_holdings => C4::Context->preference('SummaryHoldings') ? 1 : 0,
401
    summary_holdings    => $summary_holdings,
394
);
402
);
395
403
396
if (C4::Context->preference("AlternateHoldingsField") && scalar @items == 0) {
404
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 220-225 sub generate_subfield_form { Link Here
220
        
221
        
221
                  #---- "true" authorised value
222
                  #---- "true" authorised value
222
            }
223
            }
224
            elsif ( $subfieldlib->{authorised_value} eq "holdings" ) {
225
                push @authorised_values, "" unless ( $subfieldlib->{mandatory} );
226
                my $holdings = Koha::Holdings->search({ biblionumber => $biblionumber, deleted_on => undef }, { order_by => ['holdingbranch'] })->unblessed;
227
                for my $holding ( @$holdings ) {
228
                    push @authorised_values, $holding->{holding_id};
229
                    $authorised_lib{$holding->{holding_id}} = $holding->{holding_id} . ' ' . $holding->{holdingbranch} . ' ' . $holding->{location} . ' ' . $holding->{ccode} . ' ' . $holding->{callnumber};
230
                }
231
                my $input = new CGI;
232
                $value = $input->param('holding_id') unless ($value);
233
            }
223
            else {
234
            else {
224
                  push @authorised_values, qq{};
235
                  push @authorised_values, qq{};
225
                  my $av = GetAuthorisedValues( $subfieldlib->{authorised_value} );
236
                  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->move_items_from_biblio($from_biblio);
93
        $biblio->move_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 move_items_from_biblio)
163
    # Moving orders (orders linked to items of frombiblio have already been moved by move_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 4646-4648 SELECT tagfield, tagsubfield, liblibrarian, libopac, repeatable, mandatory, koha Link Here
4646
FROM marc_subfield_structure
4648
FROM marc_subfield_structure
4647
WHERE frameworkcode=""
4649
WHERE frameworkcode=""
4648
AND kohafield IN ("biblio.title", "biblio.author", "biblioitems.publishercode", "biblioitems.editionstatement", "biblio.copyrightdate", "biblioitems.isbn", "biblio.seriestitle" );
4650
AND kohafield IN ("biblio.title", "biblio.author", "biblioitems.publishercode", "biblioitems.editionstatement", "biblio.copyrightdate", "biblioitems.isbn", "biblio.seriestitle" );
4651
4652
4653
-- HOLDINGS RECORD FRAMEWORK
4654
4655
INSERT IGNORE INTO `biblio_framework` VALUES ('HLD', 'Default holdings framework');
4656
INSERT IGNORE INTO `marc_tag_structure` (`tagfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `authorised_value`, `frameworkcode`) VALUES
4657
        ('999', 'SYSTEM CONTROL NUMBERS (KOHA)', 'SYSTEM CONTROL NUMBERS (KOHA)', 1, 0, '', 'HLD');
4658
4659
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
4660
        ('999', 'c', 'Koha biblionumber', 'Koha biblionumber', 0, 0, 'biblio.biblionumber', -1, NULL, NULL, '', NULL, -5, 'HLD', '', '', NULL),
4661
        ('999', 'e', 'Koha holding_id', 'Koha holding_id', 0, 0, 'holdings.holding_id', -1, NULL, NULL, '', NULL, -5, 'HLD', '', '', NULL);
4662
4663
4664
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
4665
        ('942', 'n', 'Suppress in OPAC', 'Suppress in OPAC', 0, 0, 'holdings.suppress', 9, '', '', '', 0, 0, 'HLD', '', '', NULL);
4666
4667
INSERT IGNORE INTO `marc_tag_structure` (`tagfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `authorised_value`, `frameworkcode`) VALUES
4668
        ('000', 'LEADER', 'LEADER', 0, 1, '', 'HLD'),
4669
        ('001', 'CONTROL NUMBER', 'CONTROL NUMBER', 0, 0, '', 'HLD'),
4670
        ('003', 'CONTROL NUMBER IDENTIFIER', 'CONTROL NUMBER IDENTIFIER', 0, 1, '', 'HLD'),
4671
        ('005', 'DATE AND TIME OF LATEST TRANSACTION', 'DATE AND TIME OF LATEST TRANSACTION', 0, 1, '', 'HLD'),
4672
        ('006', 'FIXED-LENGTH DATA ELEMENTS--ADDITIONAL MATERIAL CHARACTERISTICS', 'FIXED-LENGTH DATA ELEMENTS--ADDITIONAL MATERIAL CHARACTERISTICS', 1, 0, '', 'HLD'),
4673
        ('007', 'PHYSICAL DESCRIPTION FIXED FIELD--GENERAL INFORMATION', 'PHYSICAL DESCRIPTION FIXED FIELD--GENERAL INFORMATION', 1, 0, '', 'HLD'),
4674
        ('008', 'FIXED-LENGTH DATA ELEMENTS--GENERAL INFORMATION', 'FIXED-LENGTH DATA ELEMENTS--GENERAL INFORMATION', 0, 1, '', 'HLD');
4675
4676
INSERT IGNORE INTO `marc_tag_structure` (`tagfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `authorised_value`, `frameworkcode`) VALUES
4677
        ('010', 'LIBRARY OF CONGRESS CONTROL NUMBER', 'LIBRARY OF CONGRESS CONTROL NUMBER', 0, 0, '', 'HLD'),
4678
        ('014', 'LINKAGE NUMBER', 'LINKAGE NUMBER', 1, 0, '', 'HLD'),
4679
        ('016', 'NATIONAL BIBLIOGRAPHIC AGENCY CONTROL NUMBER', 'NATIONAL BIBLIOGRAPHIC AGENCY CONTROL NUMBER', 1, 0, '', 'HLD'),
4680
        ('017', 'COPYRIGHT OR LEGAL DEPOSIT NUMBER', 'COPYRIGHT OR LEGAL DEPOSIT NUMBER', 1, 0, '', 'HLD'),
4681
        ('020', 'INTERNATIONAL STANDARD BOOK NUMBER', 'INTERNATIONAL STANDARD BOOK NUMBER', 1, 0, NULL, 'HLD'),
4682
        ('022', 'INTERNATIONAL STANDARD SERIAL NUMBER', 'INTERNATIONAL STANDARD SERIAL NUMBER', 1, 0, NULL, 'HLD'),
4683
        ('024', 'OTHER STANDARD IDENTIFIER', 'OTHER STANDARD IDENTIFIER', 1, 0, NULL, 'HLD'),
4684
        ('027', 'STANDARD TECHNICAL REPORT NUMBER', 'STANDARD TECHNICAL REPORT NUMBER', 1, 0, '', 'HLD'),
4685
        ('030', 'CODEN DESIGNATION', 'CODEN DESIGNATION', 1, 0, '', 'HLD'),
4686
        ('035', 'SYSTEM CONTROL NUMBER', 'SYSTEM CONTROL NUMBER', 1, 0, NULL, 'HLD'),
4687
        ('040', 'CATALOGING SOURCE', 'CATALOGING SOURCE', 0, 1, NULL, 'HLD'),
4688
        ('066', 'CHARACTER SETS PRESENT', 'CHARACTER SETS PRESENT', 0, 0, NULL, 'HLD'),
4689
        ('337', 'MEDIA TYPE', 'MEDIA TYPE', 1, 0, NULL, 'HLD'),
4690
        ('338', 'CARRIER TYPE', 'CARRIER TYPE', 1, 0, NULL, 'HLD'),
4691
        ('347', 'DIGITAL FILE CHARACTERISTICS', 'DIGITAL FILE CHARACTERISTICS', 1, 0, NULL, 'HLD'),
4692
        ('506', 'RESTRICTIONS ON ACCESS NOTE', 'RESTRICTIONS ON ACCESS NOTE', 1, 0, NULL, 'HLD'),
4693
        ('538', 'SYSTEM DETAILS NOTE', 'SYSTEM DETAILS NOTE', 1, 0, NULL, 'HLD'),
4694
        ('541', 'IMMEDIATE SOURCE OF ACQUISITION NOTE', 'IMMEDIATE SOURCE OF ACQUISITION NOTE', 1, 0, NULL, 'HLD'),
4695
        ('561', 'OWNERSHIP AND CUSTODIAL HISTORY', 'OWNERSHIP AND CUSTODIAL HISTORY', 1, 0, NULL, 'HLD'),
4696
        ('562', 'COPY AND VERSION IDENTIFICATION NOTE', 'COPY AND VERSION IDENTIFICATION NOTE', 1, 0, NULL, 'HLD'),
4697
        ('563', 'BINDING INFORMATION', 'BINDING INFORMATION', 1, 0, NULL, 'HLD'),
4698
        ('583', 'ACTION NOTE', 'ACTION NOTE', 1, 0, NULL, 'HLD'),
4699
        ('842', 'TEXTUAL PHYSICAL FORM DESIGNATOR', 'TEXTUAL PHYSICAL FORM DESIGNATOR', 0, 0, NULL, 'HLD'),
4700
        ('843', 'REPRODUCTION NOTE', 'REPRODUCTION NOTE', 1, 0, NULL, 'HLD'),
4701
        ('844', 'NAME OF UNIT', 'NAME OF UNIT', 0, 0, NULL, 'HLD'),
4702
        ('845', 'TERMS GOVERNING USE AND REPRODUCTION NOTE', 'TERMS GOVERNING USE AND REPRODUCTION NOTE', 1, 0, NULL, 'HLD'),
4703
        ('850', 'HOLDING INSTITUTION', 'HOLDING INSTITUTION', 1, 0, NULL, 'HLD'),
4704
        ('852', 'LOCATION', 'LOCATION', 1, 0, NULL, 'HLD'),
4705
        ('853', 'CAPTIONS AND PATTERN--BASIC BIBLIOGRAPHIC UNIT', 'CAPTIONS AND PATTERN--BASIC BIBLIOGRAPHIC UNIT', 1, 0, NULL, 'HLD'),
4706
        ('854', 'CAPTIONS AND PATTERN--SUPPLEMENTARY MATERIAL', 'CAPTIONS AND PATTERN--SUPPLEMENTARY MATERIAL', 1, 0, NULL, 'HLD'),
4707
        ('855', 'CAPTIONS AND PATTERN--INDEXES', 'CAPTIONS AND PATTERN--INDEXES', 1, 0, NULL, 'HLD'),
4708
        ('856', 'ELECTRONIC LOCATION AND ACCESS', 'ELECTRONIC LOCATION AND ACCESS', 1, 0, NULL, 'HLD'),
4709
        ('863', 'ENUMERATION AND CHRONOLOGY--BASIC BIBLIOGRAPHIC UNIT', 'ENUMERATION AND CHRONOLOGY--BASIC BIBLIOGRAPHIC UNIT', 1, 0, NULL, 'HLD'),
4710
        ('864', 'ENUMERATION AND CHRONOLOGY--SUPPLEMENTARY MATERIAL', 'ENUMERATION AND CHRONOLOGY--SUPPLEMENTARY MATERIAL', 1, 0, NULL, 'HLD'),
4711
        ('865', 'ENUMERATION AND CHRONOLOGY--INDEXES', 'ENUMERATION AND CHRONOLOGY--INDEXES', 1, 0, NULL, 'HLD'),
4712
        ('866', 'TEXTUAL HOLDINGS--BASIC BIBLIOGRAPHIC UNIT', 'TEXTUAL HOLDINGS--BASIC BIBLIOGRAPHIC UNIT', 1, 0, NULL, 'HLD'),
4713
        ('867', 'TEXTUAL HOLDINGS--SUPPLEMENTARY MATERIAL', 'TEXTUAL HOLDINGS--SUPPLEMENTARY MATERIAL', 1, 0, NULL, 'HLD'),
4714
        ('868', 'TEXTUAL HOLDINGS--INDEXES', 'TEXTUAL HOLDINGS--INDEXES', 1, 0, NULL, 'HLD'),
4715
        ('876', 'ITEM INFORMATION--BASIC BIBLIOGRAPHIC UNIT', 'ITEM INFORMATION--BASIC BIBLIOGRAPHIC UNIT', 1, 0, NULL, 'HLD'),
4716
        ('877', 'ITEM INFORMATION--SUPPLEMENTARY MATERIAL', 'ITEM INFORMATION--SUPPLEMENTARY MATERIAL', 1, 0, NULL, 'HLD'),
4717
        ('878', 'ITEM INFORMATION--INDEXES', 'ITEM INFORMATION--INDEXES', 1, 0, NULL, 'HLD');
4718
4719
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
4720
        ('000', '@', 'fixed length control field', 'fixed length control field', 0, 1, '', 0, '', '', 'marc21_leader_holdings.pl', 0, 0, 'HLD', '', '', NULL),
4721
        ('001', '@', 'control field', 'control field', 0, 0, '', 0, '', '', '', 0, 0, 'HLD', '', '', NULL),
4722
        ('003', '@', 'control field', 'control field', 0, 1, '', 0, '', '', 'marc21_orgcode.pl', 0, 0, 'HLD', '', '', NULL),
4723
        ('005', '@', 'control field', 'control field', 0, 1, '', 0, '', '', 'marc21_field_005.pl', 0, 0, 'HLD', '', '', NULL),
4724
        ('006', '@', 'fixed length control field', 'fixed length control field', 0, 0, '', 0, '', '', 'marc21_field_006.pl', 0, -1, 'HLD', '', '', NULL),
4725
        ('007', '@', 'fixed length control field', 'fixed length control field', 0, 0, '', 0, '', '', 'marc21_field_007.pl', 0, 0, 'HLD', '', '', NULL),
4726
        ('008', '@', 'fixed length control field', 'fixed length control field', 0, 1, '', 0, '', '', 'marc21_field_008_holdings.pl', 0, 0, 'HLD', '', '', NULL),
4727
        ('010', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 0, '', '', NULL, 0, -6, 'HLD', '', '', NULL),
4728
        ('010', 'a', 'LC control number', 'LC control number', 0, 0, 'biblioitems.lccn', 0, '', '', '', 0, 0, 'HLD', '', '', NULL),
4729
        ('010', 'b', 'NUCMC control number', 'NUCMC control number', 1, 0, '', 0, '', '', '', 0, -1, '', '', '', NULL),
4730
        ('010', 'z', 'Canceled/invalid LC control number', 'Canceled/invalid LC control number', 1, 0, '', 0, '', '', '', 0, -1, 'HLD', '', '', NULL),
4731
        ('014', '6', 'Linkage', 'Linkage', 0, 0, '', 0, '', '', '', 0, -6, '', '', '', NULL),
4732
        ('014', 'a', 'Linkage number', 'Linkage number', 0, 0, '', 0, '', '', '', 0, 0, 'HLD', '', '', NULL),
4733
        ('014', 'b', 'Source of number', 'Source of number', 0, 0, '', 0, '', '', '', 0, -1, 'HLD', '', '', NULL),
4734
        ('014', 'z', 'Canceled/invalid linkage number', 'Canceled/invalid linkage number', 1, 0, '', 0, '', '', '', 0, -1, 'HLD', '', '', NULL),
4735
        ('016', '2', 'Source', 'Source', 0, 0, '', 0, '', '', '', 0, 0, '', '', '', NULL),
4736
        ('016', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 0, '', '', '', 0, -6, 'HLD', '', '', NULL),
4737
        ('016', 'a', 'Record control number', 'Record control number', 0, 0, '', 0, '', '', '', 0, 0, 'HLD', '', '', NULL),
4738
        ('016', 'z', 'Canceled/invalid control number', 'Canceled/invalid control number', 1, 0, '', 0, '', '', '', 0, -1, 'HLD', '', '', NULL),
4739
        ('017', '2', 'Source', 'Source', 0, 0, '', 0, '', '', '', 0, -6, '', '', '', NULL),
4740
        ('017', '6', 'Linkage', 'Linkage', 0, 0, '', 0, '', '', '', 0, -6, '', '', '', NULL),
4741
        ('017', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 0, '', '', '', 0, -6, 'HLD', '', '', NULL),
4742
        ('017', 'a', 'Copyright or legal deposit number', 'Copyright or legal deposit number', 1, 0, '', 0, '', '', '', 0, -6, 'HLD', '', '', NULL),
4743
        ('017', 'b', 'Assigning agency', 'Assigning agency', 0, 0, '', 0, '', '', '', 0, -6, 'HLD', '', '', NULL),
4744
        ('017', 'd', 'Date', 'Date', 0, 0, '', 0, '', '', NULL, 0, -6, 'HLD', '', '', NULL),
4745
        ('017', 'i', 'Display text', 'Display text', 0, 0, '', 0, '', '', '', 0, -6, 'HLD', '', '', NULL),
4746
        ('017', 'z', 'Canceled/invalid copyright or legal deposit number', 'Canceled/invalid copyright or legal deposit number', 1, 0, '', 0, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4747
        ('020', '6', 'Linkage', 'Linkage', 0, 0, '', 0, '', '', '', 0, -6, 'HLD', '', '', NULL),
4748
        ('020', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 0, '', '', '', 0, -6, 'HLD', '', '', NULL),
4749
        ('020', 'a', 'International Standard Book Number', 'International Standard Book Number', 0, 0, 'biblioitems.isbn', 0, '', '', '', 0, 0, 'HLD', '', '', NULL),
4750
        ('020', 'c', 'Terms of availability', 'Terms of availability', 0, 0, '', 0, '', '', '', 0, 0, 'HLD', '', '', NULL),
4751
        ('020', 'q', 'Qualifying information', 'Qualifying information', 1, 0, '', 0, '', '', '', 0, 0, 'HLD', '', '', NULL),
4752
        ('020', 'z', 'Canceled/invalid ISBN', 'Canceled/invalid ISBN', 1, 0, '', 0, '', '', '', 0, -1, 'HLD', '', '', NULL),
4753
        ('022', '2', 'Source', 'Source', 0, 0, '', 0, '', '', '', 0, 0, 'HLD', '', '', NULL),
4754
        ('022', '6', 'Linkage', 'Linkage', 0, 0, '', 0, '', '', '', 0, -6, 'HLD', '', '', NULL),
4755
        ('022', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 0, '', '', '', 0, -6, 'HLD', '', '', NULL),
4756
        ('022', 'a', 'International Standard Serial Number', 'International Standard Serial Number', 0, 0, 'biblioitems.issn', 0, '', '', '', 0, 0, 'HLD', '', '', NULL),
4757
        ('022', 'l', 'ISSN-L', 'ISSN-L', 0, 0, '', 0, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4758
        ('022', 'm', 'Canceled ISSN-L', 'Canceled ISSN-L', 1, 0, '', 0, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4759
        ('022', 'y', 'Incorrect ISSN', 'Incorrect ISSN', 1, 0, '', 0, '', '', '', 0, -1, 'HLD', '', '', NULL),
4760
        ('022', 'z', 'Canceled ISSN', 'Canceled ISSN', 1, 0, '', 0, '', '', '', 0, -1, 'HLD', '', '', NULL),
4761
        ('024', '2', 'Source of number or code', 'Source of number or code', 0, 0, '', 0, '', '', '', 0, 0, 'HLD', '', '', NULL),
4762
        ('024', '6', 'Linkage', 'Linkage', 0, 0, '', 0, '', '', '', 0, -6, 'HLD', '', '', NULL),
4763
        ('024', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 0, '', '', '', 0, -6, 'HLD', '', '', NULL),
4764
        ('024', 'a', 'Standard number or code', 'Standard number or code', 0, 0, '', 0, '', '', '', 0, 0, 'HLD', '', '', NULL),
4765
        ('024', 'b', 'Additional codes following the standard number [OBSOLETE]', 'Additional codes following the standard number [OBSOLETE]', 0, 0, '', 0, '', '', '', 0, -6, 'HLD', '', '', NULL),
4766
        ('024', 'c', 'Terms of availability', 'Terms of availability', 0, 0, '', 0, '', '', '', 0, 0, 'HLD', '', '', NULL),
4767
        ('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),
4768
        ('024', 'q', 'Qualifying information', 'Qualifying information', 1, 0, '', 0, '', '', '', 0, 0, 'HLD', '', '', NULL),
4769
        ('024', 'z', 'Canceled/invalid standard number or code', 'Canceled/invalid standard number or code', 1, 0, '', 0, '', '', '', 0, -1, 'HLD', '', '', NULL),
4770
        ('027', '6', 'Linkage', 'Linkage', 0, 0, '', 0, '', '', '', 0, -6, 'HLD', '', '', NULL),
4771
        ('027', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 0, '', '', '', 0, -6, 'HLD', '', '', NULL),
4772
        ('027', 'a', 'Standard technical report number', 'Standard technical report number', 0, 0, '', 0, '', '', '', 0, -1, 'HLD', '', '', NULL),
4773
        ('027', 'q', 'Qualifying information', 'Qualifying information', 1, 0, '', 0, '', '', '', 0, 0, 'HLD', '', '', NULL),
4774
        ('027', 'z', 'Canceled/invalid number', 'Canceled/invalid number', 1, 0, '', 0, '', '', '', 0, -1, 'HLD', '', '', NULL),
4775
        ('030', '6', 'Linkage', 'Linkage', 0, 0, '', 0, '', '', '', 0, -6, 'HLD', '', '', NULL),
4776
        ('030', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 0, '', '', '', 0, -6, 'HLD', '', '', NULL),
4777
        ('030', 'a', 'CODEN', 'CODEN', 0, 0, '', 0, '', '', '', 0, -6, 'HLD', '', '', NULL),
4778
        ('030', 'z', 'Canceled/invalid CODEN', 'Canceled/invalid CODEN', 1, 0, '', 0, '', '', '', 0, -6, 'HLD', '', '', NULL),
4779
        ('035', '6', 'Linkage', 'Linkage', 0, 0, '', 0, '', '', '', 0, -6, 'HLD', '', '', NULL),
4780
        ('035', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 0, '', '', '', 0, -6, 'HLD', '', '', NULL),
4781
        ('035', 'a', 'System control number', 'System control number', 0, 0, '', 0, '', '', '', 0, 0, 'HLD', '', '', NULL),
4782
        ('035', 'z', 'Canceled/invalid control number', 'Canceled/invalid control number', 1, 0, '', 0, '', '', '', 0, -1, 'HLD', '', '', NULL),
4783
        ('040', '6', 'Linkage', 'Linkage', 0, 0, '', 0, '', '', '', 0, -6, 'HLD', '', '', NULL),
4784
        ('040', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 0, '', '', '', 0, -6, 'HLD', '', '', NULL),
4785
        ('040', 'a', 'Original cataloging agency', 'Original cataloging agency', 0, 0, '', 0, '', '', '', 0, 0, 'HLD', '', '', NULL),
4786
        ('040', 'b', 'Language of cataloging', 'Language of cataloging', 0, 0, '', 0, '', '', '', 0, 0, 'HLD', '', '', NULL),
4787
        ('040', 'c', 'Transcribing agency', 'Transcribing agency', 0, 1, '', 0, '', '', '', 0, 0, 'HLD', '', '', NULL),
4788
        ('040', 'd', 'Modifying agency', 'Modifying agency', 1, 0, '', 0, '', '', '', 0, 0, 'HLD', '', '', NULL),
4789
        ('066', 'a', 'Primary G0 character set', 'Primary G0 character set', 0, 0, NULL, 0, NULL, NULL, '', NULL, -6, 'HLD', '', '', NULL),
4790
        ('066', 'b', 'Primary G1 character set', 'Primary G1 character set', 0, 0, NULL, 0, NULL, NULL, '', NULL, -6, 'HLD', '', '', NULL),
4791
        ('066', 'c', 'Alternate G0 or G1 character set', 'Alternate G0 or G1 character set', 1, 0, NULL, 0, NULL, NULL, '', NULL, -6, 'HLD', '', '', NULL),
4792
        ('337', '0', 'Authority record control number or standard number', 'Authority record control number or standard number', 1, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4793
        ('337', '1', 'Real World Object URI', 'Real World Object URI', 1, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4794
        ('337', '2', 'Source', 'Source', 0, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4795
        ('337', '3', 'Materials specified', 'Materials specified', 0, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4796
        ('337', '6', 'Linkage', 'Linkage', 0, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4797
        ('337', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4798
        ('337', 'a', 'Media type term', 'Media type term', 1, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4799
        ('337', 'b', 'Media type code', 'Media type code', 1, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4800
        ('338', '0', 'Authority record control number or standard number', 'Authority record control number or standard number', 1, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4801
        ('338', '1', 'Real World Object URI', 'Real World Object URI', 1, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4802
        ('338', '2', 'Source', 'Source', 0, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4803
        ('338', '3', 'Materials specified', 'Materials specified', 0, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4804
        ('338', '6', 'Linkage', 'Linkage', 0, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4805
        ('338', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4806
        ('338', 'a', 'Carrier type term', 'Carrier type term', 1, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4807
        ('338', 'b', 'Carrier type code', 'Carrier type code', 1, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4808
        ('347', 'a', 'File type', 'File type', 1, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4809
        ('347', '0', 'Authority record control number or standard number', 'Authority record control number or standard number', 1, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4810
        ('347', '1', 'Real World Object URI', 'Real World Object URI', 1, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4811
        ('347', '2', 'Source', 'Source', 0, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4812
        ('347', '3', 'Materials specified', 'Materials specified', 0, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4813
        ('347', '6', 'Linkage', 'Linkage', 0, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4814
        ('347', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4815
        ('347', 'b', 'Encoding format', 'Encoding format', 1, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4816
        ('347', 'c', 'File size', 'File size', 1, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4817
        ('347', 'd', 'Resolution', 'Resolution', 1, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4818
        ('347', 'e', 'Regional encoding', 'Regional encoding', 1, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4819
        ('347', 'f', 'Encoded bitrate', 'Encoded bitrate', 1, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4820
        ('506', '2', 'Source of term', 'Source of term', 0, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4821
        ('506', '3', 'Materials specified', 'Materials specified', 0, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4822
        ('506', '5', 'Institution to which field applies', 'Institution to which field applies', 0, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4823
        ('506', '6', 'Linkage', 'Linkage', 0, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4824
        ('506', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4825
        ('506', 'a', 'Terms governing access', 'Terms governing access', 0, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4826
        ('506', 'b', 'Jurisdiction', 'Jurisdiction', 1, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4827
        ('506', 'c', 'Physical access provisions', 'Physical access provisions', 1, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4828
        ('506', 'd', 'Authorized users', 'Authorized users', 1, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4829
        ('506', 'e', 'Authorization', 'Authorization', 1, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4830
        ('506', 'f', 'Standardized terminology for access restriction', 'Standardized terminology for access restriction', 1, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4831
        ('506', 'u', 'Uniform Resource Identifier', 'Uniform Resource Identifier', 1, 0, '', 5, '', '', '', 1, -6, 'HLD', '', '', NULL),
4832
        ('538', '3', 'Materials specified', 'Materials specified', 0, 0, NULL, 5, NULL, NULL, '', NULL, -6, 'HLD', '', '', NULL),
4833
        ('538', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4834
        ('538', '6', 'Linkage', 'Linkage', 0, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4835
        ('538', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4836
        ('538', 'a', 'System details note', 'System details note', 0, 0, '', 5, '', '', '', NULL, -1, 'HLD', '', '', NULL),
4837
        ('538', 'i', 'Display text', 'Display text', 0, 0, '', 5, '', '', '', NULL, -1, 'HLD', '', '', NULL),
4838
        ('538', 'u', 'Uniform Resource Identifier', 'Uniform Resource Identifier', 1, 0, '', 5, '', '', '', 1, -1, 'HLD', '', '', NULL),
4839
        ('541', '3', 'Materials specified', 'Materials specified', 0, 0, NULL, 5, NULL, NULL, '', NULL, -6, 'HLD', '', '', NULL),
4840
        ('541', '5', 'Institution to which field applies', 'Institution to which field applies', 0, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4841
        ('541', '6', 'Linkage', 'Linkage', 0, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4842
        ('541', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4843
        ('541', 'a', 'Source of acquisition', 'Source of acquisition', 0, 0, '', 5, '', '', '', NULL, 1, 'HLD', '', '', NULL),
4844
        ('541', 'b', 'Address', 'Address', 0, 0, '', 5, '', '', '', NULL, 1, 'HLD', '', '', NULL),
4845
        ('541', 'c', 'Method of acquisition', 'Method of acquisition', 0, 0, '', 5, '', '', '', NULL, 1, 'HLD', '', '', NULL),
4846
        ('541', 'd', 'Date of acquisition', 'Date of acquisition', 0, 0, '', 5, '', '', '', NULL, 1, 'HLD', '', '', NULL),
4847
        ('541', 'e', 'Accession number', 'Accession number', 0, 0, '', 5, '', '', '', NULL, 1, 'HLD', '', '', NULL),
4848
        ('541', 'f', 'Owner', 'Owner', 0, 0, '', 5, '', '', '', NULL, 1, 'HLD', '', '', NULL),
4849
        ('541', 'h', 'Purchase price', 'Purchase price', 0, 0, '', 5, '', '', '', NULL, 1, 'HLD', '', '', NULL),
4850
        ('541', 'n', 'Extent', 'Extent', 1, 0, '', 5, '', '', '', NULL, 1, 'HLD', '', '', NULL),
4851
        ('541', 'o', 'Type of unit', 'Type of unit', 1, 0, '', 5, '', '', '', NULL, 1, 'HLD', '', '', NULL),
4852
        ('561', '3', 'Materials specified', 'Materials specified', 0, 0, NULL, 5, NULL, NULL, '', NULL, -6, 'HLD', '', '', NULL),
4853
        ('561', '5', 'Institution to which field applies', 'Institution to which field applies', 0, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4854
        ('561', '6', 'Linkage', 'Linkage', 0, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4855
        ('561', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4856
        ('561', 'a', 'History', 'History', 0, 0, '', 5, '', '', '', NULL, 6, 'HLD', '', '', NULL),
4857
        ('561', 'b', 'Time of collation [OBSOLETE]', 'Time of collation [OBSOLETE]', 0, 0, '', 5, '', '', '', NULL, 6, 'HLD', '', '', NULL),
4858
        ('561', 'u', 'Uniform Resource Identifier', 'Uniform Resource Identifier', 1, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4859
        ('562', '3', 'Materials specified', 'Materials specified', 0, 0, NULL, 5, NULL, NULL, '', NULL, -6, 'HLD', '', '', NULL),
4860
        ('562', '5', 'Institution to which field applies', 'Institution to which field applies', 0, 0, NULL, -1, NULL, NULL, '', NULL, -6, 'HLD', '', '', NULL),
4861
        ('562', '6', 'Linkage', 'Linkage', 0, 0, NULL, 5, NULL, NULL, '', NULL, -6, 'HLD', '', '', NULL),
4862
        ('562', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, NULL, 5, NULL, NULL, '', NULL, -6, 'HLD', '', '', NULL),
4863
        ('562', 'a', 'Identifying markings', 'Identifying markings', 1, 0, NULL, 5, NULL, NULL, '', NULL, -1, 'HLD', '', '', NULL),
4864
        ('562', 'b', 'Copy identification', 'Copy identification', 1, 0, NULL, 5, NULL, NULL, '', NULL, -1, 'HLD', '', '', NULL),
4865
        ('562', 'c', 'Version identification', 'Version identification', 1, 0, NULL, 5, NULL, NULL, '', NULL, -1, 'HLD', '', '', NULL),
4866
        ('562', 'd', 'Presentation format', 'Presentation format', 1, 0, NULL, 5, NULL, NULL, '', NULL, -1, 'HLD', '', '', NULL),
4867
        ('562', 'e', 'Number of copies', 'Number of copies', 1, 0, NULL, 5, NULL, NULL, '', NULL, -1, 'HLD', '', '', NULL),
4868
        ('563', '3', 'Materials specified', 'Materials specified', 0, 0, NULL, 5, NULL, NULL, '', NULL, -6, 'HLD', '', '', NULL),
4869
        ('563', '5', 'Institution to which field applies', 'Institution to which field applies', 0, 0, NULL, -1, NULL, NULL, '', NULL, -6, 'HLD', '', '', NULL),
4870
        ('563', '6', 'Linkage', 'Linkage', 0, 0, NULL, 5, NULL, NULL, '', NULL, -6, 'HLD', '', '', NULL),
4871
        ('563', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, NULL, 5, NULL, NULL, '', NULL, -6, 'HLD', '', '', NULL),
4872
        ('563', 'a', 'Binding note', 'Binding note', 0, 0, NULL, 5, NULL, NULL, '', NULL, -1, 'HLD', '', '', NULL),
4873
        ('563', 'u', 'Uniform Resource Identifier', 'Uniform Resource Identifier', 1, 0, NULL, 5, NULL, NULL, '', 1, -1, 'HLD', '', '', NULL),
4874
        ('583', '2', 'Source of term', 'Source of term', 0, 0, NULL, 5, NULL, NULL, '', NULL, -6, 'HLD', '', '', NULL),
4875
        ('583', '3', 'Materials specified', 'Materials specified', 0, 0, NULL, 5, NULL, NULL, '', NULL, -6, 'HLD', '', '', NULL),
4876
        ('583', '5', 'Institution to which field applies', 'Institution to which field applies', 0, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4877
        ('583', '6', 'Linkage', 'Linkage', 0, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4878
        ('583', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4879
        ('583', 'a', 'Action', 'Action', 0, 0, '', 5, '', '', '', NULL, -1, 'HLD', '', '', NULL),
4880
        ('583', 'b', 'Action identification', 'Action identification', 1, 0, '', 5, '', '', '', NULL, -1, 'HLD', '', '', NULL),
4881
        ('583', 'c', 'Time/date of action', 'Time/date of action', 1, 0, '', 5, '', '', '', NULL, -1, 'HLD', '', '', NULL),
4882
        ('583', 'd', 'Action interval', 'Action interval', 1, 0, '', 5, '', '', '', NULL, -1, 'HLD', '', '', NULL),
4883
        ('583', 'e', 'Contingency for action', 'Contingency for action', 1, 0, '', 5, '', '', '', NULL, -1, 'HLD', '', '', NULL),
4884
        ('583', 'f', 'Authorization', 'Authorization', 1, 0, '', 5, '', '', '', NULL, -1, 'HLD', '', '', NULL),
4885
        ('583', 'h', 'Jurisdiction', 'Jurisdiction', 1, 0, '', 5, '', '', '', NULL, -1, 'HLD', '', '', NULL),
4886
        ('583', 'i', 'Method of action', 'Method of action', 1, 0, '', 5, '', '', '', NULL, -1, 'HLD', '', '', NULL),
4887
        ('583', 'j', 'Site of action', 'Site of action', 1, 0, '', 5, '', '', '', NULL, -1, 'HLD', '', '', NULL),
4888
        ('583', 'k', 'Action agent', 'Action agent', 1, 0, '', 5, '', '', '', NULL, -1, 'HLD', '', '', NULL),
4889
        ('583', 'l', 'Status', 'Status', 1, 0, '', 5, '', '', '', NULL, -1, 'HLD', '', '', NULL),
4890
        ('583', 'n', 'Extent', 'Extent', 1, 0, '', 5, '', '', '', NULL, -1, 'HLD', '', '', NULL),
4891
        ('583', 'o', 'Type of unit', 'Type of unit', 1, 0, '', 5, '', '', '', NULL, -1, 'HLD', '', '', NULL),
4892
        ('583', 'u', 'Uniform Resource Identifier', 'Uniform Resource Identifier', 1, 0, '', 5, '', '', '', 1, -1, 'HLD', '', '', NULL),
4893
        ('583', 'x', 'Nonpublic note', 'Nonpublic note', 1, 0, '', 5, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4894
        ('583', 'z', 'Public note', 'Public note', 1, 0, '', 5, '', '', '', NULL, -1, 'HLD', '', '', NULL),
4895
        ('842', '6', 'Linkage', 'Linkage', 0, 0, '', 8, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4896
        ('842', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 8, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4897
        ('842', 'a', 'Textual physical form designator', 'Textual physical form designator', 0, 0, '', 8, '', '', '', NULL, -1, 'HLD', '', '', NULL),
4898
        ('843', '3', 'Materials specified', 'Materials specified', 0, 0, NULL, 8, NULL, NULL, '', NULL, -6, 'HLD', '', '', NULL),
4899
        ('843', '5', 'Institution to which field applies', 'Institution to which field applies', 0, 0, NULL, -1, NULL, NULL, '', NULL, -6, 'HLD', '', '', NULL),
4900
        ('843', '6', 'Linkage', 'Linkage', 0, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4901
        ('843', '7', 'Fixed-length data elements of reproduction', 'Fixed-length data elements of reproduction', 0, 0, NULL, 8, NULL, NULL, '', NULL, -6, 'HLD', '', '', NULL),
4902
        ('843', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 8, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4903
        ('843', 'a', 'Type of reproduction', 'Type of reproduction', 0, 0, NULL, 8, NULL, NULL, '', NULL, -1, 'HLD', '', '', NULL),
4904
        ('843', 'b', 'Place of reproduction', 'Place of reproduction', 1, 0, NULL, 8, NULL, NULL, '', NULL, -1, 'HLD', '', '', NULL),
4905
        ('843', 'c', 'Agency responsible for reproduction', 'Agency responsible for reproduction', 1, 0, NULL, 8, NULL, NULL, '', NULL, -1, 'HLD', '', '', NULL),
4906
        ('843', 'd', 'Date of reproduction', 'Date of reproduction', 0, 0, NULL, 8, NULL, NULL, '', NULL, -1, 'HLD', '', '', NULL),
4907
        ('843', 'e', 'Physical description of reproduction', 'Physical description of reproduction', 0, 0, NULL, 8, NULL, NULL, '', NULL, -1, 'HLD', '', '', NULL),
4908
        ('843', 'f', 'Series statement of reproduction', 'Series statement of reproduction', 1, 0, NULL, 8, NULL, NULL, '', NULL, -1, 'HLD', '', '', NULL),
4909
        ('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),
4910
        ('843', 'n', 'Note about reproduction', 'Note about reproduction', 1, 0, NULL, 8, NULL, NULL, '', NULL, -1, 'HLD', '', '', NULL),
4911
        ('844', '6', 'Linkage', 'Linkage', 0, 0, '', 8, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4912
        ('844', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 8, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4913
        ('844', 'a', 'Name of unit', 'Name of unit', 0, 0, '', 8, '', '', '', NULL, -1, 'HLD', '', '', NULL),
4914
        ('845', 'a', 'Terms governing use and reproduction', 'Terms governing use and reproduction', 0, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4915
        ('845', 'b', 'Jurisdiction', 'Jurisdiction', 0, 0, '', 8, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4916
        ('845', 'c', 'Authorization', 'Authorization', 0, 0, '', 8, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4917
        ('845', 'd', 'Authorized users', 'Authorized users', 0, 0, '', 8, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4918
        ('845', 'u', 'Uniform Resource Identifier', 'Uniform Resource Identifier', 1, 0, '', 8, '', '', '', 1, -6, 'HLD', '', '', NULL),
4919
        ('850', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, NULL, 8, NULL, NULL, '', NULL, 4, 'HLD', '', '', NULL),
4920
        ('850', 'a', 'Holding institution', 'Holding institution', 1, 0, NULL, 8, NULL, NULL, '', NULL, 4, 'HLD', '', '', NULL),
4921
        ('850', 'b', 'Holdings (NR) (MU VM SE) [OBSOLETE]', 'Holdings (NR) (MU VM SE) [OBSOLETE]', 0, 0, NULL, 8, NULL, NULL, '', NULL, 4, 'HLD', '', '', NULL),
4922
        ('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),
4923
        ('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),
4924
        ('852', '2', 'Source of classification or shelving scheme', 'Source of classification or shelving scheme', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4925
        ('852', '3', 'Materials specified', 'Materials specified', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4926
        ('852', '6', 'Linkage', 'Linkage', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4927
        ('852', '8', 'Sequence number', 'Sequence number', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4928
        ('852', 'a', 'Location', 'Location', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4929
        ('852', 'b', 'Sublocation or collection', 'Sublocation or collection', 1, 0, 'holdings.holdingbranch', 8, 'branches', '', '', NULL, 4, 'HLD', '', '', NULL),
4930
        ('852', 'c', 'Shelving location', 'Shelving location', 1, 0, 'holdings.location', 8, 'LOC', '', '', NULL, 4, 'HLD', '', '', NULL),
4931
        ('852', 'd', 'Former shelving location', 'Former shelving location', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4932
        ('852', 'e', 'Address', 'Address', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4933
        ('852', 'f', 'Coded location qualifier', 'Coded location qualifier', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4934
        ('852', 'g', 'Non-coded location qualifier', 'Non-coded location qualifier', 1, 0, 'holdings.ccode', 8, 'CCODE', '', '', NULL, 4, 'HLD', '', '', NULL),
4935
        ('852', 'h', 'Classification part', 'Classification part', 0, 0, 'holdings.callnumber', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4936
        ('852', 'i', 'Item part', 'Item part', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4937
        ('852', 'j', 'Shelving control number', 'Shelving control number', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4938
        ('852', 'k', 'Call number prefix', 'Call number prefix', 1, 0, 'holdings.callnumber', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4939
        ('852', 'l', 'Shelving form of title', 'Shelving form of title', 0, 0, 'holdings.callnumber', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4940
        ('852', 'm', 'Call number suffix', 'Call number suffix', 1, 0, 'holdings.callnumber', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4941
        ('852', 'n', 'Country code', 'Country code', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4942
        ('852', 'p', 'Piece designation', 'Piece designation', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4943
        ('852', 'q', 'Piece physical condition', 'Piece physical condition', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4944
        ('852', 's', 'Copyright article-fee code', 'Copyright article-fee code', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4945
        ('852', 't', 'Copy number', 'Copy number', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4946
        ('852', 'u', 'Uniform Resource Identifier', 'Uniform Resource Identifier', 1, 0, '', 8, '', '', '', 1, 4, 'HLD', '', '', NULL),
4947
        ('852', 'x', 'Nonpublic note', 'Nonpublic note', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4948
        ('852', 'z', 'Public note', 'Public note', 1, 0, 'holdings.public_note', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4949
        ('853', '3', 'Materials specified', 'Materials specified', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4950
        ('853', '6', 'Linkage', 'Linkage', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4951
        ('853', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4952
        ('853', 'a', 'First level of enumeration', 'First level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4953
        ('853', 'b', 'Second level of enumeration', 'Second level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4954
        ('853', 'c', 'Third level of enumeration', 'Third level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4955
        ('853', 'd', 'Fourth level of enumeration', 'Fourth level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4956
        ('853', 'e', 'Fifth level of enumeration', 'Fifth level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4957
        ('853', 'f', 'Sixth level of enumeration', 'Sixth level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4958
        ('853', 'g', 'Alternative numbering scheme, first level of enumeration', 'Alternative numbering scheme, first level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4959
        ('853', 'h', 'Alternative numbering scheme, second level of enumeration', 'Alternative numbering scheme, second level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4960
        ('853', 'i', 'First level of chronology', 'First level of chronology', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4961
        ('853', 'j', 'Second level of chronology', 'Second level of chronology', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4962
        ('853', 'k', 'Third level of chronology', 'Third level of chronology', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4963
        ('853', 'l', 'Fourth level of chronology', 'Fourth level of chronology', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4964
        ('853', 'm', 'Alternative numbering scheme, chronology', 'Alternative numbering scheme, chronology', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4965
        ('853', 'n', 'Pattern note', 'Pattern note', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4966
        ('853', 'p', 'Number of pieces per issuance', 'Number of pieces per issuance', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4967
        ('853', 't', 'Copy', 'Copy', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4968
        ('853', 'u', 'Bibliographic units per next higher level', 'Bibliographic units per next higher level', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4969
        ('853', 'v', 'Numbering continuity', 'Numbering continuity', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4970
        ('853', 'w', 'Frequency', 'Frequency', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4971
        ('853', 'x', 'Calendar change', 'Calendar change', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4972
        ('853', 'y', 'Regularity pattern', 'Regularity pattern', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4973
        ('853', 'z', 'Numbering scheme', 'Numbering scheme', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4974
        ('854', '3', 'Materials specified', 'Materials specified', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4975
        ('854', '6', 'Linkage', 'Linkage', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4976
        ('854', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4977
        ('854', 'a', 'First level of enumeration', 'First level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4978
        ('854', 'b', 'Second level of enumeration', 'Second level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4979
        ('854', 'c', 'Third level of enumeration', 'Third level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4980
        ('854', 'd', 'Fourth level of enumeration', 'Fourth level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4981
        ('854', 'e', 'Fifth level of enumeration', 'Fifth level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4982
        ('854', 'f', 'Sixth level of enumeration', 'Sixth level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4983
        ('854', 'g', 'Alternative numbering scheme, first level of enumeration', 'Alternative numbering scheme, first level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4984
        ('854', 'h', 'Alternative numbering scheme, second level of enumeration', 'Alternative numbering scheme, second level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4985
        ('854', 'i', 'First level of chronology', 'First level of chronology', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4986
        ('854', 'j', 'Second level of chronology', 'Second level of chronology', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4987
        ('854', 'k', 'Third level of chronology', 'Third level of chronology', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4988
        ('854', 'l', 'Fourth level of chronology', 'Fourth level of chronology', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4989
        ('854', 'm', 'Alternative numbering scheme, chronology', 'Alternative numbering scheme, chronology', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4990
        ('854', 'n', 'Pattern note', 'Pattern note', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4991
        ('854', 'p', 'Number of pieces per issuance', 'Number of pieces per issuance', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4992
        ('854', 't', 'Copy', 'Copy', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4993
        ('854', 'u', 'Bibliographic units per next higher level', 'Bibliographic units per next higher level', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4994
        ('854', 'v', 'Numbering continuity', 'Numbering continuity', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4995
        ('854', 'w', 'Frequency', 'Frequency', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4996
        ('854', 'x', 'Calendar change', 'Calendar change', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4997
        ('854', 'y', 'Regularity pattern', 'Regularity pattern', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4998
        ('854', 'z', 'Numbering scheme', 'Numbering scheme', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4999
        ('855', '3', 'Materials specified', 'Materials specified', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5000
        ('855', '6', 'Linkage', 'Linkage', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5001
        ('855', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5002
        ('855', 'a', 'First level of enumeration', 'First level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5003
        ('855', 'b', 'Second level of enumeration', 'Second level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5004
        ('855', 'c', 'Third level of enumeration', 'Third level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5005
        ('855', 'd', 'Fourth level of enumeration', 'Fourth level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5006
        ('855', 'e', 'Fifth level of enumeration', 'Fifth level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5007
        ('855', 'f', 'Sixth level of enumeration', 'Sixth level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5008
        ('855', 'g', 'Alternative numbering scheme, first level of enumeration', 'Alternative numbering scheme, first level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5009
        ('855', 'h', 'Alternative numbering scheme, second level of enumeration', 'Alternative numbering scheme, second level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5010
        ('855', 'i', 'First level of chronology', 'First level of chronology', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5011
        ('855', 'j', 'Second level of chronology', 'Second level of chronology', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5012
        ('855', 'k', 'Third level of chronology', 'Third level of chronology', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5013
        ('855', 'l', 'Fourth level of chronology', 'Fourth level of chronology', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5014
        ('855', 'm', 'Alternative numbering scheme, chronology', 'Alternative numbering scheme, chronology', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5015
        ('855', 'n', 'Pattern note', 'Pattern note', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5016
        ('855', 'p', 'Number of pieces per issuance', 'Number of pieces per issuance', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5017
        ('855', 't', 'Copy', 'Copy', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5018
        ('855', 'u', 'Bibliographic units per next higher level', 'Bibliographic units per next higher level', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5019
        ('855', 'v', 'Numbering continuity', 'Numbering continuity', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5020
        ('855', 'w', 'Frequency', 'Frequency', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5021
        ('855', 'x', 'Calendar change', 'Calendar change', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5022
        ('855', 'y', 'Regularity pattern', 'Regularity pattern', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5023
        ('855', 'z', 'Numbering scheme', 'Numbering scheme', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5024
        ('856', '2', 'Access method', 'Access method', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5025
        ('856', '3', 'Materials specified', 'Materials specified', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5026
        ('856', '6', 'Linkage', 'Linkage', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5027
        ('856', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5028
        ('856', 'a', 'Host name', 'Host name', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5029
        ('856', 'b', 'Access number', 'Access number', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5030
        ('856', 'c', 'Compression information', 'Compression information', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5031
        ('856', 'd', 'Path', 'Path', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5032
        ('856', 'f', 'Electronic name', 'Electronic name', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5033
        ('856', 'h', 'Processor of request', 'Processor of request', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5034
        ('856', 'i', 'Instruction', 'Instruction', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5035
        ('856', 'j', 'Bits per second', 'Bits per second', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5036
        ('856', 'k', 'Password', 'Password', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5037
        ('856', 'l', 'Logon', 'Logon', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5038
        ('856', 'm', 'Contact for access assistance', 'Contact for access assistance', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5039
        ('856', 'n', 'Name of location of host', 'Name of location of host', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5040
        ('856', 'o', 'Operating system', 'Operating system', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5041
        ('856', 'p', 'Port', 'Port', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5042
        ('856', 'q', 'Electronic format type', 'Electronic format type', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5043
        ('856', 'r', 'Settings', 'Settings', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5044
        ('856', 's', 'File size', 'File size', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5045
        ('856', 't', 'Terminal emulation', 'Terminal emulation', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5046
        ('856', 'u', 'Uniform Resource Identifier', 'Uniform Resource Identifier', 1, 0, 'biblioitems.url', 8, '', '', '', 1, 4, 'HLD', '', '', NULL),
5047
        ('856', 'v', 'Hours access method available', 'Hours access method available', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5048
        ('856', 'w', 'Record control number', 'Record control number', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5049
        ('856', 'x', 'Nonpublic note', 'Nonpublic note', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5050
        ('856', 'y', 'Link text', 'Link text', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5051
        ('856', 'z', 'Public note', 'Public note', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5052
        ('863', '6', 'Linkage', 'Linkage', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5053
        ('863', '8', 'Field link and sequence number', 'Field link and sequence number', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5054
        ('863', 'a', 'First level of enumeration', 'First level of enumeration', 0, 0, 'holdings.summary', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5055
        ('863', 'b', 'Second level of enumeration', 'Second level of enumeration', 0, 0, 'holdings.summary', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5056
        ('863', 'c', 'Third level of enumeration', 'Third level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5057
        ('863', 'd', 'Fourth level of enumeration', 'Fourth level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5058
        ('863', 'e', 'Fifth level of enumeration', 'Fifth level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5059
        ('863', 'f', 'Sixth level of enumeration', 'Sixth level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5060
        ('863', 'g', 'Alternative numbering scheme, first level of enumeration', 'Alternative numbering scheme, first level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5061
        ('863', 'h', 'Alternative numbering scheme, second level of enumeration', 'Alternative numbering scheme, second level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5062
        ('863', 'i', 'First level of chronology', 'First level of chronology', 0, 0, 'holdings.summary', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5063
        ('863', 'j', 'Second level of chronology', 'Second level of chronology', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5064
        ('863', 'k', 'Third level of chronology', 'Third level of chronology', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5065
        ('863', 'l', 'Fourth level of chronology', 'Fourth level of chronology', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5066
        ('863', 'm', 'Alternative numbering scheme, chronology', 'Alternative numbering scheme, chronology', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5067
        ('863', 'n', 'Converted Gregorian year', 'Converted Gregorian year', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5068
        ('863', 'o', 'Type of unit', 'Type of unit', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5069
        ('863', 'p', 'Piece designation', 'Piece designation', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5070
        ('863', 'q', 'Piece physical condition', 'Piece physical condition', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5071
        ('863', 's', 'Copyright article-fee code', 'Copyright article-fee code', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5072
        ('863', 't', 'Copy number', 'Copy number', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5073
        ('863', 'v', 'Issuing date', 'Issuing date', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5074
        ('863', 'w', 'Break indicator', 'Break indicator', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5075
        ('863', 'x', 'Nonpublic note', 'Nonpublic note', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5076
        ('863', 'z', 'Public note', 'Public note', 1, 0, 'holdings.summary', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5077
        ('864', '6', 'Linkage', 'Linkage', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5078
        ('864', '8', 'Field link and sequence number', 'Field link and sequence number', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5079
        ('864', 'a', 'First level of enumeration', 'First level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5080
        ('864', 'b', 'Second level of enumeration', 'Second level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5081
        ('864', 'c', 'Third level of enumeration', 'Third level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5082
        ('864', 'd', 'Fourth level of enumeration', 'Fourth level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5083
        ('864', 'e', 'Fifth level of enumeration', 'Fifth level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5084
        ('864', 'f', 'Sixth level of enumeration', 'Sixth level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5085
        ('864', 'g', 'Alternative numbering scheme, first level of enumeration', 'Alternative numbering scheme, first level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5086
        ('864', 'h', 'Alternative numbering scheme, second level of enumeration', 'Alternative numbering scheme, second level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5087
        ('864', 'i', 'First level of chronology', 'First level of chronology', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5088
        ('864', 'j', 'Second level of chronology', 'Second level of chronology', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5089
        ('864', 'k', 'Third level of chronology', 'Third level of chronology', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5090
        ('864', 'l', 'Fourth level of chronology', 'Fourth level of chronology', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5091
        ('864', 'm', 'Alternative numbering scheme, chronology', 'Alternative numbering scheme, chronology', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5092
        ('864', 'n', 'Converted Gregorian year', 'Converted Gregorian year', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5093
        ('864', 'o', 'Type of unit', 'Type of unit', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5094
        ('864', 'p', 'Piece designation', 'Piece designation', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5095
        ('864', 'q', 'Piece physical condition', 'Piece physical condition', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5096
        ('864', 's', 'Copyright article-fee code', 'Copyright article-fee code', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5097
        ('864', 't', 'Copy number', 'Copy number', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5098
        ('864', 'v', 'Issuing date', 'Issuing date', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5099
        ('864', 'w', 'Break indicator', 'Break indicator', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5100
        ('864', 'x', 'Nonpublic note', 'Nonpublic note', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5101
        ('864', 'z', 'Public note', 'Public note', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5102
        ('865', '6', 'Linkage', 'Linkage', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5103
        ('865', '8', 'Field link and sequence number', 'Field link and sequence number', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5104
        ('865', 'a', 'First level of enumeration', 'First level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5105
        ('865', 'b', 'Second level of enumeration', 'Second level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5106
        ('865', 'c', 'Third level of enumeration', 'Third level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5107
        ('865', 'd', 'Fourth level of enumeration', 'Fourth level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5108
        ('865', 'e', 'Fifth level of enumeration', 'Fifth level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5109
        ('865', 'f', 'Sixth level of enumeration', 'Sixth level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5110
        ('865', 'g', 'Alternative numbering scheme, first level of enumeration', 'Alternative numbering scheme, first level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5111
        ('865', 'h', 'Alternative numbering scheme, second level of enumeration', 'Alternative numbering scheme, second level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5112
        ('865', 'i', 'First level of chronology', 'First level of chronology', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5113
        ('865', 'j', 'Second level of chronology', 'Second level of chronology', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5114
        ('865', 'k', 'Third level of chronology', 'Third level of chronology', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5115
        ('865', 'l', 'Fourth level of chronology', 'Fourth level of chronology', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5116
        ('865', 'm', 'Alternative numbering scheme, chronology', 'Alternative numbering scheme, chronology', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5117
        ('865', 'n', 'Converted Gregorian year', 'Converted Gregorian year', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5118
        ('865', 'o', 'Type of unit', 'Type of unit', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5119
        ('865', 'p', 'Piece designation', 'Piece designation', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5120
        ('865', 'q', 'Piece physical condition', 'Piece physical condition', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5121
        ('865', 's', 'Copyright article-fee code', 'Copyright article-fee code', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5122
        ('865', 't', 'Copy number', 'Copy number', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5123
        ('865', 'v', 'Issuing date', 'Issuing date', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5124
        ('865', 'w', 'Break indicator', 'Break indicator', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5125
        ('865', 'x', 'Nonpublic note', 'Nonpublic note', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5126
        ('865', 'z', 'Public note', 'Public note', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5127
        ('866', '6', 'Linkage', 'Linkage', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5128
        ('866', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5129
        ('866', 'a', 'Textual string', 'Textual string', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5130
        ('866', 'x', 'Nonpublic note', 'Nonpublic note', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5131
        ('866', 'z', 'Public note', 'Public note', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5132
        ('867', '6', 'Linkage', 'Linkage', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5133
        ('867', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5134
        ('867', 'a', 'Textual string', 'Textual string', 0, 0, 'holdings.supplements', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5135
        ('867', 'x', 'Nonpublic note', 'Nonpublic note', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5136
        ('867', 'z', 'Public note', 'Public note', 1, 0, 'holdings.supplements', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5137
        ('868', '6', 'Linkage', 'Linkage', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5138
        ('868', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5139
        ('868', 'a', 'Textual string', 'Textual string', 0, 0, 'holdings.indexes', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5140
        ('868', 'x', 'Nonpublic note', 'Nonpublic note', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5141
        ('868', 'z', 'Public note', 'Public note', 1, 0, 'holdings.indexes', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5142
        ('876', '3', 'Materials specified', 'Materials specified', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5143
        ('876', '6', 'Linkage', 'Linkage', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5144
        ('876', '8', 'Sequence number', 'Sequence number', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5145
        ('876', 'a', 'Internal item number', 'Internal item number', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5146
        ('876', 'b', 'Invalid or canceled internal item number', 'Invalid or canceled internal item number', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5147
        ('876', 'c', 'Cost', 'Cost', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5148
        ('876', 'd', 'Date acquired', 'Date acquired', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5149
        ('876', 'e', 'Source of acquisition', 'Source of acquisition', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5150
        ('876', 'h', 'Use restrictions', 'Use restrictions', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5151
        ('876', 'j', 'Item status', 'Item status', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5152
        ('876', 'l', 'Temporary location', 'Temporary location', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5153
        ('876', 'p', 'Piece designation', 'Piece designation', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5154
        ('876', 'r', 'Invalid or canceled piece designation', 'Invalid or canceled piece designation', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5155
        ('876', 't', 'Copy number', 'Copy number', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5156
        ('876', 'x', 'Nonpublic note', 'Nonpublic note', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5157
        ('876', 'z', 'Public note', 'Public note', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5158
        ('877', '3', 'Materials specified', 'Materials specified', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5159
        ('877', '6', 'Linkage', 'Linkage', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5160
        ('877', '8', 'Sequence number', 'Sequence number', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5161
        ('877', 'a', 'Internal item number', 'Internal item number', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5162
        ('877', 'b', 'Invalid or canceled internal item number', 'Invalid or canceled internal item number', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5163
        ('877', 'c', 'Cost', 'Cost', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5164
        ('877', 'd', 'Date acquired', 'Date acquired', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5165
        ('877', 'e', 'Source of acquisition', 'Source of acquisition', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5166
        ('877', 'h', 'Use restrictions', 'Use restrictions', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5167
        ('877', 'j', 'Item status', 'Item status', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5168
        ('877', 'l', 'Temporary location', 'Temporary location', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5169
        ('877', 'p', 'Piece designation', 'Piece designation', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5170
        ('877', 'r', 'Invalid or canceled piece designation', 'Invalid or canceled piece designation', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5171
        ('877', 't', 'Copy number', 'Copy number', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5172
        ('877', 'x', 'Nonpublic note', 'Nonpublic note', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5173
        ('877', 'z', 'Public note', 'Public note', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5174
        ('878', '3', 'Materials specified', 'Materials specified', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5175
        ('878', '6', 'Linkage', 'Linkage', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5176
        ('878', '8', 'Sequence number', 'Sequence number', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5177
        ('878', 'a', 'Internal item number', 'Internal item number', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5178
        ('878', 'b', 'Invalid or canceled internal item number', 'Invalid or canceled internal item number', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5179
        ('878', 'c', 'Cost', 'Cost', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5180
        ('878', 'd', 'Date acquired', 'Date acquired', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5181
        ('878', 'e', 'Source of acquisition', 'Source of acquisition', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5182
        ('878', 'h', 'Use restrictions', 'Use restrictions', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5183
        ('878', 'j', 'Item status', 'Item status', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5184
        ('878', 'l', 'Temporary location', 'Temporary location', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5185
        ('878', 'p', 'Piece designation', 'Piece designation', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5186
        ('878', 'r', 'Invalid or canceled piece designation', 'Invalid or canceled piece designation', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5187
        ('878', 't', 'Copy number', 'Copy number', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5188
        ('878', 'x', 'Nonpublic note', 'Nonpublic note', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5189
        ('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 844-855 CREATE TABLE `issuingrules` ( -- circulation and fine rules Link Here
844
  KEY `itemtype` (`itemtype`)
845
  KEY `itemtype` (`itemtype`)
845
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
846
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
846
847
848
--
849
-- Table structure for table `holdings`
850
--
851
852
DROP TABLE IF EXISTS `holdings`;
853
CREATE TABLE `holdings` ( -- table that stores summary holdings information
854
  `holding_id` int(11) NOT NULL auto_increment, -- unique identifier assigned to each holdings record
855
  `biblionumber` int(11) NOT NULL default 0, -- foreign key from biblio table used to link this record to the right bib record
856
  `frameworkcode` varchar(4) NOT NULL default '', -- foreign key from the biblio_framework table to identify which framework was used in cataloging this record
857
  `holdingbranch` varchar(10) default NULL, -- foreign key from the branches table for the library that owns this record (MARC21 852$a)
858
  `location` varchar(80) default NULL, -- authorized value for the shelving location for this record (MARC21 852$b)
859
  `ccode` varchar(80) default NULL, -- authorized value for the collection code associated with this item (MARC21 852$g)
860
  `callnumber` varchar(255) default NULL, -- call number (852$h+$i in MARC21)
861
  `suppress` tinyint(1) default NULL, -- Boolean indicating whether the record is suppressed in OPAC
862
  `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, -- date and time this record was last touched
863
  `datecreated` DATE NOT NULL, -- the date this record was added to Koha
864
	`deleted_on` DATETIME DEFAULT NULL, -- the date this record was deleted
865
  PRIMARY KEY  (`holding_id`),
866
  KEY `hldnoidx` (`holding_id`),
867
  KEY `hldbibnoidx` (`biblionumber`),
868
  KEY `timestamp` (`timestamp`),
869
  CONSTRAINT `holdings_ibfk_1` FOREIGN KEY (`biblionumber`) REFERENCES `biblio` (`biblionumber`) ON DELETE CASCADE ON UPDATE CASCADE,
870
  CONSTRAINT `holdings_ibfk_2` FOREIGN KEY (`holdingbranch`) REFERENCES `branches` (`branchcode`) ON UPDATE CASCADE
871
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
872
873
--
874
-- Table structure for table `holdings_metadata`
875
--
876
877
DROP TABLE IF EXISTS `holdings_metadata`;
878
CREATE TABLE `holdings_metadata` (
879
  `id` INT(11) NOT NULL AUTO_INCREMENT,
880
  `holding_id` INT(11) NOT NULL,
881
  `format` VARCHAR(16) NOT NULL,
882
  `schema` VARCHAR(16) NOT NULL,
883
  `metadata` LONGTEXT NOT NULL,
884
	`deleted_on` DATETIME DEFAULT NULL, -- the date this record was deleted
885
  PRIMARY KEY(id),
886
  UNIQUE KEY `holdings_metadata_uniq_key` (`holding_id`,`format`,`schema`),
887
  KEY `hldnoidx` (`holding_id`),
888
  CONSTRAINT `holdings_metadata_fk_1` FOREIGN KEY (`holding_id`) REFERENCES `holdings` (`holding_id`) ON DELETE CASCADE ON UPDATE CASCADE
889
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
890
847
--
891
--
848
-- Table structure for table `items`
892
-- Table structure for table `items`
849
--
893
--
850
894
851
DROP TABLE IF EXISTS `items`;
895
DROP TABLE IF EXISTS `items`;
852
CREATE TABLE `items` ( -- holdings/item information
896
CREATE TABLE `items` ( -- item information
853
  `itemnumber` int(11) NOT NULL auto_increment, -- primary key and unique identifier added by Koha
897
  `itemnumber` int(11) NOT NULL auto_increment, -- primary key and unique identifier added by Koha
854
  `biblionumber` int(11) NOT NULL default 0, -- foreign key from biblio table used to link this item to the right bib record
898
  `biblionumber` int(11) NOT NULL default 0, -- foreign key from biblio table used to link this item to the right bib record
855
  `biblioitemnumber` int(11) NOT NULL default 0, -- foreign key from the biblioitems table to link to item to additional information
899
  `biblioitemnumber` int(11) NOT NULL default 0, -- foreign key from the biblioitems table to link to item to additional information
Lines 895-900 CREATE TABLE `items` ( -- holdings/item information Link Here
895
  `copynumber` varchar(32) default NULL, -- copy number (MARC21 952$t)
939
  `copynumber` varchar(32) default NULL, -- copy number (MARC21 952$t)
896
  `stocknumber` varchar(32) default NULL, -- inventory number (MARC21 952$i)
940
  `stocknumber` varchar(32) default NULL, -- inventory number (MARC21 952$i)
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.
941
  `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.
942
  `holding_id` int(11) default NULL, -- foreign key from holdings table used to link this item to the right holdings record
898
  PRIMARY KEY  (`itemnumber`),
943
  PRIMARY KEY  (`itemnumber`),
899
  UNIQUE KEY `itembarcodeidx` (`barcode`),
944
  UNIQUE KEY `itembarcodeidx` (`barcode`),
900
  KEY `itemstocknumberidx` (`stocknumber`),
945
  KEY `itemstocknumberidx` (`stocknumber`),
Lines 907-916 CREATE TABLE `items` ( -- holdings/item information Link Here
907
  KEY `items_ccode` (`ccode`),
952
  KEY `items_ccode` (`ccode`),
908
  KEY `itype_idx` (`itype`),
953
  KEY `itype_idx` (`itype`),
909
  KEY `timestamp` (`timestamp`),
954
  KEY `timestamp` (`timestamp`),
955
  KEY `hldid_idx` (`holding_id`),
910
  CONSTRAINT `items_ibfk_1` FOREIGN KEY (`biblioitemnumber`) REFERENCES `biblioitems` (`biblioitemnumber`) ON DELETE CASCADE ON UPDATE CASCADE,
956
  CONSTRAINT `items_ibfk_1` FOREIGN KEY (`biblioitemnumber`) REFERENCES `biblioitems` (`biblioitemnumber`) ON DELETE CASCADE ON UPDATE CASCADE,
911
  CONSTRAINT `items_ibfk_2` FOREIGN KEY (`homebranch`) REFERENCES `branches` (`branchcode`) ON UPDATE CASCADE,
957
  CONSTRAINT `items_ibfk_2` FOREIGN KEY (`homebranch`) REFERENCES `branches` (`branchcode`) ON UPDATE CASCADE,
912
  CONSTRAINT `items_ibfk_3` FOREIGN KEY (`holdingbranch`) REFERENCES `branches` (`branchcode`) ON UPDATE CASCADE,
958
  CONSTRAINT `items_ibfk_3` FOREIGN KEY (`holdingbranch`) REFERENCES `branches` (`branchcode`) ON UPDATE CASCADE,
913
  CONSTRAINT `items_ibfk_4` FOREIGN KEY (`biblionumber`) REFERENCES `biblio` (`biblionumber`) ON DELETE CASCADE ON UPDATE CASCADE
959
  CONSTRAINT `items_ibfk_4` FOREIGN KEY (`biblionumber`) REFERENCES `biblio` (`biblionumber`) ON DELETE CASCADE ON UPDATE CASCADE,
960
  CONSTRAINT `items_ibfk_5` FOREIGN KEY (`holding_id`) REFERENCES `holdings` (`holding_id`) ON DELETE CASCADE ON UPDATE CASCADE
914
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
961
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
915
962
916
--
963
--
(-)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 590-595 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
590
('SubscriptionHistory','simplified','simplified|full','Define the display preference for serials issue history in OPAC','Choice'),
590
('SubscriptionHistory','simplified','simplified|full','Define the display preference for serials issue history in OPAC','Choice'),
591
('SubscriptionLog','1',NULL,'If ON, enables subscriptions log','YesNo'),
591
('SubscriptionLog','1',NULL,'If ON, enables subscriptions log','YesNo'),
592
('suggestion','1','','If ON, enables patron suggestions feature in OPAC','YesNo'),
592
('suggestion','1','','If ON, enables patron suggestions feature in OPAC','YesNo'),
593
('SummaryHoldings', '0', NULL, 'If ON, enables support for holdings records.', 'YesNo'),
593
('SuspendHoldsIntranet','1','Allow holds to be suspended from the intranet.',NULL,'YesNo'),
594
('SuspendHoldsIntranet','1','Allow holds to be suspended from the intranet.',NULL,'YesNo'),
594
('SuspendHoldsOpac','1','Allow holds to be suspended from the OPAC.',NULL,'YesNo'),
595
('SuspendHoldsOpac','1','Allow holds to be suspended from the OPAC.',NULL,'YesNo'),
595
('SvcMaxReportRows','10',NULL,'Maximum number of rows to return via the report web service.','Integer'),
596
('SvcMaxReportRows','10',NULL,'Maximum number of rows to return via the report web service.','Integer'),
(-)a/koha-tmpl/intranet-tmpl/prog/css/addholding.css (+171 lines)
Line 0 Link Here
1
#addholdingtabs {
2
	margin-top : 1em;
3
}
4
5
#addholdingtabs .ui-tabs-panel {
6
	float : left;
7
}
8
9
.buttonPlus {
10
	font-weight : bold;
11
	text-decoration : none;
12
}
13
14
.buttonMinus {
15
	font-weight : bold;
16
	text-decoration : none;
17
}
18
19
a.expandfield {
20
	text-decoration : none;
21
}
22
23
#authoritytabs {
24
	margin-top : 1em;
25
	margin-bottom : 1em;
26
}
27
28
.toptabs .ui-tabs-nav li a {
29
	padding : .2em 1.2em;
30
}
31
32
div.tag {
33
    clear: both;
34
}
35
36
div.subfield_line {
37
    padding-bottom: .3em;
38
    float: left;
39
    clear: left;
40
    width: 100%;
41
}
42
43
div.subfield_line label {
44
    font-size:89%;
45
    float: left;
46
	 padding-right : .4em;
47
    width: 16em;
48
    text-align: left;
49
    clear:left;
50
}
51
52
.subfieldcode img {
53
    cursor: pointer;
54
}
55
56
.tag_title {
57
	font-size : 90%;
58
	padding : .2em 0;
59
}
60
61
.tagnum {
62
	font-size : 110%;
63
	font-weight : bold;
64
	color : #000;
65
	padding : .1em .3em .1em 0;
66
}
67
68
a.tagnum {
69
	font-size : 110%;
70
	font-weight : bold;
71
	color : #000;
72
	padding : .1em .3em .1em 0;
73
	text-decoration : none;
74
}
75
76
.subfield {
77
	color : #00698a;
78
	float: left;
79
	width: 10em;
80
	text-align:right;
81
}
82
83
.subfieldcode {
84
	display: block;
85
	float: left;
86
}
87
88
.labelsubfield {
89
	float:left;
90
}
91
92
.input_marceditor {
93
	float:left;
94
	width:30em;
95
}
96
97
.indicator {
98
    width: 1em;
99
    box-sizing: content-box;
100
}
101
102
*html .input_marceditor {
103
	width : 15em;
104
}
105
106
#cataloguing_additem_newitem fieldset.rows label, #cataloguing_additem_newitem fieldset.rows span.label {
107
	font-size : 100%;
108
	width : 25%;
109
}
110
111
#cataloguing_additem_newitem fieldset.rows li {
112
	padding-bottom : 3px;
113
}
114
#cataloguing_additem_newitem .input_marceditor {
115
	width : auto;
116
}
117
118
#cataloguing_additem_newitem textarea.input_marceditor {
119
     width : 31em;
120
}
121
122
.mandatory_marker {
123
	color: red;
124
}
125
.linktools { display: block; white-space: nowrap; }
126
.linktools a { font-size : 75%; display:block;text-decoration:none;}
127
.linktools a {margin:0 2px;padding:2px;background-color:#FFF;text-align:center; }
128
.linktools a:first-child { border-bottom: 1px solid #DDD; }
129
.linktools a:hover { background-color: #FFC; }
130
.subfield_controls { margin : 0 .5em; }
131
.readonly { border-width : 1px; border-style: inset; padding-left : 15px; background: #EEE url(../img/locked.png) center left no-repeat; width:29em; }
132
133
#cataloguing_additem_itemlist {
134
	margin-bottom : 1em;
135
}
136
.yui-gf div.first {
137
	width : 19%;
138
}
139
140
.yui-gf .yui-u {
141
	width: 79.2%;
142
}
143
144
tbody tr.active:nth-child(2n+1) td,
145
tbody tr.active td {
146
    background-color: #FFFFCC;
147
}
148
149
#loading {
150
    background-color: #FFF;
151
    cursor: wait;
152
    height: 100%;
153
    left: 0;
154
    opacity: .7;
155
    position: fixed;
156
    top: 0;
157
    width: 100%;
158
    z-index: 1000;
159
}
160
#loading div {
161
    background : transparent url(../img/loading.gif) top left no-repeat;
162
    font-size : 175%;
163
    font-weight: bold;
164
    height: 2em;
165
    left: 50%;
166
    margin: -1em 0 0 -2.5em;
167
    padding-left : 50px;
168
    position: absolute;
169
    top: 50%;
170
    width: 15em;
171
}
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc (+4 lines)
Lines 10-15 CAN_user_serials_create_subscription ) %] Link Here
10
             <li><a id="newbiblio" href="/cgi-bin/koha/cataloguing/addbiblio.pl">New record</a></li>
10
             <li><a id="newbiblio" href="/cgi-bin/koha/cataloguing/addbiblio.pl">New record</a></li>
11
            [% END %]
11
            [% END %]
12
12
13
            [% IF ( show_summary_holdings && CAN_user_editcatalogue_edit_items ) %]
14
            <li><a id="newholding" href="/cgi-bin/koha/cataloguing/addholding.pl?biblionumber=[% biblionumber | 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 197-203 Link Here
197
          </div>
197
          </div>
198
        </td>
198
        </td>
199
    </tr>
199
    </tr>
200
201
    [% FOREACH loo IN frameworks %]
200
    [% FOREACH loo IN frameworks %]
202
        <tr>
201
        <tr>
203
            <td>[% loo.frameworkcode | html %]</td>
202
            <td>[% loo.frameworkcode | html %]</td>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref (+7 lines)
Lines 294-296 Cataloging: Link Here
294
            - "All values of repeating tags and subfields will be printed with the given RIS tag."
294
            - "All values of repeating tags and subfields will be printed with the given RIS tag."
295
            - "<br/>"
295
            - "<br/>"
296
            - "Use of TY ( record type ) as a key will <i>replace</i> the default TY with the field value of your choosing."
296
            - "Use of TY ( record type ) as a key will <i>replace</i> the default TY with the field value of your choosing."
297
    Holdings:
298
        -
299
            - pref: SummaryHoldings
300
              choices:
301
                  yes: Use
302
                  no: "Don't use"
303
            - 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 158-173 Link Here
158
<ul>
159
<ul>
159
    [% IF (SeparateHoldings) %]
160
    [% IF (SeparateHoldings) %]
160
        <li>
161
        <li>
161
            <a href="#holdings">[% LoginBranchname | html %] holdings ([% itemloop.size() || 0 | html %])</a>
162
            <a href="#holdings">[% LoginBranchname | html %] [% IF (show_summary_holdings) %]items[% ELSE %]holdings[% END %] ([% itemloop.size() || 0 | html %])</a>
162
        </li>
163
        </li>
163
        <li>
164
        <li>
164
            <a href="#otherholdings">Other holdings ([% otheritemloop.size() || 0 | html %])</a>
165
            <a href="#otherholdings">[% IF (show_summary_holdings) %]Other items[% ELSE %]Other holdings[% END %] ([% otheritemloop.size() || 0 | html %])</a>
165
        </li>
166
        </li>
166
    [% ELSE %]
167
    [% ELSE %]
167
        <li>
168
        <li>
168
            <a href="#holdings">Holdings ([% itemloop.size() || 0 | html %])</a>
169
            <a href="#holdings">[% IF (show_summary_holdings) %]Items[% ELSE %]Holdings[% END %] ([% itemloop.size() || 0 | html %])</a>
169
        </li>
170
        </li>
170
    [% END %]
171
    [% END %]
172
    [% IF (show_summary_holdings) %]
173
        <li><a href="#summaryholdings">Holdings ([% summary_holdings.count() || 0 | html %])</a></li>
174
    [% END %]
171
[% IF ( MARCNOTES || notes ) %]<li><a href="#description">Descriptions</a></li>[% END %]
175
[% IF ( MARCNOTES || notes ) %]<li><a href="#description">Descriptions</a></li>[% END %]
172
[% IF ( subscriptionsnumber ) %]<li><a href="#subscriptions">Subscriptions</a></li>[% END %]
176
[% IF ( subscriptionsnumber ) %]<li><a href="#subscriptions">Subscriptions</a></li>[% END %]
173
[% IF Koha.Preference('AcquisitionDetails') %]<li><a href="#acq_details">Acquisition details</a></li>[% END %]
177
[% IF Koha.Preference('AcquisitionDetails') %]<li><a href="#acq_details">Acquisition details</a></li>[% END %]
Lines 185-190 Link Here
185
[% END %]
189
[% END %]
186
</ul>
190
</ul>
187
191
192
[% IF ( show_summary_holdings ) %]
193
    <div id="summaryholdings">
194
195
    [% IF ( summary_holdings ) %]
196
        <div class="summaryholdings_table_controls">
197
        </div>
198
        <table class="summaryholdings_table">
199
            <thead>
200
                <tr>
201
                    <th>Library</th>
202
                    <th>Location</th>
203
                    <th>Collection</th>
204
                    <th>Call number</th>
205
                    <th>Status</th>
206
                    [% IF ( CAN_user_editcatalogue_edit_items ) %]<th class="NoSort">&nbsp;</th>[% END %]
207
                </tr>
208
            </thead>
209
            <tbody>
210
                [% FOREACH holding IN summary_holdings %]
211
                    <tr>
212
                        <td class="branch">[% UNLESS ( singlebranchmode ) %][% Branches.GetName( holding.holdingbranch ) | html %] [% END %]</td>
213
                        <td class="location"><span class="shelvingloc">[% holding.location | html %]</span>
214
                        <td class="collection">[% holding.ccode | html %]</span>
215
                        <td class="itemcallnumber">[% IF ( holding.callnumber ) %] [% holding.callnumber | html %][% END %]</td>
216
                        <td class="status">
217
                            [% IF ( holding.suppress ) %]
218
                                <span class="suppressed">Suppressed in OPAC</span>
219
                            [% END %]
220
                        </td>
221
                    [% IF CAN_user_editcatalogue_edit_items %]
222
                        <td class="actions">
223
                            <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>
224
                            <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>
225
                            <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>
226
                            <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>
227
                        </td>
228
                    [% END %]
229
                    </tr>
230
                [% END %]
231
            </tbody>
232
        </table>
233
    [% ELSE %]
234
        <div id="noitems">No holdings records</div>
235
    [% END %]
236
237
    </div>
238
[% END %]
239
188
[% items_table_block_iter = 0 %]
240
[% items_table_block_iter = 0 %]
189
[% BLOCK items_table %]
241
[% BLOCK items_table %]
190
    [% items_table_block_iter = items_table_block_iter + 1 %]
242
    [% items_table_block_iter = items_table_block_iter + 1 %]
Lines 208-213 Link Here
208
            <tr>
260
            <tr>
209
                [% IF (StaffDetailItemSelection) %]<th class="NoSort"></th>[% END %]
261
                [% IF (StaffDetailItemSelection) %]<th class="NoSort"></th>[% END %]
210
                [% IF ( item_level_itypes ) %]<th>Item type</th>[% END %]
262
                [% IF ( item_level_itypes ) %]<th>Item type</th>[% END %]
263
                [% IF ( show_summary_holdings ) %]<th>Holdings record</th>[% END %]
211
                <th>Current location</th>
264
                <th>Current location</th>
212
                <th>Home library</th>
265
                <th>Home library</th>
213
                [% IF ( itemdata_ccode ) %]<th>Collection</th>[% END %]
266
                [% IF ( itemdata_ccode ) %]<th>Collection</th>[% END %]
Lines 246-251 Link Here
246
                            [% item.translated_description | html %]
299
                            [% item.translated_description | html %]
247
                        </td>
300
                        </td>
248
                    [% END %]
301
                    [% END %]
302
                    [% IF ( show_summary_holdings ) %]
303
                        <td class="holding">[% Holdings.GetLocation(item.holding_id) | html %]</td>
304
                    [% END %]
249
                    <td class="location">[% UNLESS ( singlebranchmode ) %][% Branches.GetName( item.branchcode ) | html %] [% END %]</td>
305
                    <td class="location">[% UNLESS ( singlebranchmode ) %][% Branches.GetName( item.branchcode ) | html %] [% END %]</td>
250
                    <td class="homebranch">
306
                    <td class="homebranch">
251
                        [% Branches.GetName(item.homebranch) | html %]
307
                        [% Branches.GetName(item.homebranch) | html %]
Lines 908-919 Link Here
908
                    $("input[name='itemnumber'][type='checkbox']", $("#"+tab)).prop('checked', false);
964
                    $("input[name='itemnumber'][type='checkbox']", $("#"+tab)).prop('checked', false);
909
                    itemSelectionBuildActionLinks(tab);
965
                    itemSelectionBuildActionLinks(tab);
910
                });
966
                });
967
968
                $('a.delete').click(function() {
969
                    return confirm(_("Are you sure?"));
970
                });
911
            });
971
            });
912
        [% END %]
972
        [% END %]
913
973
914
        $(document).ready(function() {
974
        $(document).ready(function() {
915
            $('#bibliodetails').tabs();
975
            $('#bibliodetails').tabs();
916
            [% IF count == 0 %]
976
            [% IF count == 0 and not show_summary_holdings %]
917
                $('#bibliodetails').tabs("option", "active", 3);
977
                $('#bibliodetails').tabs("option", "active", 3);
918
            [% END %]
978
            [% END %]
919
            $('#search-form').focus();
979
            $('#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 478-483 Link Here
478
479
479
                                            <td>
480
                                            <td>
480
                                                <div class="availability">
481
                                                <div class="availability">
482
                                                    [% IF ( SEARCH_RESULT.summary_holdings ) %]
483
                                                        <div class="holdings">
484
                                                            <strong>Holdings</strong>
485
                                                            <ul>
486
                                                            [% FOREACH holding IN SEARCH_RESULT.summary_holdings %]
487
                                                                <li>
488
                                                                    [% Holdings.GetLocation(holding) | html %]
489
                                                                </li>
490
                                                            [% END %]
491
                                                            </ul>
492
                                                        </div>
493
                                                    [% END %]
494
481
                                                    [% IF ( SEARCH_RESULT.items_count ) %]
495
                                                    [% IF ( SEARCH_RESULT.items_count ) %]
482
                                                        <strong>
496
                                                        <strong>
483
                                                            [% IF MaxSearchResultsItemsPerRecordStatusCheck && SEARCH_RESULT.items_count > MaxSearchResultsItemsPerRecordStatusCheck %]
497
                                                            [% IF MaxSearchResultsItemsPerRecordStatusCheck && SEARCH_RESULT.items_count > MaxSearchResultsItemsPerRecordStatusCheck %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addholding.tt (+620 lines)
Line 0 Link Here
1
[% USE raw %]
2
[% USE Asset %]
3
[% USE Koha %]
4
[% INCLUDE 'doc-head-open.inc' %]
5
<title>Koha &rsaquo; Cataloging &rsaquo; [% title | html %] [% IF ( author ) %] by [% author | html %][% END %] (Record #[% biblionumber | html %]) &rsaquo; Holdings</title>
6
[% INCLUDE 'doc-head-close.inc' %]
7
 [% Asset.js("lib/hc-sticky.js") | $raw %]
8
 [% Asset.js("js/cataloging.js") | $raw %]
9
[% INCLUDE 'browser-strings.inc' %]
10
[% Asset.js("js/browser.js") | $raw %]
11
[% Asset.css("css/addholding.css") | $raw %]
12
[% INCLUDE 'select2.inc' %]
13
[% IF ( bidi ) %]
14
   [% Asset.css("css/right-to-left.css") | $raw %]
15
[% END %]
16
</head>
17
<body id="cat_addholding" class="cat">
18
19
   <div id="loading">
20
       <div>Loading, please wait...</div>
21
   </div>
22
23
[% INCLUDE 'header.inc' %]
24
25
<div id="breadcrumbs">
26
          <a href="/cgi-bin/koha/mainpage.pl">Home</a>
27
 &rsaquo; <a href="/cgi-bin/koha/cataloguing/addbooks.pl">Cataloging</a>
28
 &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>
29
 &rsaquo; <a href="/cgi-bin/koha/cataloguing/addholding.pl?biblionumber=[% biblionumber | uri %]">Holdings</a>
30
</div>
31
32
<div class="main container-fluid">
33
    <div class="row">
34
        <div class="col-md-10 col-md-offset-1">
35
36
<h1>
37
[% IF ( holding_id ) %]Editing holdings record number [% holding_id | html %]
38
[% ELSE %]Add holdings record
39
[% END %]
40
</h1>
41
42
[% IF ( error_items_exist ) %]<div class="dialog alert"><strong>This holdings record has items attached.</strong> Please delete them first.</div>[% END %]
43
[% IF ( error_delete_failed ) %]<div class="dialog alert"><strong>Error deleting the record.</strong></div>[% END %]
44
45
[% IF ( done ) %]
46
    <script>
47
        opener.document.forms['f'].holding_id.value=[% holding_id | html %];
48
        window.close();
49
    </script>
50
[% ELSE %]
51
    <form method="post" name="f" id="f" action="/cgi-bin/koha/cataloguing/addholding.pl" onsubmit="return Check();">
52
    <input type="hidden" value="[% IF ( holding_id ) %]view[% ELSE %]holdings[% END %]" id="redirect" name="redirect" />
53
    <input type="hidden" value="" id="current_tab" name="current_tab" />
54
[% END %]
55
56
<div id="toolbar" class="btn-toolbar">
57
    [% IF CAN_user_editcatalogue_edit_items %]
58
        <div class="btn-group">
59
            <button class="btn btn-default btn-sm" id="saverecord"><i class="fa fa-save"></i> Save</button>
60
            <button class="btn btn-default btn-sm dropdown-toggle" data-toggle="dropdown">
61
            <span class="caret"></span>
62
            </button>
63
            <ul class="dropdown-menu">
64
                <li><a id="saveandview" href="#">Save and view record</a></li>
65
                <li><a id="saveanditems" href="#">Save and edit items</a></li>
66
                <li><a id="saveandcontinue" href="#">Save and continue editing</a></li>
67
            </ul>
68
        </div>
69
    [% END %]
70
71
    <div class="btn-group">
72
        <button class="btn btn-default btn-sm dropdown-toggle" data-toggle="dropdown"><i class="fa fa-cog"></i> Settings <span class="caret"></span></button>
73
        <ul id="settings-menu" class="dropdown-menu">
74
            [% IF Koha.Preference( 'EnableAdvancedCatalogingEditor' ) == 1 %]
75
                [% # disabled until supported <li><a href="#" id="switcheditor">Switch to advanced editor</a></li> %]
76
            [% END %]
77
            [% IF marcflavour != 'NORMARC' AND NOT advancedMARCEditor %]
78
                <li>
79
                    <a href="#" id="marcDocsSelect"><i class="fa fa-check-square-o"></i> Show MARC tag documentation links</a>
80
                <li>
81
                    <a href="#" id="marcTagsSelect"><i class="fa fa-check-square-o"></i> Show tags</a>
82
                </li>
83
            [% END %]
84
            <li class="divider"></li>
85
            <li class="nav-header">Change framework</li>
86
            <li>
87
                <a href="#" class="change-framework" data-frameworkcode="">
88
                    [% IF ( frameworkcode ) %]
89
                       <i class="fa fa-fw">&nbsp;</i>
90
                    [% ELSE %]
91
                        <i class="fa fa-fw fa-check"></i>
92
                    [% END %]
93
                    Default
94
                </a>
95
            </li>
96
            [% FOREACH framework IN frameworks%]
97
                <li>
98
                    <a href="#" class="change-framework" data-frameworkcode="[% framework.frameworkcode | html %]">
99
                        [% IF framework.frameworkcode == frameworkcode %]
100
                            <i class="fa fa-fw fa-check"></i>
101
                        [% ELSE %]
102
                            <i class="fa fa-fw">&nbsp;</i>
103
                        [% END %]
104
                        [% framework.frameworktext | html %]
105
                    </a>
106
                </li>
107
            [% END %]
108
        </ul>
109
    </div>
110
    <div class="btn-group">
111
        <a class="btn btn-default btn-sm" id="cancel" href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblionumber | url %]">Cancel</a>
112
    </div>
113
</div>
114
115
[% IF ( popup ) %]
116
        <input type="hidden" name="mode" value="popup" />
117
[% END %]
118
        <input type="hidden" name="op" value="add" />
119
        <input type="hidden" id="frameworkcode" name="frameworkcode" value="[% frameworkcode | html %]" />
120
        <input type="hidden" name="biblionumber" value="[% biblionumber | html %]" />
121
        <input type="hidden" name="holding_id" value="[% holding_id | html %]" />
122
        <input type="hidden" name="changed_framework" value="" />
123
124
<div id="addholdingtabs" class="toptabs numbered">
125
    <ul>
126
        [% FOREACH BIG_LOO IN BIG_LOOP %]
127
        <li><a href="#tab[% BIG_LOO.number | uri %]XX">[% BIG_LOO.number | html %]</a></li>
128
        [% END %]
129
    </ul>
130
131
[% FOREACH BIG_LOO IN BIG_LOOP %]
132
    <div id="tab[% BIG_LOO.number | html %]XX">
133
134
    [% FOREACH innerloo IN BIG_LOO.innerloop %]
135
    [% IF ( innerloo.tag ) %]
136
    <div class="tag" id="tag_[% innerloo.tag | html %]_[% innerloo.index | html %][% innerloo.random | html %]">
137
        <div class="tag_title" id="div_indicator_tag_[% innerloo.tag | html %]_[% innerloo.index | html %][% innerloo.random | html %]">
138
            [% IF advancedMARCEditor %]
139
                <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>
140
            [% ELSE %]
141
                <span class="tagnum" title="[% innerloo.tag_lib | html %]">[% innerloo.tag | html %]</span>
142
                [% IF marcflavour != 'NORMARC' %]<a href="#" class="marcdocs" onclick="PopupMARCFieldDoc('[% innerloo.tag | html %]'); return false;">&nbsp;?</a>[% END %]
143
            [% END %]
144
                [% IF ( innerloo.fixedfield ) %]
145
                    <input type="text"
146
                        tabindex="1"
147
                        class="indicator flat"
148
                        style="display:none;"
149
                        name="tag_[% innerloo.tag | html %]_indicator1_[% innerloo.index | html %][% innerloo.random | html %]"
150
                        size="1"
151
                        maxlength="1"
152
                        value="[% innerloo.indicator1 | html %]" />
153
                    <input type="text"
154
                        tabindex="1"
155
                        class="indicator flat"
156
                        style="display:none;"
157
                        name="tag_[% innerloo.tag | html %]_indicator2_[% innerloo.index | html %][% innerloo.random | html %]"
158
                        size="1"
159
                        maxlength="1"
160
                        value="[% innerloo.indicator2 | html %]" />
161
                [% ELSE %]
162
                    <input type="text"
163
                        tabindex="1"
164
                        class="indicator flat"
165
                        name="tag_[% innerloo.tag | html %]_indicator1_[% innerloo.index | html %][% innerloo.random | html %]"
166
                        size="1"
167
                        maxlength="1"
168
                        value="[% innerloo.indicator1 | html %]" />
169
                    <input type="text"
170
                        tabindex="1"
171
                        class="indicator flat"
172
                        name="tag_[% innerloo.tag | html %]_indicator2_[% innerloo.index | html %][% innerloo.random | html %]"
173
                        size="1"
174
                        maxlength="1"
175
                        value="[% innerloo.indicator2 | html %]" />
176
                [% END %] -
177
178
            [% UNLESS advancedMARCEditor %]
179
                <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>
180
            [% END %]
181
                <span class="field_controls">
182
                [% IF ( innerloo.repeatable ) %]
183
                    <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">
184
                        <img src="[% interface | html %]/[% theme | html %]/img/repeat-tag.png" alt="Repeat this Tag" />
185
                    </a>
186
                [% END %]
187
                    <a href="#" tabindex="1" class="buttonMinus" onclick="UnCloneField('tag_[% innerloo.tag | html %]_[% innerloo.index | html %][% innerloo.random | html %]'); return false;" title="Delete this Tag">
188
                        <img src="[% interface | html %]/[% theme | html %]/img/delete-tag.png" alt="Delete this Tag" />
189
                    </a>
190
                </span>
191
192
        </div>
193
194
        [% FOREACH subfield_loo IN innerloo.subfield_loop %]
195
            <!--  One line on the marc editor -->
196
            <div class="subfield_line" style="[% subfield_loo.visibility | html %]" id="subfield[% subfield_loo.tag | html %][% subfield_loo.subfield | html %][% subfield_loo.random | html %]">
197
198
                [% UNLESS advancedMARCEditor %]
199
                    [% 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">
200
                    [% ELSE %]<label for="tag_[% subfield_loo.tag | html %]_subfield_[% subfield_loo.subfield | html %]_[% subfield_loo.index | html %]_[% subfield_loo.index_subfield | html %]" class="labelsubfield">
201
                    [% END %]
202
                [% END %]
203
204
                <span class="subfieldcode">
205
                    [% IF ( subfield_loo.fixedfield ) %]
206
                        <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" />
207
                    [% ELSE %]
208
                        <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" />
209
                    [% END %]
210
                        <input type="text"
211
                            title="[% subfield_loo.marc_lib | html %]"
212
                            style=" [% IF ( subfield_loo.fixedfield ) %]display:none; [% END %]border:0;"
213
                            name="tag_[% subfield_loo.tag | html %]_code_[% subfield_loo.subfield | html %]_[% subfield_loo.index | html %]_[% subfield_loo.index_subfield | html %]"
214
                            value="[% subfield_loo.subfield | html %]"
215
                            size="1"
216
                            maxlength="1"
217
                            class="flat"
218
                            tabindex="0" />
219
                </span>
220
221
                [% UNLESS advancedMARCEditor %]
222
                    [% IF ( subfield_loo.mandatory ) %]<span class="subfield subfield_mandatory">[% ELSE %]<span class="subfield">[% END %]
223
                        [% subfield_loo.marc_lib | html %]
224
                        [% IF ( subfield_loo.mandatory ) %]<span class="mandatory_marker" title="This field is mandatory">*</span>[% END %]
225
                    </span>
226
                    </label>
227
                [% END %]
228
229
                [% SET mv = subfield_loo.marc_value %]
230
                [% IF ( mv.type == 'text' ) %]
231
                    [% IF ( mv.readonly == 1 ) %]
232
                    <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" />
233
                    [% ELSE %]
234
                    <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 -%]" />
235
                    [% END %]
236
                    [% IF ( mv.authtype ) %]
237
                    <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>
238
                    [% END %]
239
                [% ELSIF ( mv.type == 'text_complex' ) %]
240
                    <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 -%]" />
241
                    <span class="subfield_controls">
242
                        [% IF mv.noclick %]
243
                            <a href="#" class="buttonDot tag_editor disabled" tabindex="-1" title="No popup"></a>
244
                        [% ELSE %]
245
                            <a href="#" id="buttonDot_[% mv.id | html %]" class="buttonDot tag_editor framework_plugin" tabindex="1" title="Tag editor">Tag editor</a>
246
                        [% END %]
247
                    </span>
248
                    [% mv.javascript | $raw %]
249
                [% ELSIF ( mv.type == 'hidden' ) %]
250
                    <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 -%]" />
251
                [% ELSIF ( mv.type == 'textarea' ) %]
252
                    <textarea cols="70" rows="4" id="[%- mv.id | html -%]" name="[%- mv.name | html -%]" class="input_marceditor" tabindex="1">[%- mv.value | html -%]</textarea>
253
                [% ELSIF ( mv.type == 'select' ) %]
254
                    <select name="[%- mv.name | html -%]" tabindex="1" size="1" class="input_marceditor" id="[%- mv.id | html -%]">
255
                    [% FOREACH aval IN mv.values %]
256
                        [% IF aval == mv.default %]
257
                        <option value="[%- aval | html -%]" selected="selected">[%- mv.labels.$aval | html -%]</option>
258
                        [% ELSE %]
259
                        <option value="[%- aval | html -%]">[%- mv.labels.$aval | html -%]</option>
260
                        [% END %]
261
                    [% END %]
262
                    </select>
263
                [% END %]
264
265
                <span class="subfield_controls">
266
                [% IF ( subfield_loo.repeatable ) %]
267
                    <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;">
268
                        <img src="[% interface | html %]/[% theme | html %]/img/clone-subfield.png" alt="Clone" title="Clone this subfield" />
269
                    </a>
270
                    <a href="#" class="buttonMinus" tabindex="1" onclick="UnCloneField('subfield[% subfield_loo.tag | html %][% subfield_loo.subfield | html %][% subfield_loo.random | html %]'); return false;">
271
                        <img src="[% interface | html %]/[% theme | html %]/img/delete-subfield.png" alt="Delete" title="Delete this subfield" />
272
                    </a>
273
                [% END %]
274
                </span>
275
276
            </div>
277
            <!-- End of the line -->
278
        [% END %]
279
280
    </div>
281
    [% END %]<!-- if innerloo.tag -->
282
    [% END %]<!-- BIG_LOO.innerloop -->
283
    </div>
284
[% END %]<!-- BIG_LOOP -->
285
286
</div><!-- tabs -->
287
288
</form>
289
290
</div>
291
</div>
292
</div>
293
294
<script>
295
    var browser = KOHA.browser('[% searchid | html %]', parseInt('[% biblionumber | html %]', 10));
296
    browser.show();
297
298
    $(window).load(function() {
299
        $("#loading").hide();
300
    });
301
    var Sticky;
302
    $(document).ready(function() {
303
        $('#addholdingtabs').tabs().bind('show.ui-tabs', function(e, ui) {
304
            $("#"+ui.panel.id+" input:eq(0)").focus();
305
        });
306
307
        [% IF tab %]
308
            $('#addholdingtabs').selectTabByID("#[% tab | html %]");
309
        [% END %]
310
311
        Sticky = $("#toolbar");
312
        Sticky.hcSticky({
313
            stickTo: ".main",
314
            stickyClass: "floating"
315
        });
316
317
        /* check cookie to hide/show marcdocs*/
318
        if($.cookie("marcdocs_[% borrowernumber | html %]") == 'hide'){
319
            toggleMARCdocLinks(false);
320
        } else {
321
            toggleMARCdocLinks(true);
322
        }
323
324
        $("#marcDocsSelect").click(function(){
325
            if($.cookie("marcdocs_[% borrowernumber | html %]") == 'hide'){
326
                toggleMARCdocLinks(true);
327
            } else {
328
                toggleMARCdocLinks(false);
329
            }
330
        });
331
332
        /* check cookie to hide/show marc tags*/
333
        var marctags_cookie = $.cookie("marctags_[% borrowernumber | html %]");
334
        if (marctags_cookie == 'hide'){
335
            toggleMARCTagLinks(false);
336
        } else if( marctags_cookie == 'show'){
337
            toggleMARCTagLinks(true)
338
        } else {
339
            [% UNLESS Koha.Preference("hide_marc") %]
340
                toggleMARCTagLinks(true)
341
            [% ELSE %]
342
                toggleMARCTagLinks(false);
343
            [% END %]
344
        }
345
346
        $("#marcTagsSelect").click(function(){
347
            if( $.cookie("marctags_[% borrowernumber | html %]") == 'hide'){
348
                toggleMARCTagLinks(true)
349
            } else {
350
                toggleMARCTagLinks(false);
351
            }
352
        });
353
354
        $("#saverecord").click(function(){
355
            $(".btn-group").removeClass("open");
356
            onOption();
357
            return false;
358
        });
359
360
        $("#saveandview").click(function(){
361
            $(".btn-group").removeClass("open");
362
            redirect("view");
363
            return false;
364
        });
365
366
        $("#saveanditems").click(function(){
367
            $(".btn-group").removeClass("open");
368
            redirect("items");
369
            return false;
370
        });
371
        $("#saveandcontinue").click(function(){
372
            $(".btn-group").removeClass("open");
373
            var tab = $("#addholdingtabs li.ui-tabs-active:first a").attr('href');
374
            tab = tab.replace('#', '');
375
            $("#current_tab").val(tab);
376
            redirect("just_save", tab);
377
            return false;
378
        });
379
380
        $( '#switcheditor' ).click( function() {
381
382
            if ( !confirm( _("Any changes will not be saved. Continue?") ) ) return false;
383
384
            $.cookie( 'catalogue_editor_[% USER_INFO.borrowernumber | html %]', 'advanced', { expires: 365, path: '/' } );
385
386
            var holding_id = [% holding_id || "''" | html %];
387
            window.location = '/cgi-bin/koha/cataloguing/editor.pl#catalog/' + biblionumber + '/holdings/' + holding_id;
388
389
            return false;
390
        } );
391
        $(".change-framework").on("click", function(){
392
            var frameworkcode = $(this).data("frameworkcode");
393
            $("#frameworkcode").val( frameworkcode );
394
            Changefwk();
395
        });
396
    });
397
398
function redirect(dest){
399
    $("#redirect").attr("value",dest);
400
    return Check();
401
}
402
403
[% IF ( CAN_user_editcatalogue_edit_items ) %]
404
    var onOption = function () {
405
        return Check();
406
    }
407
[% END %]
408
409
function Dopop(link,i) {
410
    defaultvalue = document.getElementById(i).value;
411
    window.open(link+"&result="+defaultvalue,"valuebuilder",'width=700,height=550,toolbar=false,scrollbars=yes');
412
}
413
414
function PopupMARCFieldDoc(field) {
415
    [% IF ( marcflavour == 'MARC21' ) %]
416
        _MARC21FieldDoc(field);
417
    [% ELSIF ( marcflavour == 'UNIMARC' ) %]
418
        _UNIMARCFieldDoc(field);
419
    [% END %]
420
}
421
422
function _MARC21FieldDoc(field) {
423
    if(field == 0) {
424
        window.open("http://www.loc.gov/marc/holdings/hdleader.html");
425
    } else if (field < 900) {
426
        window.open("http://www.loc.gov/marc/holdings/hd" + ("000"+field).slice(-3) + ".html");
427
    } else {
428
        window.open("http://www.loc.gov/marc/holdings/hd9xx.html");
429
    }
430
}
431
432
function _UNIMARCFieldDoc(field) {
433
    /* http://archive.ifla.org/VI/3/p1996-1/ is an outdated version of UNIMARC, but
434
       seems to be the only version available that can be linked to per tag.  More recent
435
       versions of the UNIMARC standard are available on the IFLA website only as
436
       PDFs!
437
    */
438
    var url;
439
    if (field == 0) {
440
        url = "http://archive.ifla.org/VI/3/p1996-1/uni.htm";
441
    } else {
442
        var first = field.substring(0,1);
443
        url = "http://archive.ifla.org/VI/3/p1996-1/uni" + first + ".htm#";
444
        if (first == 0) url = url + "b";
445
        url = first == 9
446
              ? "http://archive.ifla.org/VI/3/p1996-1/uni9.htm"
447
              : url + field;
448
    }
449
    window.open(url);
450
}
451
452
/*
453
 * Functions to hide/show marc docs and tags links
454
 */
455
456
function toggleMARCdocLinks(flag){
457
    if( flag === true ){
458
        $(".marcdocs").show();
459
        $.cookie("marcdocs_[% borrowernumber | html %]",'show', { path: "/", expires: 365 });
460
        $("#marcDocsSelect i").addClass('fa-check-square-o').removeClass('fa-square-o');
461
    } else {
462
        $(".marcdocs").hide();
463
        $.cookie("marcdocs_[% borrowernumber | html %]",'hide', { path: "/", expires: 365 });
464
        $("#marcDocsSelect i").removeClass('fa-check-square-o').addClass('fa-square-o');
465
    }
466
}
467
468
function toggleMARCTagLinks(flag){
469
    if( flag === true ){
470
        $(".tagnum").show();
471
        $(".subfieldcode").show();
472
        $.cookie("marctags_[% borrowernumber | html %]",'show', { path: "/", expires: 365 });
473
        $("#marcTagsSelect i").addClass('fa-check-square-o').removeClass('fa-square-o');
474
    } else {
475
        $(".tagnum").hide();
476
        $(".subfieldcode").hide();
477
        $.cookie("marctags_[% borrowernumber | html %]",'hide', { path: "/", expires: 365 });
478
        $("#marcTagsSelect i").removeClass('fa-check-square-o').addClass('fa-square-o');
479
    }
480
}
481
482
/**
483
 * check if mandatory subfields are written
484
 */
485
function AreMandatoriesNotOk(){
486
    var mandatories = new Array();
487
    var mandatoriesfields = new Array();
488
    var tab = new Array();
489
    var label = new Array();
490
    var flag=0;
491
    var tabflag= new Array();
492
    [% FOREACH BIG_LOO IN BIG_LOOP %]
493
        [% FOREACH innerloo IN BIG_LOO.innerloop %]
494
            [% IF ( innerloo.mandatory ) %]
495
                mandatoriesfields.push(new Array("[% innerloo.tag | html %]","[% innerloo.index | html %][% innerloo.random | html %]","[% innerloo.index | html %]"));
496
            [% END %]
497
            [% FOREACH subfield_loo IN innerloo.subfield_loop %]
498
                [% IF ( subfield_loo.mandatory ) %]
499
                    mandatories.push("[% subfield_loo.id | html %]");
500
                    tab.push("[% BIG_LOO.number | html %]");
501
                    label.push("[% subfield_loo.marc_lib | $raw %]");
502
                [% END %]
503
            [% END %]
504
        [% END %]
505
    [% END %]
506
    var StrAlert = _("Can't save this record because the following field aren't filled:");
507
    StrAlert += "\n\n";
508
    for (var i=0,len=mandatories.length; i<len ; i++) {
509
        var tag=mandatories[i].substr(4,3);
510
        var subfield=mandatories[i].substr(17,1);
511
        var tagnumber=mandatories[i].substr(19,mandatories[i].lastIndexOf("_")-19);
512
        if (tabflag[tag+subfield+tagnumber] ==  null) {
513
            tabflag[tag+subfield+tagnumber]=new Array();
514
            tabflag[tag+subfield+tagnumber][0]=0;
515
        }
516
        if (tabflag[tag+subfield+tagnumber][0] != 1 && (document.getElementById(mandatories[i]) != null && ! document.getElementById(mandatories[i]).value || document.getElementById(mandatories[i]) == null)) {
517
            tabflag[tag+subfield+tagnumber][0] = 0 + tabflag[tag+subfield+tagnumber] ;
518
            document.getElementById(mandatories[i]).setAttribute('class','subfield_not_filled');
519
            $('#' + mandatories[i]).focus();
520
            tabflag[tag+subfield+tagnumber][1]=label[i];
521
            tabflag[tag+subfield+tagnumber][2]=tab[i];
522
        } else {
523
            tabflag[tag+subfield+tagnumber][0] = 1;
524
        }
525
    }
526
    for (var tagsubfieldid in tabflag) {
527
      if (tabflag[tagsubfieldid][0]==0) {
528
        var tag=tagsubfieldid.substr(0,3);
529
        var subfield=tagsubfieldid.substr(3,1);
530
        StrAlert += "\t* "+_("tag %s subfield %s %s in tab %s").format(tag, subfield, tabflag[tagsubfieldid][1], tabflag[tagsubfieldid][2]) + "\n";
531
        flag=1;
532
      }
533
    }
534
535
    /* Check for mandatories field(not subfields) */
536
    for (var i=0,len=mandatoriesfields.length; i<len; i++) {
537
        isempty  = true;
538
        arr      = mandatoriesfields[i];
539
        divid    = "tag_" + arr[0] + "_" + arr[1];
540
        varegexp = new RegExp("^tag_" + arr[0] + "_code_");
541
542
        if(parseInt(arr[0]) >= 10) {
543
            elem = document.getElementById(divid);
544
            eleminputs = elem.getElementsByTagName('input');
545
546
            for(var j=0,len2=eleminputs.length; j<len2; j++){
547
548
                if(eleminputs[j].name.match(varegexp) && eleminputs[j].value){
549
                        inputregexp = new RegExp("^tag_" + arr[0] + "_subfield_" + eleminputs[j].value + "_" + arr[2]);
550
551
                        for( var k=0; k<len2; k++){
552
                            if(eleminputs[k].id.match(inputregexp) && eleminputs[k].value){
553
                                isempty = false
554
                            }
555
                        }
556
557
                        elemselect = elem.getElementsByTagName('select');
558
                        for( var k=0; k<elemselect.length; k++){
559
                            if(elemselect[k].id.match(inputregexp) && elemselect[k].value){
560
                                isempty = false
561
                            }
562
                        }
563
                }
564
            }
565
566
            elemtextareas = elem.getElementsByTagName('textarea');
567
            for(var j=0,len2=elemtextareas.length; j<len2; j++){
568
                // this bit assumes that the only textareas in this context would be for subfields
569
                if (elemtextareas[j].value) {
570
                    isempty = false;
571
                }
572
            }
573
        } else {
574
            isempty = false;
575
        }
576
577
        if (isempty) {
578
            flag = 1;
579
                    StrAlert += "\t* " + _("Field %s is mandatory, at least one of its subfields must be filled.").format(arr[0]) + "\n";
580
        }
581
    }
582
583
    if (flag) {
584
        return StrAlert;
585
    } else {
586
        return flag;
587
    }
588
}
589
590
/**
591
 *
592
 *
593
 */
594
function Check(){
595
    var StrAlert = AreMandatoriesNotOk();
596
    if( ! StrAlert ){
597
        document.f.submit();
598
        return true;
599
    } else {
600
        alert(StrAlert);
601
        return false;
602
    }
603
}
604
605
function Changefwk() {
606
    var f = document.f;
607
    f.op.value = "[% op | html %]";
608
    f.biblionumber.value = "[% biblionumber | html %]";
609
    f.holding_id.value = "[% holding_iddata | html %]";
610
    f.changed_framework.value = "changed";
611
    f.submit();
612
}
613
614
$(document).ready(function() {
615
    $('.subfield_line select').select2();
616
});
617
</script>
618
619
620
[% 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 235-240 Link Here
235
                                                        <a href="/cgi-bin/koha/catalogue/moredetail.pl?item=[% loopro.object | uri %]&amp;biblionumber=[% loopro.biblionumber | uri %]&amp;bi=[% loopro.biblioitemnumber | uri %]#item[% loopro.object | uri %]">Item [% loopro.object | html %]</a>
235
                                                        <a href="/cgi-bin/koha/catalogue/moredetail.pl?item=[% loopro.object | uri %]&amp;biblionumber=[% loopro.biblionumber | uri %]&amp;bi=[% loopro.biblioitemnumber | uri %]#item[% loopro.object | uri %]">Item [% loopro.object | html %]</a>
236
                                                    [% ELSIF ( loopro.info.substr(0, 6) == 'biblio' ) %]
236
                                                    [% ELSIF ( loopro.info.substr(0, 6) == 'biblio' ) %]
237
                                                        <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% loopro.object | uri %]" title="Display detail for this biblio">Biblio [% loopro.object | html %]</a>
237
                                                        <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% loopro.object | uri %]" title="Display detail for this biblio">Biblio [% loopro.object | html %]</a>
238
                                                    [% ELSIF ( loopro.info.substr(0, 7) == 'holding' ) %]
239
                                                        <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>
238
                                                    [% ELSE %]
240
                                                    [% ELSE %]
239
                                                        [% loopro.object | html %]
241
                                                        [% loopro.object | html %]
240
                                                    [% END %]
242
                                                    [% END %]
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt (+28 lines)
Lines 6-11 Link Here
6
[% USE Branches %]
6
[% USE Branches %]
7
[% USE ColumnsSettings %]
7
[% USE ColumnsSettings %]
8
[% USE AuthorisedValues %]
8
[% USE AuthorisedValues %]
9
[% USE Holdings %]
9
[% SET TagsShowEnabled = ( ( Koha.Preference( 'TagsEnabled' ) == 1 ) && TagsShowOnDetail ) %]
10
[% SET TagsShowEnabled = ( ( Koha.Preference( 'TagsEnabled' ) == 1 ) && TagsShowOnDetail ) %]
10
[% SET TagsInputEnabled = ( ( Koha.Preference( 'opacuserlogin' ) == 1 ) && ( Koha.Preference( 'TagsEnabled' ) == 1 ) && TagsInputOnDetail ) %]
11
[% SET TagsInputEnabled = ( ( Koha.Preference( 'opacuserlogin' ) == 1 ) && ( Koha.Preference( 'TagsEnabled' ) == 1 ) && TagsInputOnDetail ) %]
11
[% IF Koha.Preference('AmazonAssocTag') %]
12
[% IF Koha.Preference('AmazonAssocTag') %]
Lines 685-690 Link Here
685
                                [% END %]
686
                                [% END %]
686
                            [% END %]
687
                            [% END %]
687
                        [% END # IF itemloop.size %]
688
                        [% END # IF itemloop.size %]
689
                        [% IF summary_holdings %]
690
                            [% FOREACH holding IN summary_holdings %]
691
                                [% UNLESS holding.suppress %]
692
                                    [% holding_details = Holdings.GetDetails(holding) %]
693
                                    [% IF holding_details.public_note || holding_details.summary || holding_details.supplements || holding_details.indexes %]
694
                                        <span class="summary-holdings">
695
                                            <br>
696
                                            <strong>Additional information for [% Holdings.GetLocation(holding, 1) | html %]</strong>
697
                                            <ul>
698
                                                [% IF holding_details.public_note %]
699
                                                    <li>Public note: [% holding_details.public_note | html %]</li>
700
                                                [% END %]
701
                                                [% IF holding_details.summary %]
702
                                                    <li>Summary: [% holding_details.summary | html %]</li>
703
                                                [% END %]
704
                                                [% IF holding_details.supplements %]
705
                                                    <li>Supplements: [% holding_details.supplements | html %]</li>
706
                                                [% END %]
707
                                                [% IF holding_details.indexes %]
708
                                                    <li>Indexes: [% holding_details.indexes | html %]</li>
709
                                                [% END %]
710
                                            </ul>
711
                                        </span>
712
                                    [% END %]
713
                                [% END %]
714
                            [% END %]
715
                        [% END %]
688
                        [% PROCESS 'shelfbrowser.inc' %]
716
                        [% PROCESS 'shelfbrowser.inc' %]
689
                        [% INCLUDE shelfbrowser tab='holdings' %]
717
                        [% INCLUDE shelfbrowser tab='holdings' %]
690
                        <br style="clear:both;" />
718
                        <br style="clear:both;" />
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt (+10 lines)
Lines 1-6 Link Here
1
[% USE raw %]
1
[% USE raw %]
2
[% USE Asset %]
2
[% USE Asset %]
3
[% USE Koha %]
3
[% USE Koha %]
4
[% USE Holdings %]
4
[% SET TagsShowEnabled = ( ( Koha.Preference( 'TagsEnabled' ) == 1 ) && TagsShowOnList ) %]
5
[% SET TagsShowEnabled = ( ( Koha.Preference( 'TagsEnabled' ) == 1 ) && TagsShowOnList ) %]
5
[% SET TagsInputEnabled = ( ( Koha.Preference( 'opacuserlogin' ) == 1 ) && ( Koha.Preference( 'TagsEnabled' ) == 1 ) && TagsInputOnList ) %]
6
[% SET TagsInputEnabled = ( ( Koha.Preference( 'opacuserlogin' ) == 1 ) && ( Koha.Preference( 'TagsEnabled' ) == 1 ) && TagsInputOnList ) %]
6
[% SET AdlibrisEnabled = Koha.Preference('AdlibrisCoversEnabled') %]
7
[% SET AdlibrisEnabled = Koha.Preference('AdlibrisCoversEnabled') %]
Lines 421-426 Link Here
421
                                                                    [% END %]
422
                                                                    [% END %]
422
                                                                [% ELSE %]
423
                                                                [% ELSE %]
423
                                                                    <span class="unavailable">No items available:</span>
424
                                                                    <span class="unavailable">No items available:</span>
425
                                                                    [% IF ( SEARCH_RESULT.summary_holdings ) %]
426
                                                                        <span class="summary-holdings">
427
                                                                            [% FOREACH holding IN SEARCH_RESULT.summary_holdings %]
428
                                                                                [% UNLESS holding.suppress %]
429
                                                                                    [% Holdings.GetLocation(holding, 1) | html %],
430
                                                                                [% END %]
431
                                                                            [% END %]
432
                                                                        </span>
433
                                                                    [% END %]
424
                                                                [% END %]
434
                                                                [% END %]
425
                                                            [% END # / IF SEARCH_RESULT.available_items_loop.size %]
435
                                                            [% END # / IF SEARCH_RESULT.available_items_loop.size %]
426
436
(-)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 1226-1232 Link Here
1226
                            </xsl:for-each>
1227
                            </xsl:for-each>
1227
                            (<xsl:value-of select="$AlternateHoldingsCount"/>)
1228
                            (<xsl:value-of select="$AlternateHoldingsCount"/>)
1228
                            </xsl:when>
1229
                            </xsl:when>
1229
                            <xsl:otherwise><span class="noitems">No items available </span> </xsl:otherwise>
1230
                            <xsl:otherwise>
1231
                                <span class="noitems">No items available </span>
1232
                                <xsl:if test="//holdings:holdings/holdings:holding/holdings:suppress[.='0']">:
1233
                                    <xsl:for-each select="//holdings:holdings/holdings:holding[./holdings:suppress='0']">
1234
                                        <xsl:if test="position() > 1">, </xsl:if>
1235
                                        <xsl:value-of select="./holdings:holdingbranch"/>
1236
                                        <xsl:if test="string-length(./holdings:location) > 0">
1237
                                        - <xsl:value-of select="./holdings:location"/>
1238
                                        </xsl:if>
1239
                                        <xsl:if test="string-length(./holdings:callnumber) > 0">
1240
                                        - <xsl:value-of select="./holdings:callnumber"/>
1241
                                        </xsl:if>
1242
                                    </xsl:for-each>
1243
                                </xsl:if>
1244
                            </xsl:otherwise>
1230
                        </xsl:choose>
1245
                        </xsl:choose>
1231
				   </xsl:when>
1246
				   </xsl:when>
1232
                   <xsl:when test="count(key('item-by-status', 'available'))>0">
1247
                   <xsl:when test="count(key('item-by-status', 'available'))>0">
(-)a/opac/opac-detail.pl (+7 lines)
Lines 747-752 if (scalar(@itemloop) == 0 || scalar(@otheritemloop) == 0) { Link Here
747
    }
747
    }
748
}
748
}
749
749
750
# Fetch summary holdings
751
if (C4::Context->preference('SummaryHoldings')) {
752
    my $summary_holdings = Koha::Holdings->search({ biblionumber => $biblionumber, deleted_on => undef });
753
    $template->param( summary_holdings => $summary_holdings );
754
}
755
756
750
## get notes and subjects from MARC record
757
## get notes and subjects from MARC record
751
if (!C4::Context->preference("OPACXSLTDetailsDisplay") ) {
758
if (!C4::Context->preference("OPACXSLTDetailsDisplay") ) {
752
    my $marcisbnsarray   = GetMarcISBN    ($record,$marcflavour);
759
    my $marcisbnsarray   = GetMarcISBN    ($record,$marcflavour);
(-)a/t/db_dependent/Koha/Holding.t (+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 => 4; 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 149-157 subtest "as_marc_field() tests" => sub { Link Here
149
    $schema->storage->txn_rollback;
150
    $schema->storage->txn_rollback;
150
};
151
};
151
152
152
subtest 'move_items_from_biblio() tests' => sub {
153
subtest 'move_holdings_from_biblio() tests' => sub {
153
154
154
    plan tests => 12;
155
    plan tests => 19;
155
156
156
    $schema->storage->txn_begin;
157
    $schema->storage->txn_begin;
157
158
Lines 162-175 subtest 'move_items_from_biblio() tests' => sub { Link Here
162
163
163
    my $source_biblionumber = $source_biblio->biblionumber;
164
    my $source_biblionumber = $source_biblio->biblionumber;
164
165
166
    my $library = $builder->build_object({ class => 'Koha::Libraries' });
167
168
    my $holding_marc = MARC::Record->new();
169
    $holding_marc->append_fields(MARC::Field->new('852','','','b' => $library->branchcode));
170
    my $source_holding = Koha::Holding->new({ biblionumber => $source_biblionumber, frameworkcode => '' });
171
    $source_holding->set_marc({record => $holding_marc});
172
    $source_holding->store();
173
174
    my $standalone_holding = Koha::Holding->new({ biblionumber => $source_biblionumber, frameworkcode => '' });
175
    $standalone_holding->set_marc({record => $holding_marc});
176
    $standalone_holding->store();
177
165
    my $item1 = $builder->build_sample_item({ biblionumber => $source_biblionumber });
178
    my $item1 = $builder->build_sample_item({ biblionumber => $source_biblionumber });
179
    $item1->set({ holding_id => $source_holding->holding_id() })->store();
166
    my $item2 = $builder->build_sample_item({ biblionumber => $source_biblionumber });
180
    my $item2 = $builder->build_sample_item({ biblionumber => $source_biblionumber });
181
    $item2->set({ holding_id => $source_holding->holding_id() })->store();
167
182
168
    my $itemnumber1 = $item1->itemnumber;
183
    my $itemnumber1 = $item1->itemnumber;
169
    my $itemnumber2 = $item2->itemnumber;
184
    my $itemnumber2 = $item2->itemnumber;
170
185
171
    my $library = $builder->build_object({ class => 'Koha::Libraries' });
172
173
    my $patron = $builder->build_object({
186
    my $patron = $builder->build_object({
174
        class => 'Koha::Patrons',
187
        class => 'Koha::Patrons',
175
        value => { branchcode => $library->branchcode, }
188
        value => { branchcode => $library->branchcode, }
Lines 220-225 subtest 'move_items_from_biblio() tests' => sub { Link Here
220
    @result = $dbh->selectrow_array('SELECT biblionumber FROM items WHERE itemnumber = ?', undef, $itemnumber2);
233
    @result = $dbh->selectrow_array('SELECT biblionumber FROM items WHERE itemnumber = ?', undef, $itemnumber2);
221
    is($result[0], $source_biblionumber, 'Correct biblionumber in the unmoved item');
234
    is($result[0], $source_biblionumber, 'Correct biblionumber in the unmoved item');
222
235
236
    my $target_holdings = $target_biblio->holdings();
237
    is($target_holdings->count, 1, 'Holdings record created in target biblio');
238
239
    @result = $dbh->selectrow_array('SELECT holding_id FROM items WHERE itemnumber = ?', undef, $itemnumber1);
240
    is($result[0], $target_holdings->next()->holding_id(), 'Correct holding_id in the moved item');
241
242
    @result = $dbh->selectrow_array('SELECT holding_id FROM items WHERE itemnumber = ?', undef, $itemnumber2);
243
    is($result[0], $source_holding->holding_id(), 'Correct holding_id in the unmoved item');
244
223
    @result = $dbh->selectrow_array('SELECT biblionumber FROM aqorders WHERE ordernumber = ?', undef, $ordernumber1);
245
    @result = $dbh->selectrow_array('SELECT biblionumber FROM aqorders WHERE ordernumber = ?', undef, $ordernumber1);
224
    is($result[0], $target_biblio->biblionumber, 'Correct biblionumber in aqorders for order with the moved item');
246
    is($result[0], $target_biblio->biblionumber, 'Correct biblionumber in aqorders for order with the moved item');
225
247
Lines 250-254 subtest 'move_items_from_biblio() tests' => sub { Link Here
250
    @result = $dbh->selectrow_array('SELECT biblionumber FROM linktracker WHERE itemnumber = ?', undef, $itemnumber2);
272
    @result = $dbh->selectrow_array('SELECT biblionumber FROM linktracker WHERE itemnumber = ?', undef, $itemnumber2);
251
    is($result[0], $source_biblionumber, 'Correct biblionumber in linktracker for unmoved item');
273
    is($result[0], $source_biblionumber, 'Correct biblionumber in linktracker for unmoved item');
252
274
275
    @result = $dbh->selectrow_array('SELECT biblionumber FROM linktracker WHERE itemnumber = ?', undef, $itemnumber1);
276
    is($result[0], $target_biblio->biblionumber, 'Correct biblionumber in linktracker for moved item');
277
278
    @result = $dbh->selectrow_array('SELECT biblionumber FROM linktracker WHERE itemnumber = ?', undef, $itemnumber2);
279
    is($result[0], $source_biblionumber, 'Correct biblionumber in linktracker for unmoved item');
280
281
    # Move everything
282
    $target_biblio->move_holdings_from_biblio($source_biblio);
283
284
    @result = $dbh->selectrow_array('SELECT biblionumber FROM holdings WHERE holding_id = ?', undef, $standalone_holding->holding_id);
285
    is($result[0], $target_biblio->biblionumber, 'Correct biblionumber in the standalone holdings record');
286
287
    @result = $dbh->selectrow_array('SELECT holding_id FROM items WHERE itemnumber = ?', undef, $itemnumber2);
288
    is($result[0], $source_holding->holding_id(), 'Correct holding_id in the second moved item');
289
253
    $schema->storage->txn_rollback;
290
    $schema->storage->txn_rollback;
254
};
291
};
(-)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