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

(-)a/C4/Biblio.pm (+17 lines)
Lines 44-49 use Koha::Authority::Types; Link Here
44
use Koha::Acquisition::Currencies;
44
use Koha::Acquisition::Currencies;
45
use Koha::Biblio::Metadata;
45
use Koha::Biblio::Metadata;
46
use Koha::Biblio::Metadatas;
46
use Koha::Biblio::Metadatas;
47
use Koha::Holdings;
47
use Koha::Holds;
48
use Koha::Holds;
48
use Koha::ItemTypes;
49
use Koha::ItemTypes;
49
use Koha::SearchEngine;
50
use Koha::SearchEngine;
Lines 1561-1566 sub GetAuthorisedValueDesc { Link Here
1561
            return $itemtype ? $itemtype->translated_description : q||;
1562
            return $itemtype ? $itemtype->translated_description : q||;
1562
        }
1563
        }
1563
1564
1565
        #---- holdings
1566
        if ( $tagslib->{$tag}->{$subfield}->{'authorised_value'} eq "holdings" ) {
1567
            my $holding = Koha::Holdings->find( $value );
1568
            if ( $holding ) {
1569
                my @parts;
1570
1571
                push @parts, $value;
1572
                push @parts, $holding->holdingbranch() if $holding->holdingbranch();
1573
                push @parts, $holding->location() if $holding->location();
1574
                push @parts, $holding->callnumber() if $holding->callnumber();
1575
1576
                return join(' ', @parts);
1577
            }
1578
            return q||;
1579
        }
1580
1564
        #---- "true" authorized value
1581
        #---- "true" authorized value
1565
        $category = $tagslib->{$tag}->{$subfield}->{'authorised_value'};
1582
        $category = $tagslib->{$tag}->{$subfield}->{'authorised_value'};
1566
    }
1583
    }
(-)a/C4/Holdings.pm (+744 lines)
Line 0 Link Here
1
package C4::Holdings;
2
3
# Copyright 2000-2002 Katipo Communications
4
# Copyright 2010 BibLibre
5
# Copyright 2011 Equinox Software, Inc.
6
# Copyright 2017-2018 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
use Modern::Perl;
24
use Carp;
25
26
# TODO check which use's are really necessary
27
28
use Encode qw( decode is_utf8 );
29
use List::MoreUtils qw( uniq );
30
use MARC::Record;
31
use MARC::File::USMARC;
32
use MARC::File::XML;
33
use POSIX qw(strftime);
34
35
use C4::Koha;
36
use C4::Log;    # logaction
37
use C4::ClassSource;
38
use C4::Charset;
39
use C4::Debug;
40
41
use Koha::Caches;
42
use Koha::Holdings::Metadata;
43
use Koha::Holdings::Metadatas;
44
use Koha::Libraries;
45
46
use vars qw(@ISA @EXPORT);
47
use vars qw($debug $cgi_debug);
48
49
BEGIN {
50
51
    require Exporter;
52
    @ISA = qw( Exporter );
53
54
    # to add holdings
55
    # EXPORTED FUNCTIONS.
56
    push @EXPORT, qw(
57
      &AddHolding
58
    );
59
60
    # to get something
61
    push @EXPORT, qw(
62
      GetHolding
63
    );
64
65
    # To modify something
66
    push @EXPORT, qw(
67
      &ModHolding
68
    );
69
70
    # To delete something
71
    push @EXPORT, qw(
72
      &DelHolding
73
    );
74
}
75
76
=head1 NAME
77
78
C4::Holding - cataloging management functions
79
80
=head1 DESCRIPTION
81
82
Holding.pm contains functions for managing storage and editing of holdings data within Koha. Most of the functions in this module are used for cataloging holdings records: adding, editing, or removing holdings. Koha stores holdings information in two places:
83
84
=over 4
85
86
=item 1. in the holdings table which is limited to a one-to-one mapping to underlying MARC data
87
88
=item 2. as MARC XML in holdings_metadata.metadata
89
90
=back
91
92
In the 3.0 version of Koha, the authoritative record-level information is in holdings_metadata.metadata
93
94
Because the data isn't completely normalized there's a chance for information to get out of sync. The design choice to go with a un-normalized schema was driven by performance and stability concerns. However, if this occur, it can be considered as a bug : The API is (or should be) complete & the only entry point for all holdings management.
95
96
=over 4
97
98
=item 1. Add*/Mod*/Del*/ - high-level external functions suitable for being called from external scripts to manage the collection
99
100
=back
101
102
The MARC record (in holdings_metadata.metadata) contains the MARC holdings record. It also contains the holding_id. That is the reason why it is not stored directly by AddHolding, with all other fields. To save a holding, we need to:
103
104
=over 4
105
106
=item 1. save data in holdings table, that gives us a holding_id
107
108
=item 2. add the holding_id into the MARC record
109
110
=item 3. save the marc record
111
112
=back
113
114
=head1 EXPORTED FUNCTIONS
115
116
=head2 AddHolding
117
118
  $holding_id = AddHolding($record, $frameworkcode, $biblionumber);
119
120
Exported function (core API) for adding a new holding to koha.
121
122
The first argument is a C<MARC::Record> object containing the
123
holding to add, while the second argument is the desired MARC
124
framework code and third the biblionumber to link to.
125
126
=cut
127
128
sub AddHolding {
129
    my $record          = shift;
130
    my $frameworkcode   = shift;
131
    my $biblionumber    = shift;
132
    if (!$record) {
133
        carp('AddHolding called with undefined record');
134
        return;
135
    }
136
137
    my $dbh = C4::Context->dbh;
138
139
    my $biblio = Koha::Biblios->find( $biblionumber );
140
    my $biblioitemnumber = $biblio->biblioitem->biblioitemnumber;
141
142
    # transform the data into koha-table style data
143
    SetUTF8Flag($record);
144
    my $rowData = TransformMarcHoldingToKoha( $record );
145
    my ($holding_id) = _koha_add_holding( $dbh, $rowData, $frameworkcode, $biblionumber, $biblioitemnumber );
146
147
    _koha_marc_update_ids( $record, $frameworkcode, $holding_id, $biblionumber, $biblioitemnumber );
148
149
    # now add the record
150
    ModHoldingMarc( $record, $holding_id, $frameworkcode );
151
152
    logaction( "CATALOGUING", "ADD", $holding_id, "holding" ) if C4::Context->preference("CataloguingLog");
153
    return $holding_id;
154
}
155
156
=head2 ModHolding
157
158
  ModHolding($record, $holding_id, $frameworkcode);
159
160
Replace an existing holding record identified by C<$holding_id>
161
with one supplied by the MARC::Record object C<$record>.
162
163
C<$frameworkcode> specifies the MARC framework to use
164
when storing the modified holdings record.
165
166
Returns 1 on success 0 on failure
167
168
=cut
169
170
sub ModHolding {
171
    my ( $record, $holding_id, $frameworkcode ) = @_;
172
    if (!$record) {
173
        carp 'No record passed to ModHolding';
174
        return 0;
175
    }
176
177
    if ( C4::Context->preference("CataloguingLog") ) {
178
        my $newrecord = GetMarcHolding($holding_id);
179
        logaction( "CATALOGUING", "MODIFY", $holding_id, "holding BEFORE=>" . $newrecord->as_formatted );
180
    }
181
182
    # Cleaning up invalid fields must be done early or SetUTF8Flag is liable to
183
    # throw an exception which probably won't be handled.
184
    foreach my $field ($record->fields()) {
185
        if (! $field->is_control_field()) {
186
            if (scalar($field->subfields()) == 0 || (scalar($field->subfields()) == 1 && $field->subfield('9'))) {
187
                $record->delete_field($field);
188
            }
189
        }
190
    }
191
192
    SetUTF8Flag($record);
193
    my $dbh = C4::Context->dbh;
194
195
    $frameworkcode = 'HLD' if !$frameworkcode || $frameworkcode eq 'Default';
196
197
    # update holding_id in MARC
198
    _koha_marc_update_ids( $record, $frameworkcode, $holding_id );
199
200
    # load the koha-table data object
201
    my $rowData = TransformMarcHoldingToKoha( $record );
202
    # update the MARC record (that now contains biblio and items) with the new record data
203
    &ModHoldingMarc( $record, $holding_id, $frameworkcode );
204
205
    # modify the other koha tables
206
    _koha_modify_holding( $dbh, $holding_id, $rowData, $frameworkcode );
207
208
    return 1;
209
}
210
211
=head2 DelHolding
212
213
  my $error = &DelHolding($holding_id);
214
215
Exported function (core API) for deleting a holding in koha.
216
Deletes holding record from Koha tables (holdings, holdings_metadata)
217
Also backs it up to deleted* tables.
218
Checks to make sure that the holding has no items attached.
219
return:
220
C<$error> : undef unless an error occurs
221
222
=cut
223
224
sub DelHolding {
225
    my ($holding_id) = @_;
226
    my $dbh = C4::Context->dbh;
227
    my $error;    # for error handling
228
229
    # First make sure this holding has no items attached
230
    my $sth = $dbh->prepare("SELECT itemnumber FROM items WHERE holding_id=?");
231
    $sth->execute($holding_id);
232
    if ( my $itemnumber = $sth->fetchrow ) {
233
234
        # Fix this to use a status the template can understand
235
        $error .= "This holding record has items attached, please delete them first before deleting this holding record ";
236
    }
237
238
    return $error if $error;
239
240
    # delete holding
241
    _koha_delete_holding( $dbh, $holding_id );
242
243
    logaction( "CATALOGUING", "DELETE", $holding_id, "holding" ) if C4::Context->preference("CataloguingLog");
244
245
    return;
246
}
247
248
=head2 GetHolding
249
250
  my $holding = &GetHolding($holding_id);
251
252
=cut
253
254
sub GetHolding {
255
    my ($holding_id) = @_;
256
    my $dbh             = C4::Context->dbh;
257
    my $sth             = $dbh->prepare("SELECT * FROM holding WHERE holding_id = ? AND deleted_on IS NULL");
258
    my $count           = 0;
259
    my @results;
260
    $sth->execute($holding_id);
261
    if ( my $data = $sth->fetchrow_hashref ) {
262
        return $data;
263
    }
264
    return;
265
}
266
267
=head2 GetHoldingsByBiblionumber
268
269
  GetHoldingsByBiblionumber($biblionumber);
270
271
Returns an arrayref of hashrefs suitable for use in a TMPL_LOOP
272
Called by C<C4::XISBN>
273
274
=cut
275
276
sub GetHoldingsByBiblionumber {
277
    my ( $bib ) = @_;
278
    my $dbh = C4::Context->dbh;
279
    my $sth = $dbh->prepare("SELECT * FROM holdings WHERE holdings.biblionumber = ? AND deleted_on IS NULL") || die $dbh->errstr;
280
    # Get all holdings attached to a biblioitem
281
    my $i = 0;
282
    my @results;
283
    $sth->execute($bib) || die $sth->errstr;
284
    while ( my $data = $sth->fetchrow_hashref ) {
285
        push(@results, $data);
286
    }
287
    return (\@results);
288
}
289
290
=head2 GetMarcHolding
291
292
  my $record = GetMarcHolding(holding_id, [$opac]);
293
294
Returns MARC::Record representing a holding record, or C<undef> if the
295
record doesn't exist.
296
297
=over 4
298
299
=item C<$holding_id>
300
301
the holding_id
302
303
=item C<$opac>
304
305
set to true to make the result suited for OPAC view. This causes things like
306
OpacHiddenItems to be applied.
307
308
=back
309
310
=cut
311
312
sub GetMarcHolding {
313
    my $holding_id = shift;
314
    my $opac         = shift || 0;
315
316
    if (not defined $holding_id) {
317
        carp 'GetMarcHolding called with undefined holding_id';
318
        return;
319
    }
320
321
    my $marcflavour = C4::Context->preference('marcflavour');
322
323
    my $marcxml = GetXmlHolding( $holding_id );
324
    $marcxml = StripNonXmlChars( $marcxml );
325
    my $frameworkcode = GetHoldingFrameworkCode( $holding_id );
326
    MARC::File::XML->default_record_format( $marcflavour );
327
328
    if ($marcxml) {
329
        my $record = eval {
330
            MARC::Record::new_from_xml( $marcxml, "utf8", $marcflavour );
331
        };
332
        if ($@) { warn " problem with holding $holding_id : $@ \n$marcxml"; }
333
        return unless $record;
334
335
        _koha_marc_update_ids( $record, $frameworkcode, $holding_id );
336
337
        return $record;
338
    }
339
    return;
340
}
341
342
=head2 GetXmlHolding
343
344
  my $marcxml = GetXmlHolding($holding_id);
345
346
Returns holdings_metadata.metadata/marcxml of the holding_id passed in parameter.
347
348
=cut
349
350
sub GetXmlHolding {
351
    my ($holding_id) = @_;
352
    return unless $holding_id;
353
354
    my $marcflavour = C4::Context->preference('marcflavour');
355
    my $sth = C4::Context->dbh->prepare(
356
        q|
357
        SELECT metadata
358
        FROM holdings_metadata
359
        WHERE holding_id=?
360
            AND format='marcxml'
361
            AND marcflavour=?
362
        |
363
    );
364
365
    $sth->execute( $holding_id, $marcflavour );
366
    my ($marcxml) = $sth->fetchrow();
367
    $sth->finish();
368
    return $marcxml;
369
}
370
371
=head2 GetHoldingFrameworkCode
372
373
  $frameworkcode = GetFrameworkCode( $holding_id )
374
375
=cut
376
377
sub GetHoldingFrameworkCode {
378
    my ($holding_id) = @_;
379
    my $sth = C4::Context->dbh->prepare("SELECT frameworkcode FROM holdings WHERE holding_id=?");
380
    $sth->execute($holding_id);
381
    my ($frameworkcode) = $sth->fetchrow;
382
    $sth->finish();
383
    return $frameworkcode;
384
}
385
386
=head1 INTERNAL FUNCTIONS
387
388
=head2 _koha_add_holding
389
390
  my ($holding_id,$error) = _koha_add_hodings($dbh, $holding, $frameworkcode, $biblionumber, $biblioitemnumber);
391
392
Internal function to add a holding ($holding is a hash with the values)
393
394
=cut
395
396
sub _koha_add_holding {
397
    my ( $dbh, $holding, $frameworkcode, $biblionumber, $biblioitemnumber ) = @_;
398
399
    my $error;
400
401
    my $query = "INSERT INTO holdings
402
        SET biblionumber = ?,
403
            biblioitemnumber = ?,
404
            frameworkcode = ?,
405
            holdingbranch = ?,
406
            location = ?,
407
            callnumber = ?,
408
            suppress = ?,
409
            datecreated = NOW()
410
        ";
411
412
    my $sth = $dbh->prepare($query);
413
    $sth->execute(
414
        $biblionumber, $biblioitemnumber, $frameworkcode,
415
        $holding->{holdingbranch}, $holding->{location}, $holding->{callnumber}, $holding->{suppress}
416
    );
417
418
    my $holding_id = $dbh->{'mysql_insertid'};
419
    if ( $dbh->errstr ) {
420
        $error .= "ERROR in _koha_add_holding $query" . $dbh->errstr;
421
        warn $error;
422
    }
423
424
    $sth->finish();
425
426
    return ( $holding_id, $error );
427
}
428
429
=head2 _koha_modify_holding
430
431
  my ($biblionumber,$error) == _koha_modify_holding($dbh, $holding, $frameworkcode);
432
433
Internal function for updating the holdings table
434
435
=cut
436
437
sub _koha_modify_holding {
438
    my ( $dbh, $holding_id, $holding, $frameworkcode ) = @_;
439
    my $error;
440
441
    my $query = "
442
        UPDATE holdings
443
        SET    frameworkcode = ?,
444
               holdingbranch = ?,
445
               location = ?,
446
               callnumber = ?,
447
               suppress = ?
448
        WHERE  holding_id = ?
449
        "
450
      ;
451
    my $sth = $dbh->prepare($query);
452
453
    $sth->execute(
454
        $frameworkcode, $holding->{holdingbranch}, $holding->{location}, $holding->{callnumber}, $holding->{suppress}, $holding_id
455
    ) if $holding_id;
456
457
    if ( $dbh->errstr || !$holding_id ) {
458
        die "ERROR in _koha_modify_holding for holding $holding_id: " . $dbh->errstr;
459
    }
460
    return ( $holding_id, $error );
461
}
462
463
=head2 _koha_delete_holding
464
465
  $error = _koha_delete_holding($dbh, $holding_id);
466
467
Internal sub for deleting from holdings table
468
469
C<$dbh> - the database handle
470
471
C<$holding_id> - the holding_id of the holding to be deleted
472
473
=cut
474
475
sub _koha_delete_holding {
476
    my ( $dbh, $holding_id ) = @_;
477
478
    my $schema = Koha::Database->new->schema;
479
    $schema->txn_do(
480
        sub {
481
            $dbh->do('UPDATE holdings_metadata SET deleted_on = NOW() WHERE holding_id=?', undef, $holding_id);
482
            $dbh->do('UPDATE holdings SET deleted_on = NOW() WHERE holding_id=?', undef, $holding_id);
483
        }
484
    );
485
    return;
486
}
487
488
=head1 INTERNAL FUNCTIONS
489
490
=head2 _koha_marc_update_ids
491
492
493
  _koha_marc_update_ids($record, $frameworkcode, $holding_id[, $biblionumber, $biblioitemnumber]);
494
495
Internal function to add or update holding_id, biblionumber and biblioitemnumber to
496
the MARC XML.
497
498
=cut
499
500
sub _koha_marc_update_ids {
501
    my ( $record, $frameworkcode, $holding_id, $biblionumber, $biblioitemnumber ) = @_;
502
503
    my ( $holding_tag, $holding_subfield ) = GetMarcHoldingFromKohaField( "holdings.holding_id" );
504
    die qq{No holding_id tag for framework "$frameworkcode"} unless $holding_tag;
505
506
    if ( $holding_tag < 10 ) {
507
        C4::Biblio::UpsertMarcControlField( $record, $holding_tag, $holding_id );
508
    } else {
509
        C4::Biblio::UpsertMarcSubfield($record, $holding_tag, $holding_subfield, $holding_id);
510
    }
511
512
    if ( defined $biblionumber ) {
513
        my ( $biblio_tag, $biblio_subfield ) = GetMarcHoldingFromKohaField( "biblio.biblionumber" );
514
        die qq{No biblionumber tag for framework "$frameworkcode"} unless $biblio_tag;
515
        if ( $biblio_tag < 10 ) {
516
            C4::Biblio::UpsertMarcControlField( $record, $biblio_tag, $biblionumber );
517
        } else {
518
            C4::Biblio::UpsertMarcSubfield($record, $biblio_tag, $biblio_subfield, $biblionumber);
519
        }
520
    }
521
    if ( defined $biblioitemnumber ) {
522
        my ( $biblioitem_tag, $biblioitem_subfield ) = GetMarcHoldingFromKohaField( "biblioitems.biblioitemnumber" );
523
        die qq{No biblioitemnumber tag for framework "$frameworkcode"} unless $biblioitem_tag;
524
        if ( $biblioitem_tag < 10 ) {
525
            C4::Biblio::UpsertMarcControlField( $record, $biblioitem_tag, $biblioitemnumber );
526
        } else {
527
            C4::Biblio::UpsertMarcSubfield($record, $biblioitem_tag, $biblioitem_subfield, $biblioitemnumber);
528
        }
529
    }
530
}
531
532
=head1 UNEXPORTED FUNCTIONS
533
534
=head2 ModHoldingMarc
535
536
  &ModHoldingMarc($newrec,$holding_id,$frameworkcode);
537
538
Add MARC XML data for a holding to koha
539
540
Function exported, but should NOT be used, unless you really know what you're doing
541
542
=cut
543
544
sub ModHoldingMarc {
545
    # pass the MARC::Record to this function, and it will create the records in
546
    # the marcxml field
547
    my ( $record, $holding_id, $frameworkcode ) = @_;
548
    if ( !$record ) {
549
        carp 'ModHoldingMarc passed an undefined record';
550
        return;
551
    }
552
553
    # Clone record as it gets modified
554
    $record = $record->clone();
555
    my $dbh    = C4::Context->dbh;
556
    my @fields = $record->fields();
557
    if ( !$frameworkcode ) {
558
        $frameworkcode = "";
559
    }
560
    my $sth = $dbh->prepare("UPDATE holdings SET frameworkcode=? WHERE holding_id=?");
561
    $sth->execute( $frameworkcode, $holding_id );
562
    $sth->finish;
563
    my $encoding = C4::Context->preference("marcflavour");
564
565
    # deal with UNIMARC field 100 (encoding) : create it if needed & set encoding to unicode
566
    if ( $encoding eq "UNIMARC" ) {
567
        my $defaultlanguage = C4::Context->preference("UNIMARCField100Language");
568
        $defaultlanguage = "fre" if (!$defaultlanguage || length($defaultlanguage) != 3);
569
        my $string = $record->subfield( 100, "a" );
570
        if ( ($string) && ( length( $record->subfield( 100, "a" ) ) == 36 ) ) {
571
            my $f100 = $record->field(100);
572
            $record->delete_field($f100);
573
        } else {
574
            $string = POSIX::strftime( "%Y%m%d", localtime );
575
            $string =~ s/\-//g;
576
            $string = sprintf( "%-*s", 35, $string );
577
            substr ( $string, 22, 3, $defaultlanguage);
578
        }
579
        substr( $string, 25, 3, "y50" );
580
        unless ( $record->subfield( 100, "a" ) ) {
581
            $record->insert_fields_ordered( MARC::Field->new( 100, "", "", "a" => $string ) );
582
        }
583
    }
584
585
    #enhancement 5374: update transaction date (005) for marc21/unimarc
586
    if($encoding =~ /MARC21|UNIMARC/) {
587
      my @a= (localtime) [5,4,3,2,1,0]; $a[0]+=1900; $a[1]++;
588
        # YY MM DD HH MM SS (update year and month)
589
      my $f005= $record->field('005');
590
      $f005->update(sprintf("%4d%02d%02d%02d%02d%04.1f",@a)) if $f005;
591
    }
592
593
    my $metadata = {
594
        holding_id => $holding_id,
595
        format        => 'marcxml',
596
        marcflavour   => C4::Context->preference('marcflavour'),
597
    };
598
    # FIXME To replace with ->find_or_create?
599
    if ( my $m_rs = Koha::Holdings::Metadatas->find($metadata) ) {
600
        $m_rs->metadata( $record->as_xml_record($encoding) );
601
        $m_rs->store;
602
    } else {
603
        my $m_rs = Koha::Holdings::Metadata->new($metadata);
604
        $m_rs->metadata( $record->as_xml_record($encoding) );
605
        $m_rs->store;
606
    }
607
    return $holding_id;
608
}
609
610
=head2 GetMarcHoldingFromKohaField
611
612
    ( $field,$subfield ) = GetMarcHoldingFromKohaField( $kohafield );
613
    @fields = GetMarcHoldingFromKohaField( $kohafield );
614
    $field = GetMarcHoldingFromKohaField( $kohafield );
615
616
    Returns the MARC fields & subfields mapped to $kohafield.
617
    Uses the HLD framework that is considered as authoritative.
618
619
    In list context all mappings are returned; there can be multiple
620
    mappings. Note that in the above example you could miss a second
621
    mappings in the first call.
622
    In scalar context only the field tag of the first mapping is returned.
623
624
=cut
625
626
sub GetMarcHoldingFromKohaField {
627
    my ( $kohafield ) = @_;
628
    return unless $kohafield;
629
    # The next call uses the Default framework since it is AUTHORITATIVE
630
    # for all Koha to MARC mappings.
631
    my $mss = C4::Biblio::GetMarcSubfieldStructure( 'HLD' ); # Do not change framework
632
    my @retval;
633
    foreach( @{ $mss->{$kohafield} } ) {
634
        push @retval, $_->{tagfield}, $_->{tagsubfield};
635
    }
636
    return wantarray ? @retval : ( @retval ? $retval[0] : undef );
637
}
638
639
=head2 GetMarcHoldingSubfieldStructureFromKohaField
640
641
    my $str = GetMarcHoldingSubfieldStructureFromKohaField( $kohafield );
642
643
    Returns marc subfield structure information for $kohafield.
644
    Uses the HLD framework that is considered as authoritative.
645
646
    In list context returns a list of all hashrefs, since there may be
647
    multiple mappings. In scalar context the first hashref is returned.
648
649
=cut
650
651
sub GetMarcHoldingSubfieldStructureFromKohaField {
652
    my ( $kohafield ) = @_;
653
654
    return unless $kohafield;
655
656
    # The next call uses the Default framework since it is AUTHORITATIVE
657
    # for all Koha to MARC mappings.
658
    my $mss = C4::Biblio::GetMarcSubfieldStructure( 'HLD' ); # Do not change framework
659
    return unless $mss->{$kohafield};
660
    return wantarray ? @{$mss->{$kohafield}} : $mss->{$kohafield}->[0];
661
}
662
663
=head2 TransformMarcHoldingToKoha
664
665
    $result = TransformMarcHoldingToKoha( $record, undef )
666
667
Extract data from a MARC holdings record into a hashref representing
668
Koha holdings fields.
669
670
If passed an undefined record will log the error and return an empty
671
hash_ref.
672
673
=cut
674
675
sub TransformMarcHoldingToKoha {
676
    my ( $record ) = @_;
677
678
    my $result = {};
679
    if (!defined $record) {
680
        carp('TransformMarcToKoha called with undefined record');
681
        return $result;
682
    }
683
684
    my %tables = ( holdings => 1 );
685
686
    # The next call acknowledges HLD as the authoritative framework
687
    # for holdings to MARC mappings.
688
    my $mss = C4::Biblio::GetMarcSubfieldStructure( 'HLD' ); # Do not change framework
689
    foreach my $kohafield ( keys %{ $mss } ) {
690
        my ( $table, $column ) = split /[.]/, $kohafield, 2;
691
        next unless $tables{$table};
692
        my $val = TransformMarcHoldingToKohaOneField( $kohafield, $record );
693
        next if !defined $val;
694
        $result->{$column} = $val;
695
    }
696
    return $result;
697
}
698
699
=head2 TransformMarcHoldingToKohaOneField
700
701
    $val = TransformMarcHoldingToKohaOneField( 'biblio.title', $marc );
702
703
    Note: The authoritative Default framework is used implicitly.
704
705
=cut
706
707
sub TransformMarcHoldingToKohaOneField {
708
    my ( $kohafield, $marc ) = @_;
709
710
    my ( @rv, $retval );
711
    my @mss = GetMarcHoldingSubfieldStructureFromKohaField($kohafield);
712
    foreach my $fldhash ( @mss ) {
713
        my $tag = $fldhash->{tagfield};
714
        my $sub = $fldhash->{tagsubfield};
715
        foreach my $fld ( $marc->field($tag) ) {
716
            if( $sub eq '@' || $fld->is_control_field ) {
717
                push @rv, $fld->data if $fld->data;
718
            } else {
719
                push @rv, grep { $_ } $fld->subfield($sub);
720
            }
721
        }
722
    }
723
    return unless @rv;
724
    $retval = join ' | ', uniq(@rv);
725
726
    return $retval;
727
}
728
729
1;
730
731
732
__END__
733
734
=head1 AUTHOR
735
736
Koha Development Team <http://koha-community.org/>
737
738
Paul POULAIN paul.poulain@free.fr
739
740
Joshua Ferraro jmf@liblime.com
741
742
Ere Maijala ere.maijala@helsinki.fi
743
744
=cut
(-)a/C4/Items.pm (-1 / +4 lines)
Lines 479-484 sub _build_default_values_for_mod_marc { Link Here
479
        stocknumber              => undef,
479
        stocknumber              => undef,
480
        uri                      => undef,
480
        uri                      => undef,
481
        withdrawn                => 0,
481
        withdrawn                => 0,
482
        holding_id               => undef,
482
    };
483
    };
483
    my %default_values_for_mod_from_marc;
484
    my %default_values_for_mod_from_marc;
484
    while ( my ( $field, $default_value ) = each %$default_values ) {
485
    while ( my ( $field, $default_value ) = each %$default_values ) {
Lines 1799-1805 sub _koha_new_item { Link Here
1799
            more_subfields_xml  = ?,
1800
            more_subfields_xml  = ?,
1800
            copynumber          = ?,
1801
            copynumber          = ?,
1801
            stocknumber         = ?,
1802
            stocknumber         = ?,
1802
            new_status          = ?
1803
            new_status          = ?,
1804
            holding_id          = ?
1803
          ";
1805
          ";
1804
    my $sth = $dbh->prepare($query);
1806
    my $sth = $dbh->prepare($query);
1805
    my $today = output_pref({ dt => dt_from_string, dateformat => 'iso', dateonly => 1 });
1807
    my $today = output_pref({ dt => dt_from_string, dateformat => 'iso', dateonly => 1 });
Lines 1844-1849 sub _koha_new_item { Link Here
1844
            $item->{'copynumber'},
1846
            $item->{'copynumber'},
1845
            $item->{'stocknumber'},
1847
            $item->{'stocknumber'},
1846
            $item->{'new_status'},
1848
            $item->{'new_status'},
1849
            $item->{'holding_id'},
1847
    );
1850
    );
1848
1851
1849
    my $itemnumber;
1852
    my $itemnumber;
(-)a/C4/Search.pm (+8 lines)
Lines 20-25 use strict; Link Here
20
require Exporter;
20
require Exporter;
21
use C4::Context;
21
use C4::Context;
22
use C4::Biblio;    # GetMarcFromKohaField, GetBiblioData
22
use C4::Biblio;    # GetMarcFromKohaField, GetBiblioData
23
use C4::Holdings;  # GetHoldingsByBiblionumber
23
use C4::Koha;      # getFacets
24
use C4::Koha;      # getFacets
24
use Koha::DateUtils;
25
use Koha::DateUtils;
25
use Koha::Libraries;
26
use Koha::Libraries;
Lines 2052-2057 sub searchResults { Link Here
2052
        my $maxitems_pref = C4::Context->preference('maxItemsinSearchResults');
2053
        my $maxitems_pref = C4::Context->preference('maxItemsinSearchResults');
2053
        my $maxitems = $maxitems_pref ? $maxitems_pref - 1 : 1;
2054
        my $maxitems = $maxitems_pref ? $maxitems_pref - 1 : 1;
2054
        my @hiddenitems; # hidden itemnumbers based on OpacHiddenItems syspref
2055
        my @hiddenitems; # hidden itemnumbers based on OpacHiddenItems syspref
2056
        my $summary_holdings;
2055
2057
2056
        # loop through every item
2058
        # loop through every item
2057
        foreach my $field (@fields) {
2059
        foreach my $field (@fields) {
Lines 2235-2240 sub searchResults { Link Here
2235
            push @available_items_loop, $available_items->{$key}
2237
            push @available_items_loop, $available_items->{$key}
2236
        }
2238
        }
2237
2239
2240
        # Fetch summary holdings
2241
        if (C4::Context->preference('SummaryHoldings')) {
2242
            $summary_holdings = C4::Holdings::GetHoldingsByBiblionumber($oldbiblio->{biblionumber});
2243
        }
2244
2238
        # XSLT processing of some stuff
2245
        # XSLT processing of some stuff
2239
        # we fetched the sysprefs already before the loop through all retrieved record!
2246
        # we fetched the sysprefs already before the loop through all retrieved record!
2240
        if (!$scan && $xslfile) {
2247
        if (!$scan && $xslfile) {
Lines 2267-2272 sub searchResults { Link Here
2267
        $oldbiblio->{onholdcount}          = $item_onhold_count;
2274
        $oldbiblio->{onholdcount}          = $item_onhold_count;
2268
        $oldbiblio->{orderedcount}         = $ordered_count;
2275
        $oldbiblio->{orderedcount}         = $ordered_count;
2269
        $oldbiblio->{notforloancount}      = $notforloan_count;
2276
        $oldbiblio->{notforloancount}      = $notforloan_count;
2277
        $oldbiblio->{summary_holdings}     = $summary_holdings;
2270
2278
2271
        if (C4::Context->preference("AlternateHoldingsField") && $items_count == 0) {
2279
        if (C4::Context->preference("AlternateHoldingsField") && $items_count == 0) {
2272
            my $fieldspec = C4::Context->preference("AlternateHoldingsField");
2280
            my $fieldspec = C4::Context->preference("AlternateHoldingsField");
(-)a/C4/XSLT.pm (-1 / +32 lines)
Lines 241-249 sub XSLTParse4Display { Link Here
241
    # grab the XML, run it through our stylesheet, push it out to the browser
241
    # grab the XML, run it through our stylesheet, push it out to the browser
242
    my $record = transformMARCXML4XSLT($biblionumber, $orig_record);
242
    my $record = transformMARCXML4XSLT($biblionumber, $orig_record);
243
    my $itemsxml  = buildKohaItemsNamespace($biblionumber, $hidden_items);
243
    my $itemsxml  = buildKohaItemsNamespace($biblionumber, $hidden_items);
244
    my $holdingsxml  = buildKohaHoldingsNamespace($biblionumber);
244
    my $xmlrecord = $record->as_xml(C4::Context->preference('marcflavour'));
245
    my $xmlrecord = $record->as_xml(C4::Context->preference('marcflavour'));
245
246
246
    $xmlrecord =~ s/\<\/record\>/$itemsxml$sysxml\<\/record\>/;
247
    $xmlrecord =~ s/\<\/record\>/$itemsxml$holdingsxml$sysxml\<\/record\>/;
247
    if ($fixamps) { # We need to correct the HTML entities that Zebra outputs
248
    if ($fixamps) { # We need to correct the HTML entities that Zebra outputs
248
        $xmlrecord =~ s/\&amp;amp;/\&amp;/g;
249
        $xmlrecord =~ s/\&amp;amp;/\&amp;/g;
249
        $xmlrecord =~ s/\&amp\;lt\;/\&lt\;/g;
250
        $xmlrecord =~ s/\&amp\;lt\;/\&lt\;/g;
Lines 342-347 sub buildKohaItemsNamespace { Link Here
342
    return $xml;
343
    return $xml;
343
}
344
}
344
345
346
sub buildKohaHoldingsNamespace {
347
    my ($biblionumber) = @_;
348
349
    my $holdings = C4::Holdings::GetHoldingsByBiblionumber( $biblionumber );
350
351
    my $shelflocations =
352
      { map { $_->{authorised_value} => $_->{opac_description} } Koha::AuthorisedValues->get_descriptions_by_koha_field( { frameworkcode => 'HLD', kohafield => 'holdings.location' } ) };
353
354
    my %branches = map { $_->branchcode => $_->branchname } Koha::Libraries->search({}, { order_by => 'branchname' });
355
356
    my $location = "";
357
    my $ccode = "";
358
    my $xml = '';
359
    for my $holding ( @{$holdings} ) {
360
        my $holdingbranch = $holding->{holdingbranch} ? xml_escape($branches{$holding->{holdingbranch}}) : '';
361
        my $location = $holding->{location} ? xml_escape($shelflocations->{$holding->{location}} || $holding->{location}) : '';
362
        my $callnumber = xml_escape($holding->{callnumber});
363
        my $suppress = $holding->{suppress} || '0';
364
        $xml .=
365
            "<holding>"
366
          . "<holdingbranch>$holdingbranch</holdingbranch>"
367
          . "<location>$location</location>"
368
          . "<callnumber>$callnumber</callnumber>"
369
          . "<suppress>$suppress</suppress>"
370
          . "</holding>";
371
    }
372
    $xml = "<holdings xmlns=\"http://www.koha-community.org/holdings\">$xml</holdings>";
373
    return $xml;
374
}
375
345
=head2 engine
376
=head2 engine
346
377
347
Returns reference to XSLT handler object.
378
Returns reference to XSLT handler object.
(-)a/Koha/Holding.pm (+72 lines)
Line 0 Link Here
1
package Koha::Holding;
2
3
# Copyright ByWater Solutions 2014
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 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 Koha::Database;
26
27
use base qw(Koha::Object);
28
29
=head1 NAME
30
31
Koha::Holding - Koha Holding Object class
32
33
=head1 API
34
35
=head2 Class Methods
36
37
=cut
38
39
=head3 items
40
41
my @items = $holding->items();
42
my $items = $holding->items();
43
44
Returns the related Koha::Items object for this holding in scalar context,
45
or list of Koha::Item objects in list context.
46
47
=cut
48
49
sub items {
50
    my ($self) = @_;
51
52
    $self->{_items} ||= Koha::Items->search( { holding_id => $self->holding_id() } );
53
54
    return wantarray ? $self->{_items}->as_list : $self->{_items};
55
}
56
57
=head3 type
58
59
=cut
60
61
sub _type {
62
    return 'Holding';
63
}
64
65
=head1 AUTHOR
66
67
Kyle M Hall <kyle@bywatersolutions.com>
68
Ere Maijala <ere.maijala@helsinki.fi>
69
70
=cut
71
72
1;
(-)a/Koha/Holdings.pm (+64 lines)
Line 0 Link Here
1
package Koha::Holdings;
2
3
# Copyright ByWater Solutions 2015
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 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 Koha::Database;
26
27
use Koha::Holding;
28
29
use base qw(Koha::Objects);
30
31
=head1 NAME
32
33
Koha::Holdings - Koha Holdings object set class
34
35
=head1 API
36
37
=head2 Class Methods
38
39
=cut
40
41
=head3 type
42
43
=cut
44
45
sub _type {
46
    return 'Holding';
47
}
48
49
=head3 object_class
50
51
=cut
52
53
sub object_class {
54
    return 'Koha::Holding';
55
}
56
57
=head1 AUTHOR
58
59
Kyle M Hall <kyle@bywatersolutions.com>
60
Ere Maijala <ere.maijala@helsinki.fi>
61
62
=cut
63
64
1;
(-)a/Koha/Holdings/Metadata.pm (+44 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::Metadata - Koha Metadata Object class
29
30
=head1 API
31
32
=head2 Class Methods
33
34
=cut
35
36
=head3 type
37
38
=cut
39
40
sub _type {
41
    return 'HoldingsMetadata';
42
}
43
44
1;
(-)a/Koha/Holdings/Metadatas.pm (+50 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::Biblio::Metadata;
25
26
use base qw(Koha::Objects);
27
28
=head1 NAME
29
30
Koha::Biblio::Metadatas - Koha Metadata Object set class
31
32
=head1 API
33
34
=head2 Class Methods
35
36
=cut
37
38
=head3 type
39
40
=cut
41
42
sub _type {
43
    return 'HoldingsMetadata';
44
}
45
46
sub object_class {
47
    return 'Koha::Holdings::Metadata';
48
}
49
50
1;
(-)a/Koha/Schema/Result/Deleteditem.pm (-4 / +11 lines)
Lines 198-204 __PACKAGE__->table("deleteditems"); Link Here
198
198
199
  data_type: 'timestamp'
199
  data_type: 'timestamp'
200
  datetime_undef_if_invalid: 1
200
  datetime_undef_if_invalid: 1
201
  default_value: current_timestamp
201
  default_value: 'current_timestamp()'
202
  is_nullable: 0
202
  is_nullable: 0
203
203
204
=head2 location
204
=head2 location
Lines 282-287 __PACKAGE__->table("deleteditems"); Link Here
282
  is_nullable: 1
282
  is_nullable: 1
283
  size: 32
283
  size: 32
284
284
285
=head2 holding_id
286
287
  data_type: 'integer'
288
  is_nullable: 1
289
285
=cut
290
=cut
286
291
287
__PACKAGE__->add_columns(
292
__PACKAGE__->add_columns(
Lines 361-367 __PACKAGE__->add_columns( Link Here
361
  {
366
  {
362
    data_type => "timestamp",
367
    data_type => "timestamp",
363
    datetime_undef_if_invalid => 1,
368
    datetime_undef_if_invalid => 1,
364
    default_value => \"current_timestamp",
369
    default_value => "current_timestamp()",
365
    is_nullable => 0,
370
    is_nullable => 0,
366
  },
371
  },
367
  "location",
372
  "location",
Lines 392-397 __PACKAGE__->add_columns( Link Here
392
  { data_type => "varchar", is_nullable => 1, size => 32 },
397
  { data_type => "varchar", is_nullable => 1, size => 32 },
393
  "new_status",
398
  "new_status",
394
  { data_type => "varchar", is_nullable => 1, size => 32 },
399
  { data_type => "varchar", is_nullable => 1, size => 32 },
400
  "holding_id",
401
  { data_type => "integer", is_nullable => 1 },
395
);
402
);
396
403
397
=head1 PRIMARY KEY
404
=head1 PRIMARY KEY
Lines 407-414 __PACKAGE__->add_columns( Link Here
407
__PACKAGE__->set_primary_key("itemnumber");
414
__PACKAGE__->set_primary_key("itemnumber");
408
415
409
416
410
# Created by DBIx::Class::Schema::Loader v0.07042 @ 2018-02-18 16:41:11
417
# Created by DBIx::Class::Schema::Loader v0.07048 @ 2018-06-27 11:40:34
411
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:xb11fPjp5PyXU7yfFWHycw
418
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:FaSCq9rlu95SF2rj2uUe6g
412
419
413
420
414
# You can replace this text with custom content, and it will be preserved on regeneration
421
# You can replace this text with custom content, and it will be preserved on regeneration
(-)a/Koha/Schema/Result/Holding.pm (+242 lines)
Line 0 Link Here
1
use utf8;
2
package Koha::Schema::Result::Holding;
3
4
# Created by DBIx::Class::Schema::Loader
5
# DO NOT MODIFY THE FIRST PART OF THIS FILE
6
7
=head1 NAME
8
9
Koha::Schema::Result::Holding
10
11
=cut
12
13
use strict;
14
use warnings;
15
16
use base 'DBIx::Class::Core';
17
18
=head1 TABLE: C<holdings>
19
20
=cut
21
22
__PACKAGE__->table("holdings");
23
24
=head1 ACCESSORS
25
26
=head2 holding_id
27
28
  data_type: 'integer'
29
  is_auto_increment: 1
30
  is_nullable: 0
31
32
=head2 biblionumber
33
34
  data_type: 'integer'
35
  default_value: 0
36
  is_foreign_key: 1
37
  is_nullable: 0
38
39
=head2 biblioitemnumber
40
41
  data_type: 'integer'
42
  default_value: 0
43
  is_foreign_key: 1
44
  is_nullable: 0
45
46
=head2 frameworkcode
47
48
  data_type: 'varchar'
49
  default_value: (empty string)
50
  is_nullable: 0
51
  size: 4
52
53
=head2 holdingbranch
54
55
  data_type: 'varchar'
56
  is_foreign_key: 1
57
  is_nullable: 1
58
  size: 10
59
60
=head2 location
61
62
  data_type: 'varchar'
63
  is_nullable: 1
64
  size: 80
65
66
=head2 callnumber
67
68
  data_type: 'varchar'
69
  is_nullable: 1
70
  size: 255
71
72
=head2 suppress
73
74
  data_type: 'tinyint'
75
  is_nullable: 1
76
77
=head2 timestamp
78
79
  data_type: 'timestamp'
80
  datetime_undef_if_invalid: 1
81
  default_value: 'current_timestamp()'
82
  is_nullable: 0
83
84
=head2 datecreated
85
86
  data_type: 'date'
87
  datetime_undef_if_invalid: 1
88
  is_nullable: 0
89
90
=head2 deleted_on
91
92
  data_type: 'datetime'
93
  datetime_undef_if_invalid: 1
94
  is_nullable: 1
95
96
=cut
97
98
__PACKAGE__->add_columns(
99
  "holding_id",
100
  { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
101
  "biblionumber",
102
  {
103
    data_type      => "integer",
104
    default_value  => 0,
105
    is_foreign_key => 1,
106
    is_nullable    => 0,
107
  },
108
  "biblioitemnumber",
109
  {
110
    data_type      => "integer",
111
    default_value  => 0,
112
    is_foreign_key => 1,
113
    is_nullable    => 0,
114
  },
115
  "frameworkcode",
116
  { data_type => "varchar", default_value => "", is_nullable => 0, size => 4 },
117
  "holdingbranch",
118
  { data_type => "varchar", is_foreign_key => 1, is_nullable => 1, size => 10 },
119
  "location",
120
  { data_type => "varchar", is_nullable => 1, size => 80 },
121
  "callnumber",
122
  { data_type => "varchar", is_nullable => 1, size => 255 },
123
  "suppress",
124
  { data_type => "tinyint", is_nullable => 1 },
125
  "timestamp",
126
  {
127
    data_type => "timestamp",
128
    datetime_undef_if_invalid => 1,
129
    default_value => "current_timestamp()",
130
    is_nullable => 0,
131
  },
132
  "datecreated",
133
  { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 0 },
134
  "deleted_on",
135
  {
136
    data_type => "datetime",
137
    datetime_undef_if_invalid => 1,
138
    is_nullable => 1,
139
  },
140
);
141
142
=head1 PRIMARY KEY
143
144
=over 4
145
146
=item * L</holding_id>
147
148
=back
149
150
=cut
151
152
__PACKAGE__->set_primary_key("holding_id");
153
154
=head1 RELATIONS
155
156
=head2 biblioitemnumber
157
158
Type: belongs_to
159
160
Related object: L<Koha::Schema::Result::Biblioitem>
161
162
=cut
163
164
__PACKAGE__->belongs_to(
165
  "biblioitemnumber",
166
  "Koha::Schema::Result::Biblioitem",
167
  { biblioitemnumber => "biblioitemnumber" },
168
  { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
169
);
170
171
=head2 biblionumber
172
173
Type: belongs_to
174
175
Related object: L<Koha::Schema::Result::Biblio>
176
177
=cut
178
179
__PACKAGE__->belongs_to(
180
  "biblionumber",
181
  "Koha::Schema::Result::Biblio",
182
  { biblionumber => "biblionumber" },
183
  { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
184
);
185
186
=head2 holdingbranch
187
188
Type: belongs_to
189
190
Related object: L<Koha::Schema::Result::Branch>
191
192
=cut
193
194
__PACKAGE__->belongs_to(
195
  "holdingbranch",
196
  "Koha::Schema::Result::Branch",
197
  { branchcode => "holdingbranch" },
198
  {
199
    is_deferrable => 1,
200
    join_type     => "LEFT",
201
    on_delete     => "RESTRICT",
202
    on_update     => "CASCADE",
203
  },
204
);
205
206
=head2 holdings_metadatas
207
208
Type: has_many
209
210
Related object: L<Koha::Schema::Result::HoldingsMetadata>
211
212
=cut
213
214
__PACKAGE__->has_many(
215
  "holdings_metadatas",
216
  "Koha::Schema::Result::HoldingsMetadata",
217
  { "foreign.holding_id" => "self.holding_id" },
218
  { cascade_copy => 0, cascade_delete => 0 },
219
);
220
221
=head2 items
222
223
Type: has_many
224
225
Related object: L<Koha::Schema::Result::Item>
226
227
=cut
228
229
__PACKAGE__->has_many(
230
  "items",
231
  "Koha::Schema::Result::Item",
232
  { "foreign.holding_id" => "self.holding_id" },
233
  { cascade_copy => 0, cascade_delete => 0 },
234
);
235
236
237
# Created by DBIx::Class::Schema::Loader v0.07048 @ 2018-06-27 11:41:46
238
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:NZ+oAy5PbrzkGnTxDr4nsw
239
240
241
# You can replace this text with custom code or comments, and it will be preserved on regeneration
242
1;
(-)a/Koha/Schema/Result/HoldingsMetadata.pm (+138 lines)
Line 0 Link Here
1
use utf8;
2
package Koha::Schema::Result::HoldingsMetadata;
3
4
# Created by DBIx::Class::Schema::Loader
5
# DO NOT MODIFY THE FIRST PART OF THIS FILE
6
7
=head1 NAME
8
9
Koha::Schema::Result::HoldingsMetadata
10
11
=cut
12
13
use strict;
14
use warnings;
15
16
use base 'DBIx::Class::Core';
17
18
=head1 TABLE: C<holdings_metadata>
19
20
=cut
21
22
__PACKAGE__->table("holdings_metadata");
23
24
=head1 ACCESSORS
25
26
=head2 id
27
28
  data_type: 'integer'
29
  is_auto_increment: 1
30
  is_nullable: 0
31
32
=head2 holding_id
33
34
  data_type: 'integer'
35
  is_foreign_key: 1
36
  is_nullable: 0
37
38
=head2 format
39
40
  data_type: 'varchar'
41
  is_nullable: 0
42
  size: 16
43
44
=head2 marcflavour
45
46
  data_type: 'varchar'
47
  is_nullable: 0
48
  size: 16
49
50
=head2 metadata
51
52
  data_type: 'longtext'
53
  is_nullable: 0
54
55
=head2 deleted_on
56
57
  data_type: 'datetime'
58
  datetime_undef_if_invalid: 1
59
  is_nullable: 1
60
61
=cut
62
63
__PACKAGE__->add_columns(
64
  "id",
65
  { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
66
  "holding_id",
67
  { data_type => "integer", is_foreign_key => 1, is_nullable => 0 },
68
  "format",
69
  { data_type => "varchar", is_nullable => 0, size => 16 },
70
  "marcflavour",
71
  { data_type => "varchar", is_nullable => 0, size => 16 },
72
  "metadata",
73
  { data_type => "longtext", is_nullable => 0 },
74
  "deleted_on",
75
  {
76
    data_type => "datetime",
77
    datetime_undef_if_invalid => 1,
78
    is_nullable => 1,
79
  },
80
);
81
82
=head1 PRIMARY KEY
83
84
=over 4
85
86
=item * L</id>
87
88
=back
89
90
=cut
91
92
__PACKAGE__->set_primary_key("id");
93
94
=head1 UNIQUE CONSTRAINTS
95
96
=head2 C<holdings_metadata_uniq_key>
97
98
=over 4
99
100
=item * L</holding_id>
101
102
=item * L</format>
103
104
=item * L</marcflavour>
105
106
=back
107
108
=cut
109
110
__PACKAGE__->add_unique_constraint(
111
  "holdings_metadata_uniq_key",
112
  ["holding_id", "format", "marcflavour"],
113
);
114
115
=head1 RELATIONS
116
117
=head2 holding
118
119
Type: belongs_to
120
121
Related object: L<Koha::Schema::Result::Holding>
122
123
=cut
124
125
__PACKAGE__->belongs_to(
126
  "holding",
127
  "Koha::Schema::Result::Holding",
128
  { holding_id => "holding_id" },
129
  { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
130
);
131
132
133
# Created by DBIx::Class::Schema::Loader v0.07048 @ 2018-06-27 11:41:46
134
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:tIav0mJ+CvAkROl3xSnE2Q
135
136
137
# You can replace this text with custom code or comments, and it will be preserved on regeneration
138
1;
(-)a/Koha/Schema/Result/Item.pm (-4 / +32 lines)
Lines 202-208 __PACKAGE__->table("items"); Link Here
202
202
203
  data_type: 'timestamp'
203
  data_type: 'timestamp'
204
  datetime_undef_if_invalid: 1
204
  datetime_undef_if_invalid: 1
205
  default_value: current_timestamp
205
  default_value: 'current_timestamp()'
206
  is_nullable: 0
206
  is_nullable: 0
207
207
208
=head2 location
208
=head2 location
Lines 286-291 __PACKAGE__->table("items"); Link Here
286
  is_nullable: 1
286
  is_nullable: 1
287
  size: 32
287
  size: 32
288
288
289
=head2 holding_id
290
291
  data_type: 'integer'
292
  is_foreign_key: 1
293
  is_nullable: 1
294
289
=cut
295
=cut
290
296
291
__PACKAGE__->add_columns(
297
__PACKAGE__->add_columns(
Lines 375-381 __PACKAGE__->add_columns( Link Here
375
  {
381
  {
376
    data_type => "timestamp",
382
    data_type => "timestamp",
377
    datetime_undef_if_invalid => 1,
383
    datetime_undef_if_invalid => 1,
378
    default_value => \"current_timestamp",
384
    default_value => "current_timestamp()",
379
    is_nullable => 0,
385
    is_nullable => 0,
380
  },
386
  },
381
  "location",
387
  "location",
Lines 406-411 __PACKAGE__->add_columns( Link Here
406
  { data_type => "varchar", is_nullable => 1, size => 32 },
412
  { data_type => "varchar", is_nullable => 1, size => 32 },
407
  "new_status",
413
  "new_status",
408
  { data_type => "varchar", is_nullable => 1, size => 32 },
414
  { data_type => "varchar", is_nullable => 1, size => 32 },
415
  "holding_id",
416
  { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
409
);
417
);
410
418
411
=head1 PRIMARY KEY
419
=head1 PRIMARY KEY
Lines 576-581 __PACKAGE__->belongs_to( Link Here
576
  },
584
  },
577
);
585
);
578
586
587
=head2 holding_id
588
589
Type: belongs_to
590
591
Related object: L<Koha::Schema::Result::Holding>
592
593
=cut
594
595
__PACKAGE__->belongs_to(
596
  "holding_id",
597
  "Koha::Schema::Result::Holding",
598
  { holding_id => "holding_id" },
599
  {
600
    is_deferrable => 1,
601
    join_type     => "LEFT",
602
    on_delete     => "CASCADE",
603
    on_update     => "CASCADE",
604
  },
605
);
606
579
=head2 homebranch
607
=head2 homebranch
580
608
581
Type: belongs_to
609
Type: belongs_to
Lines 687-694 __PACKAGE__->might_have( Link Here
687
);
715
);
688
716
689
717
690
# Created by DBIx::Class::Schema::Loader v0.07042 @ 2018-02-18 16:41:12
718
# Created by DBIx::Class::Schema::Loader v0.07048 @ 2018-03-27 18:01:32
691
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:CrNXvpDUvvcuPZK2Gfzs/Q
719
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:2by51tQSbBWys0cwsoqyMg
692
720
693
__PACKAGE__->belongs_to( biblioitem => "Koha::Schema::Result::Biblioitem", "biblioitemnumber" );
721
__PACKAGE__->belongs_to( biblioitem => "Koha::Schema::Result::Biblioitem", "biblioitemnumber" );
694
722
(-)a/Koha/Template/Plugin/Holdings.pm (+90 lines)
Line 0 Link Here
1
package Koha::Template::Plugin::Holdings;
2
3
# Copyright ByWater Solutions 2012
4
# Copyright BibLibre 2014
5
# Copyright 2017-2018 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
use C4::Holdings;
29
30
use Koha::Holdings;
31
32
sub GetLocation {
33
    my ( $self, $holding ) = @_;
34
    my $opac = shift || 0;
35
36
    if ( !$holding ) {
37
        return '';
38
    }
39
40
    if ( ref($holding) ne 'HASH' ) {
41
        $holding = Koha::Holdings->find( $holding )->unblessed;
42
        if ( !$holding ) {
43
            return '';
44
        }
45
    }
46
47
    my @parts;
48
49
    if ( $opac ) {
50
        if ( $holding->{'holdingbranch'}) {
51
            my $query = "SELECT branchname FROM branches WHERE branchcode = ?";
52
            my $sth   = C4::Context->dbh->prepare( $query );
53
            $sth->execute( $holding->{'holdingbranch'} );
54
            my $b = $sth->fetchrow_hashref();
55
            push @parts, $b->{'branchname'} if $b;
56
            $sth->finish();
57
        }
58
        if ( $holding->{'location'} ) {
59
            my $av = Koha::AuthorisedValues->search({ category => 'LOC', authorised_value => $holding->{'location'} });
60
            push @parts, $av->next->opac_description if $av->count;
61
        }
62
        push @parts, $holding->{'callnumber'} if $holding->{'callnumber'};
63
        return join(' - ', @parts);
64
    }
65
66
    push @parts, $holding->{'holding_id'};
67
    push @parts, $holding->{'holdingbranch'} if $holding->{'holdingbranch'};
68
    push @parts, $holding->{'location'} if $holding->{'location'};
69
    push @parts, $holding->{'callnumber'} if $holding->{'callnumber'};
70
    return join(' ', @parts);
71
}
72
73
sub GetDetails {
74
    my ( $self, $holding ) = @_;
75
    my $opac = shift || 0;
76
77
    if ( !$holding ) {
78
        return '';
79
    }
80
81
    if ( ref($holding) eq 'HASH' ) {
82
        $holding = $holding->{'holding_id'};
83
    }
84
85
    my $marcHolding = C4::Holdings::GetMarcHolding( $holding, $opac );
86
87
    return C4::Holdings::TransformMarcHoldingToKoha( $marcHolding );
88
}
89
90
1;
(-)a/catalogue/detail.pl (-1 / +9 lines)
Lines 26-31 use C4::Koha; Link Here
26
use C4::Serials;    #uses getsubscriptionfrom biblionumber
26
use C4::Serials;    #uses getsubscriptionfrom biblionumber
27
use C4::Output;
27
use C4::Output;
28
use C4::Biblio;
28
use C4::Biblio;
29
use C4::Holdings;
29
use C4::Items;
30
use C4::Items;
30
use C4::Circulation;
31
use C4::Circulation;
31
use C4::Reserves;
32
use C4::Reserves;
Lines 177-182 foreach my $subscription (@subscriptions) { Link Here
177
    push @subs, \%cell;
178
    push @subs, \%cell;
178
}
179
}
179
180
181
# Summary holdings
182
my $summary_holdings;
183
if (C4::Context->preference('SummaryHoldings')) {
184
    $summary_holdings = C4::Holdings::GetHoldingsByBiblionumber($biblionumber);
185
}
180
186
181
# Get acquisition details
187
# Get acquisition details
182
if ( C4::Context->preference('AcquisitionDetails') ) {
188
if ( C4::Context->preference('AcquisitionDetails') ) {
Lines 365-371 $template->param( Link Here
365
        hostrecords         => $hostrecords,
371
        hostrecords         => $hostrecords,
366
	analytics_flag	=> $analytics_flag,
372
	analytics_flag	=> $analytics_flag,
367
	C4::Search::enabled_staff_search_views,
373
	C4::Search::enabled_staff_search_views,
368
        materials       => $materials_flag,
374
    materials       => $materials_flag,
375
    show_summary_holdings => C4::Context->preference('SummaryHoldings') ? 1 : 0,
376
    summary_holdings => $summary_holdings,
369
);
377
);
370
378
371
if (C4::Context->preference("AlternateHoldingsField") && scalar @items == 0) {
379
if (C4::Context->preference("AlternateHoldingsField") && scalar @items == 0) {
(-)a/cataloguing/addholding.pl (+729 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-2018 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::Holdings;
31
use C4::Search;
32
use C4::Biblio;
33
use C4::Context;
34
use MARC::Record;
35
use C4::Log;
36
use C4::Koha;
37
use C4::ClassSource;
38
use C4::ImportBatch;
39
use C4::Charset;
40
use Koha::BiblioFrameworks;
41
use Koha::DateUtils;
42
use C4::Matcher;
43
44
use Koha::ItemTypes;
45
use Koha::Libraries;
46
47
use Koha::BiblioFrameworks;
48
49
use Date::Calc qw(Today);
50
use MARC::File::USMARC;
51
use MARC::File::XML;
52
use URI::Escape;
53
54
if ( C4::Context->preference('marcflavour') eq 'UNIMARC' ) {
55
    MARC::File::XML->default_record_format('UNIMARC');
56
}
57
58
our($tagslib,$authorised_values_sth,$is_a_modif,$usedTagsLib,$mandatory_z3950);
59
60
=head1 FUNCTIONS
61
62
=head2 build_authorized_values_list
63
64
=cut
65
66
sub build_authorized_values_list {
67
    my ( $tag, $subfield, $value, $dbh, $authorised_values_sth,$index_tag,$index_subfield ) = @_;
68
69
    my @authorised_values;
70
    my %authorised_lib;
71
72
    # builds list, depending on authorised value...
73
74
    #---- branch
75
    if ( $tagslib->{$tag}->{$subfield}->{'authorised_value'} eq "branches" ) {
76
        my $libraries = Koha::Libraries->search_filtered({}, {order_by => ['branchname']});
77
        while ( my $l = $libraries->next ) {
78
            push @authorised_values, $l->branchcode;
79
            $authorised_lib{$l->branchcode} = $l->branchname;
80
        }
81
    }
82
    elsif ( $tagslib->{$tag}->{$subfield}->{authorised_value} eq "LOC" ) {
83
        push @authorised_values, ""
84
          unless ( $tagslib->{$tag}->{$subfield}->{mandatory}
85
            && ( $value || $tagslib->{$tag}->{$subfield}->{defaultvalue} ) );
86
87
88
        my $branch_limit = C4::Context->userenv ? C4::Context->userenv->{"branch"} : "";
89
        my $avs = Koha::AuthorisedValues->search(
90
            {
91
                branchcode => $branch_limit,
92
                category => $tagslib->{$tag}->{$subfield}->{authorised_value},
93
            },
94
            {
95
                order_by => [ 'category', 'lib', 'lib_opac' ],
96
            }
97
        );
98
99
        while ( my $av = $avs->next ) {
100
            push @authorised_values, $av->authorised_value;
101
            $authorised_lib{$av->authorised_value} = $av->lib;
102
        }
103
    }
104
    elsif ( $tagslib->{$tag}->{$subfield}->{authorised_value} eq "cn_source" ) {
105
        push @authorised_values, ""
106
          unless ( $tagslib->{$tag}->{$subfield}->{mandatory} );
107
108
        my $class_sources = GetClassSources();
109
110
        my $default_source = C4::Context->preference("DefaultClassificationSource");
111
112
        foreach my $class_source (sort keys %$class_sources) {
113
            next unless $class_sources->{$class_source}->{'used'} or
114
                        ($value and $class_source eq $value) or
115
                        ($class_source eq $default_source);
116
            push @authorised_values, $class_source;
117
            $authorised_lib{$class_source} = $class_sources->{$class_source}->{'description'};
118
        }
119
        $value = $default_source unless $value;
120
    }
121
    else {
122
        my $branch_limit = C4::Context->userenv ? C4::Context->userenv->{"branch"} : "";
123
        $authorised_values_sth->execute(
124
            $tagslib->{$tag}->{$subfield}->{authorised_value},
125
            $branch_limit ? $branch_limit : (),
126
        );
127
128
        push @authorised_values, ""
129
          unless ( $tagslib->{$tag}->{$subfield}->{mandatory}
130
            && ( $value || $tagslib->{$tag}->{$subfield}->{defaultvalue} ) );
131
132
        while ( my ( $value, $lib ) = $authorised_values_sth->fetchrow_array ) {
133
            push @authorised_values, $value;
134
            $authorised_lib{$value} = $lib;
135
        }
136
    }
137
    $authorised_values_sth->finish;
138
    return {
139
        type     => 'select',
140
        id       => "tag_".$tag."_subfield_".$subfield."_".$index_tag."_".$index_subfield,
141
        name     => "tag_".$tag."_subfield_".$subfield."_".$index_tag."_".$index_subfield,
142
        default  => $value,
143
        values   => \@authorised_values,
144
        labels   => \%authorised_lib,
145
    };
146
147
}
148
149
=head2 CreateKey
150
151
    Create a random value to set it into the input name
152
153
=cut
154
155
sub CreateKey {
156
    return int(rand(1000000));
157
}
158
159
=head2 create_input
160
161
 builds the <input ...> entry for a subfield.
162
163
=cut
164
165
sub create_input {
166
    my ( $tag, $subfield, $value, $index_tag, $tabloop, $rec, $authorised_values_sth,$cgi ) = @_;
167
168
    my $index_subfield = CreateKey(); # create a specific key for each subfield
169
170
    $value =~ s/"/&quot;/g;
171
172
    # if there is no value provided but a default value in parameters, get it
173
    if ( $value eq '' ) {
174
        $value = $tagslib->{$tag}->{$subfield}->{defaultvalue};
175
176
        # get today date & replace <<YYYY>>, <<MM>>, <<DD>> if provided in the default value
177
        my $today_dt = dt_from_string;
178
        my $year = $today_dt->strftime('%Y');
179
        my $month = $today_dt->strftime('%m');
180
        my $day = $today_dt->strftime('%d');
181
        $value =~ s/<<YYYY>>/$year/g;
182
        $value =~ s/<<MM>>/$month/g;
183
        $value =~ s/<<DD>>/$day/g;
184
        # And <<USER>> with surname (?)
185
        my $username=(C4::Context->userenv?C4::Context->userenv->{'surname'}:"superlibrarian");
186
        $value=~s/<<USER>>/$username/g;
187
188
    }
189
    my $dbh = C4::Context->dbh;
190
191
    # map '@' as "subfield" label for fixed fields
192
    # to something that's allowed in a div id.
193
    my $id_subfield = $subfield;
194
    $id_subfield = "00" if $id_subfield eq "@";
195
196
    my %subfield_data = (
197
        tag        => $tag,
198
        subfield   => $id_subfield,
199
        marc_lib       => $tagslib->{$tag}->{$subfield}->{lib},
200
        tag_mandatory  => $tagslib->{$tag}->{mandatory},
201
        mandatory      => $tagslib->{$tag}->{$subfield}->{mandatory},
202
        repeatable     => $tagslib->{$tag}->{$subfield}->{repeatable},
203
        kohafield      => $tagslib->{$tag}->{$subfield}->{kohafield},
204
        index          => $index_tag,
205
        id             => "tag_".$tag."_subfield_".$id_subfield."_".$index_tag."_".$index_subfield,
206
        value          => $value,
207
        maxlength      => $tagslib->{$tag}->{$subfield}->{maxlength},
208
        random         => CreateKey(),
209
    );
210
211
    if(exists $mandatory_z3950->{$tag.$subfield}){
212
        $subfield_data{z3950_mandatory} = $mandatory_z3950->{$tag.$subfield};
213
    }
214
    # Subfield is hidden depending of hidden and mandatory flag, and is always
215
    # shown if it contains anything or if its field is mandatory.
216
    my $tdef = $tagslib->{$tag};
217
    $subfield_data{visibility} = "display:none;"
218
        if $tdef->{$subfield}->{hidden} % 2 == 1 &&
219
           $value eq '' &&
220
           !$tdef->{$subfield}->{mandatory} &&
221
           !$tdef->{mandatory};
222
    # expand all subfields of 773 if there is a host item provided in the input
223
    $subfield_data{visibility} ="" if ($tag eq 773 and $cgi->param('hostitemnumber'));
224
225
226
    # it's an authorised field
227
    if ( $tagslib->{$tag}->{$subfield}->{authorised_value} ) {
228
        $subfield_data{marc_value} =
229
          build_authorized_values_list( $tag, $subfield, $value, $dbh,
230
            $authorised_values_sth,$index_tag,$index_subfield );
231
232
    # it's a subfield $9 linking to an authority record - see bug 2206
233
    }
234
    elsif ($subfield eq "9" and
235
           exists($tagslib->{$tag}->{'a'}->{authtypecode}) and
236
           defined($tagslib->{$tag}->{'a'}->{authtypecode}) and
237
           $tagslib->{$tag}->{'a'}->{authtypecode} ne '') {
238
239
        $subfield_data{marc_value} = {
240
            type      => 'text',
241
            id        => $subfield_data{id},
242
            name      => $subfield_data{id},
243
            value     => $value,
244
            size      => 5,
245
            maxlength => $subfield_data{maxlength},
246
            readonly  => 1,
247
        };
248
249
    # it's a thesaurus / authority field
250
    }
251
    elsif ( $tagslib->{$tag}->{$subfield}->{authtypecode} ) {
252
        # when authorities auto-creation is allowed, do not set readonly
253
        my $is_readonly = !C4::Context->preference("BiblioAddsAuthorities");
254
255
        $subfield_data{marc_value} = {
256
            type      => 'text',
257
            id        => $subfield_data{id},
258
            name      => $subfield_data{id},
259
            value     => $value,
260
            size      => 67,
261
            maxlength => $subfield_data{maxlength},
262
            readonly  => ($is_readonly) ? 1 : 0,
263
            authtype  => $tagslib->{$tag}->{$subfield}->{authtypecode},
264
        };
265
266
    # it's a plugin field
267
    } elsif ( $tagslib->{$tag}->{$subfield}->{'value_builder'} ) {
268
        require Koha::FrameworkPlugin;
269
        my $plugin = Koha::FrameworkPlugin->new( {
270
            name => $tagslib->{$tag}->{$subfield}->{'value_builder'},
271
        });
272
        my $pars= { dbh => $dbh, record => $rec, tagslib => $tagslib,
273
            id => $subfield_data{id}, tabloop => $tabloop };
274
        $plugin->build( $pars );
275
        if( !$plugin->errstr ) {
276
            $subfield_data{marc_value} = {
277
                type           => 'text_complex',
278
                id             => $subfield_data{id},
279
                name           => $subfield_data{id},
280
                value          => $value,
281
                size           => 67,
282
                maxlength      => $subfield_data{maxlength},
283
                javascript     => $plugin->javascript,
284
                noclick        => $plugin->noclick,
285
            };
286
        } else {
287
            warn $plugin->errstr;
288
            # supply default input form
289
            $subfield_data{marc_value} = {
290
                type      => 'text',
291
                id        => $subfield_data{id},
292
                name      => $subfield_data{id},
293
                value     => $value,
294
                size      => 67,
295
                maxlength => $subfield_data{maxlength},
296
                readonly  => 0,
297
            };
298
        }
299
300
    # it's an hidden field
301
    } elsif ( $tag eq '' ) {
302
        $subfield_data{marc_value} = {
303
            type      => 'hidden',
304
            id        => $subfield_data{id},
305
            name      => $subfield_data{id},
306
            value     => $value,
307
            size      => 67,
308
            maxlength => $subfield_data{maxlength},
309
        };
310
311
    }
312
    else {
313
        # it's a standard field
314
        if (
315
            length($value) > 100
316
            or
317
            ( C4::Context->preference("marcflavour") eq "UNIMARC" && $tag >= 300
318
                and $tag < 400 && $subfield eq 'a' )
319
            or (    $tag >= 500
320
                and $tag < 600
321
                && C4::Context->preference("marcflavour") eq "MARC21" )
322
          )
323
        {
324
            $subfield_data{marc_value} = {
325
                type      => 'textarea',
326
                id        => $subfield_data{id},
327
                name      => $subfield_data{id},
328
                value     => $value,
329
            };
330
331
        }
332
        else {
333
            $subfield_data{marc_value} = {
334
                type      => 'text',
335
                id        => $subfield_data{id},
336
                name      => $subfield_data{id},
337
                value     => $value,
338
                size      => 67,
339
                maxlength => $subfield_data{maxlength},
340
                readonly  => 0,
341
            };
342
343
        }
344
    }
345
    $subfield_data{'index_subfield'} = $index_subfield;
346
    return \%subfield_data;
347
}
348
349
350
=head2 format_indicator
351
352
Translate indicator value for output form - specifically, map
353
indicator = ' ' to ''.  This is for the convenience of a cataloger
354
using a mouse to select an indicator input.
355
356
=cut
357
358
sub format_indicator {
359
    my $ind_value = shift;
360
    return '' if not defined $ind_value;
361
    return '' if $ind_value eq ' ';
362
    return $ind_value;
363
}
364
365
sub build_tabs {
366
    my ( $template, $record, $dbh, $encoding,$input ) = @_;
367
368
    # fill arrays
369
    my @loop_data = ();
370
    my $tag;
371
372
    my $branch_limit = C4::Context->userenv ? C4::Context->userenv->{"branch"} : "";
373
    my $query = "SELECT authorised_value, lib
374
                FROM authorised_values";
375
    $query .= qq{ LEFT JOIN authorised_values_branches ON ( id = av_id )} if $branch_limit;
376
    $query .= " WHERE category = ?";
377
    $query .= " AND ( branchcode = ? OR branchcode IS NULL )" if $branch_limit;
378
    $query .= " GROUP BY lib ORDER BY lib, lib_opac";
379
    my $authorised_values_sth = $dbh->prepare( $query );
380
381
    # in this array, we will push all the 10 tabs
382
    # to avoid having 10 tabs in the template : they will all be in the same BIG_LOOP
383
    my @BIG_LOOP;
384
    my %seen;
385
    my @tab_data; # all tags to display
386
387
    foreach my $used ( @$usedTagsLib ){
388
        push @tab_data,$used->{tagfield} if not $seen{$used->{tagfield}};
389
        $seen{$used->{tagfield}}++;
390
    }
391
392
    my $max_num_tab=-1;
393
    foreach(@$usedTagsLib){
394
        if($_->{tab} > -1 && $_->{tab} >= $max_num_tab && $_->{tagfield} != '995'){ # FIXME : MARC21 ?
395
            $max_num_tab = $_->{tab};
396
        }
397
    }
398
    if($max_num_tab >= 9){
399
        $max_num_tab = 9;
400
    }
401
    # loop through each tab 0 through 9
402
    for ( my $tabloop = 0 ; $tabloop <= $max_num_tab ; $tabloop++ ) {
403
        my @loop_data = (); #innerloop in the template.
404
        my $i = 0;
405
        foreach my $tag (@tab_data) {
406
            $i++;
407
            next if ! $tag;
408
            my ($indicator1, $indicator2);
409
            my $index_tag = CreateKey;
410
411
            # if MARC::Record is not empty =>use it as master loop, then add missing subfields that should be in the tab.
412
            # if MARC::Record is empty => use tab as master loop.
413
            if ( $record ne -1 && ( $record->field($tag) || $tag eq '000' ) ) {
414
                my @fields;
415
		if ( $tag ne '000' ) {
416
                    @fields = $record->field($tag);
417
		}
418
		else {
419
		   push @fields, $record->leader(); # if tag == 000
420
		}
421
		# loop through each field
422
                foreach my $field (@fields) {
423
424
                    my @subfields_data;
425
                    if ( $tag < 10 ) {
426
                        my ( $value, $subfield );
427
                        if ( $tag ne '000' ) {
428
                            $value    = $field->data();
429
                            $subfield = "@";
430
                        }
431
                        else {
432
                            $value    = $field;
433
                            $subfield = '@';
434
                        }
435
                        next if ( $tagslib->{$tag}->{$subfield}->{tab} ne $tabloop );
436
                        next
437
                          if ( $tagslib->{$tag}->{$subfield}->{kohafield} eq
438
                            'biblio.biblionumber' );
439
                        push(
440
                            @subfields_data,
441
                            &create_input(
442
                                $tag, $subfield, $value, $index_tag, $tabloop, $record,
443
                                $authorised_values_sth,$input
444
                            )
445
                        );
446
                    }
447
                    else {
448
                        my @subfields = $field->subfields();
449
                        foreach my $subfieldcount ( 0 .. $#subfields ) {
450
                            my $subfield = $subfields[$subfieldcount][0];
451
                            my $value    = $subfields[$subfieldcount][1];
452
                            next if ( length $subfield != 1 );
453
                            next if ( $tagslib->{$tag}->{$subfield}->{tab} ne $tabloop );
454
                            push(
455
                                @subfields_data,
456
                                &create_input(
457
                                    $tag, $subfield, $value, $index_tag, $tabloop,
458
                                    $record, $authorised_values_sth,$input
459
                                )
460
                            );
461
                        }
462
                    }
463
464
                    # now, loop again to add parameter subfield that are not in the MARC::Record
465
                    foreach my $subfield ( sort( keys %{ $tagslib->{$tag} } ) )
466
                    {
467
                        next if ( length $subfield != 1 );
468
                        next if ( $tagslib->{$tag}->{$subfield}->{tab} ne $tabloop );
469
                        next if ( $tag < 10 );
470
                        next
471
                          if ( ( $tagslib->{$tag}->{$subfield}->{hidden} <= -4 )
472
                            or ( $tagslib->{$tag}->{$subfield}->{hidden} >= 5 ) )
473
                            and not ( $subfield eq "9" and
474
                                      exists($tagslib->{$tag}->{'a'}->{authtypecode}) and
475
                                      defined($tagslib->{$tag}->{'a'}->{authtypecode}) and
476
                                      $tagslib->{$tag}->{'a'}->{authtypecode} ne ""
477
                                    )
478
                          ;    #check for visibility flag
479
                               # if subfield is $9 in a field whose $a is authority-controlled,
480
                               # always include in the form regardless of the hidden setting - bug 2206
481
                        next if ( defined( $field->subfield($subfield) ) );
482
                        push(
483
                            @subfields_data,
484
                            &create_input(
485
                                $tag, $subfield, '', $index_tag, $tabloop, $record,
486
                                $authorised_values_sth,$input
487
                            )
488
                        );
489
                    }
490
                    if ( $#subfields_data >= 0 ) {
491
                        # build the tag entry.
492
                        # note that the random() field is mandatory. Otherwise, on repeated fields, you'll
493
                        # have twice the same "name" value, and cgi->param() will return only one, making
494
                        # all subfields to be merged in a single field.
495
                        my %tag_data = (
496
                            tag           => $tag,
497
                            index         => $index_tag,
498
                            tag_lib       => $tagslib->{$tag}->{lib},
499
                            repeatable       => $tagslib->{$tag}->{repeatable},
500
                            mandatory       => $tagslib->{$tag}->{mandatory},
501
                            subfield_loop => \@subfields_data,
502
                            fixedfield    => $tag < 10?1:0,
503
                            random        => CreateKey,
504
                        );
505
                        if ($tag >= 10){ # no indicator for 00x tags
506
                           $tag_data{indicator1} = format_indicator($field->indicator(1)),
507
                           $tag_data{indicator2} = format_indicator($field->indicator(2)),
508
                        }
509
                        push( @loop_data, \%tag_data );
510
                    }
511
                 } # foreach $field end
512
513
            # if breeding is empty
514
            }
515
            else {
516
                my @subfields_data;
517
                foreach my $subfield ( sort( keys %{ $tagslib->{$tag} } ) ) {
518
                    next if ( length $subfield != 1 );
519
                    next
520
                      if ( ( $tagslib->{$tag}->{$subfield}->{hidden} <= -4 )
521
                        or ( $tagslib->{$tag}->{$subfield}->{hidden} >= 5 ) )
522
                      and not ( $subfield eq "9" and
523
                                exists($tagslib->{$tag}->{'a'}->{authtypecode}) and
524
                                defined($tagslib->{$tag}->{'a'}->{authtypecode}) and
525
                                $tagslib->{$tag}->{'a'}->{authtypecode} ne ""
526
                              )
527
                      ;    #check for visibility flag
528
                           # if subfield is $9 in a field whose $a is authority-controlled,
529
                           # always include in the form regardless of the hidden setting - bug 2206
530
                    next
531
                      if ( $tagslib->{$tag}->{$subfield}->{tab} ne $tabloop );
532
			push(
533
                        @subfields_data,
534
                        &create_input(
535
                            $tag, $subfield, '', $index_tag, $tabloop, $record,
536
                            $authorised_values_sth,$input
537
                        )
538
                    );
539
                }
540
                if ( $#subfields_data >= 0 ) {
541
                    my %tag_data = (
542
                        tag              => $tag,
543
                        index            => $index_tag,
544
                        tag_lib          => $tagslib->{$tag}->{lib},
545
                        repeatable       => $tagslib->{$tag}->{repeatable},
546
                        mandatory       => $tagslib->{$tag}->{mandatory},
547
                        indicator1       => $indicator1,
548
                        indicator2       => $indicator2,
549
                        subfield_loop    => \@subfields_data,
550
                        tagfirstsubfield => $subfields_data[0],
551
                        fixedfield       => $tag < 10?1:0,
552
                    );
553
554
                    push @loop_data, \%tag_data ;
555
                }
556
            }
557
        }
558
        if ( $#loop_data >= 0 ) {
559
            push @BIG_LOOP, {
560
                number    => $tabloop,
561
                innerloop => \@loop_data,
562
            };
563
        }
564
    }
565
    $authorised_values_sth->finish;
566
    $template->param( BIG_LOOP => \@BIG_LOOP );
567
}
568
569
# ========================
570
#          MAIN
571
#=========================
572
my $input = new CGI;
573
my $error = $input->param('error');
574
my $biblionumber  = $input->param('biblionumber');
575
my $holding_id = $input->param('holding_id'); # if holding_id exists, it's a modif, not a new holding.
576
my $op            = $input->param('op');
577
my $mode          = $input->param('mode');
578
my $frameworkcode = $input->param('frameworkcode');
579
my $redirect      = $input->param('redirect');
580
my $searchid      = $input->param('searchid');
581
my $dbh           = C4::Context->dbh;
582
583
my $userflags = 'edit_items';
584
585
my $changed_framework = $input->param('changed_framework');
586
$frameworkcode = &C4::Holdings::GetHoldingFrameworkCode($holding_id)
587
  if ( $holding_id and not( defined $frameworkcode) and $op ne 'add' );
588
589
$frameworkcode = 'HLD' if ( !$frameworkcode || $frameworkcode eq 'Default' );
590
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
591
    {
592
        template_name   => "cataloguing/addholding.tt",
593
        query           => $input,
594
        type            => "intranet",
595
        authnotrequired => 0,
596
        flagsrequired   => { editcatalogue => $userflags },
597
    }
598
);
599
600
# TODO: support in advanced editor?
601
#if ( $op ne "delete" && C4::Context->preference('EnableAdvancedCatalogingEditor') && $input->cookie( 'catalogue_editor_' . $loggedinuser ) eq 'advanced' ) {
602
#    print $input->redirect( '/cgi-bin/koha/cataloguing/editor.pl#catalog/' . $biblionumber . '/holdings/' . ( $holding_id ? $holding_id : '' ) );
603
#    exit;
604
#}
605
606
my $frameworks = Koha::BiblioFrameworks->search({}, { order_by => ['frameworktext'] });
607
$template->param(
608
    frameworks => $frameworks
609
);
610
611
# ++ Global
612
$tagslib         = &GetMarcStructure( 1, $frameworkcode );
613
$usedTagsLib     = &GetUsedMarcStructure( $frameworkcode );
614
# -- Global
615
616
my $record   = -1;
617
my $encoding = "";
618
619
if ($holding_id){
620
    $record = C4::Holdings::GetMarcHolding($holding_id);
621
}
622
623
$is_a_modif = 0;
624
625
if ($holding_id) {
626
    $is_a_modif = 1;
627
628
}
629
my ( $biblionumbertagfield, $biblionumbertagsubfield ) =
630
    &GetMarcFromKohaField( "biblio.biblionumber", $frameworkcode );
631
632
#-------------------------------------------------------------------------------------
633
if ( $op eq "add" ) {
634
#-------------------------------------------------------------------------------------
635
    $template->param(
636
        biblionumberdata => $biblionumber,
637
    );
638
    # getting html input
639
    my @params = $input->multi_param();
640
    $record = TransformHtmlToMarc( $input, 1 );
641
    if ( $is_a_modif ) {
642
        ModHolding( $record, $holding_id, $frameworkcode );
643
    }
644
    else {
645
        $holding_id = AddHolding( $record, $frameworkcode, $biblionumber );
646
    }
647
    if ($redirect eq "items" || ($mode ne "popup" && !$is_a_modif && $redirect ne "view" && $redirect ne "just_save")){
648
        print $input->redirect("/cgi-bin/koha/catalogue/detail.pl?biblionumber=$biblionumber&searchid=$searchid");
649
        exit;
650
    }
651
    elsif(($is_a_modif || $redirect eq "view") && $redirect ne "just_save"){
652
        print $input->redirect("/cgi-bin/koha/catalogue/detail.pl?biblionumber=$biblionumber&searchid=$searchid");
653
        exit;
654
    }
655
    elsif ($redirect eq "just_save"){
656
        my $tab = $input->param('current_tab');
657
        print $input->redirect("/cgi-bin/koha/cataloguing/addholding.pl?biblionumber=$biblionumber&holding_id=$holding_id&framework=$frameworkcode&tab=$tab&searchid=$searchid");
658
    }
659
    else {
660
          $template->param(
661
            biblionumber => $biblionumber,
662
            holding_id => $holding_id,
663
            done         =>1,
664
            popup        =>1
665
          );
666
          $template->param(
667
            popup => $mode,
668
            itemtype => $frameworkcode,
669
          );
670
          output_html_with_http_headers $input, $cookie, $template->output;
671
          exit;
672
    }
673
}
674
elsif ( $op eq "delete" ) {
675
676
    my $error = &DelHolding($holding_id);
677
    if ($error) {
678
        warn "ERROR when DELETING HOLDING $holding_id : $error";
679
        print "Content-Type: text/html\n\n<html><body><h1>ERROR when DELETING HOLDING $holding_id : $error</h1></body></html>";
680
        exit;
681
    }
682
683
    print $input->redirect("/cgi-bin/koha/catalogue/detail.pl?biblionumber=$biblionumber&searchid=$searchid");
684
    exit;
685
686
} else {
687
   #----------------------------------------------------------------------------
688
   # If we're in a duplication case, we have to set to "" the holding_id
689
   # as we'll save the holding as a new one.
690
    $template->param(
691
        holding_iddata => $holding_id,
692
        op                => $op,
693
    );
694
    if ( $op eq "duplicate" ) {
695
        $holding_id = "";
696
    }
697
698
    if($changed_framework eq "changed"){
699
        $record = TransformHtmlToMarc( $input, 1 );
700
    }
701
    elsif( $record ne -1 ) {
702
#FIXME: it's kind of silly to go from MARC::Record to MARC::File::XML and then back again just to fix the encoding
703
        eval {
704
            my $uxml = $record->as_xml;
705
            MARC::Record::default_record_format("UNIMARC")
706
            if ( C4::Context->preference("marcflavour") eq "UNIMARC" );
707
            my $urecord = MARC::Record::new_from_xml( $uxml, 'UTF-8' );
708
            $record = $urecord;
709
        };
710
    }
711
    build_tabs( $template, $record, $dbh, $encoding,$input );
712
    $template->param(
713
        holding_id            => $holding_id,
714
        biblionumber             => $biblionumber,
715
        biblionumbertagfield     => $biblionumbertagfield,
716
        biblionumbertagsubfield  => $biblionumbertagsubfield,
717
    );
718
}
719
720
$template->param(
721
    popup => $mode,
722
    frameworkcode => $frameworkcode,
723
    itemtype => $frameworkcode,
724
    borrowernumber => $loggedinuser,
725
    tab => scalar $input->param('tab')
726
);
727
$template->{'VARS'}->{'searchid'} = $searchid;
728
729
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 211-216 sub generate_subfield_form { Link Here
211
        
212
        
212
                  #---- "true" authorised value
213
                  #---- "true" authorised value
213
            }
214
            }
215
            elsif ( $subfieldlib->{authorised_value} eq "holdings" ) {
216
                push @authorised_values, "" unless ( $subfieldlib->{mandatory} );
217
                my $holdings = Koha::Holdings->search({biblionumber => $biblionumber}, { order_by => ['holdingbranch'] })->unblessed;
218
                for my $holding ( @$holdings ) {
219
                    push @authorised_values, $holding->{holding_id};
220
                    $authorised_lib{$holding->{holding_id}} = $holding->{holding_id} . ' ' . $holding->{holdingbranch} . ' ' . $holding->{location} . ' ' . $holding->{callnumber};
221
                }
222
		    my $input = new CGI;
223
                $value = $input->param('holding_id') unless ($value);
224
            }
214
            else {
225
            else {
215
                  push @authorised_values, qq{} unless ( $subfieldlib->{mandatory} );
226
                  push @authorised_values, qq{} unless ( $subfieldlib->{mandatory} );
216
                  my $av = GetAuthorisedValues( $subfieldlib->{authorised_value} );
227
                  my $av = GetAuthorisedValues( $subfieldlib->{authorised_value} );
(-)a/cataloguing/value_builder/marc21_field_008_holdings.pl (+120 lines)
Line 0 Link Here
1
#!/usr/bin/perl
2
3
# Copyright 2000-2002 Katipo Communications
4
# Copyright 2017-2018 University of Helsinki (The National Library Of Finland)
5
#
6
# This file is part of Koha.
7
#
8
# Koha is free software; you can redistribute it and/or modify it
9
# under the terms of the GNU General Public License as published by
10
# the Free Software Foundation; either version 3 of the License, or
11
# (at your option) any later version.
12
#
13
# Koha is distributed in the hope that it will be useful, but
14
# WITHOUT ANY WARRANTY; without even the implied warranty of
15
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
# GNU General Public License for more details.
17
#
18
# You should have received a copy of the GNU General Public License
19
# along with Koha; if not, see <http://www.gnu.org/licenses>.
20
21
use Modern::Perl;
22
use C4::Auth;
23
use CGI qw ( -utf8 );
24
use C4::Context;
25
26
use C4::Search;
27
use C4::Output;
28
29
use XML::LibXML;
30
use Koha::Util::FrameworkPlugin qw|date_entered|;
31
32
my $builder = sub {
33
    my ( $params ) = @_;
34
35
    my $lang = C4::Context->preference('DefaultLanguageField008' );
36
    $lang = "eng" unless $lang;
37
    $lang = pack("A3", $lang);
38
39
    my $function_name = $params->{id};
40
    my $dateentered = date_entered();
41
    my $res           = "
42
<script type=\"text/javascript\">
43
//<![CDATA[
44
45
function Focus$function_name(event) {
46
    if ( document.getElementById(event.data.id).value ) {
47
	}
48
	else {
49
        document.getElementById(event.data.id).value='$dateentered' + '0u    0   4   uu${lang}0$dateentered';
50
	}
51
    return 1;
52
}
53
54
function Click$function_name(event) {
55
    defaultvalue=document.getElementById(event.data.id).value;
56
    //Retrieve full leader string and pass it to the 008 tag editor
57
    var leader_value = \$(\"input[id^='tag_000']\").val();
58
    var leader_parameter = \"\";
59
    if (leader_value){
60
        //Only add the parameter to the URL if there is a value to add
61
        leader_parameter = \"&leader=\"+leader_value;
62
    }
63
    newin=window.open(\"../cataloguing/plugin_launcher.pl?plugin_name=marc21_field_008_holdings.pl&index=\"+ event.data.id +\"&result=\"+defaultvalue+leader_parameter,\"tag_editor\",'width=1000,height=600,toolbar=false,scrollbars=yes');
64
65
}
66
//]]>
67
</script>
68
";
69
70
    return $res;
71
};
72
73
my $launcher = sub {
74
    my ( $params ) = @_;
75
    my $input = $params->{cgi};
76
    my $index= $input->param('index');
77
    my $result= $input->param('result');
78
79
    my $lang = C4::Context->preference('DefaultLanguageField008' );
80
    $lang = "eng" unless $lang;
81
    $lang = pack("A3", $lang);
82
83
    my ($template, $loggedinuser, $cookie)
84
    = get_template_and_user({template_name => "cataloguing/value_builder/marc21_field_008_holdings.tt",
85
                 query => $input,
86
                 type => "intranet",
87
                 authnotrequired => 0,
88
                 flagsrequired => {editcatalogue => '*'},
89
                 debug => 1,
90
                 });
91
    my $dateentered = date_entered();
92
    $result = $dateentered + '0u    0   0   uu' + $lang + '0' + $dateentered unless $result;
93
    my @f;
94
    for(0,6..8,12..17,20..22,25,26) {
95
        my $len = 1;
96
        if ($_ == 0 || $_ == 26) {
97
            $len = 6;
98
        } elsif ($_ == 8) {
99
            $len = 4;
100
        } elsif ($_ == 17 || $_ == 22) {
101
            $len = 3;
102
        }
103
        warn ($_ . ': ' . $len);
104
        $f[$_]=substr($result,$_,$len);
105
    }
106
    $template->param(index => $index);
107
108
    $f[0]= $dateentered if !$f[0] || $f[0]=~/\s/;
109
    $template->param(f1 => $f[0]);
110
111
    for(6..8,12..17,20..22,25,26) {
112
        $template->param(
113
            "f$_" => $f[$_],
114
            "f$_".($f[$_] eq '|'? 'pipe': $f[$_]) => $f[$_],
115
        );
116
    }
117
    output_html_with_http_headers $input, $cookie, $template->output;
118
};
119
120
return { builder => $builder, launcher => $launcher };
(-)a/cataloguing/value_builder/marc21_leader_holdings.pl (+85 lines)
Line 0 Link Here
1
#!/usr/bin/perl
2
3
# Copyright 2000-2002 Katipo Communications
4
# Copyright 2017-2018 University of Helsinki (The National Library Of Finland)
5
#
6
# This file is part of Koha.
7
#
8
# Koha is free software; you can redistribute it and/or modify it
9
# under the terms of the GNU General Public License as published by
10
# the Free Software Foundation; either version 3 of the License, or
11
# (at your option) any later version.
12
#
13
# Koha is distributed in the hope that it will be useful, but
14
# WITHOUT ANY WARRANTY; without even the implied warranty of
15
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
# GNU General Public License for more details.
17
#
18
# You should have received a copy of the GNU General Public License
19
# along with Koha; if not, see <http://www.gnu.org/licenses>.
20
21
use Modern::Perl;
22
use CGI qw ( -utf8 );
23
24
use C4::Auth;
25
use C4::Context;
26
use C4::Output;
27
28
my $builder = sub {
29
    my ( $params ) = @_;
30
    my $function_name = $params->{id};
31
    my $res           = "
32
<script type=\"text/javascript\">
33
//<![CDATA[
34
35
function Focus$function_name(event) {
36
    if(!document.getElementById(event.data.id).value){
37
        document.getElementById(event.data.id).value = '     nu  a22     ui 4500';
38
    }
39
}
40
41
function Click$function_name(event) {
42
    defaultvalue=document.getElementById(event.data.id).value;
43
    newin=window.open(\"../cataloguing/plugin_launcher.pl?plugin_name=marc21_leader_holdings.pl&index=\"+ event.data.id +\"&result=\"+defaultvalue,\"tag_editor\",'width=1000,height=600,toolbar=false,scrollbars=yes');
44
}
45
46
//]]>
47
</script>
48
";
49
50
    return $res;
51
};
52
53
my $launcher = sub {
54
    my ( $params ) = @_;
55
    my $input = $params->{cgi};
56
    my $index   = $input->param('index');
57
    my $result  = $input->param('result');
58
59
    my $dbh = C4::Context->dbh;
60
61
    my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
62
        {   template_name   => "cataloguing/value_builder/marc21_leader_holdings.tt",
63
            query           => $input,
64
            type            => "intranet",
65
            authnotrequired => 0,
66
            flagsrequired   => { editcatalogue => '*' },
67
            debug           => 1,
68
        }
69
    );
70
    $result = "     nu  a22     ui 4500" unless $result;
71
    my $f5    = substr( $result, 5,  1 );
72
    my $f6    = substr( $result, 6,  1 );
73
    my $f17   = substr( $result, 17, 1 );
74
    my $f18   = substr( $result, 18, 1 );
75
    $template->param(
76
        index     => $index,
77
        "f5$f5"   => 1,
78
        "f6$f6"   => 1,
79
        "f17$f17" => 1,
80
        "f18$f18" => 1,
81
    );
82
    output_html_with_http_headers $input, $cookie, $template->output;
83
};
84
85
return { builder => $builder, launcher => $launcher };
(-)a/installer/data/mysql/atomicupdate/bug_20447-add_holdings_tables.sql (+398 lines)
Line 0 Link Here
1
--
2
-- Table structure for table `holdings`
3
--
4
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
    `biblioitemnumber` int(11) NOT NULL default 0, -- foreign key from the biblioitems table to link record to additional information
9
    `frameworkcode` varchar(4) NOT NULL default '', -- foreign key from the biblio_framework table to identify which framework was used in cataloging this record
10
    `holdingbranch` varchar(10) default NULL, -- foreign key from the branches table for the library that owns this record (MARC21 852$a)
11
    `location` varchar(80) default NULL, -- authorized value for the shelving location for this record (MARC21 852$b)
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 `hldbinoidx` (`biblioitemnumber`),
20
    KEY `hldbibnoidx` (`biblionumber`),
21
    CONSTRAINT `holdings_ibfk_1` FOREIGN KEY (`biblionumber`) REFERENCES `biblio` (`biblionumber`) ON DELETE CASCADE ON UPDATE CASCADE,
22
    CONSTRAINT `holdings_ibfk_2` FOREIGN KEY (`biblioitemnumber`) REFERENCES `biblioitems` (`biblioitemnumber`) ON DELETE CASCADE ON UPDATE CASCADE,
23
    CONSTRAINT `holdings_ibfk_3` FOREIGN KEY (`holdingbranch`) REFERENCES `branches` (`branchcode`) ON UPDATE CASCADE
24
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
25
26
--
27
-- Table structure for table `holdings_metadata`
28
--
29
30
CREATE TABLE holdings_metadata (
31
    `id` INT(11) NOT NULL AUTO_INCREMENT,
32
    `holding_id` INT(11) NOT NULL,
33
    `format` VARCHAR(16) NOT NULL,
34
    `marcflavour` VARCHAR(16) NOT NULL,
35
    `metadata` LONGTEXT NOT NULL,
36
    `deleted_on` DATETIME DEFAULT NULL, -- the date this record was deleted
37
    PRIMARY KEY(id),
38
    UNIQUE KEY `holdings_metadata_uniq_key` (`holding_id`,`format`,`marcflavour`),
39
    KEY `hldnoidx` (`holding_id`),
40
    CONSTRAINT `holdings_metadata_fk_1` FOREIGN KEY (`holding_id`) REFERENCES `holdings` (`holding_id`) ON DELETE CASCADE ON UPDATE CASCADE
41
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
42
43
--
44
-- Add holding_id to items table
45
--
46
47
ALTER TABLE `items` ADD COLUMN `holding_id` int(11) default NULL;
48
ALTER TABLE `items` ADD CONSTRAINT `items_ibfk_5` FOREIGN KEY (`holding_id`) REFERENCES `holdings` (`holding_id`) ON DELETE CASCADE ON UPDATE CASCADE;
49
ALTER TABLE `items` ADD KEY `hldid_idx` (`holding_id`);
50
51
--
52
-- Add holding_id to deleteditems table
53
--
54
55
ALTER TABLE `deleteditems` ADD COLUMN `holding_id` int(11) default NULL;
56
57
--
58
-- Insert a new category to authorised_value_categories table
59
--
60
61
INSERT INTO authorised_value_categories( category_name ) VALUES ('holdings');
62
63
64
--
65
-- Insert 999e to the default framework
66
--
67
68
INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES
69
        ('999', 'e', 'Koha holding_id', 'Koha holding_id', 0, 0, 'holdings.holding_id', -1, NULL, NULL, '', NULL, -5, '', '', '', NULL);
70
71
72
--
73
-- Insert 952v to marc_subfield_structure table
74
--
75
76
INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES
77
        ('952', 'V', 'Holding record',  'Holding record',  0, 0, 'items.holding_id', 10, 'holdings', '', '', NULL, 0,  '', '', '', NULL);
78
79
-- HOLDINGS RECORD FRAMEWORK
80
81
INSERT IGNORE INTO `biblio_framework` (`frameworkcode`, `frameworktext`) VALUES ('HLD', 'Default holdings framework');
82
INSERT IGNORE INTO `marc_tag_structure` (`tagfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `authorised_value`, `frameworkcode`) VALUES
83
        ('999', 'SYSTEM CONTROL NUMBERS (KOHA)', 'SYSTEM CONTROL NUMBERS (KOHA)', 1, 0, '', 'HLD');
84
85
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
86
        ('999', 'c', 'Koha biblionumber', 'Koha biblionumber', 0, 0, 'biblio.biblionumber', -1, NULL, NULL, '', NULL, -5, 'HLD', '', '', NULL),
87
        ('999', 'd', 'Koha biblioitemnumber', 'Koha biblioitemnumber', 0, 0, 'biblioitems.biblioitemnumber', -1, NULL, NULL, '', NULL, -5, 'HLD', '', '', NULL),
88
        ('999', 'e', 'Koha holding_id', 'Koha holding_id', 0, 0, 'holdings.holding_id', -1, NULL, NULL, '', NULL, -5, 'HLD', '', '', NULL);
89
90
91
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
92
        ('942', 'n', 'Suppress in OPAC', 'Suppress in OPAC', 0, 0, 'holdings.suppress', 9, '', '', '', 0, 0, 'HLD', '', '', NULL);
93
94
INSERT IGNORE INTO `marc_tag_structure` (`tagfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `authorised_value`, `frameworkcode`) VALUES
95
        ('000', 'LEADER', 'LEADER', 0, 1, '', 'HLD'),
96
        ('001', 'CONTROL NUMBER', 'CONTROL NUMBER', 0, 0, '', 'HLD'),
97
        ('003', 'CONTROL NUMBER IDENTIFIER', 'CONTROL NUMBER IDENTIFIER', 0, 1, '', 'HLD'),
98
        ('005', 'DATE AND TIME OF LATEST TRANSACTION', 'DATE AND TIME OF LATEST TRANSACTION', 0, 1, '', 'HLD'),
99
        ('006', 'FIXED-LENGTH DATA ELEMENTS--ADDITIONAL MATERIAL CHARACTERISTICS', 'FIXED-LENGTH DATA ELEMENTS--ADDITIONAL MATERIAL CHARACTERISTICS', 1, 0, '', 'HLD'),
100
        ('007', 'PHYSICAL DESCRIPTION FIXED FIELD--GENERAL INFORMATION', 'PHYSICAL DESCRIPTION FIXED FIELD--GENERAL INFORMATION', 1, 0, '', 'HLD'),
101
        ('008', 'FIXED-LENGTH DATA ELEMENTS--GENERAL INFORMATION', 'FIXED-LENGTH DATA ELEMENTS--GENERAL INFORMATION', 0, 1, '', 'HLD');
102
103
INSERT IGNORE INTO `marc_tag_structure` (`tagfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `authorised_value`, `frameworkcode`) VALUES
104
        ('850', 'HOLDING INSTITUTION', 'HOLDING INSTITUTION', 1, 0, NULL, 'HLD'),
105
        ('852', 'LOCATION', 'LOCATION', 1, 0, NULL, 'HLD'),
106
        ('853', 'CAPTIONS AND PATTERN--BASIC BIBLIOGRAPHIC UNIT', 'CAPTIONS AND PATTERN--BASIC BIBLIOGRAPHIC UNIT', 1, 0, NULL, 'HLD'),
107
        ('854', 'CAPTIONS AND PATTERN--SUPPLEMENTARY MATERIAL', 'CAPTIONS AND PATTERN--SUPPLEMENTARY MATERIAL', 1, 0, NULL, 'HLD'),
108
        ('855', 'CAPTIONS AND PATTERN--INDEXES', 'CAPTIONS AND PATTERN--INDEXES', 1, 0, NULL, 'HLD'),
109
        ('856', 'ELECTRONIC LOCATION AND ACCESS', 'ELECTRONIC LOCATION AND ACCESS', 1, 0, NULL, 'HLD'),
110
        ('863', 'ENUMERATION AND CHRONOLOGY--BASIC BIBLIOGRAPHIC UNIT', 'ENUMERATION AND CHRONOLOGY--BASIC BIBLIOGRAPHIC UNIT', 1, 0, NULL, 'HLD'),
111
        ('864', 'ENUMERATION AND CHRONOLOGY--SUPPLEMENTARY MATERIAL', 'ENUMERATION AND CHRONOLOGY--SUPPLEMENTARY MATERIAL', 1, 0, NULL, 'HLD'),
112
        ('865', 'ENUMERATION AND CHRONOLOGY--INDEXES', 'ENUMERATION AND CHRONOLOGY--INDEXES', 1, 0, NULL, 'HLD'),
113
        ('866', 'TEXTUAL HOLDINGS--BASIC BIBLIOGRAPHIC UNIT', 'TEXTUAL HOLDINGS--BASIC BIBLIOGRAPHIC UNIT', 1, 0, NULL, 'HLD'),
114
        ('867', 'TEXTUAL HOLDINGS--SUPPLEMENTARY MATERIAL', 'TEXTUAL HOLDINGS--SUPPLEMENTARY MATERIAL', 1, 0, NULL, 'HLD'),
115
        ('868', 'TEXTUAL HOLDINGS--INDEXES', 'TEXTUAL HOLDINGS--INDEXES', 1, 0, NULL, 'HLD'),
116
        ('876', 'ITEM INFORMATION--BASIC BIBLIOGRAPHIC UNIT', 'ITEM INFORMATION--BASIC BIBLIOGRAPHIC UNIT', 1, 0, NULL, 'HLD'),
117
        ('877', 'ITEM INFORMATION--SUPPLEMENTARY MATERIAL', 'ITEM INFORMATION--SUPPLEMENTARY MATERIAL', 1, 0, NULL, 'HLD'),
118
        ('878', 'ITEM INFORMATION--INDEXES', 'ITEM INFORMATION--INDEXES', 1, 0, NULL, 'HLD');
119
120
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
121
        ('000', '@', 'fixed length control field', 'fixed length control field', 0, 1, '', 0, '', '', 'marc21_leader_holdings.pl', 0, 0, 'HLD', '', '', NULL),
122
        ('001', '@', 'control field', 'control field', 0, 0, '', 0, '', '', '', 0, 0, 'HLD', '', '', NULL),
123
        ('003', '@', 'control field', 'control field', 0, 1, '', 0, '', '', 'marc21_orgcode.pl', 0, 0, 'HLD', '', '', NULL),
124
        ('005', '@', 'control field', 'control field', 0, 1, '', 0, '', '', 'marc21_field_005.pl', 0, 0, 'HLD', '', '', NULL),
125
        ('006', '@', 'fixed length control field', 'fixed length control field', 0, 0, '', 0, '', '', 'marc21_field_006.pl', 0, -1, 'HLD', '', '', NULL),
126
        ('007', '@', 'fixed length control field', 'fixed length control field', 0, 0, '', 0, '', '', 'marc21_field_007.pl', 0, 0, 'HLD', '', '', NULL),
127
        ('008', '@', 'fixed length control field', 'fixed length control field', 0, 1, '', 0, '', '', 'marc21_field_008_holdings.pl', 0, 0, 'HLD', '', '', NULL),
128
        ('850', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, NULL, 8, NULL, NULL, '', NULL, 4, 'HLD', '', '', NULL),
129
        ('850', 'a', 'Holding institution', 'Holding institution', 1, 0, NULL, 8, NULL, NULL, '', NULL, 4, 'HLD', '', '', NULL),
130
        ('850', 'b', 'Holdings (NR) (MU VM SE) [OBSOLETE]', 'Holdings (NR) (MU VM SE) [OBSOLETE]', 0, 0, NULL, 8, NULL, NULL, '', NULL, 4, 'HLD', '', '', NULL),
131
        ('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),
132
        ('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),
133
        ('852', '2', 'Source of classification or shelving scheme', 'Source of classification or shelving scheme', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
134
        ('852', '3', 'Materials specified', 'Materials specified', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
135
        ('852', '6', 'Linkage', 'Linkage', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
136
        ('852', '8', 'Sequence number', 'Sequence number', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
137
        ('852', 'a', 'Location', 'Location', 0, 0, 'holdings.holdingbranch', 8, 'branches', '', '', NULL, 4, 'HLD', '', '', NULL),
138
        ('852', 'b', 'Sublocation or collection', 'Sublocation or collection', 1, 0, 'holdings.location', 8, 'LOC', '', '', NULL, 4, 'HLD', '', '', NULL),
139
        ('852', 'c', 'Shelving location', 'Shelving location', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
140
        ('852', 'd', 'Former shelving location', 'Former shelving location', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
141
        ('852', 'e', 'Address', 'Address', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
142
        ('852', 'f', 'Coded location qualifier', 'Coded location qualifier', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
143
        ('852', 'g', 'Non-coded location qualifier', 'Non-coded location qualifier', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
144
        ('852', 'h', 'Classification part', 'Classification part', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
145
        ('852', 'i', 'Item part', 'Item part', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
146
        ('852', 'j', 'Shelving control number', 'Shelving control number', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
147
        ('852', 'k', 'Call number prefix', 'Call number prefix', 1, 0, 'holdings.callnumber', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
148
        ('852', 'l', 'Shelving form of title', 'Shelving form of title', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
149
        ('852', 'm', 'Call number suffix', 'Call number suffix', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
150
        ('852', 'n', 'Country code', 'Country code', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
151
        ('852', 'p', 'Piece designation', 'Piece designation', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
152
        ('852', 'q', 'Piece physical condition', 'Piece physical condition', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
153
        ('852', 's', 'Copyright article-fee code', 'Copyright article-fee code', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
154
        ('852', 't', 'Copy number', 'Copy number', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
155
        ('852', 'u', 'Uniform Resource Identifier', 'Uniform Resource Identifier', 1, 0, '', 8, '', '', '', 1, 4, 'HLD', '', '', NULL),
156
        ('852', 'x', 'Nonpublic note', 'Nonpublic note', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
157
        ('852', 'z', 'Public note', 'Public note', 1, 0, 'holdings.public_note', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
158
        ('853', '3', 'Materials specified', 'Materials specified', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
159
        ('853', '6', 'Linkage', 'Linkage', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
160
        ('853', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
161
        ('853', 'a', 'First level of enumeration', 'First level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
162
        ('853', 'b', 'Second level of enumeration', 'Second level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
163
        ('853', 'c', 'Third level of enumeration', 'Third level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
164
        ('853', 'd', 'Fourth level of enumeration', 'Fourth level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
165
        ('853', 'e', 'Fifth level of enumeration', 'Fifth level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
166
        ('853', 'f', 'Sixth level of enumeration', 'Sixth level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
167
        ('853', 'g', 'Alternative numbering scheme, first level of enumeration', 'Alternative numbering scheme, first level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
168
        ('853', 'h', 'Alternative numbering scheme, second level of enumeration', 'Alternative numbering scheme, second level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
169
        ('853', 'i', 'First level of chronology', 'First level of chronology', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
170
        ('853', 'j', 'Second level of chronology', 'Second level of chronology', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
171
        ('853', 'k', 'Third level of chronology', 'Third level of chronology', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
172
        ('853', 'l', 'Fourth level of chronology', 'Fourth level of chronology', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
173
        ('853', 'm', 'Alternative numbering scheme, chronology', 'Alternative numbering scheme, chronology', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
174
        ('853', 'n', 'Pattern note', 'Pattern note', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
175
        ('853', 'p', 'Number of pieces per issuance', 'Number of pieces per issuance', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
176
        ('853', 't', 'Copy', 'Copy', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
177
        ('853', 'u', 'Bibliographic units per next higher level', 'Bibliographic units per next higher level', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
178
        ('853', 'v', 'Numbering continuity', 'Numbering continuity', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
179
        ('853', 'w', 'Frequency', 'Frequency', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
180
        ('853', 'x', 'Calendar change', 'Calendar change', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
181
        ('853', 'y', 'Regularity pattern', 'Regularity pattern', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
182
        ('853', 'z', 'Numbering scheme', 'Numbering scheme', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
183
        ('854', '3', 'Materials specified', 'Materials specified', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
184
        ('854', '6', 'Linkage', 'Linkage', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
185
        ('854', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
186
        ('854', 'a', 'First level of enumeration', 'First level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
187
        ('854', 'b', 'Second level of enumeration', 'Second level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
188
        ('854', 'c', 'Third level of enumeration', 'Third level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
189
        ('854', 'd', 'Fourth level of enumeration', 'Fourth level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
190
        ('854', 'e', 'Fifth level of enumeration', 'Fifth level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
191
        ('854', 'f', 'Sixth level of enumeration', 'Sixth level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
192
        ('854', 'g', 'Alternative numbering scheme, first level of enumeration', 'Alternative numbering scheme, first level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
193
        ('854', 'h', 'Alternative numbering scheme, second level of enumeration', 'Alternative numbering scheme, second level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
194
        ('854', 'i', 'First level of chronology', 'First level of chronology', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
195
        ('854', 'j', 'Second level of chronology', 'Second level of chronology', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
196
        ('854', 'k', 'Third level of chronology', 'Third level of chronology', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
197
        ('854', 'l', 'Fourth level of chronology', 'Fourth level of chronology', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
198
        ('854', 'm', 'Alternative numbering scheme, chronology', 'Alternative numbering scheme, chronology', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
199
        ('854', 'n', 'Pattern note', 'Pattern note', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
200
        ('854', 'p', 'Number of pieces per issuance', 'Number of pieces per issuance', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
201
        ('854', 't', 'Copy', 'Copy', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
202
        ('854', 'u', 'Bibliographic units per next higher level', 'Bibliographic units per next higher level', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
203
        ('854', 'v', 'Numbering continuity', 'Numbering continuity', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
204
        ('854', 'w', 'Frequency', 'Frequency', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
205
        ('854', 'x', 'Calendar change', 'Calendar change', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
206
        ('854', 'y', 'Regularity pattern', 'Regularity pattern', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
207
        ('854', 'z', 'Numbering scheme', 'Numbering scheme', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
208
        ('855', '3', 'Materials specified', 'Materials specified', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
209
        ('855', '6', 'Linkage', 'Linkage', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
210
        ('855', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
211
        ('855', 'a', 'First level of enumeration', 'First level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
212
        ('855', 'b', 'Second level of enumeration', 'Second level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
213
        ('855', 'c', 'Third level of enumeration', 'Third level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
214
        ('855', 'd', 'Fourth level of enumeration', 'Fourth level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
215
        ('855', 'e', 'Fifth level of enumeration', 'Fifth level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
216
        ('855', 'f', 'Sixth level of enumeration', 'Sixth level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
217
        ('855', 'g', 'Alternative numbering scheme, first level of enumeration', 'Alternative numbering scheme, first level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
218
        ('855', 'h', 'Alternative numbering scheme, second level of enumeration', 'Alternative numbering scheme, second level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
219
        ('855', 'i', 'First level of chronology', 'First level of chronology', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
220
        ('855', 'j', 'Second level of chronology', 'Second level of chronology', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
221
        ('855', 'k', 'Third level of chronology', 'Third level of chronology', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
222
        ('855', 'l', 'Fourth level of chronology', 'Fourth level of chronology', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
223
        ('855', 'm', 'Alternative numbering scheme, chronology', 'Alternative numbering scheme, chronology', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
224
        ('855', 'n', 'Pattern note', 'Pattern note', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
225
        ('855', 'p', 'Number of pieces per issuance', 'Number of pieces per issuance', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
226
        ('855', 't', 'Copy', 'Copy', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
227
        ('855', 'u', 'Bibliographic units per next higher level', 'Bibliographic units per next higher level', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
228
        ('855', 'v', 'Numbering continuity', 'Numbering continuity', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
229
        ('855', 'w', 'Frequency', 'Frequency', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
230
        ('855', 'x', 'Calendar change', 'Calendar change', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
231
        ('855', 'y', 'Regularity pattern', 'Regularity pattern', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
232
        ('855', 'z', 'Numbering scheme', 'Numbering scheme', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
233
        ('856', '2', 'Access method', 'Access method', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
234
        ('856', '3', 'Materials specified', 'Materials specified', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
235
        ('856', '6', 'Linkage', 'Linkage', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
236
        ('856', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
237
        ('856', 'a', 'Host name', 'Host name', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
238
        ('856', 'b', 'Access number', 'Access number', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
239
        ('856', 'c', 'Compression information', 'Compression information', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
240
        ('856', 'd', 'Path', 'Path', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
241
        ('856', 'f', 'Electronic name', 'Electronic name', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
242
        ('856', 'h', 'Processor of request', 'Processor of request', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
243
        ('856', 'i', 'Instruction', 'Instruction', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
244
        ('856', 'j', 'Bits per second', 'Bits per second', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
245
        ('856', 'k', 'Password', 'Password', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
246
        ('856', 'l', 'Logon', 'Logon', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
247
        ('856', 'm', 'Contact for access assistance', 'Contact for access assistance', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
248
        ('856', 'n', 'Name of location of host', 'Name of location of host', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
249
        ('856', 'o', 'Operating system', 'Operating system', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
250
        ('856', 'p', 'Port', 'Port', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
251
        ('856', 'q', 'Electronic format type', 'Electronic format type', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
252
        ('856', 'r', 'Settings', 'Settings', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
253
        ('856', 's', 'File size', 'File size', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
254
        ('856', 't', 'Terminal emulation', 'Terminal emulation', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
255
        ('856', 'u', 'Uniform Resource Identifier', 'Uniform Resource Identifier', 1, 0, 'biblioitems.url', 8, '', '', '', 1, 4, 'HLD', '', '', NULL),
256
        ('856', 'v', 'Hours access method available', 'Hours access method available', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
257
        ('856', 'w', 'Record control number', 'Record control number', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
258
        ('856', 'x', 'Nonpublic note', 'Nonpublic note', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
259
        ('856', 'y', 'Link text', 'Link text', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
260
        ('856', 'z', 'Public note', 'Public note', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
261
        ('863', '6', 'Linkage', 'Linkage', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
262
        ('863', '8', 'Field link and sequence number', 'Field link and sequence number', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
263
        ('863', 'a', 'First level of enumeration', 'First level of enumeration', 0, 0, 'holdings.summary', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
264
        ('863', 'b', 'Second level of enumeration', 'Second level of enumeration', 0, 0, 'holdings.summary', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
265
        ('863', 'c', 'Third level of enumeration', 'Third level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
266
        ('863', 'd', 'Fourth level of enumeration', 'Fourth level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
267
        ('863', 'e', 'Fifth level of enumeration', 'Fifth level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
268
        ('863', 'f', 'Sixth level of enumeration', 'Sixth level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
269
        ('863', 'g', 'Alternative numbering scheme, first level of enumeration', 'Alternative numbering scheme, first level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
270
        ('863', 'h', 'Alternative numbering scheme, second level of enumeration', 'Alternative numbering scheme, second level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
271
        ('863', 'i', 'First level of chronology', 'First level of chronology', 0, 0, 'holdings.summary', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
272
        ('863', 'j', 'Second level of chronology', 'Second level of chronology', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
273
        ('863', 'k', 'Third level of chronology', 'Third level of chronology', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
274
        ('863', 'l', 'Fourth level of chronology', 'Fourth level of chronology', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
275
        ('863', 'm', 'Alternative numbering scheme, chronology', 'Alternative numbering scheme, chronology', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
276
        ('863', 'n', 'Converted Gregorian year', 'Converted Gregorian year', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
277
        ('863', 'o', 'Type of unit', 'Type of unit', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
278
        ('863', 'p', 'Piece designation', 'Piece designation', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
279
        ('863', 'q', 'Piece physical condition', 'Piece physical condition', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
280
        ('863', 's', 'Copyright article-fee code', 'Copyright article-fee code', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
281
        ('863', 't', 'Copy number', 'Copy number', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
282
        ('863', 'v', 'Issuing date', 'Issuing date', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
283
        ('863', 'w', 'Break indicator', 'Break indicator', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
284
        ('863', 'x', 'Nonpublic note', 'Nonpublic note', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
285
        ('863', 'z', 'Public note', 'Public note', 1, 0, 'holdings.summary', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
286
        ('864', '6', 'Linkage', 'Linkage', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
287
        ('864', '8', 'Field link and sequence number', 'Field link and sequence number', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
288
        ('864', 'a', 'First level of enumeration', 'First level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
289
        ('864', 'b', 'Second level of enumeration', 'Second level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
290
        ('864', 'c', 'Third level of enumeration', 'Third level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
291
        ('864', 'd', 'Fourth level of enumeration', 'Fourth level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
292
        ('864', 'e', 'Fifth level of enumeration', 'Fifth level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
293
        ('864', 'f', 'Sixth level of enumeration', 'Sixth level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
294
        ('864', 'g', 'Alternative numbering scheme, first level of enumeration', 'Alternative numbering scheme, first level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
295
        ('864', 'h', 'Alternative numbering scheme, second level of enumeration', 'Alternative numbering scheme, second level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
296
        ('864', 'i', 'First level of chronology', 'First level of chronology', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
297
        ('864', 'j', 'Second level of chronology', 'Second level of chronology', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
298
        ('864', 'k', 'Third level of chronology', 'Third level of chronology', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
299
        ('864', 'l', 'Fourth level of chronology', 'Fourth level of chronology', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
300
        ('864', 'm', 'Alternative numbering scheme, chronology', 'Alternative numbering scheme, chronology', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
301
        ('864', 'n', 'Converted Gregorian year', 'Converted Gregorian year', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
302
        ('864', 'o', 'Type of unit', 'Type of unit', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
303
        ('864', 'p', 'Piece designation', 'Piece designation', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
304
        ('864', 'q', 'Piece physical condition', 'Piece physical condition', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
305
        ('864', 's', 'Copyright article-fee code', 'Copyright article-fee code', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
306
        ('864', 't', 'Copy number', 'Copy number', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
307
        ('864', 'v', 'Issuing date', 'Issuing date', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
308
        ('864', 'w', 'Break indicator', 'Break indicator', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
309
        ('864', 'x', 'Nonpublic note', 'Nonpublic note', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
310
        ('864', 'z', 'Public note', 'Public note', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
311
        ('865', '6', 'Linkage', 'Linkage', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
312
        ('865', '8', 'Field link and sequence number', 'Field link and sequence number', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
313
        ('865', 'a', 'First level of enumeration', 'First level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
314
        ('865', 'b', 'Second level of enumeration', 'Second level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
315
        ('865', 'c', 'Third level of enumeration', 'Third level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
316
        ('865', 'd', 'Fourth level of enumeration', 'Fourth level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
317
        ('865', 'e', 'Fifth level of enumeration', 'Fifth level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
318
        ('865', 'f', 'Sixth level of enumeration', 'Sixth level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
319
        ('865', 'g', 'Alternative numbering scheme, first level of enumeration', 'Alternative numbering scheme, first level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
320
        ('865', 'h', 'Alternative numbering scheme, second level of enumeration', 'Alternative numbering scheme, second level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
321
        ('865', 'i', 'First level of chronology', 'First level of chronology', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
322
        ('865', 'j', 'Second level of chronology', 'Second level of chronology', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
323
        ('865', 'k', 'Third level of chronology', 'Third level of chronology', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
324
        ('865', 'l', 'Fourth level of chronology', 'Fourth level of chronology', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
325
        ('865', 'm', 'Alternative numbering scheme, chronology', 'Alternative numbering scheme, chronology', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
326
        ('865', 'n', 'Converted Gregorian year', 'Converted Gregorian year', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
327
        ('865', 'o', 'Type of unit', 'Type of unit', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
328
        ('865', 'p', 'Piece designation', 'Piece designation', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
329
        ('865', 'q', 'Piece physical condition', 'Piece physical condition', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
330
        ('865', 's', 'Copyright article-fee code', 'Copyright article-fee code', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
331
        ('865', 't', 'Copy number', 'Copy number', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
332
        ('865', 'v', 'Issuing date', 'Issuing date', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
333
        ('865', 'w', 'Break indicator', 'Break indicator', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
334
        ('865', 'x', 'Nonpublic note', 'Nonpublic note', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
335
        ('865', 'z', 'Public note', 'Public note', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
336
        ('866', '6', 'Linkage', 'Linkage', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
337
        ('866', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
338
        ('866', 'a', 'Textual string', 'Textual string', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
339
        ('866', 'x', 'Nonpublic note', 'Nonpublic note', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
340
        ('866', 'z', 'Public note', 'Public note', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
341
        ('867', '6', 'Linkage', 'Linkage', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
342
        ('867', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
343
        ('867', 'a', 'Textual string', 'Textual string', 0, 0, 'holdings.supplements', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
344
        ('867', 'x', 'Nonpublic note', 'Nonpublic note', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
345
        ('867', 'z', 'Public note', 'Public note', 1, 0, 'holdings.supplements', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
346
        ('868', '6', 'Linkage', 'Linkage', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
347
        ('868', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
348
        ('868', 'a', 'Textual string', 'Textual string', 0, 0, 'holdings.indexes', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
349
        ('868', 'x', 'Nonpublic note', 'Nonpublic note', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
350
        ('868', 'z', 'Public note', 'Public note', 1, 0, 'holdings.indexes', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
351
        ('876', '3', 'Materials specified', 'Materials specified', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
352
        ('876', '6', 'Linkage', 'Linkage', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
353
        ('876', '8', 'Sequence number', 'Sequence number', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
354
        ('876', 'a', 'Internal item number', 'Internal item number', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
355
        ('876', 'b', 'Invalid or canceled internal item number', 'Invalid or canceled internal item number', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
356
        ('876', 'c', 'Cost', 'Cost', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
357
        ('876', 'd', 'Date acquired', 'Date acquired', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
358
        ('876', 'e', 'Source of acquisition', 'Source of acquisition', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
359
        ('876', 'h', 'Use restrictions', 'Use restrictions', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
360
        ('876', 'j', 'Item status', 'Item status', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
361
        ('876', 'l', 'Temporary location', 'Temporary location', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
362
        ('876', 'p', 'Piece designation', 'Piece designation', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
363
        ('876', 'r', 'Invalid or canceled piece designation', 'Invalid or canceled piece designation', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
364
        ('876', 't', 'Copy number', 'Copy number', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
365
        ('876', 'x', 'Nonpublic note', 'Nonpublic note', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
366
        ('876', 'z', 'Public note', 'Public note', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
367
        ('877', '3', 'Materials specified', 'Materials specified', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
368
        ('877', '6', 'Linkage', 'Linkage', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
369
        ('877', '8', 'Sequence number', 'Sequence number', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
370
        ('877', 'a', 'Internal item number', 'Internal item number', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
371
        ('877', 'b', 'Invalid or canceled internal item number', 'Invalid or canceled internal item number', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
372
        ('877', 'c', 'Cost', 'Cost', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
373
        ('877', 'd', 'Date acquired', 'Date acquired', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
374
        ('877', 'e', 'Source of acquisition', 'Source of acquisition', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
375
        ('877', 'h', 'Use restrictions', 'Use restrictions', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
376
        ('877', 'j', 'Item status', 'Item status', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
377
        ('877', 'l', 'Temporary location', 'Temporary location', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
378
        ('877', 'p', 'Piece designation', 'Piece designation', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
379
        ('877', 'r', 'Invalid or canceled piece designation', 'Invalid or canceled piece designation', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
380
        ('877', 't', 'Copy number', 'Copy number', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
381
        ('877', 'x', 'Nonpublic note', 'Nonpublic note', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
382
        ('877', 'z', 'Public note', 'Public note', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
383
        ('878', '3', 'Materials specified', 'Materials specified', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
384
        ('878', '6', 'Linkage', 'Linkage', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
385
        ('878', '8', 'Sequence number', 'Sequence number', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
386
        ('878', 'a', 'Internal item number', 'Internal item number', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
387
        ('878', 'b', 'Invalid or canceled internal item number', 'Invalid or canceled internal item number', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
388
        ('878', 'c', 'Cost', 'Cost', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
389
        ('878', 'd', 'Date acquired', 'Date acquired', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
390
        ('878', 'e', 'Source of acquisition', 'Source of acquisition', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
391
        ('878', 'h', 'Use restrictions', 'Use restrictions', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
392
        ('878', 'j', 'Item status', 'Item status', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
393
        ('878', 'l', 'Temporary location', 'Temporary location', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
394
        ('878', 'p', 'Piece designation', 'Piece designation', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
395
        ('878', 'r', 'Invalid or canceled piece designation', 'Invalid or canceled piece designation', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
396
        ('878', 't', 'Copy number', 'Copy number', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
397
        ('878', 'x', 'Nonpublic note', 'Nonpublic note', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
398
        ('878', 'z', 'Public note', 'Public note', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL);
(-)a/installer/data/mysql/en/marcflavour/marc21/mandatory/marc21_framework_DEFAULT.sql (-1 / +325 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 97-102 INSERT IGNORE INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblib Link Here
97
		('952', '7', 'Not for loan', 'Not for loan', 0, 0, 'items.notforloan', 10, 'NOT_LOAN', '', '', 0, 0, '', '', '', NULL),
98
		('952', '7', 'Not for loan', 'Not for loan', 0, 0, 'items.notforloan', 10, 'NOT_LOAN', '', '', 0, 0, '', '', '', NULL),
98
		('952', '8', 'Collection code', 'Collection code', 0, 0, 'items.ccode', 10, 'CCODE', '', '', 0, 0, '', '', '', NULL),
99
		('952', '8', 'Collection code', 'Collection code', 0, 0, 'items.ccode', 10, 'CCODE', '', '', 0, 0, '', '', '', NULL),
99
		('952', '9', 'Koha itemnumber (autogenerated)', 'Koha itemnumber', 0, 0, 'items.itemnumber', -1, '', '', '', 0, 7, '', '', '', NULL),
100
		('952', '9', 'Koha itemnumber (autogenerated)', 'Koha itemnumber', 0, 0, 'items.itemnumber', -1, '', '', '', 0, 7, '', '', '', NULL),
101
        ('952', 'V', 'Holding record',  'Holding record',  0, 0, 'items.holding_id', 10, 'holdings', '', '', NULL, 0,  '', '', '', NULL),
100
		('952', 'a', 'Permanent location', 'Permanent Location', 0, 0, 'items.homebranch', 10, 'branches', '', '', 0, 0, '', '', '', NULL),
102
		('952', 'a', 'Permanent location', 'Permanent Location', 0, 0, 'items.homebranch', 10, 'branches', '', '', 0, 0, '', '', '', NULL),
101
		('952', 'b', 'Current location', 'Current Location', 0, 0, 'items.holdingbranch', 10, 'branches', '', '', 0, 0, '', '', '', NULL),
103
		('952', 'b', 'Current location', 'Current Location', 0, 0, 'items.holdingbranch', 10, 'branches', '', '', 0, 0, '', '', '', NULL),
102
		('952', 'c', 'Shelving location', 'Shelving location', 0, 0, 'items.location', 10, 'LOC', '', '', 0, 0, '', '', '', NULL),
104
		('952', 'c', 'Shelving location', 'Shelving location', 0, 0, 'items.location', 10, 'LOC', '', '', 0, 0, '', '', '', NULL),
Lines 4616-4618 SELECT tagfield, tagsubfield, liblibrarian, libopac, repeatable, mandatory, koha Link Here
4616
FROM marc_subfield_structure
4618
FROM marc_subfield_structure
4617
WHERE frameworkcode=""
4619
WHERE frameworkcode=""
4618
AND kohafield IN ("biblio.title", "biblio.author", "biblioitems.publishercode", "biblioitems.editionstatement", "biblio.copyrightdate", "biblioitems.isbn", "biblio.seriestitle" );
4620
AND kohafield IN ("biblio.title", "biblio.author", "biblioitems.publishercode", "biblioitems.editionstatement", "biblio.copyrightdate", "biblioitems.isbn", "biblio.seriestitle" );
4621
4622
4623
-- HOLDINGS RECORD FRAMEWORK
4624
4625
INSERT IGNORE INTO `biblio_framework` VALUES ('HLD', 'Default holdings framework');
4626
INSERT IGNORE INTO `marc_tag_structure` (`tagfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `authorised_value`, `frameworkcode`) VALUES
4627
		('999', 'SYSTEM CONTROL NUMBERS (KOHA)', 'SYSTEM CONTROL NUMBERS (KOHA)', 1, 0, '', 'HLD');
4628
4629
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
4630
		('999', 'c', 'Koha biblionumber', 'Koha biblionumber', 0, 0, 'biblio.biblionumber', -1, NULL, NULL, '', NULL, -5, 'HLD', '', '', NULL),
4631
		('999', 'd', 'Koha biblioitemnumber', 'Koha biblioitemnumber', 0, 0, 'biblioitems.biblioitemnumber', -1, NULL, NULL, '', NULL, -5, 'HLD', '', '', NULL),
4632
		('999', 'e', 'Koha holding_id', 'Koha holding_id', 0, 0, 'holdings.holding_id', -1, NULL, NULL, '', NULL, -5, 'HLD', '', '', NULL);
4633
4634
4635
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
4636
		('942', 'n', 'Suppress in OPAC', 'Suppress in OPAC', 0, 0, 'holdings.suppress', 9, '', '', '', 0, 0, 'HLD', '', '', NULL);
4637
4638
INSERT IGNORE INTO `marc_tag_structure` (`tagfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `authorised_value`, `frameworkcode`) VALUES
4639
		('000', 'LEADER', 'LEADER', 0, 1, '', 'HLD'),
4640
		('001', 'CONTROL NUMBER', 'CONTROL NUMBER', 0, 0, '', 'HLD'),
4641
		('003', 'CONTROL NUMBER IDENTIFIER', 'CONTROL NUMBER IDENTIFIER', 0, 1, '', 'HLD'),
4642
		('005', 'DATE AND TIME OF LATEST TRANSACTION', 'DATE AND TIME OF LATEST TRANSACTION', 0, 1, '', 'HLD'),
4643
		('006', 'FIXED-LENGTH DATA ELEMENTS--ADDITIONAL MATERIAL CHARACTERISTICS', 'FIXED-LENGTH DATA ELEMENTS--ADDITIONAL MATERIAL CHARACTERISTICS', 1, 0, '', 'HLD'),
4644
		('007', 'PHYSICAL DESCRIPTION FIXED FIELD--GENERAL INFORMATION', 'PHYSICAL DESCRIPTION FIXED FIELD--GENERAL INFORMATION', 1, 0, '', 'HLD'),
4645
		('008', 'FIXED-LENGTH DATA ELEMENTS--GENERAL INFORMATION', 'FIXED-LENGTH DATA ELEMENTS--GENERAL INFORMATION', 0, 1, '', 'HLD');
4646
4647
INSERT IGNORE INTO `marc_tag_structure` (`tagfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `authorised_value`, `frameworkcode`) VALUES
4648
		('850', 'HOLDING INSTITUTION', 'HOLDING INSTITUTION', 1, 0, NULL, 'HLD'),
4649
		('852', 'LOCATION', 'LOCATION', 1, 0, NULL, 'HLD'),
4650
		('853', 'CAPTIONS AND PATTERN--BASIC BIBLIOGRAPHIC UNIT', 'CAPTIONS AND PATTERN--BASIC BIBLIOGRAPHIC UNIT', 1, 0, NULL, 'HLD'),
4651
		('854', 'CAPTIONS AND PATTERN--SUPPLEMENTARY MATERIAL', 'CAPTIONS AND PATTERN--SUPPLEMENTARY MATERIAL', 1, 0, NULL, 'HLD'),
4652
		('855', 'CAPTIONS AND PATTERN--INDEXES', 'CAPTIONS AND PATTERN--INDEXES', 1, 0, NULL, 'HLD'),
4653
		('856', 'ELECTRONIC LOCATION AND ACCESS', 'ELECTRONIC LOCATION AND ACCESS', 1, 0, NULL, 'HLD'),
4654
		('863', 'ENUMERATION AND CHRONOLOGY--BASIC BIBLIOGRAPHIC UNIT', 'ENUMERATION AND CHRONOLOGY--BASIC BIBLIOGRAPHIC UNIT', 1, 0, NULL, 'HLD'),
4655
		('864', 'ENUMERATION AND CHRONOLOGY--SUPPLEMENTARY MATERIAL', 'ENUMERATION AND CHRONOLOGY--SUPPLEMENTARY MATERIAL', 1, 0, NULL, 'HLD'),
4656
		('865', 'ENUMERATION AND CHRONOLOGY--INDEXES', 'ENUMERATION AND CHRONOLOGY--INDEXES', 1, 0, NULL, 'HLD'),
4657
		('866', 'TEXTUAL HOLDINGS--BASIC BIBLIOGRAPHIC UNIT', 'TEXTUAL HOLDINGS--BASIC BIBLIOGRAPHIC UNIT', 1, 0, NULL, 'HLD'),
4658
		('867', 'TEXTUAL HOLDINGS--SUPPLEMENTARY MATERIAL', 'TEXTUAL HOLDINGS--SUPPLEMENTARY MATERIAL', 1, 0, NULL, 'HLD'),
4659
		('868', 'TEXTUAL HOLDINGS--INDEXES', 'TEXTUAL HOLDINGS--INDEXES', 1, 0, NULL, 'HLD'),
4660
		('876', 'ITEM INFORMATION--BASIC BIBLIOGRAPHIC UNIT', 'ITEM INFORMATION--BASIC BIBLIOGRAPHIC UNIT', 1, 0, NULL, 'HLD'),
4661
		('877', 'ITEM INFORMATION--SUPPLEMENTARY MATERIAL', 'ITEM INFORMATION--SUPPLEMENTARY MATERIAL', 1, 0, NULL, 'HLD'),
4662
		('878', 'ITEM INFORMATION--INDEXES', 'ITEM INFORMATION--INDEXES', 1, 0, NULL, 'HLD');
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
		('000', '@', 'fixed length control field', 'fixed length control field', 0, 1, '', 0, '', '', 'marc21_leader_holdings.pl', 0, 0, 'HLD', '', '', NULL),
4666
		('001', '@', 'control field', 'control field', 0, 0, '', 0, '', '', '', 0, 0, 'HLD', '', '', NULL),
4667
		('003', '@', 'control field', 'control field', 0, 1, '', 0, '', '', 'marc21_orgcode.pl', 0, 0, 'HLD', '', '', NULL),
4668
		('005', '@', 'control field', 'control field', 0, 1, '', 0, '', '', 'marc21_field_005.pl', 0, 0, 'HLD', '', '', NULL),
4669
		('006', '@', 'fixed length control field', 'fixed length control field', 0, 0, '', 0, '', '', 'marc21_field_006.pl', 0, -1, 'HLD', '', '', NULL),
4670
		('007', '@', 'fixed length control field', 'fixed length control field', 0, 0, '', 0, '', '', 'marc21_field_007.pl', 0, 0, 'HLD', '', '', NULL),
4671
		('008', '@', 'fixed length control field', 'fixed length control field', 0, 1, '', 0, '', '', 'marc21_field_008_holdings.pl', 0, 0, 'HLD', '', '', NULL),
4672
		('850', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, NULL, 8, NULL, NULL, '', NULL, 4, 'HLD', '', '', NULL),
4673
		('850', 'a', 'Holding institution', 'Holding institution', 1, 0, NULL, 8, NULL, NULL, '', NULL, 4, 'HLD', '', '', NULL),
4674
		('850', 'b', 'Holdings (NR) (MU VM SE) [OBSOLETE]', 'Holdings (NR) (MU VM SE) [OBSOLETE]', 0, 0, NULL, 8, NULL, NULL, '', NULL, 4, 'HLD', '', '', NULL),
4675
		('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),
4676
		('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),
4677
		('852', '2', 'Source of classification or shelving scheme', 'Source of classification or shelving scheme', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4678
		('852', '3', 'Materials specified', 'Materials specified', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4679
		('852', '6', 'Linkage', 'Linkage', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4680
		('852', '8', 'Sequence number', 'Sequence number', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4681
		('852', 'a', 'Location', 'Location', 0, 0, 'holdings.holdingbranch', 8, 'branches', '', '', NULL, 4, 'HLD', '', '', NULL),
4682
		('852', 'b', 'Sublocation or collection', 'Sublocation or collection', 1, 0, 'holdings.location', 8, 'LOC', '', '', NULL, 4, 'HLD', '', '', NULL),
4683
		('852', 'c', 'Shelving location', 'Shelving location', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4684
		('852', 'd', 'Former shelving location', 'Former shelving location', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4685
		('852', 'e', 'Address', 'Address', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4686
		('852', 'f', 'Coded location qualifier', 'Coded location qualifier', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4687
		('852', 'g', 'Non-coded location qualifier', 'Non-coded location qualifier', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4688
		('852', 'h', 'Classification part', 'Classification part', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4689
		('852', 'i', 'Item part', 'Item part', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4690
		('852', 'j', 'Shelving control number', 'Shelving control number', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4691
		('852', 'k', 'Call number prefix', 'Call number prefix', 1, 0, 'holdings.callnumber', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4692
		('852', 'l', 'Shelving form of title', 'Shelving form of title', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4693
		('852', 'm', 'Call number suffix', 'Call number suffix', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4694
		('852', 'n', 'Country code', 'Country code', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4695
		('852', 'p', 'Piece designation', 'Piece designation', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4696
		('852', 'q', 'Piece physical condition', 'Piece physical condition', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4697
		('852', 's', 'Copyright article-fee code', 'Copyright article-fee code', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4698
		('852', 't', 'Copy number', 'Copy number', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4699
		('852', 'u', 'Uniform Resource Identifier', 'Uniform Resource Identifier', 1, 0, '', 8, '', '', '', 1, 4, 'HLD', '', '', NULL),
4700
		('852', 'x', 'Nonpublic note', 'Nonpublic note', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4701
		('852', 'z', 'Public note', 'Public note', 1, 0, 'holdings.public_note', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4702
		('853', '3', 'Materials specified', 'Materials specified', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4703
		('853', '6', 'Linkage', 'Linkage', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4704
		('853', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4705
		('853', 'a', 'First level of enumeration', 'First level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4706
		('853', 'b', 'Second level of enumeration', 'Second level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4707
		('853', 'c', 'Third level of enumeration', 'Third level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4708
		('853', 'd', 'Fourth level of enumeration', 'Fourth level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4709
		('853', 'e', 'Fifth level of enumeration', 'Fifth level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4710
		('853', 'f', 'Sixth level of enumeration', 'Sixth level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4711
		('853', 'g', 'Alternative numbering scheme, first level of enumeration', 'Alternative numbering scheme, first level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4712
		('853', 'h', 'Alternative numbering scheme, second level of enumeration', 'Alternative numbering scheme, second level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4713
		('853', 'i', 'First level of chronology', 'First level of chronology', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4714
		('853', 'j', 'Second level of chronology', 'Second level of chronology', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4715
		('853', 'k', 'Third level of chronology', 'Third level of chronology', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4716
		('853', 'l', 'Fourth level of chronology', 'Fourth level of chronology', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4717
		('853', 'm', 'Alternative numbering scheme, chronology', 'Alternative numbering scheme, chronology', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4718
		('853', 'n', 'Pattern note', 'Pattern note', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4719
		('853', 'p', 'Number of pieces per issuance', 'Number of pieces per issuance', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4720
		('853', 't', 'Copy', 'Copy', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4721
		('853', 'u', 'Bibliographic units per next higher level', 'Bibliographic units per next higher level', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4722
		('853', 'v', 'Numbering continuity', 'Numbering continuity', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4723
		('853', 'w', 'Frequency', 'Frequency', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4724
		('853', 'x', 'Calendar change', 'Calendar change', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4725
		('853', 'y', 'Regularity pattern', 'Regularity pattern', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4726
		('853', 'z', 'Numbering scheme', 'Numbering scheme', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4727
		('854', '3', 'Materials specified', 'Materials specified', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4728
		('854', '6', 'Linkage', 'Linkage', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4729
		('854', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4730
		('854', 'a', 'First level of enumeration', 'First level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4731
		('854', 'b', 'Second level of enumeration', 'Second level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4732
		('854', 'c', 'Third level of enumeration', 'Third level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4733
		('854', 'd', 'Fourth level of enumeration', 'Fourth level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4734
		('854', 'e', 'Fifth level of enumeration', 'Fifth level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4735
		('854', 'f', 'Sixth level of enumeration', 'Sixth level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4736
		('854', 'g', 'Alternative numbering scheme, first level of enumeration', 'Alternative numbering scheme, first level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4737
		('854', 'h', 'Alternative numbering scheme, second level of enumeration', 'Alternative numbering scheme, second level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4738
		('854', 'i', 'First level of chronology', 'First level of chronology', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4739
		('854', 'j', 'Second level of chronology', 'Second level of chronology', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4740
		('854', 'k', 'Third level of chronology', 'Third level of chronology', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4741
		('854', 'l', 'Fourth level of chronology', 'Fourth level of chronology', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4742
		('854', 'm', 'Alternative numbering scheme, chronology', 'Alternative numbering scheme, chronology', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4743
		('854', 'n', 'Pattern note', 'Pattern note', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4744
		('854', 'p', 'Number of pieces per issuance', 'Number of pieces per issuance', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4745
		('854', 't', 'Copy', 'Copy', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4746
		('854', 'u', 'Bibliographic units per next higher level', 'Bibliographic units per next higher level', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4747
		('854', 'v', 'Numbering continuity', 'Numbering continuity', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4748
		('854', 'w', 'Frequency', 'Frequency', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4749
		('854', 'x', 'Calendar change', 'Calendar change', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4750
		('854', 'y', 'Regularity pattern', 'Regularity pattern', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4751
		('854', 'z', 'Numbering scheme', 'Numbering scheme', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4752
		('855', '3', 'Materials specified', 'Materials specified', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4753
		('855', '6', 'Linkage', 'Linkage', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4754
		('855', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4755
		('855', 'a', 'First level of enumeration', 'First level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4756
		('855', 'b', 'Second level of enumeration', 'Second level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4757
		('855', 'c', 'Third level of enumeration', 'Third level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4758
		('855', 'd', 'Fourth level of enumeration', 'Fourth level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4759
		('855', 'e', 'Fifth level of enumeration', 'Fifth level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4760
		('855', 'f', 'Sixth level of enumeration', 'Sixth level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4761
		('855', 'g', 'Alternative numbering scheme, first level of enumeration', 'Alternative numbering scheme, first level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4762
		('855', 'h', 'Alternative numbering scheme, second level of enumeration', 'Alternative numbering scheme, second level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4763
		('855', 'i', 'First level of chronology', 'First level of chronology', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4764
		('855', 'j', 'Second level of chronology', 'Second level of chronology', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4765
		('855', 'k', 'Third level of chronology', 'Third level of chronology', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4766
		('855', 'l', 'Fourth level of chronology', 'Fourth level of chronology', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4767
		('855', 'm', 'Alternative numbering scheme, chronology', 'Alternative numbering scheme, chronology', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4768
		('855', 'n', 'Pattern note', 'Pattern note', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4769
		('855', 'p', 'Number of pieces per issuance', 'Number of pieces per issuance', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4770
		('855', 't', 'Copy', 'Copy', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4771
		('855', 'u', 'Bibliographic units per next higher level', 'Bibliographic units per next higher level', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4772
		('855', 'v', 'Numbering continuity', 'Numbering continuity', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4773
		('855', 'w', 'Frequency', 'Frequency', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4774
		('855', 'x', 'Calendar change', 'Calendar change', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4775
		('855', 'y', 'Regularity pattern', 'Regularity pattern', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4776
		('855', 'z', 'Numbering scheme', 'Numbering scheme', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4777
		('856', '2', 'Access method', 'Access method', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
4778
		('856', '3', 'Materials specified', 'Materials specified', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
4779
		('856', '6', 'Linkage', 'Linkage', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
4780
		('856', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
4781
		('856', 'a', 'Host name', 'Host name', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
4782
		('856', 'b', 'Access number', 'Access number', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
4783
		('856', 'c', 'Compression information', 'Compression information', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
4784
		('856', 'd', 'Path', 'Path', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
4785
		('856', 'f', 'Electronic name', 'Electronic name', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
4786
		('856', 'h', 'Processor of request', 'Processor of request', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
4787
		('856', 'i', 'Instruction', 'Instruction', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
4788
		('856', 'j', 'Bits per second', 'Bits per second', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
4789
		('856', 'k', 'Password', 'Password', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
4790
		('856', 'l', 'Logon', 'Logon', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
4791
		('856', 'm', 'Contact for access assistance', 'Contact for access assistance', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
4792
		('856', 'n', 'Name of location of host', 'Name of location of host', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
4793
		('856', 'o', 'Operating system', 'Operating system', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
4794
		('856', 'p', 'Port', 'Port', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
4795
		('856', 'q', 'Electronic format type', 'Electronic format type', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
4796
		('856', 'r', 'Settings', 'Settings', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
4797
		('856', 's', 'File size', 'File size', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
4798
		('856', 't', 'Terminal emulation', 'Terminal emulation', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
4799
		('856', 'u', 'Uniform Resource Identifier', 'Uniform Resource Identifier', 1, 0, 'biblioitems.url', 8, '', '', '', 1, 4, 'HLD', '', '', NULL),
4800
		('856', 'v', 'Hours access method available', 'Hours access method available', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
4801
		('856', 'w', 'Record control number', 'Record control number', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
4802
		('856', 'x', 'Nonpublic note', 'Nonpublic note', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
4803
		('856', 'y', 'Link text', 'Link text', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
4804
		('856', 'z', 'Public note', 'Public note', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
4805
		('863', '6', 'Linkage', 'Linkage', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4806
		('863', '8', 'Field link and sequence number', 'Field link and sequence number', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4807
		('863', 'a', 'First level of enumeration', 'First level of enumeration', 0, 0, 'holdings.summary', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
4808
		('863', 'b', 'Second level of enumeration', 'Second level of enumeration', 0, 0, 'holdings.summary', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
4809
		('863', 'c', 'Third level of enumeration', 'Third level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
4810
		('863', 'd', 'Fourth level of enumeration', 'Fourth level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
4811
		('863', 'e', 'Fifth level of enumeration', 'Fifth level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
4812
		('863', 'f', 'Sixth level of enumeration', 'Sixth level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
4813
		('863', 'g', 'Alternative numbering scheme, first level of enumeration', 'Alternative numbering scheme, first level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
4814
		('863', 'h', 'Alternative numbering scheme, second level of enumeration', 'Alternative numbering scheme, second level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
4815
		('863', 'i', 'First level of chronology', 'First level of chronology', 0, 0, 'holdings.summary', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
4816
		('863', 'j', 'Second level of chronology', 'Second level of chronology', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
4817
		('863', 'k', 'Third level of chronology', 'Third level of chronology', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
4818
		('863', 'l', 'Fourth level of chronology', 'Fourth level of chronology', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
4819
		('863', 'm', 'Alternative numbering scheme, chronology', 'Alternative numbering scheme, chronology', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
4820
		('863', 'n', 'Converted Gregorian year', 'Converted Gregorian year', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
4821
		('863', 'o', 'Type of unit', 'Type of unit', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
4822
		('863', 'p', 'Piece designation', 'Piece designation', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
4823
		('863', 'q', 'Piece physical condition', 'Piece physical condition', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
4824
		('863', 's', 'Copyright article-fee code', 'Copyright article-fee code', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
4825
		('863', 't', 'Copy number', 'Copy number', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
4826
		('863', 'v', 'Issuing date', 'Issuing date', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
4827
		('863', 'w', 'Break indicator', 'Break indicator', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
4828
		('863', 'x', 'Nonpublic note', 'Nonpublic note', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
4829
		('863', 'z', 'Public note', 'Public note', 1, 0, 'holdings.summary', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
4830
		('864', '6', 'Linkage', 'Linkage', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4831
		('864', '8', 'Field link and sequence number', 'Field link and sequence number', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4832
		('864', 'a', 'First level of enumeration', 'First level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
4833
		('864', 'b', 'Second level of enumeration', 'Second level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
4834
		('864', 'c', 'Third level of enumeration', 'Third level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
4835
		('864', 'd', 'Fourth level of enumeration', 'Fourth level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
4836
		('864', 'e', 'Fifth level of enumeration', 'Fifth level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
4837
		('864', 'f', 'Sixth level of enumeration', 'Sixth level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
4838
		('864', 'g', 'Alternative numbering scheme, first level of enumeration', 'Alternative numbering scheme, first level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
4839
		('864', 'h', 'Alternative numbering scheme, second level of enumeration', 'Alternative numbering scheme, second level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
4840
		('864', 'i', 'First level of chronology', 'First level of chronology', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
4841
		('864', 'j', 'Second level of chronology', 'Second level of chronology', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
4842
		('864', 'k', 'Third level of chronology', 'Third level of chronology', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
4843
		('864', 'l', 'Fourth level of chronology', 'Fourth level of chronology', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
4844
		('864', 'm', 'Alternative numbering scheme, chronology', 'Alternative numbering scheme, chronology', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
4845
		('864', 'n', 'Converted Gregorian year', 'Converted Gregorian year', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
4846
		('864', 'o', 'Type of unit', 'Type of unit', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
4847
		('864', 'p', 'Piece designation', 'Piece designation', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
4848
		('864', 'q', 'Piece physical condition', 'Piece physical condition', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
4849
		('864', 's', 'Copyright article-fee code', 'Copyright article-fee code', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
4850
		('864', 't', 'Copy number', 'Copy number', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
4851
		('864', 'v', 'Issuing date', 'Issuing date', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
4852
		('864', 'w', 'Break indicator', 'Break indicator', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
4853
		('864', 'x', 'Nonpublic note', 'Nonpublic note', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
4854
		('864', 'z', 'Public note', 'Public note', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
4855
		('865', '6', 'Linkage', 'Linkage', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4856
		('865', '8', 'Field link and sequence number', 'Field link and sequence number', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4857
		('865', 'a', 'First level of enumeration', 'First level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
4858
		('865', 'b', 'Second level of enumeration', 'Second level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
4859
		('865', 'c', 'Third level of enumeration', 'Third level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
4860
		('865', 'd', 'Fourth level of enumeration', 'Fourth level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
4861
		('865', 'e', 'Fifth level of enumeration', 'Fifth level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
4862
		('865', 'f', 'Sixth level of enumeration', 'Sixth level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
4863
		('865', 'g', 'Alternative numbering scheme, first level of enumeration', 'Alternative numbering scheme, first level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
4864
		('865', 'h', 'Alternative numbering scheme, second level of enumeration', 'Alternative numbering scheme, second level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
4865
		('865', 'i', 'First level of chronology', 'First level of chronology', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
4866
		('865', 'j', 'Second level of chronology', 'Second level of chronology', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
4867
		('865', 'k', 'Third level of chronology', 'Third level of chronology', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
4868
		('865', 'l', 'Fourth level of chronology', 'Fourth level of chronology', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
4869
		('865', 'm', 'Alternative numbering scheme, chronology', 'Alternative numbering scheme, chronology', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
4870
		('865', 'n', 'Converted Gregorian year', 'Converted Gregorian year', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
4871
		('865', 'o', 'Type of unit', 'Type of unit', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
4872
		('865', 'p', 'Piece designation', 'Piece designation', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
4873
		('865', 'q', 'Piece physical condition', 'Piece physical condition', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
4874
		('865', 's', 'Copyright article-fee code', 'Copyright article-fee code', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
4875
		('865', 't', 'Copy number', 'Copy number', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
4876
		('865', 'v', 'Issuing date', 'Issuing date', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
4877
		('865', 'w', 'Break indicator', 'Break indicator', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
4878
		('865', 'x', 'Nonpublic note', 'Nonpublic note', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
4879
		('865', 'z', 'Public note', 'Public note', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
4880
		('866', '6', 'Linkage', 'Linkage', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4881
		('866', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4882
		('866', 'a', 'Textual string', 'Textual string', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
4883
		('866', 'x', 'Nonpublic note', 'Nonpublic note', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
4884
		('866', 'z', 'Public note', 'Public note', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
4885
		('867', '6', 'Linkage', 'Linkage', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4886
		('867', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4887
		('867', 'a', 'Textual string', 'Textual string', 0, 0, 'holdings.supplements', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
4888
		('867', 'x', 'Nonpublic note', 'Nonpublic note', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
4889
		('867', 'z', 'Public note', 'Public note', 1, 0, 'holdings.supplements', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
4890
		('868', '6', 'Linkage', 'Linkage', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4891
		('868', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4892
		('868', 'a', 'Textual string', 'Textual string', 0, 0, 'holdings.indexes', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
4893
		('868', 'x', 'Nonpublic note', 'Nonpublic note', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
4894
		('868', 'z', 'Public note', 'Public note', 1, 0, 'holdings.indexes', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
4895
		('876', '3', 'Materials specified', 'Materials specified', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4896
		('876', '6', 'Linkage', 'Linkage', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4897
		('876', '8', 'Sequence number', 'Sequence number', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4898
		('876', 'a', 'Internal item number', 'Internal item number', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4899
		('876', 'b', 'Invalid or canceled internal item number', 'Invalid or canceled internal item number', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4900
		('876', 'c', 'Cost', 'Cost', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4901
		('876', 'd', 'Date acquired', 'Date acquired', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4902
		('876', 'e', 'Source of acquisition', 'Source of acquisition', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4903
		('876', 'h', 'Use restrictions', 'Use restrictions', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4904
		('876', 'j', 'Item status', 'Item status', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4905
		('876', 'l', 'Temporary location', 'Temporary location', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4906
		('876', 'p', 'Piece designation', 'Piece designation', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4907
		('876', 'r', 'Invalid or canceled piece designation', 'Invalid or canceled piece designation', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4908
		('876', 't', 'Copy number', 'Copy number', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4909
		('876', 'x', 'Nonpublic note', 'Nonpublic note', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4910
		('876', 'z', 'Public note', 'Public note', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4911
		('877', '3', 'Materials specified', 'Materials specified', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4912
		('877', '6', 'Linkage', 'Linkage', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4913
		('877', '8', 'Sequence number', 'Sequence number', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4914
		('877', 'a', 'Internal item number', 'Internal item number', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4915
		('877', 'b', 'Invalid or canceled internal item number', 'Invalid or canceled internal item number', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4916
		('877', 'c', 'Cost', 'Cost', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4917
		('877', 'd', 'Date acquired', 'Date acquired', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4918
		('877', 'e', 'Source of acquisition', 'Source of acquisition', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4919
		('877', 'h', 'Use restrictions', 'Use restrictions', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4920
		('877', 'j', 'Item status', 'Item status', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4921
		('877', 'l', 'Temporary location', 'Temporary location', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4922
		('877', 'p', 'Piece designation', 'Piece designation', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4923
		('877', 'r', 'Invalid or canceled piece designation', 'Invalid or canceled piece designation', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4924
		('877', 't', 'Copy number', 'Copy number', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4925
		('877', 'x', 'Nonpublic note', 'Nonpublic note', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4926
		('877', 'z', 'Public note', 'Public note', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4927
		('878', '3', 'Materials specified', 'Materials specified', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4928
		('878', '6', 'Linkage', 'Linkage', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4929
		('878', '8', 'Sequence number', 'Sequence number', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4930
		('878', 'a', 'Internal item number', 'Internal item number', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4931
		('878', 'b', 'Invalid or canceled internal item number', 'Invalid or canceled internal item number', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4932
		('878', 'c', 'Cost', 'Cost', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4933
		('878', 'd', 'Date acquired', 'Date acquired', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4934
		('878', 'e', 'Source of acquisition', 'Source of acquisition', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4935
		('878', 'h', 'Use restrictions', 'Use restrictions', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4936
		('878', 'j', 'Item status', 'Item status', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4937
		('878', 'l', 'Temporary location', 'Temporary location', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4938
		('878', 'p', 'Piece designation', 'Piece designation', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4939
		('878', 'r', 'Invalid or canceled piece designation', 'Invalid or canceled piece designation', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4940
		('878', 't', 'Copy number', 'Copy number', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4941
		('878', 'x', 'Nonpublic note', 'Nonpublic note', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4942
		('878', 'z', 'Public note', 'Public note', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL);
(-)a/installer/data/mysql/kohastructure.sql (-2 / +50 lines)
Lines 668-673 CREATE TABLE `deleteditems` ( Link Here
668
  `copynumber` varchar(32) default NULL, -- copy number (MARC21 952$t)
668
  `copynumber` varchar(32) default NULL, -- copy number (MARC21 952$t)
669
  `stocknumber` varchar(32) default NULL, -- inventory number (MARC21 952$i)
669
  `stocknumber` varchar(32) default NULL, -- inventory number (MARC21 952$i)
670
  `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.
670
  `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.
671
  `holding_id` int(11) default NULL, -- foreign key from holdings table used to link this item to the right holdings record
671
  PRIMARY KEY  (`itemnumber`),
672
  PRIMARY KEY  (`itemnumber`),
672
  KEY `delitembarcodeidx` (`barcode`),
673
  KEY `delitembarcodeidx` (`barcode`),
673
  KEY `delitemstocknumberidx` (`stocknumber`),
674
  KEY `delitemstocknumberidx` (`stocknumber`),
Lines 880-890 CREATE TABLE `refund_lost_item_fee_rules` ( -- refund lost item fee rules tbale Link Here
880
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
881
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
881
882
882
--
883
--
884
-- Table structure for table `holdings`
885
--
886
887
DROP TABLE IF EXISTS `holdings`;
888
CREATE TABLE `holdings` ( -- table that stores summary holdings information
889
  `holding_id` int(11) NOT NULL auto_increment, -- unique identifier assigned to each holdings record
890
  `biblionumber` int(11) NOT NULL default 0, -- foreign key from biblio table used to link this record to the right bib record
891
  `biblioitemnumber` int(11) NOT NULL default 0, -- foreign key from the biblioitems table to link record to additional information
892
  `frameworkcode` varchar(4) NOT NULL default '', -- foreign key from the biblio_framework table to identify which framework was used in cataloging this record
893
  `holdingbranch` varchar(10) default NULL, -- foreign key from the branches table for the library that owns this record (MARC21 852$a)
894
  `location` varchar(80) default NULL, -- authorized value for the shelving location for this record (MARC21 852$b)
895
  `callnumber` varchar(255) default NULL, -- call number (852$h+$i in MARC21)
896
  `suppress` tinyint(1) default NULL, -- Boolean indicating whether the record is suppressed in OPAC
897
  `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, -- date and time this record was last touched
898
  `datecreated` DATE NOT NULL, -- the date this record was added to Koha
899
	`deleted_on` DATETIME DEFAULT NULL, -- the date this record was deleted
900
  PRIMARY KEY  (`holding_id`),
901
  KEY `hldnoidx` (`holding_id`),
902
  KEY `hldbinoidx` (`biblioitemnumber`),
903
  KEY `hldbibnoidx` (`biblionumber`),
904
  CONSTRAINT `holdings_ibfk_1` FOREIGN KEY (`biblionumber`) REFERENCES `biblio` (`biblionumber`) ON DELETE CASCADE ON UPDATE CASCADE,
905
  CONSTRAINT `holdings_ibfk_2` FOREIGN KEY (`biblioitemnumber`) REFERENCES `biblioitems` (`biblioitemnumber`) ON DELETE CASCADE ON UPDATE CASCADE,
906
  CONSTRAINT `holdings_ibfk_3` FOREIGN KEY (`holdingbranch`) REFERENCES `branches` (`branchcode`) ON UPDATE CASCADE
907
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
908
909
--
910
-- Table structure for table `holdings_metadata`
911
--
912
913
DROP TABLE IF EXISTS `holdings_metadata`;
914
CREATE TABLE holdings_metadata (
915
  `id` INT(11) NOT NULL AUTO_INCREMENT,
916
  `holding_id` INT(11) NOT NULL,
917
  `format` VARCHAR(16) NOT NULL,
918
  `marcflavour` VARCHAR(16) NOT NULL,
919
  `metadata` LONGTEXT NOT NULL,
920
	`deleted_on` DATETIME DEFAULT NULL, -- the date this record was deleted
921
  PRIMARY KEY(id),
922
  UNIQUE KEY `holdings_metadata_uniq_key` (`holding_id`,`format`,`marcflavour`),
923
  KEY `hldnoidx` (`holding_id`),
924
  CONSTRAINT `holdings_metadata_fk_1` FOREIGN KEY (`holding_id`) REFERENCES `holdings` (`holding_id`) ON DELETE CASCADE ON UPDATE CASCADE
925
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
926
927
--
883
-- Table structure for table `items`
928
-- Table structure for table `items`
884
--
929
--
885
930
886
DROP TABLE IF EXISTS `items`;
931
DROP TABLE IF EXISTS `items`;
887
CREATE TABLE `items` ( -- holdings/item information
932
CREATE TABLE `items` ( -- item information
888
  `itemnumber` int(11) NOT NULL auto_increment, -- primary key and unique identifier added by Koha
933
  `itemnumber` int(11) NOT NULL auto_increment, -- primary key and unique identifier added by Koha
889
  `biblionumber` int(11) NOT NULL default 0, -- foreign key from biblio table used to link this item to the right bib record
934
  `biblionumber` int(11) NOT NULL default 0, -- foreign key from biblio table used to link this item to the right bib record
890
  `biblioitemnumber` int(11) NOT NULL default 0, -- foreign key from the biblioitems table to link to item to additional information
935
  `biblioitemnumber` int(11) NOT NULL default 0, -- foreign key from the biblioitems table to link to item to additional information
Lines 930-935 CREATE TABLE `items` ( -- holdings/item information Link Here
930
  `copynumber` varchar(32) default NULL, -- copy number (MARC21 952$t)
975
  `copynumber` varchar(32) default NULL, -- copy number (MARC21 952$t)
931
  `stocknumber` varchar(32) default NULL, -- inventory number (MARC21 952$i)
976
  `stocknumber` varchar(32) default NULL, -- inventory number (MARC21 952$i)
932
  `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.
977
  `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.
978
  `holding_id` int(11) default NULL, -- foreign key from holdings table used to link this item to the right holdings record
933
  PRIMARY KEY  (`itemnumber`),
979
  PRIMARY KEY  (`itemnumber`),
934
  UNIQUE KEY `itembarcodeidx` (`barcode`),
980
  UNIQUE KEY `itembarcodeidx` (`barcode`),
935
  KEY `itemstocknumberidx` (`stocknumber`),
981
  KEY `itemstocknumberidx` (`stocknumber`),
Lines 942-951 CREATE TABLE `items` ( -- holdings/item information Link Here
942
  KEY `items_ccode` (`ccode`),
988
  KEY `items_ccode` (`ccode`),
943
  KEY `itype_idx` (`itype`),
989
  KEY `itype_idx` (`itype`),
944
  KEY `timestamp` (`timestamp`),
990
  KEY `timestamp` (`timestamp`),
991
  KEY `hldid_idx` (`holding_id`),
945
  CONSTRAINT `items_ibfk_1` FOREIGN KEY (`biblioitemnumber`) REFERENCES `biblioitems` (`biblioitemnumber`) ON DELETE CASCADE ON UPDATE CASCADE,
992
  CONSTRAINT `items_ibfk_1` FOREIGN KEY (`biblioitemnumber`) REFERENCES `biblioitems` (`biblioitemnumber`) ON DELETE CASCADE ON UPDATE CASCADE,
946
  CONSTRAINT `items_ibfk_2` FOREIGN KEY (`homebranch`) REFERENCES `branches` (`branchcode`) ON UPDATE CASCADE,
993
  CONSTRAINT `items_ibfk_2` FOREIGN KEY (`homebranch`) REFERENCES `branches` (`branchcode`) ON UPDATE CASCADE,
947
  CONSTRAINT `items_ibfk_3` FOREIGN KEY (`holdingbranch`) REFERENCES `branches` (`branchcode`) ON UPDATE CASCADE,
994
  CONSTRAINT `items_ibfk_3` FOREIGN KEY (`holdingbranch`) REFERENCES `branches` (`branchcode`) ON UPDATE CASCADE,
948
  CONSTRAINT `items_ibfk_4` FOREIGN KEY (`biblionumber`) REFERENCES `biblio` (`biblionumber`) ON DELETE CASCADE ON UPDATE CASCADE
995
  CONSTRAINT `items_ibfk_4` FOREIGN KEY (`biblionumber`) REFERENCES `biblio` (`biblionumber`) ON DELETE CASCADE ON UPDATE CASCADE,
996
  CONSTRAINT `items_ibfk_5` FOREIGN KEY (`holding_id`) REFERENCES `holdings` (`holding_id`) ON DELETE CASCADE ON UPDATE CASCADE
949
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
997
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
950
998
951
--
999
--
(-)a/installer/data/mysql/mandatory/auth_val_cat.sql (+1 lines)
Lines 20-25 INSERT IGNORE INTO authorised_value_categories( category_name ) Link Here
20
INSERT IGNORE INTO authorised_value_categories( category_name )
20
INSERT IGNORE INTO authorised_value_categories( category_name )
21
    VALUES
21
    VALUES
22
    ('branches'),
22
    ('branches'),
23
    ('holdings'),
23
    ('itemtypes'),
24
    ('itemtypes'),
24
    ('cn_source');
25
    ('cn_source');
25
26
(-)a/koha-tmpl/intranet-tmpl/prog/css/addholding.css (+171 lines)
Line 0 Link Here
1
#addholdingtabs {
2
	margin-top : 1em;
3
}
4
5
#addholdingtabs .ui-tabs-panel {
6
	float : left;
7
}
8
9
.buttonPlus {
10
	font-weight : bold;
11
	text-decoration : none;
12
}
13
14
.buttonMinus {
15
	font-weight : bold;
16
	text-decoration : none;
17
}
18
19
a.expandfield {
20
	text-decoration : none;
21
}
22
23
#authoritytabs {
24
	margin-top : 1em;
25
	margin-bottom : 1em;
26
}
27
28
.toptabs .ui-tabs-nav li a {
29
	padding : .2em 1.2em;
30
}
31
32
div.tag {
33
    clear: both;
34
}
35
36
div.subfield_line {
37
    padding-bottom: .3em;
38
    float: left;
39
    clear: left;
40
    width: 100%;
41
}
42
43
div.subfield_line label {
44
    font-size:89%;
45
    float: left;
46
	 padding-right : .4em;
47
    width: 16em;
48
    text-align: left;
49
    clear:left;
50
}
51
52
.subfieldcode img {
53
    cursor: pointer;
54
}
55
56
.tag_title {
57
	font-size : 90%;
58
	padding : .2em 0;
59
}
60
61
.tagnum {
62
	font-size : 110%;
63
	font-weight : bold;
64
	color : #000;
65
	padding : .1em .3em .1em 0;
66
}
67
68
a.tagnum {
69
	font-size : 110%;
70
	font-weight : bold;
71
	color : #000;
72
	padding : .1em .3em .1em 0;
73
	text-decoration : none;
74
}
75
76
.subfield {
77
	color : #00698a;
78
	float: left;
79
	width: 10em;
80
	text-align:right;
81
}
82
83
.subfieldcode {
84
	display: block;
85
	float: left;
86
}
87
88
.labelsubfield {
89
	float:left;
90
}
91
92
.input_marceditor {
93
	float:left;
94
	width:30em;
95
}
96
97
.indicator {
98
    width: 1em;
99
    box-sizing: content-box;
100
}
101
102
*html .input_marceditor {
103
	width : 15em;
104
}
105
106
#cataloguing_additem_newitem fieldset.rows label, #cataloguing_additem_newitem fieldset.rows span.label {
107
	font-size : 100%;
108
	width : 25%;
109
}
110
111
#cataloguing_additem_newitem fieldset.rows li {
112
	padding-bottom : 3px;
113
}
114
#cataloguing_additem_newitem .input_marceditor {
115
	width : auto;
116
}
117
118
#cataloguing_additem_newitem textarea.input_marceditor {
119
     width : 31em;
120
}
121
122
.mandatory_marker {
123
	color: red;
124
}
125
.linktools { display: block; white-space: nowrap; }
126
.linktools a { font-size : 75%; display:block;text-decoration:none;}
127
.linktools a {margin:0 2px;padding:2px;background-color:#FFF;text-align:center; }
128
.linktools a:first-child { border-bottom: 1px solid #DDD; }
129
.linktools a:hover { background-color: #FFC; }
130
.subfield_controls { margin : 0 .5em; }
131
.readonly { border-width : 1px; border-style: inset; padding-left : 15px; background: #EEE url(../img/locked.png) center left no-repeat; width:29em; }
132
133
#cataloguing_additem_itemlist {
134
	margin-bottom : 1em;
135
}
136
.yui-gf div.first {
137
	width : 19%;
138
}
139
140
.yui-gf .yui-u {
141
	width: 79.2%;
142
}
143
144
tbody tr.active:nth-child(2n+1) td,
145
tbody tr.active td {
146
    background-color: #FFFFCC;
147
}
148
149
#loading {
150
    background-color: #FFF;
151
    cursor: wait;
152
    height: 100%;
153
    left: 0;
154
    opacity: .7;
155
    position: fixed;
156
    top: 0;
157
    width: 100%;
158
    z-index: 1000;
159
}
160
#loading div {
161
    background : transparent url(../img/loading.gif) top left no-repeat;
162
    font-size : 175%;
163
    font-weight: bold;
164
    height: 2em;
165
    left: 50%;
166
    margin: -1em 0 0 -2.5em;
167
    padding-left : 50px;
168
    position: absolute;
169
    top: 50%;
170
    width: 15em;
171
}
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc (+4 lines)
Lines 10-15 CAN_user_serials_create_subscription ) %] Link Here
10
             <li><a id="newbiblio" href="/cgi-bin/koha/cataloguing/addbiblio.pl">New record</a></li>
10
             <li><a id="newbiblio" href="/cgi-bin/koha/cataloguing/addbiblio.pl">New record</a></li>
11
            [% END %]
11
            [% END %]
12
12
13
            [% IF ( show_summary_holdings && CAN_user_editcatalogue_edit_items ) %]
14
            <li><a id="newholding" href="/cgi-bin/koha/cataloguing/addholding.pl?biblionumber=[% biblionumber %]#addholding">New holding</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 %]#additema">New item</a></li>
18
             <li><a id="newitem" href="/cgi-bin/koha/cataloguing/additem.pl?biblionumber=[% biblionumber %]#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 %]" role="button" data-toggle="dropdown" href="#">
138
            <a class="btn btn-default btn-xs dropdown-toggle" id="frameworkactions[% loo.frameworkcode %]" 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 %]</td>
202
            <td>[% loo.frameworkcode %]</td>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref (+7 lines)
Lines 276-278 Cataloging: Link Here
276
            - "All values of repeating tags and subfields will be printed with the given RIS tag."
276
            - "All values of repeating tags and subfields will be printed with the given RIS tag."
277
            - "<br/>"
277
            - "<br/>"
278
            - "Use of TY ( record type ) as a key will <i>replace</i> the default TY with the field value of your choosing."
278
            - "Use of TY ( record type ) as a key will <i>replace</i> the default TY with the field value of your choosing."
279
    Holdings:
280
        -
281
            - pref: SummaryHoldings
282
              choices:
283
                  yes: Use
284
                  no: "Don't use"
285
            - summary holdings records.
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt (-11 / +69 lines)
Lines 4-9 Link Here
4
[% USE AuthorisedValues %]
4
[% USE AuthorisedValues %]
5
[% USE Branches %]
5
[% USE Branches %]
6
[% USE Biblio %]
6
[% USE Biblio %]
7
[% USE Holdings %]
7
8
8
[% IF Koha.Preference('AmazonAssocTag') %]
9
[% IF Koha.Preference('AmazonAssocTag') %]
9
    [% AmazonAssocTag = '?tag=' _ Koha.Preference('AmazonAssocTag') %]
10
    [% AmazonAssocTag = '?tag=' _ Koha.Preference('AmazonAssocTag') %]
Lines 295-311 Link Here
295
<div id="bibliodetails" class="toptabs">
296
<div id="bibliodetails" class="toptabs">
296
297
297
<ul>
298
<ul>
298
    [% IF (SeparateHoldings) %]
299
    [% IF (show_summary_holdings) %]
299
        <li>
300
        <li><a href="#summaryholdings">Holdings ([% summary_holdings.size() || 0 %])</a></li>
300
            <a href="#holdings">[% LoginBranchname %] holdings ([% itemloop.size() || 0 %])</a>
301
        [% IF (SeparateHoldings) %]
301
        </li>
302
            <li><a href="#holdings">[% LoginBranchname %] items ([% itemloop.size() || 0 %])</a></li>
302
        <li>
303
            <li><a href="#otherholdings">Other items ([% otheritemloop.size() || 0 %])</a></li>
303
            <a href="#otherholdings">Other holdings ([% otheritemloop.size() || 0 %])</a>
304
        [% ELSE %]
304
        </li>
305
            <li><a href="#holdings">Items ([% itemloop.size() || 0 %])</a></li>
306
        [% END %]
305
    [% ELSE %]
307
    [% ELSE %]
306
        <li>
308
        [% IF (SeparateHoldings) %]
307
            <a href="#holdings">Holdings ([% itemloop.size() || 0 %])</a>
309
            <li><a href="#holdings">[% LoginBranchname %] holdings ([% itemloop.size() || 0 %])</a></li>
308
        </li>
310
            <li><a href="#otherholdings">Other holdings ([% otheritemloop.size() || 0 %])</a></li>
311
        [% ELSE %]
312
            <li><a href="#holdings">Holdings ([% itemloop.size() || 0 %])</a></li>
313
        [% END %]
309
    [% END %]
314
    [% END %]
310
[% IF ( MARCNOTES || notes ) %]<li><a href="#description">Descriptions</a></li>[% END %]
315
[% IF ( MARCNOTES || notes ) %]<li><a href="#description">Descriptions</a></li>[% END %]
311
[% IF ( subscriptionsnumber ) %]<li><a href="#subscriptions">Subscriptions</a></li>[% END %]
316
[% IF ( subscriptionsnumber ) %]<li><a href="#subscriptions">Subscriptions</a></li>[% END %]
Lines 324-329 Link Here
324
[% END %]
329
[% END %]
325
</ul>
330
</ul>
326
331
332
[% IF ( show_summary_holdings ) %]
333
    <div id="summaryholdings">
334
335
    [% IF ( summary_holdings ) %]
336
        <div class="summaryholdings_table_controls">
337
        </div>
338
        <table class="summaryholdings_table">
339
            <thead>
340
                <tr>
341
                    <th>Library</th>
342
                    <th>Location</th>
343
                    <th>Call number</th>
344
                    <th>Status</th>
345
                    [% IF ( CAN_user_editcatalogue_edit_items ) %]<th class="NoSort">&nbsp;</th>[% END %]
346
                </tr>
347
            </thead>
348
            <tbody>
349
                [% FOREACH holding IN summary_holdings %]
350
                    <tr>
351
                        <td class="branch">[% UNLESS ( singlebranchmode ) %][% Branches.GetName( holding.holdingbranch ) %] [% END %]</td>
352
                        <td class="location"><span class="shelvingloc">[% holding.location %][% IF ( holding.sub_location ) %] ([% holding.sub_location %])[% END %]</span>
353
                        <td class="itemcallnumber">[% IF ( holding.callnumber ) %] [% holding.callnumber %][% END %]</td>
354
                        <td class="status">
355
                            [% IF ( holding.suppress ) %]
356
                                <span class="suppressed">Suppressed in OPAC</span>
357
                            [% END %]
358
                        </td>
359
                    [% IF CAN_user_editcatalogue_edit_items %]
360
                        <td class="actions">
361
                            <a class="btn btn-default btn-xs" href="/cgi-bin/koha/cataloguing/addholding.pl?op=edit&biblionumber=[% holding.biblionumber %]&holding_id=[% holding.holding_id %]#editholding"><i class="fa fa-pencil"></i> Edit</a>
362
                            <a class="btn btn-default btn-xs delete" href="/cgi-bin/koha/cataloguing/addholding.pl?op=delete&biblionumber=[% holding.biblionumber %]&holding_id=[% holding.holding_id %]"><i class="fa fa-eraser"></i> Delete</a>
363
                            <a class="btn btn-default btn-xs" href="/cgi-bin/koha/cataloguing/additem.pl?biblionumber=[% holding.biblionumber %]&holding_id=[% holding.holding_id %]#additema"><i class="fa fa-plus"></i> Add item</a>
364
                        </td>
365
                    [% END %]
366
                    </tr>
367
                [% END %]
368
            </tbody>
369
        </table>
370
    [% ELSE %]
371
        <div id="noitems">No holdings records</div>
372
    [% END %]
373
374
    </div>
375
[% END %]
376
327
[% items_table_block_iter = 0 %]
377
[% items_table_block_iter = 0 %]
328
[% BLOCK items_table %]
378
[% BLOCK items_table %]
329
    [% items_table_block_iter = items_table_block_iter + 1 %]
379
    [% items_table_block_iter = items_table_block_iter + 1 %]
Lines 347-352 Link Here
347
            <tr>
397
            <tr>
348
                [% IF (StaffDetailItemSelection) %]<th class="NoSort"></th>[% END %]
398
                [% IF (StaffDetailItemSelection) %]<th class="NoSort"></th>[% END %]
349
                [% IF ( item_level_itypes ) %]<th>Item type</th>[% END %]
399
                [% IF ( item_level_itypes ) %]<th>Item type</th>[% END %]
400
                [% IF ( show_summary_holdings ) %]<th>Holding</th>[% END %]
350
                <th>Current location</th>
401
                <th>Current location</th>
351
                <th>Home library</th>
402
                <th>Home library</th>
352
                [% IF ( itemdata_ccode ) %]<th>Collection</th>[% END %]
403
                [% IF ( itemdata_ccode ) %]<th>Collection</th>[% END %]
Lines 384-389 Link Here
384
                            [% item.translated_description %]
435
                            [% item.translated_description %]
385
                        </td>
436
                        </td>
386
                    [% END %]
437
                    [% END %]
438
                    [% IF ( show_summary_holdings ) %]
439
                        <td class="holding">[% Holdings.GetLocation(item.holding_id) | html %]</td>
440
                    [% END %]
387
                    <td class="location">[% UNLESS ( singlebranchmode ) %][% Branches.GetName( item.branchcode ) %] [% END %]</td>
441
                    <td class="location">[% UNLESS ( singlebranchmode ) %][% Branches.GetName( item.branchcode ) %] [% END %]</td>
388
                    <td class="homebranch">[% Branches.GetName(item.homebranch) %]<span class="shelvingloc">[% item.location %]</span> </td>
442
                    <td class="homebranch">[% Branches.GetName(item.homebranch) %]<span class="shelvingloc">[% item.location %]</span> </td>
389
                    [% IF ( itemdata_ccode ) %]<td>[% item.ccode %]</td>[% END %]
443
                    [% IF ( itemdata_ccode ) %]<td>[% item.ccode %]</td>[% END %]
Lines 1006-1017 Link Here
1006
                    $("input[name='itemnumber'][type='checkbox']", $("#"+tab)).prop('checked', false);
1060
                    $("input[name='itemnumber'][type='checkbox']", $("#"+tab)).prop('checked', false);
1007
                    itemSelectionBuildActionLinks(tab);
1061
                    itemSelectionBuildActionLinks(tab);
1008
                });
1062
                });
1063
1064
                $('a.delete').click(function() {
1065
                    return confirm(_('Are you sure?'));
1066
                });
1009
            });
1067
            });
1010
        [% END %]
1068
        [% END %]
1011
1069
1012
        $(document).ready(function() {
1070
        $(document).ready(function() {
1013
            $('#bibliodetails').tabs();
1071
            $('#bibliodetails').tabs();
1014
            [% IF count == 0 %]
1072
            [% IF count == 0 and not show_summary_holdings %]
1015
                $('#bibliodetails').tabs("option", "active", 3);
1073
                $('#bibliodetails').tabs("option", "active", 3);
1016
            [% END %]
1074
            [% END %]
1017
            $('#search-form').focus();
1075
            $('#search-form').focus();
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt (+2 lines)
Lines 1-6 Link Here
1
[% USE Asset %]
1
[% USE Asset %]
2
[% USE Koha %]
2
[% USE Koha %]
3
[% USE Branches %]
3
[% USE Branches %]
4
[% USE Holdings %]
4
[% SET footerjs = 1 %]
5
[% SET footerjs = 1 %]
5
[% INCLUDE 'doc-head-open.inc' %]
6
[% INCLUDE 'doc-head-open.inc' %]
6
<title>Koha &rsaquo; Catalog &rsaquo; Item details for [% title | html %] [% FOREACH subtitl IN subtitle %] [% subtitl.subfield | html %][% END %]</title>
7
<title>Koha &rsaquo; Catalog &rsaquo; Item details for [% title | html %] [% FOREACH subtitl IN subtitle %] [% subtitl.subfield | html %][% END %]</title>
Lines 54-59 Link Here
54
         [% END %]
55
         [% END %]
55
         [% END %][% END %]</h4>
56
         [% END %][% END %]</h4>
56
            <ol class="bibliodetails">
57
            <ol class="bibliodetails">
58
            <li><span class="label">Holding:</span> [% Holdings.GetLocation( ITEM_DAT.holding_id ) | html %]&nbsp;</li>
57
            <li><span class="label">Home library:</span> [% Branches.GetName( ITEM_DAT.homebranch ) %]&nbsp;</li>
59
            <li><span class="label">Home library:</span> [% Branches.GetName( ITEM_DAT.homebranch ) %]&nbsp;</li>
58
	    [% IF ( item_level_itypes ) %]
60
	    [% IF ( item_level_itypes ) %]
59
            <li><span class="label">Item type:</span> [% ITEM_DAT.itype %]&nbsp;</li>
61
            <li><span class="label">Item type:</span> [% ITEM_DAT.itype %]&nbsp;</li>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt (+14 lines)
Lines 1-6 Link Here
1
[% USE Asset %]
1
[% USE Asset %]
2
[% USE Koha %]
2
[% USE Koha %]
3
[% USE Biblio %]
3
[% USE Biblio %]
4
[% USE Holdings %]
4
[% USE KohaDates %]
5
[% USE KohaDates %]
5
[% SET footerjs = 1 %]
6
[% SET footerjs = 1 %]
6
[% USE AuthorisedValues %]
7
[% USE AuthorisedValues %]
Lines 478-483 Link Here
478
                                </td>
479
                                </td>
479
480
480
                                <td><div class="availability">
481
                                <td><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 (+615 lines)
Line 0 Link Here
1
[% USE Koha %]
2
[% SET KOHA_VERSION = Koha.Preference('Version') %]
3
[% INCLUDE 'doc-head-open.inc' %]
4
<title>Koha &rsaquo; Cataloging &rsaquo; [% IF ( holding_id ) %]Editing record number [% holding_id %][% ELSE %]Add holding record[% END %]</title>
5
[% INCLUDE 'doc-head-close.inc' %]
6
<script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.fixFloat_[% KOHA_VERSION %].js"></script>
7
<script type="text/javascript" src="[% interface %]/[% theme %]/js/cataloging_[% KOHA_VERSION %].js"></script>
8
[% INCLUDE 'browser-strings.inc' %]
9
<!--[if lt IE 9]>
10
<script type="text/javascript" src="[% interface %]/lib/shims/json2.min_[% KOHA_VERSION %].js"></script>
11
<![endif]-->
12
<script type="text/javascript" src="[% interface %]/js/browser_[% KOHA_VERSION %].js"></script>
13
<script type="text/javascript">
14
//<![CDATA[
15
    var browser = KOHA.browser('[% searchid %]', parseInt('[% biblionumber %]', 10));
16
    browser.show();
17
18
    $(window).load(function() {
19
        $("#loading").hide();
20
    });
21
    $(document).ready(function() {
22
        $('#addholdingtabs').tabs().bind('show.ui-tabs', function(e, ui) {
23
            $("#"+ui.panel.id+" input:eq(0)").focus();
24
        });
25
26
        [% IF tab %]
27
            $('#addholdingtabs').selectTabByID("#[% tab %]");
28
        [% END %]
29
30
        $('#toolbar').fixFloat();
31
32
        /* check cookie to hide/show marcdocs*/
33
        if($.cookie("marcdocs_[% borrowernumber %]") == 'hide'){
34
            toggleMARCdocLinks(false);
35
        } else {
36
            toggleMARCdocLinks(true);
37
        }
38
39
        $("#marcDocsSelect").click(function(){
40
            if($.cookie("marcdocs_[% borrowernumber %]") == 'hide'){
41
                toggleMARCdocLinks(true);
42
            } else {
43
                toggleMARCdocLinks(false);
44
            }
45
        });
46
47
        /* check cookie to hide/show marc tags*/
48
        var marctags_cookie = $.cookie("marctags_[% borrowernumber %]");
49
        if (marctags_cookie == 'hide'){
50
            toggleMARCTagLinks(false);
51
        } else if( marctags_cookie == 'show'){
52
            toggleMARCTagLinks(true)
53
        } else {
54
            [% UNLESS Koha.Preference("hide_marc") %]
55
                toggleMARCTagLinks(true)
56
            [% ELSE %]
57
                toggleMARCTagLinks(false);
58
            [% END %]
59
        }
60
61
        $("#marcTagsSelect").click(function(){
62
            if( $.cookie("marctags_[% borrowernumber %]") == 'hide'){
63
                toggleMARCTagLinks(true)
64
            } else {
65
                toggleMARCTagLinks(false);
66
            }
67
        });
68
69
        $("#saverecord").click(function(){
70
            $(".btn-group").removeClass("open");
71
            onOption();
72
            return false;
73
        });
74
75
        $("#saveandview").click(function(){
76
            $(".btn-group").removeClass("open");
77
            redirect("view");
78
            return false;
79
        });
80
81
        $("#saveanditems").click(function(){
82
            $(".btn-group").removeClass("open");
83
            redirect("items");
84
            return false;
85
        });
86
        $("#saveandcontinue").click(function(){
87
            $(".btn-group").removeClass("open");
88
            var tab = $("#addholdingtabs li.ui-tabs-active:first a").attr('href');
89
            tab = tab.replace('#', '');
90
            $("#current_tab").val(tab);
91
            redirect("just_save", tab);
92
            return false;
93
        });
94
95
        $( '#switcheditor' ).click( function() {
96
97
            if ( !confirm( _("Any changes will not be saved. Continue?") ) ) return false;
98
99
            $.cookie( 'catalogue_editor_[% USER_INFO.borrowernumber %]', 'advanced', { expires: 365, path: '/' } );
100
101
            var holding_id = [% holding_id || "''" %];
102
            window.location = '/cgi-bin/koha/cataloguing/editor.pl#catalog/' + biblionumber + '/holdings/' + holding_id;
103
104
            return false;
105
        } );
106
        $(".change-framework").on("click", function(){
107
            var frameworkcode = $(this).data("frameworkcode");
108
            $("#frameworkcode").val( frameworkcode );
109
            Changefwk();
110
        });
111
    });
112
113
function redirect(dest){
114
    $("#redirect").attr("value",dest);
115
    return Check();
116
}
117
118
[% IF ( CAN_user_editcatalogue_edit_items ) %]
119
    var onOption = function () {
120
        return Check();
121
    }
122
[% END %]
123
124
function Dopop(link,i) {
125
    defaultvalue = document.getElementById(i).value;
126
    window.open(link+"&result="+defaultvalue,"valuebuilder",'width=700,height=550,toolbar=false,scrollbars=yes');
127
}
128
129
function PopupMARCFieldDoc(field) {
130
    [% IF ( marcflavour == 'MARC21' ) %]
131
        _MARC21FieldDoc(field);
132
    [% ELSIF ( marcflavour == 'UNIMARC' ) %]
133
        _UNIMARCFieldDoc(field);
134
    [% END %]
135
}
136
137
function _MARC21FieldDoc(field) {
138
    if(field == 0) {
139
        window.open("http://www.loc.gov/marc/holdings/bdleader.html");
140
    } else if (field < 900) {
141
        window.open("http://www.loc.gov/marc/holdings/bd" + ("000"+field).slice(-3) + ".html");
142
    } else {
143
        window.open("http://www.loc.gov/marc/holdings/bd9xx.html");
144
    }
145
}
146
147
function _UNIMARCFieldDoc(field) {
148
    /* http://archive.ifla.org/VI/3/p1996-1/ is an outdated version of UNIMARC, but
149
       seems to be the only version available that can be linked to per tag.  More recent
150
       versions of the UNIMARC standard are available on the IFLA website only as
151
       PDFs!
152
    */
153
    var url;
154
    if (field == 0) {
155
        url = "http://archive.ifla.org/VI/3/p1996-1/uni.htm";
156
    } else {
157
        var first = field.substring(0,1);
158
        url = "http://archive.ifla.org/VI/3/p1996-1/uni" + first + ".htm#";
159
        if (first == 0) url = url + "b";
160
        url = first == 9
161
              ? "http://archive.ifla.org/VI/3/p1996-1/uni9.htm"
162
              : url + field;
163
    }
164
    window.open(url);
165
}
166
167
/*
168
 * Functions to hide/show marc docs and tags links
169
 */
170
171
function toggleMARCdocLinks(flag){
172
    if( flag === true ){
173
        $(".marcdocs").show();
174
        $.cookie("marcdocs_[% borrowernumber %]",'show', { path: "/", expires: 365 });
175
        $("#marcDocsSelect i").addClass('fa-check-square-o').removeClass('fa-square-o');
176
    } else {
177
        $(".marcdocs").hide();
178
        $.cookie("marcdocs_[% borrowernumber %]",'hide', { path: "/", expires: 365 });
179
        $("#marcDocsSelect i").removeClass('fa-check-square-o').addClass('fa-square-o');
180
    }
181
}
182
183
function toggleMARCTagLinks(flag){
184
    if( flag === true ){
185
        $(".tagnum").show();
186
        $(".subfieldcode").show();
187
        $.cookie("marctags_[% borrowernumber %]",'show', { path: "/", expires: 365 });
188
        $("#marcTagsSelect i").addClass('fa-check-square-o').removeClass('fa-square-o');
189
    } else {
190
        $(".tagnum").hide();
191
        $(".subfieldcode").hide();
192
        $.cookie("marctags_[% borrowernumber %]",'hide', { path: "/", expires: 365 });
193
        $("#marcTagsSelect i").removeClass('fa-check-square-o').addClass('fa-square-o');
194
    }
195
}
196
197
/**
198
 * check if mandatory subfields are written
199
 */
200
function AreMandatoriesNotOk(){
201
    var mandatories = new Array();
202
    var mandatoriesfields = new Array();
203
    var tab = new Array();
204
    var label = new Array();
205
    var flag=0;
206
    var tabflag= new Array();
207
    [% FOREACH BIG_LOO IN BIG_LOOP %]
208
        [% FOREACH innerloo IN BIG_LOO.innerloop %]
209
            [% IF ( innerloo.mandatory ) %]
210
                mandatoriesfields.push(new Array("[% innerloo.tag %]","[% innerloo.index %][% innerloo.random %]","[% innerloo.index %]"));
211
            [% END %]
212
            [% FOREACH subfield_loo IN innerloo.subfield_loop %]
213
                [% IF ( subfield_loo.mandatory ) %]
214
                    mandatories.push("[% subfield_loo.id %]");
215
                    tab.push("[% BIG_LOO.number %]");
216
                    label.push("[% subfield_loo.marc_lib %]");
217
                [% END %]
218
            [% END %]
219
        [% END %]
220
    [% END %]
221
    var StrAlert = _("Can't save this record because the following field aren't filled:");
222
    StrAlert += "\n\n";
223
    for (var i=0,len=mandatories.length; i<len ; i++) {
224
        var tag=mandatories[i].substr(4,3);
225
        var subfield=mandatories[i].substr(17,1);
226
        var tagnumber=mandatories[i].substr(19,mandatories[i].lastIndexOf("_")-19);
227
        if (tabflag[tag+subfield+tagnumber] ==  null) {
228
            tabflag[tag+subfield+tagnumber]=new Array();
229
            tabflag[tag+subfield+tagnumber][0]=0;
230
        }
231
        if (tabflag[tag+subfield+tagnumber][0] != 1 && (document.getElementById(mandatories[i]) != null && ! document.getElementById(mandatories[i]).value || document.getElementById(mandatories[i]) == null)) {
232
            tabflag[tag+subfield+tagnumber][0] = 0 + tabflag[tag+subfield+tagnumber] ;
233
            document.getElementById(mandatories[i]).setAttribute('class','subfield_not_filled');
234
            $('#' + mandatories[i]).focus();
235
            tabflag[tag+subfield+tagnumber][1]=label[i];
236
            tabflag[tag+subfield+tagnumber][2]=tab[i];
237
        } else {
238
            tabflag[tag+subfield+tagnumber][0] = 1;
239
        }
240
    }
241
    for (var tagsubfieldid in tabflag) {
242
      if (tabflag[tagsubfieldid][0]==0) {
243
        var tag=tagsubfieldid.substr(0,3);
244
        var subfield=tagsubfieldid.substr(3,1);
245
        StrAlert += "\t* "+_("tag %s subfield %s %s in tab %s").format(tag, subfield, tabflag[tagsubfieldid][1], tabflag[tagsubfieldid][2]) + "\n";
246
        flag=1;
247
      }
248
    }
249
250
    /* Check for mandatories field(not subfields) */
251
    for (var i=0,len=mandatoriesfields.length; i<len; i++) {
252
        isempty  = true;
253
        arr      = mandatoriesfields[i];
254
        divid    = "tag_" + arr[0] + "_" + arr[1];
255
        varegexp = new RegExp("^tag_" + arr[0] + "_code_");
256
257
        if(parseInt(arr[0]) >= 10) {
258
            elem = document.getElementById(divid);
259
            eleminputs = elem.getElementsByTagName('input');
260
261
            for(var j=0,len2=eleminputs.length; j<len2; j++){
262
263
                if(eleminputs[j].name.match(varegexp) && eleminputs[j].value){
264
                        inputregexp = new RegExp("^tag_" + arr[0] + "_subfield_" + eleminputs[j].value + "_" + arr[2]);
265
266
                        for( var k=0; k<len2; k++){
267
                            if(eleminputs[k].id.match(inputregexp) && eleminputs[k].value){
268
                                isempty = false
269
                            }
270
                        }
271
272
                        elemselect = elem.getElementsByTagName('select');
273
                        for( var k=0; k<elemselect.length; k++){
274
                            if(elemselect[k].id.match(inputregexp) && elemselect[k].value){
275
                                isempty = false
276
                            }
277
                        }
278
                }
279
            }
280
281
            elemtextareas = elem.getElementsByTagName('textarea');
282
            for(var j=0,len2=elemtextareas.length; j<len2; j++){
283
                // this bit assumes that the only textareas in this context would be for subfields
284
                if (elemtextareas[j].value) {
285
                    isempty = false;
286
                }
287
            }
288
        } else {
289
            isempty = false;
290
        }
291
292
        if (isempty) {
293
            flag = 1;
294
                    StrAlert += "\t* " + _("Field %s is mandatory, at least one of its subfields must be filled.").format(arr[0]) + "\n";
295
        }
296
    }
297
298
    if (flag) {
299
        return StrAlert;
300
    } else {
301
        return flag;
302
    }
303
}
304
305
/**
306
 *
307
 *
308
 */
309
function Check(){
310
    var StrAlert = AreMandatoriesNotOk();
311
    if( ! StrAlert ){
312
        document.f.submit();
313
        return true;
314
    } else {
315
        alert(StrAlert);
316
        return false;
317
    }
318
}
319
320
function Changefwk() {
321
    var f = document.f;
322
    f.op.value = "[% op %]";
323
    f.biblionumber.value = "[% biblionumber %]";
324
    f.holding_id.value = "[% holding_iddata %]";
325
    f.changed_framework.value = "changed";
326
    f.submit();
327
}
328
329
//]]>
330
</script>
331
<link type="text/css" rel="stylesheet" href="[% interface %]/[% theme %]/css/addholding.css" />
332
333
[% INCLUDE 'select2.inc' %]
334
<script>
335
  $(document).ready(function() {
336
    $('.subfield_line select').select2();
337
  });
338
</script>
339
340
[% IF ( bidi ) %]
341
   <link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/right-to-left_[% KOHA_VERSION %].css" />
342
[% END %]
343
</head>
344
<body id="cat_addholding" class="cat">
345
346
   <div id="loading">
347
       <div>Loading, please wait...</div>
348
   </div>
349
350
[% INCLUDE 'header.inc' %]
351
352
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/cataloguing/addbooks.pl">Cataloging</a>  &rsaquo; [% IF ( holding_id ) %]Editing record number [% holding_id %][% ELSE %]Add holding record[% END %]</div>
353
354
<div id="doc" class="yui-t7">
355
356
<div id="bd">
357
        <div id="yui-main">
358
        <div class="yui-g">
359
360
<h1>
361
[% IF ( holding_id ) %]Editing record number [% holding_id %]
362
[% ELSE %]Add holdings record
363
[% END %]
364
</h1>
365
366
[% IF ( done ) %]
367
    <script type="text/javascript">
368
        opener.document.forms['f'].holding_id.value=[% holding_id %];
369
        window.close();
370
    </script>
371
[% ELSE %]
372
    <form method="post" name="f" id="f" action="/cgi-bin/koha/cataloguing/addholding.pl" onsubmit="return Check();">
373
    <input type="hidden" value="[% IF ( holding_id ) %]view[% ELSE %]items[% END %]" id="redirect" name="redirect" />
374
    <input type="hidden" value="" id="current_tab" name="current_tab" />
375
[% END %]
376
377
<div id="toolbar" class="btn-toolbar">
378
    [% IF CAN_user_editcatalogue_edit_items %]
379
        <div class="btn-group">
380
            <button class="btn btn-default btn-sm" id="saverecord"><i class="fa fa-save"></i> Save</button>
381
            <button class="btn btn-default btn-sm dropdown-toggle" data-toggle="dropdown">
382
            <span class="caret"></span>
383
            </button>
384
            <ul class="dropdown-menu">
385
                <li><a id="saveandview" href="#">Save and view record</a></li>
386
                <li><a id="saveanditems" href="#">Save and edit items</a></li>
387
                <li><a id="saveandcontinue" href="#">Save and continue editing</a></li>
388
            </ul>
389
        </div>
390
    [% END %]
391
392
    <div class="btn-group">
393
        <button class="btn btn-default btn-sm dropdown-toggle" data-toggle="dropdown"><i class="fa fa-cog"></i> Settings <span class="caret"></span></button>
394
        <ul id="settings-menu" class="dropdown-menu">
395
            [% IF Koha.Preference( 'EnableAdvancedCatalogingEditor' ) == 1 %]
396
                <li><a href="#" id="switcheditor">Switch to advanced editor</a></li>
397
            [% END %]
398
            [% IF marcflavour != 'NORMARC' AND NOT advancedMARCEditor %]
399
                <li>
400
                    <a href="#" id="marcDocsSelect"><i class="fa fa-check-square-o"></i> Show MARC tag documentation links</a>
401
                <li>
402
                    <a href="#" id="marcTagsSelect"><i class="fa fa-check-square-o"></i> Show tags</a>
403
                </li>
404
            [% END %]
405
            <li class="divider"></li>
406
            <li class="nav-header">Change framework</li>
407
            <li>
408
                <a href="#" class="change-framework" data-frameworkcode="">
409
                    [% IF ( frameworkcode ) %]
410
                       <i class="fa fa-fw">&nbsp;</i>
411
                    [% ELSE %]
412
                        <i class="fa fa-fw fa-check"></i>
413
                    [% END %]
414
                    Default
415
                </a>
416
            </li>
417
            [% FOREACH framework IN frameworks%]
418
                <li>
419
                    <a href="#" class="change-framework" data-frameworkcode="[% framework.frameworkcode %]">
420
                        [% IF framework.frameworkcode == frameworkcode %]
421
                            <i class="fa fa-fw fa-check"></i>
422
                        [% ELSE %]
423
                            <i class="fa fa-fw">&nbsp;</i>
424
                        [% END %]
425
                        [% framework.frameworktext %]
426
                    </a>
427
                </li>
428
            [% END %]
429
        </ul>
430
    </div>
431
    <div class="btn-group">
432
        <a class="btn btn-default btn-sm" id="cancel" href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblionumber |url %]">Cancel</a>
433
    </div>
434
</div>
435
436
[% IF ( popup ) %]
437
        <input type="hidden" name="mode" value="popup" />
438
[% END %]
439
        <input type="hidden" name="op" value="add" />
440
        <input type="hidden" id="frameworkcode" name="frameworkcode" value="[% frameworkcode %]" />
441
        <input type="hidden" name="biblionumber" value="[% biblionumber %]" />
442
        <input type="hidden" name="holding_id" value="[% holding_id %]" />
443
        <input type="hidden" name="changed_framework" value="" />
444
445
<div id="addholdingtabs" class="toptabs numbered">
446
    <ul>
447
        [% FOREACH BIG_LOO IN BIG_LOOP %]
448
        <li><a href="#tab[% BIG_LOO.number %]XX">[% BIG_LOO.number %]</a></li>
449
        [% END %]
450
    </ul>
451
452
[% FOREACH BIG_LOO IN BIG_LOOP %]
453
    <div id="tab[% BIG_LOO.number %]XX">
454
455
    [% FOREACH innerloo IN BIG_LOO.innerloop %]
456
    [% IF ( innerloo.tag ) %]
457
    <div class="tag" id="tag_[% innerloo.tag %]_[% innerloo.index %][% innerloo.random %]">
458
        <div class="tag_title" id="div_indicator_tag_[% innerloo.tag %]_[% innerloo.index %][% innerloo.random %]">
459
            [% IF advancedMARCEditor %]
460
                <a href="#" tabindex="1" class="tagnum" title="[% innerloo.tag_lib %] - Click to Expand this Tag" onclick="ExpandField('tag_[% innerloo.tag %]_[% innerloo.index %][% innerloo.random %]'); return false;">[% innerloo.tag %]</a>
461
            [% ELSE %]
462
                <span class="tagnum" title="[% innerloo.tag_lib %]">[% innerloo.tag %]</span>
463
                [% IF marcflavour != 'NORMARC' %]<a href="#" class="marcdocs" onclick="PopupMARCFieldDoc('[% innerloo.tag %]'); return false;">&nbsp;?</a>[% END %]
464
            [% END %]
465
                [% IF ( innerloo.fixedfield ) %]
466
                    <input type="text"
467
                        tabindex="1"
468
                        class="indicator flat"
469
                        style="display:none;"
470
                        name="tag_[% innerloo.tag %]_indicator1_[% innerloo.index %][% innerloo.random %]"
471
                        size="1"
472
                        maxlength="1"
473
                        value="[% innerloo.indicator1 %]" />
474
                    <input type="text"
475
                        tabindex="1"
476
                        class="indicator flat"
477
                        style="display:none;"
478
                        name="tag_[% innerloo.tag %]_indicator2_[% innerloo.index %][% innerloo.random %]"
479
                        size="1"
480
                        maxlength="1"
481
                        value="[% innerloo.indicator2 %]" />
482
                [% ELSE %]
483
                    <input type="text"
484
                        tabindex="1"
485
                        class="indicator flat"
486
                        name="tag_[% innerloo.tag %]_indicator1_[% innerloo.index %][% innerloo.random %]"
487
                        size="1"
488
                        maxlength="1"
489
                        value="[% innerloo.indicator1 %]" />
490
                    <input type="text"
491
                        tabindex="1"
492
                        class="indicator flat"
493
                        name="tag_[% innerloo.tag %]_indicator2_[% innerloo.index %][% innerloo.random %]"
494
                        size="1"
495
                        maxlength="1"
496
                        value="[% innerloo.indicator2 %]" />
497
                [% END %] -
498
499
            [% UNLESS advancedMARCEditor %]
500
                <a href="#" tabindex="1" class="expandfield" onclick="ExpandField('tag_[% innerloo.tag %]_[% innerloo.index %][% innerloo.random %]'); return false;" title="Click to Expand this Tag">[% innerloo.tag_lib %]</a>
501
            [% END %]
502
                <span class="field_controls">
503
                [% IF ( innerloo.repeatable ) %]
504
                    <a href="#" tabindex="1" class="buttonPlus" onclick="CloneField('tag_[% innerloo.tag %]_[% innerloo.index %][% innerloo.random %]','0','[% advancedMARCEditor %]'); return false;" title="Repeat this Tag">
505
                        <img src="[% interface %]/[% theme %]/img/repeat-tag.png" alt="Repeat this Tag" />
506
                    </a>
507
                [% END %]
508
                    <a href="#" tabindex="1" class="buttonMinus" onclick="UnCloneField('tag_[% innerloo.tag %]_[% innerloo.index %][% innerloo.random %]'); return false;" title="Delete this Tag">
509
                        <img src="[% interface %]/[% theme %]/img/delete-tag.png" alt="Delete this Tag" />
510
                    </a>
511
                </span>
512
513
        </div>
514
515
        [% FOREACH subfield_loo IN innerloo.subfield_loop %]
516
            <!--  One line on the marc editor -->
517
            <div class="subfield_line" style="[% subfield_loo.visibility %]" id="subfield[% subfield_loo.tag %][% subfield_loo.subfield %][% subfield_loo.random %]">
518
519
                [% UNLESS advancedMARCEditor %]
520
                    [% IF ( subfield_loo.fixedfield ) %]<label for="tag_[% subfield_loo.tag %]_subfield_[% subfield_loo.subfield %]_[% subfield_loo.index %]_[% subfield_loo.index_subfield %]" style="display:none;" class="labelsubfield">
521
                    [% ELSE %]<label for="tag_[% subfield_loo.tag %]_subfield_[% subfield_loo.subfield %]_[% subfield_loo.index %]_[% subfield_loo.index_subfield %]" class="labelsubfield">
522
                    [% END %]
523
                [% END %]
524
525
                <span class="subfieldcode">
526
                    [% IF ( subfield_loo.fixedfield ) %]
527
                        <img class="buttonUp" style="display:none;" src="[% interface %]/[% theme %]/img/up.png" onclick="upSubfield('subfield[% subfield_loo.tag %][% subfield_loo.subfield %][% subfield_loo.random %]')" alt="Move Up" title="Move Up" />
528
                    [% ELSE %]
529
                        <img class="buttonUp" src="[% interface %]/[% theme %]/img/up.png" onclick="upSubfield('subfield[% subfield_loo.tag %][% subfield_loo.subfield %][% subfield_loo.random %]')" alt="Move Up" title="Move Up" />
530
                    [% END %]
531
                        <input type="text"
532
                            title="[% subfield_loo.marc_lib %]"
533
                            style=" [% IF ( subfield_loo.fixedfield ) %]display:none; [% END %]border:0;"
534
                            name="tag_[% subfield_loo.tag %]_code_[% subfield_loo.subfield %]_[% subfield_loo.index %]_[% subfield_loo.index_subfield %]"
535
                            value="[% subfield_loo.subfield %]"
536
                            size="1"
537
                            maxlength="1"
538
                            class="flat"
539
                            tabindex="0" />
540
                </span>
541
542
                [% UNLESS advancedMARCEditor %]
543
                    [% IF ( subfield_loo.mandatory ) %]<span class="subfield subfield_mandatory">[% ELSE %]<span class="subfield">[% END %]
544
                        [% subfield_loo.marc_lib %]
545
                        [% IF ( subfield_loo.mandatory ) %]<span class="mandatory_marker" title="This field is mandatory">*</span>[% END %]
546
                    </span>
547
                    </label>
548
                [% END %]
549
550
                [% SET mv = subfield_loo.marc_value %]
551
                [% IF ( mv.type == 'text' ) %]
552
                    [% IF ( mv.readonly == 1 ) %]
553
                    <input type="text" id="[%- mv.id -%]" name="[%- mv.name -%]" value="[%- mv.value -%]" class="input_marceditor readonly" tabindex="1" size="[%- mv.size -%]" maxlength="[%- mv.maxlength -%]" readonly="readonly" />
554
                    [% ELSE %]
555
                    <input type="text" id="[%- mv.id -%]" name="[%- mv.name -%]" value="[%- mv.value -%]" class="input_marceditor" tabindex="1" size="[%- mv.size -%]" maxlength="[%- mv.maxlength -%]" />
556
                    [% END %]
557
                    [% IF ( mv.authtype ) %]
558
                    <span class="subfield_controls"><a href="#" class="buttonDot tag_editor" onclick="openAuth(this.parentNode.parentNode.getElementsByTagName('input')[1].id,'[%- mv.authtype -%]','holding'); return false;" tabindex="1" title="Tag editor">Tag editor</a></span>
559
                    [% END %]
560
                [% ELSIF ( mv.type == 'text_complex' ) %]
561
                    <input type="text" id="[%- mv.id -%]" name="[%- mv.name -%]" value="[%- mv.value -%]" class="input_marceditor framework_plugin" tabindex="1" size="[%- mv.size -%]" maxlength="[%- mv.maxlength -%]" />
562
                    <span class="subfield_controls">
563
                        [% IF mv.noclick %]
564
                            <a href="#" class="buttonDot tag_editor disabled" tabindex="-1" title="No popup"></a>
565
                        [% ELSE %]
566
                            <a href="#" id="buttonDot_[% mv.id %]" class="buttonDot tag_editor framework_plugin" tabindex="1" title="Tag editor">Tag editor</a>
567
                        [% END %]
568
                    </span>
569
                    [% mv.javascript %]
570
                [% ELSIF ( mv.type == 'hidden' ) %]
571
                    <input tabindex="1" type="hidden" id="[%- mv.id -%]" name="[%- mv.name -%]" size="[%- mv.size -%]" maxlength="[%- mv.maxlength -%]" value="[%- mv.value -%]" />
572
                [% ELSIF ( mv.type == 'textarea' ) %]
573
                    <textarea cols="70" rows="4" id="[%- mv.id -%]" name="[%- mv.name -%]" class="input_marceditor" tabindex="1">[%- mv.value -%]</textarea>
574
                [% ELSIF ( mv.type == 'select' ) %]
575
                    <select name="[%- mv.name -%]" tabindex="1" size="1" class="input_marceditor" id="[%- mv.id -%]">
576
                    [% FOREACH aval IN mv.values %]
577
                        [% IF aval == mv.default %]
578
                        <option value="[%- aval -%]" selected="selected">[%- mv.labels.$aval -%]</option>
579
                        [% ELSE %]
580
                        <option value="[%- aval -%]">[%- mv.labels.$aval -%]</option>
581
                        [% END %]
582
                    [% END %]
583
                    </select>
584
                [% END %]
585
586
                <span class="subfield_controls">
587
                [% IF ( subfield_loo.repeatable ) %]
588
                    <a href="#" class="buttonPlus" tabindex="1" onclick="CloneSubfield('subfield[% subfield_loo.tag %][% subfield_loo.subfield %][% subfield_loo.random %]','[% advancedMARCEditor %]'); return false;">
589
                        <img src="[% interface %]/[% theme %]/img/clone-subfield.png" alt="Clone" title="Clone this subfield" />
590
                    </a>
591
                    <a href="#" class="buttonMinus" tabindex="1" onclick="UnCloneField('subfield[% subfield_loo.tag %][% subfield_loo.subfield %][% subfield_loo.random %]'); return false;">
592
                        <img src="[% interface %]/[% theme %]/img/delete-subfield.png" alt="Delete" title="Delete this subfield" />
593
                    </a>
594
                [% END %]
595
                </span>
596
597
            </div>
598
            <!-- End of the line -->
599
        [% END %]
600
601
    </div>
602
    [% END %]<!-- if innerloo.tag -->
603
    [% END %]<!-- BIG_LOO.innerloop -->
604
    </div>
605
[% END %]<!-- BIG_LOOP -->
606
607
</div><!-- tabs -->
608
609
</form>
610
611
</div>
612
</div>
613
</div>
614
615
[% 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
[% INCLUDE 'doc-head-open.inc' %]
2
<title>Koha &rsaquo; Holdings &rsaquo; 008 builder</title>
3
[% INCLUDE 'doc-head-close.inc' %]
4
</head>
5
<body id="cat_marc21_field_008_holdings" class="cat" style="padding:1em;">
6
<h3> 008 Fixed-length data elements</h3>
7
<form name="f_pop" onsubmit="report()" action="">
8
<input type="hidden" name="plugin_name" value="marc21_field_008_holdings.pl" />
9
<input name="f1" value="[% f1 %]" type="hidden" />
10
<table>
11
	<tr>
12
		<td>00-05 - Date entered on file</td>
13
		<td>[% f1 %]</td>
14
	</tr>
15
	<tr>
16
		<td><label for="f6">06 - Receipt or acquisition status</label></td>
17
		<td>
18
			<select name="f6" id="f6" size="1">
19
                <option value="0"[% IF ( f60 ) %] selected="selected"[% END %]>0 - Unknown</option>
20
                <option value="1"[% IF ( f61 ) %] selected="selected"[% END %]>1 - Other receipt or acquisition status</option>
21
                <option value="2"[% IF ( f62 ) %] selected="selected"[% END %]>2 - Received and complete or ceased</option>
22
                <option value="3"[% IF ( f63 ) %] selected="selected"[% END %]>3 - On order</option>
23
                <option value="4"[% IF ( f64 ) %] selected="selected"[% END %]>4 - Currently received</option>
24
                <option value="5"[% IF ( f65 ) %] selected="selected"[% END %]>5 - Not currently received</option>
25
			</select>
26
		</td>
27
	</tr>
28
    <tr>
29
        <td><label for="f7">07 - Method of acquisition</label></td>
30
        <td>
31
            <select name="f7" id="f7" size="1">
32
                <option value="c"[% IF ( f7c ) %] selected="selected"[% END %]>c - Cooperative or consortial purchase</option>
33
                <option value="d"[% IF ( f7d ) %] selected="selected"[% END %]>d - Deposit</option>
34
                <option value="e"[% IF ( f7e ) %] selected="selected"[% END %]>e - Exchange</option>
35
                <option value="f"[% IF ( f7f ) %] selected="selected"[% END %]>f - Free</option>
36
                <option value="g"[% IF ( f7g ) %] selected="selected"[% END %]>g - Gift</option>
37
                <option value="l"[% IF ( f7l ) %] selected="selected"[% END %]>l - Legal deposit</option>
38
                <option value="m"[% IF ( f7m ) %] selected="selected"[% END %]>m - Membership</option>
39
                <option value="n"[% IF ( f7n ) %] selected="selected"[% END %]>n - Non-library purchase</option>
40
                <option value="p"[% IF ( f7p ) %] selected="selected"[% END %]>p - Purchase</option>
41
                <option value="q"[% IF ( f7q ) %] selected="selected"[% END %]>q - Lease</option>
42
                <option value="u"[% IF ( f7u ) %] selected="selected"[% END %]>u - Unknown</option>
43
                <option value="z"[% IF ( f7z ) %] selected="selected"[% END %]>z - Other method of acquisition</option>
44
            </select>
45
        </td>
46
    </tr>
47
	<tr>
48
		<td><label for="f8">08-11 - Expected acquisition end date</label></td>
49
		<td><input type="text" name="f8" id="f8" maxlength="4" size="5" value="[% f8 %]" /></td>
50
	</tr>
51
    <tr>
52
        <td><label for="f12">12- General retention policy</label></td>
53
        <td>
54
            <select name="f12" id="f12" size="1">
55
                <option value="0"[% IF ( f120 ) %] selected="selected"[% END %]>0 - Unknown</option>
56
                <option value="1"[% IF ( f121 ) %] selected="selected"[% END %]>1 - Other general retention policy</option>
57
                <option value="2"[% IF ( f122 ) %] selected="selected"[% END %]>2 - Retained except as replaced by updates</option>
58
                <option value="3"[% IF ( f123 ) %] selected="selected"[% END %]>3 - Sample issue retained</option>
59
                <option value="4"[% IF ( f124 ) %] selected="selected"[% END %]>4 - Retained until replaced by microform</option>
60
                <option value="5"[% IF ( f125 ) %] selected="selected"[% END %]>5 - Retained until replaced by cumulation, replacement volume, or revision</option>
61
                <option value="6"[% IF ( f126 ) %] selected="selected"[% END %]>6 - Retained for a limited period</option>
62
                <option value="7"[% IF ( f127 ) %] selected="selected"[% END %]>7 - Not retained</option>
63
                <option value="8"[% IF ( f128 ) %] selected="selected"[% END %]>8 - Permanently retained</option>
64
            </select>
65
        </td>
66
    </tr>
67
    <tr>
68
        <td><label for="f13">13 - Policy type</label></td>
69
        <td>
70
            <select name="f13" id="f13" size="1">
71
                <option value=" "[% IF ( f13 ) %] selected="selected"[% END %]># - No information provided</option>
72
                <option value="l"[% IF ( f13l ) %] selected="selected"[% END %]>l - Latest</option>
73
                <option value="p"[% IF ( f13p ) %] selected="selected"[% END %]>p - Previous</option>
74
            </select>
75
        </td>
76
    </tr>
77
    <tr>
78
        <td><label for="f14">14 - Number of units</label></td>
79
        <td>
80
            <select name="f14" id="f14" size="1">
81
                <option value=" "[% IF ( f14 ) %] selected="selected"[% END %]># - No information provided</option>
82
                <option value="1"[% IF ( f141 ) %] selected="selected"[% END %]>1</option>
83
                <option value="2"[% IF ( f142 ) %] selected="selected"[% END %]>2</option>
84
                <option value="3"[% IF ( f143 ) %] selected="selected"[% END %]>3</option>
85
                <option value="4"[% IF ( f144 ) %] selected="selected"[% END %]>4</option>
86
                <option value="5"[% IF ( f145 ) %] selected="selected"[% END %]>5</option>
87
                <option value="6"[% IF ( f146 ) %] selected="selected"[% END %]>6</option>
88
                <option value="7"[% IF ( f147 ) %] selected="selected"[% END %]>7</option>
89
                <option value="8"[% IF ( f148 ) %] selected="selected"[% END %]>8</option>
90
                <option value="9"[% IF ( f149 ) %] selected="selected"[% END %]>9 </option>
91
            </select>
92
        </td>
93
    </tr>
94
    <tr>
95
        <td><label for="f15">15 - Unit type</label></td>
96
        <td>
97
            <select name="f15" id="f15" size="1">
98
                <option value=" "[% IF ( f15 ) %] selected="selected"[% END %]># - No information provided</option>
99
                <option value="m"[% IF ( f15m ) %] selected="selected"[% END %]>m - Month(s)</option>
100
                <option value="w"[% IF ( f15w ) %] selected="selected"[% END %]>w - Week(s)</option>
101
                <option value="y"[% IF ( f15y ) %] selected="selected"[% END %]>y - Year(s)</option>
102
                <option value="e"[% IF ( f15e ) %] selected="selected"[% END %]>e - Edition(s)</option>
103
                <option value="i"[% IF ( f15i ) %] selected="selected"[% END %]>i - Issue(s)</option>
104
                <option value="s"[% IF ( f15s ) %] selected="selected"[% END %]>s - Supplement(s)</option>
105
            </select>
106
        </td>
107
    </tr>
108
    <tr>
109
        <td><label for="f16">16 - Completeness</label></td>
110
        <td>
111
            <select name="f16" id="f16" size="1">
112
                <option value="0"[% IF ( f160 ) %] selected="selected"[% END %]>0 - Other</option>
113
                <option value="1"[% IF ( f161 ) %] selected="selected"[% END %]>1 - Complete</option>
114
                <option value="2"[% IF ( f162 ) %] selected="selected"[% END %]>2 - Incomplete</option>
115
                <option value="3"[% IF ( f163 ) %] selected="selected"[% END %]>3 - Scattered</option>
116
                <option value="4"[% IF ( f164 ) %] selected="selected"[% END %]>4 - Not applicable</option>
117
            </select>
118
        </td>
119
    </tr>
120
	<tr>
121
		<td><label for="f17">17-19 - Number of copies reported</label></td>
122
		<td><input type="text" name="f17" id="f17" maxlength="3" size="4" value="[% f17 %]" /></td>
123
	</tr>
124
    <tr>
125
        <td><label for="f20">20 - Lending policy</label></td>
126
        <td>
127
            <select name="f20" id="f20" size="1">
128
                <option value="a"[% IF ( f20a ) %] selected="selected"[% END %]>a - Will lend</option>
129
                <option value="b"[% IF ( f20b ) %] selected="selected"[% END %]>b - Will not lend</option>
130
                <option value="c"[% IF ( f20c ) %] selected="selected"[% END %]>c - Will lend hard copy only</option>
131
                <option value="l"[% IF ( f20l ) %] selected="selected"[% END %]>l - Limited lending policy</option>
132
                <option value="u"[% IF ( f20u ) %] selected="selected"[% END %]>u - Unknown</option>
133
            </select>
134
        </td>
135
    </tr>
136
    <tr>
137
        <td><label for="f21">21 - Reproduction policy</label></td>
138
        <td>
139
            <select name="f21" id="f21" size="1">
140
                <option value="a"[% IF ( f21a ) %] selected="selected"[% END %]>a - Will reproduce</option>
141
                <option value="b"[% IF ( f21b ) %] selected="selected"[% END %]>b - Will not reproduce</option>
142
                <option value="u"[% IF ( f21u ) %] selected="selected"[% END %]>u - Unknown</option>
143
            </select>
144
        </td>
145
    </tr>
146
	<tr>
147
		<td><label for="f22">22-24 - Language</label></td>
148
		<td><input type="text" name="f22" id="f22" maxlength="3" size="4" value="[% f22 %]" /></td>
149
	</tr>
150
    <tr>
151
        <td><label for="f25">25 - Separate or composite copy report</label></td>
152
        <td>
153
            <select name="f25" id="f25" size="1">
154
                <option value="0"[% IF ( f250 ) %] selected="selected"[% END %]>0 - Separate copy report</option>
155
                <option value="1"[% IF ( f251 ) %] selected="selected"[% END %]>1 - Composite copy report</option>
156
            </select>
157
        </td>
158
    </tr>
159
	<tr>
160
		<td><label for="f26">26-31 - Date of report</label></td>
161
		<td><input type="text" name="f26" id="f26" maxlength="6" size="7" value="[% f26 %]" /></td>
162
	</tr>
163
</table>
164
<fieldset class="action"><input type="submit" value="OK" /> <a href="#" class="cancel close">Cancel</a></fieldset>
165
</form>
166
<script type="text/javascript">//<![CDATA[
167
function report() {
168
            var doc   = opener.document;
169
            var field = doc.getElementById("[% index %]");
170
171
            field.value =
172
			document.f_pop.f1.value+
173
			document.f_pop.f6.value+
174
			document.f_pop.f7.value+
175
			(document.f_pop.f8.value + '    ').substr(0, 4)+
176
			document.f_pop.f12.value+
177
			document.f_pop.f13.value+
178
			document.f_pop.f14.value+
179
			document.f_pop.f15.value+
180
			document.f_pop.f16.value+
181
			(document.f_pop.f17.value + '   ').substr(0, 3)+
182
			document.f_pop.f20.value+
183
			document.f_pop.f21.value+
184
			(document.f_pop.f22.value + '   ').substr(0, 3)+
185
			document.f_pop.f25.value+
186
			document.f_pop.f26.value;
187
		self.close();
188
		return false;
189
	}
190
	//]]>
191
</script>
192
193
[% INCLUDE 'popup-bottom.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_leader_holdings.tt (+105 lines)
Line 0 Link Here
1
[% INCLUDE 'doc-head-open.inc' %]
2
<title>Koha &rsaquo; Holdings &rsaquo; 000 - Leader builder</title>
3
[% INCLUDE 'doc-head-close.inc' %]
4
</head>
5
<body id="cat_marc21_leader_holdings" class="cat" style="padding:1em;">
6
<form name="f_pop" onsubmit="report()" action="">
7
<input type="hidden" name="plugin_name" value="marc21_leader_holdings.pl" />
8
<h3>000 - Leader</h3>
9
<table>
10
	<tr>
11
        <td><span class="label">0-4 Record size</span></td>
12
		<td>(auto-filled)</td>
13
	</tr>
14
	<tr>
15
		<td><label for="f5">5 - Record status</label></td>
16
		<td>
17
			<select name="f5" id="f5" size="1">
18
				<option value="c"[% IF ( f5c ) %] selected="selected"[% END %]>c - Corrected or revised</option>
19
				<option value="d"[% IF ( f5d ) %] selected="selected"[% END %]>d - Deleted</option>
20
				<option value="n"[% IF ( f5n ) %] selected="selected"[% END %]>n - New</option>
21
			</select>
22
		</td>
23
	</tr>
24
	<tr>
25
		<td><label for="f6">6 - Type of record</label></td>
26
		<td>
27
			<select name="f6" id="f6" size="1">
28
				<option value="u"[% IF ( f6u ) %] selected="selected"[% END %]>u - Unknown</option>
29
				<option value="v"[% IF ( f6v ) %] selected="selected"[% END %]>v - Multipart item holdings</option>
30
				<option value="x"[% IF ( f6x ) %] selected="selected"[% END %]>x - Single-part item holdings</option>
31
				<option value="y"[% IF ( f6y ) %] selected="selected"[% END %]>y - Serial item holdings</option>
32
			</select>
33
		</td>
34
	</tr>
35
    <tr>
36
        <tr>07-08 - Undefined</tr>
37
        <tr>  </tr>
38
    </tr>
39
	<tr>
40
		<td>9 - Character coding scheme</td>
41
		<td>a - UCS/Unicode (auto-filled)</td>
42
	</tr>
43
	<tr>
44
		<td>10-16 - indicator/subfields/size</td>
45
		<td>(auto-filled)</td>
46
    </tr>
47
	<tr>
48
		<td><label for="f17">17 - Encoding level</label></td>
49
		<td>
50
			<select name="f17" id="f17" size="1">
51
                <option value="1"[% IF ( f171 ) %] selected="selected"[% END %]>1 - Holdings level 1</option>
52
                <option value="2"[% IF ( f172 ) %] selected="selected"[% END %]>2 - Holdings level 2</option>
53
                <option value="3"[% IF ( f173 ) %] selected="selected"[% END %]>3 - Holdings level 3</option>
54
                <option value="4"[% IF ( f174 ) %] selected="selected"[% END %]>4 - Holdings level 4</option>
55
                <option value="5"[% IF ( f175 ) %] selected="selected"[% END %]>5 - Holdings level 4 with piece designation</option>
56
                <option value="m"[% IF ( f17m ) %] selected="selected"[% END %]>m - Mixed level</option>
57
                <option value="u"[% IF ( f17u ) %] selected="selected"[% END %]>u - Unknown</option>
58
                <option value="z"[% IF ( f17z ) %] selected="selected"[% END %]>z - Other level</option>
59
			</select>
60
		</td>
61
	</tr>
62
	<tr>
63
		<td><label for="f18">18 - Item information in record</label></td>
64
		<td>
65
			<select name="f18" id="f18" size="1">
66
                <option value="i"[% IF ( f18i ) %] selected="selected"[% END %]>i - Item information</option>
67
                <option value="n"[% IF ( f18n ) %] selected="selected"[% END %]>n - No item information</option>
68
			</select>
69
		</td>
70
	</tr>
71
	<tr>
72
		<td>19 - Undefined</td>
73
		<td></td>
74
    </tr>
75
	<tr>
76
		<td>20-24 - entry map &amp; lengths</td>
77
		<td>(auto-filled)</td>
78
	</tr>
79
80
</table>
81
<fieldset class="action"><input type="submit" value="OK" /> <a href="#" class="cancel close">Cancel</a></fieldset>
82
</form>
83
<script type="text/javascript">
84
//<![CDATA[
85
function report() {
86
            var doc   = opener.document;
87
            var field = doc.getElementById("[% index %]");
88
89
            field.value =
90
			'     '+
91
			document.f_pop.f5.value+
92
			document.f_pop.f6.value+
93
			'  '+
94
			'a'+ // MARC21 UNICODE flag - must be 'a' for Koha
95
			'22     '+
96
			document.f_pop.f17.value+
97
			document.f_pop.f18.value+
98
			' '+
99
			'4500';
100
		self.close();
101
		return false;
102
	}
103
	//]]>
104
</script>
105
[% INCLUDE 'popup-bottom.inc' %]
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt (+28 lines)
Lines 5-10 Link Here
5
[% USE Branches %]
5
[% USE Branches %]
6
[% USE ColumnsSettings %]
6
[% USE ColumnsSettings %]
7
[% USE AuthorisedValues %]
7
[% USE AuthorisedValues %]
8
[% USE Holdings %]
8
[% SET TagsShowEnabled = ( ( Koha.Preference( 'TagsEnabled' ) == 1 ) && TagsShowOnDetail ) %]
9
[% SET TagsShowEnabled = ( ( Koha.Preference( 'TagsEnabled' ) == 1 ) && TagsShowOnDetail ) %]
9
[% SET TagsInputEnabled = ( ( Koha.Preference( 'opacuserlogin' ) == 1 ) && ( Koha.Preference( 'TagsEnabled' ) == 1 ) && TagsInputOnDetail ) %]
10
[% SET TagsInputEnabled = ( ( Koha.Preference( 'opacuserlogin' ) == 1 ) && ( Koha.Preference( 'TagsEnabled' ) == 1 ) && TagsInputOnDetail ) %]
10
[% IF Koha.Preference('AmazonAssocTag') %]
11
[% IF Koha.Preference('AmazonAssocTag') %]
Lines 699-704 Link Here
699
                                [% END %]
700
                                [% END %]
700
                            [% END %]
701
                            [% END %]
701
                        [% END # IF itemloop.size %]
702
                        [% END # IF itemloop.size %]
703
                        [% IF summary_holdings %]
704
                            [% FOREACH holding IN summary_holdings %]
705
                                [% UNLESS holding.suppress %]
706
                                    [% holding_details = Holdings.GetDetails(holding) %]
707
                                    [% IF holding_details.public_note || holding_details.summary || holding_details.supplements || holding_details.indexes %]
708
                                        <span class="summary-holdings">
709
                                            <br>
710
                                            <strong>Additional information for [% Holdings.GetLocation(holding, 1) | html %]</strong>
711
                                            <ul>
712
                                                [% IF holding_details.public_note %]
713
                                                    <li>Public note: [% holding_details.public_note | html %]</li>
714
                                                [% END %]
715
                                                [% IF holding_details.summary %]
716
                                                    <li>Summary: [% holding_details.summary | html %]</li>
717
                                                [% END %]
718
                                                [% IF holding_details.supplements %]
719
                                                    <li>Supplements: [% holding_details.supplements | html %]</li>
720
                                                [% END %]
721
                                                [% IF holding_details.indexes %]
722
                                                    <li>Indexes: [% holding_details.indexes | html %]</li>
723
                                                [% END %]
724
                                            </ul>
725
                                        </span>
726
                                    [% END %]
727
                                [% END %]
728
                            [% END %]
729
                        [% END %]
702
                        [% PROCESS 'shelfbrowser.inc' %]
730
                        [% PROCESS 'shelfbrowser.inc' %]
703
                        [% INCLUDE shelfbrowser tab='holdings' %]
731
                        [% INCLUDE shelfbrowser tab='holdings' %]
704
                        <br style="clear:both;" />
732
                        <br style="clear:both;" />
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt (+10 lines)
Lines 1-5 Link Here
1
[% USE Asset %]
1
[% USE Asset %]
2
[% USE Koha %]
2
[% USE Koha %]
3
[% USE Holdings %]
3
[% SET TagsShowEnabled = ( ( Koha.Preference( 'TagsEnabled' ) == 1 ) && TagsShowOnList ) %]
4
[% SET TagsShowEnabled = ( ( Koha.Preference( 'TagsEnabled' ) == 1 ) && TagsShowOnList ) %]
4
[% SET TagsInputEnabled = ( ( Koha.Preference( 'opacuserlogin' ) == 1 ) && ( Koha.Preference( 'TagsEnabled' ) == 1 ) && TagsInputOnList ) %]
5
[% SET TagsInputEnabled = ( ( Koha.Preference( 'opacuserlogin' ) == 1 ) && ( Koha.Preference( 'TagsEnabled' ) == 1 ) && TagsInputOnList ) %]
5
6
Lines 401-406 Link Here
401
                                                                    [% END %]
402
                                                                    [% END %]
402
                                                                [% ELSE %]
403
                                                                [% ELSE %]
403
                                                                    <span class="unavailable">No items available:</span>
404
                                                                    <span class="unavailable">No items available:</span>
405
                                                                    [% IF ( SEARCH_RESULT.summary_holdings ) %]
406
                                                                        <span class="summary-holdings">
407
                                                                            [% FOREACH holding IN SEARCH_RESULT.summary_holdings %]
408
                                                                                [% UNLESS holding.suppress %]
409
                                                                                    [% Holdings.GetLocation(holding, 1) | html %],
410
                                                                                [% END %]
411
                                                                            [% END %]
412
                                                                        </span>
413
                                                                    [% END %]
404
                                                                [% END %]
414
                                                                [% END %]
405
                                                            [% END # / IF SEARCH_RESULT.available_items_loop.size %]
415
                                                            [% END # / IF SEARCH_RESULT.available_items_loop.size %]
406
416
(-)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 1159-1165 Link Here
1159
                            </xsl:for-each>
1160
                            </xsl:for-each>
1160
                            (<xsl:value-of select="$AlternateHoldingsCount"/>)
1161
                            (<xsl:value-of select="$AlternateHoldingsCount"/>)
1161
                            </xsl:when>
1162
                            </xsl:when>
1162
                            <xsl:otherwise>No items available </xsl:otherwise>
1163
                            <xsl:otherwise>
1164
                                <xsl:text>No items available</xsl:text>
1165
                                <xsl:if test="//holdings:holdings/holdings:holding/holdings:suppress[.='0']">:
1166
                                    <xsl:for-each select="//holdings:holdings/holdings:holding[./holdings:suppress='0']">
1167
                                        <xsl:if test="position() > 1">, </xsl:if>
1168
                                        <xsl:value-of select="./holdings:holdingbranch"/>
1169
                                        <xsl:if test="string-length(./holdings:location) > 0">
1170
                                        - <xsl:value-of select="./holdings:location"/>
1171
                                        </xsl:if>
1172
                                        <xsl:if test="string-length(./holdings:callnumber) > 0">
1173
                                        - <xsl:value-of select="./holdings:callnumber"/>
1174
                                        </xsl:if>
1175
                                    </xsl:for-each>
1176
                                </xsl:if>
1177
                            </xsl:otherwise>
1163
                        </xsl:choose>
1178
                        </xsl:choose>
1164
				   </xsl:when>
1179
				   </xsl:when>
1165
                   <xsl:when test="count(key('item-by-status', 'available'))>0">
1180
                   <xsl:when test="count(key('item-by-status', 'available'))>0">
(-)a/opac/opac-detail.pl (-1 / +7 lines)
Lines 734-739 if (scalar(@itemloop) == 0 || scalar(@otheritemloop) == 0) { Link Here
734
    }
734
    }
735
}
735
}
736
736
737
# Fetch summary holdings
738
if (C4::Context->preference('SummaryHoldings')) {
739
    my $summary_holdings = C4::Holdings::GetHoldingsByBiblionumber($biblionumber);
740
    $template->param( summary_holdings => $summary_holdings );
741
}
742
743
737
## get notes and subjects from MARC record
744
## get notes and subjects from MARC record
738
if (!C4::Context->preference("OPACXSLTDetailsDisplay") ) {
745
if (!C4::Context->preference("OPACXSLTDetailsDisplay") ) {
739
    my $marcisbnsarray   = GetMarcISBN    ($record,$marcflavour);
746
    my $marcisbnsarray   = GetMarcISBN    ($record,$marcflavour);
740
- 

Return to bug 20447