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

(-)a/C4/Biblio.pm (+18 lines)
Lines 103-108 use Koha::Authority::Types; Link Here
103
use Koha::Acquisition::Currencies;
103
use Koha::Acquisition::Currencies;
104
use Koha::Biblio::Metadata;
104
use Koha::Biblio::Metadata;
105
use Koha::Biblio::Metadatas;
105
use Koha::Biblio::Metadatas;
106
use Koha::Holdings;
106
use Koha::Holds;
107
use Koha::Holds;
107
use Koha::ItemTypes;
108
use Koha::ItemTypes;
108
use Koha::SearchEngine;
109
use Koha::SearchEngine;
Lines 1559-1564 sub GetAuthorisedValueDesc { Link Here
1559
            return $itemtype ? $itemtype->translated_description : q||;
1560
            return $itemtype ? $itemtype->translated_description : q||;
1560
        }
1561
        }
1561
1562
1563
        #---- holdings
1564
        if ( $tagslib->{$tag}->{$subfield}->{'authorised_value'} eq "holdings" ) {
1565
            my $holding = Koha::Holdings->find( $value );
1566
            if ( $holding ) {
1567
                my @parts;
1568
1569
                push @parts, $value;
1570
                push @parts, $holding->holdingbranch() if $holding->holdingbranch();
1571
                push @parts, $holding->location() if $holding->location();
1572
                push @parts, $holding->ccode() if $holding->ccode();
1573
                push @parts, $holding->callnumber() if $holding->callnumber();
1574
1575
                return join(' ', @parts);
1576
            }
1577
            return q||;
1578
        }
1579
1562
        #---- "true" authorized value
1580
        #---- "true" authorized value
1563
        $category = $tagslib->{$tag}->{$subfield}->{'authorised_value'};
1581
        $category = $tagslib->{$tag}->{$subfield}->{'authorised_value'};
1564
    }
1582
    }
(-)a/C4/Holdings.pm (+759 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 => $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
257
    my $dbh             = C4::Context->dbh;
258
    my $sth             = $dbh->prepare("SELECT * FROM holdings WHERE holding_id = ? AND deleted_on IS NULL");
259
    $sth->execute($holding_id);
260
    if ( my $data = $sth->fetchrow_hashref ) {
261
        return $data;
262
    }
263
    return;
264
}
265
266
=head2 GetHoldingsByBiblionumber
267
268
  GetHoldingsByBiblionumber($biblionumber);
269
270
Returns an arrayref of hashrefs suitable for use in a TMPL_LOOP
271
Called by C<C4::XISBN>
272
273
=cut
274
275
sub GetHoldingsByBiblionumber {
276
    my ( $bib ) = @_;
277
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({
293
      holding_id => 123,
294
      opac => false
295
  });
296
297
Returns MARC::Record representing a holding record, or C<undef> if the
298
record doesn't exist.
299
300
If opac is passed and is 1, the record is filtered as needed.
301
302
=over 4
303
304
=item C<$holding_id>
305
306
the holding_id
307
308
=item C<$opac>
309
310
set to true to make the result suited for OPAC view.
311
312
=back
313
314
=cut
315
316
sub GetMarcHolding {
317
    my ($params) = @_;
318
319
    if (not defined $params) {
320
        carp 'GetMarcHolding called without parameters';
321
        return;
322
    }
323
324
    my $holding_id = $params->{holding_id};
325
    my $opac       = $params->{opac} || 0;
326
327
    if (not defined $holding_id) {
328
        carp 'GetMarcHolding called with undefined holding_id';
329
        return;
330
    }
331
332
    my $marcflavour = C4::Context->preference('marcflavour');
333
334
    my $marcxml = GetXmlHolding( $holding_id );
335
    $marcxml = StripNonXmlChars( $marcxml );
336
    my $frameworkcode = GetHoldingFrameworkCode( $holding_id );
337
    MARC::File::XML->default_record_format( $marcflavour );
338
339
    if ($marcxml) {
340
        my $record = eval {
341
            MARC::Record::new_from_xml( $marcxml, "utf8", $marcflavour );
342
        };
343
        if ($@) { warn " problem with holding $holding_id : $@ \n$marcxml"; }
344
        return unless $record;
345
346
        _koha_marc_update_ids( $record, $frameworkcode, $holding_id );
347
348
        return $record;
349
    }
350
    return;
351
}
352
353
=head2 GetXmlHolding
354
355
  my $marcxml = GetXmlHolding($holding_id);
356
357
Returns holdings_metadata.metadata/marcxml of the holding_id passed in parameter.
358
359
=cut
360
361
sub GetXmlHolding {
362
    my ($holding_id) = @_;
363
    return unless $holding_id;
364
365
    my $marcflavour = C4::Context->preference('marcflavour');
366
    my $sth = C4::Context->dbh->prepare(
367
        q|
368
        SELECT metadata
369
        FROM holdings_metadata
370
        WHERE holding_id=?
371
            AND format='marcxml'
372
            AND marcflavour=?
373
        |
374
    );
375
376
    $sth->execute( $holding_id, $marcflavour );
377
    my ($marcxml) = $sth->fetchrow();
378
    $sth->finish();
379
    return $marcxml;
380
}
381
382
=head2 GetHoldingFrameworkCode
383
384
  $frameworkcode = GetFrameworkCode( $holding_id )
385
386
=cut
387
388
sub GetHoldingFrameworkCode {
389
    my ($holding_id) = @_;
390
    my $sth = C4::Context->dbh->prepare("SELECT frameworkcode FROM holdings WHERE holding_id=?");
391
    $sth->execute($holding_id);
392
    my ($frameworkcode) = $sth->fetchrow;
393
    $sth->finish();
394
    return $frameworkcode;
395
}
396
397
=head1 INTERNAL FUNCTIONS
398
399
=head2 _koha_add_holding
400
401
  my ($holding_id,$error) = _koha_add_hodings($dbh, $holding, $frameworkcode, $biblionumber, $biblioitemnumber);
402
403
Internal function to add a holding ($holding is a hash with the values)
404
405
=cut
406
407
sub _koha_add_holding {
408
    my ( $dbh, $holding, $frameworkcode, $biblionumber, $biblioitemnumber ) = @_;
409
410
    my $error;
411
412
    my $query = "INSERT INTO holdings
413
        SET biblionumber = ?,
414
            biblioitemnumber = ?,
415
            frameworkcode = ?,
416
            holdingbranch = ?,
417
            location = ?,
418
            ccode = ?,
419
            callnumber = ?,
420
            suppress = ?,
421
            datecreated = NOW()
422
        ";
423
424
    my $sth = $dbh->prepare($query);
425
    $sth->execute(
426
        $biblionumber, $biblioitemnumber, $frameworkcode,
427
        $holding->{holdingbranch}, $holding->{location}, $holding->{ccode}, $holding->{callnumber}, $holding->{suppress} ? 1 : 0
428
    );
429
430
    my $holding_id = $dbh->{'mysql_insertid'};
431
    if ( $dbh->errstr ) {
432
        $error .= "ERROR in _koha_add_holding $query" . $dbh->errstr;
433
        warn $error;
434
    }
435
436
    $sth->finish();
437
438
    return ( $holding_id, $error );
439
}
440
441
=head2 _koha_modify_holding
442
443
  my ($biblionumber,$error) == _koha_modify_holding($dbh, $holding, $frameworkcode);
444
445
Internal function for updating the holdings table
446
447
=cut
448
449
sub _koha_modify_holding {
450
    my ( $dbh, $holding_id, $holding, $frameworkcode ) = @_;
451
    my $error;
452
453
    my $query = "
454
        UPDATE holdings
455
        SET    frameworkcode = ?,
456
               holdingbranch = ?,
457
               location = ?,
458
               ccode = ?,
459
               callnumber = ?,
460
               suppress = ?
461
        WHERE  holding_id = ?
462
        "
463
      ;
464
    my $sth = $dbh->prepare($query);
465
466
    $sth->execute(
467
        $frameworkcode, $holding->{holdingbranch}, $holding->{location}, $holding->{ccode}, $holding->{callnumber},
468
        $holding->{suppress} ? 1 : 0, $holding_id
469
    ) if $holding_id;
470
471
    if ( $dbh->errstr || !$holding_id ) {
472
        die "ERROR in _koha_modify_holding for holding $holding_id: " . $dbh->errstr;
473
    }
474
    return ( $holding_id, $error );
475
}
476
477
=head2 _koha_delete_holding
478
479
  $error = _koha_delete_holding($dbh, $holding_id);
480
481
Internal sub for deleting from holdings table
482
483
C<$dbh> - the database handle
484
485
C<$holding_id> - the holding_id of the holding to be deleted
486
487
=cut
488
489
sub _koha_delete_holding {
490
    my ( $dbh, $holding_id ) = @_;
491
492
    my $schema = Koha::Database->new->schema;
493
    $schema->txn_do(
494
        sub {
495
            $dbh->do('UPDATE holdings_metadata SET deleted_on = NOW() WHERE holding_id=?', undef, $holding_id);
496
            $dbh->do('UPDATE holdings SET deleted_on = NOW() WHERE holding_id=?', undef, $holding_id);
497
        }
498
    );
499
    return;
500
}
501
502
=head1 INTERNAL FUNCTIONS
503
504
=head2 _koha_marc_update_ids
505
506
507
  _koha_marc_update_ids($record, $frameworkcode, $holding_id[, $biblionumber, $biblioitemnumber]);
508
509
Internal function to add or update holding_id, biblionumber and biblioitemnumber to
510
the MARC XML.
511
512
=cut
513
514
sub _koha_marc_update_ids {
515
    my ( $record, $frameworkcode, $holding_id, $biblionumber, $biblioitemnumber ) = @_;
516
517
    my ( $holding_tag, $holding_subfield ) = GetMarcHoldingFromKohaField( "holdings.holding_id" );
518
    die qq{No holding_id tag for framework "$frameworkcode"} unless $holding_tag;
519
520
    if ( $holding_tag < 10 ) {
521
        C4::Biblio::UpsertMarcControlField( $record, $holding_tag, $holding_id );
522
    } else {
523
        C4::Biblio::UpsertMarcSubfield($record, $holding_tag, $holding_subfield, $holding_id);
524
    }
525
526
    if ( defined $biblionumber ) {
527
        my ( $biblio_tag, $biblio_subfield ) = GetMarcHoldingFromKohaField( "biblio.biblionumber" );
528
        die qq{No biblionumber tag for framework "$frameworkcode"} unless $biblio_tag;
529
        if ( $biblio_tag < 10 ) {
530
            C4::Biblio::UpsertMarcControlField( $record, $biblio_tag, $biblionumber );
531
        } else {
532
            C4::Biblio::UpsertMarcSubfield($record, $biblio_tag, $biblio_subfield, $biblionumber);
533
        }
534
    }
535
    if ( defined $biblioitemnumber ) {
536
        my ( $biblioitem_tag, $biblioitem_subfield ) = GetMarcHoldingFromKohaField( "biblioitems.biblioitemnumber" );
537
        die qq{No biblioitemnumber tag for framework "$frameworkcode"} unless $biblioitem_tag;
538
        if ( $biblioitem_tag < 10 ) {
539
            C4::Biblio::UpsertMarcControlField( $record, $biblioitem_tag, $biblioitemnumber );
540
        } else {
541
            C4::Biblio::UpsertMarcSubfield($record, $biblioitem_tag, $biblioitem_subfield, $biblioitemnumber);
542
        }
543
    }
544
}
545
546
=head1 UNEXPORTED FUNCTIONS
547
548
=head2 ModHoldingMarc
549
550
  &ModHoldingMarc($newrec,$holding_id,$frameworkcode);
551
552
Add MARC XML data for a holding to koha
553
554
Function exported, but should NOT be used, unless you really know what you're doing
555
556
=cut
557
558
sub ModHoldingMarc {
559
    # pass the MARC::Record to this function, and it will create the records in
560
    # the marcxml field
561
    my ( $record, $holding_id, $frameworkcode ) = @_;
562
    if ( !$record ) {
563
        carp 'ModHoldingMarc passed an undefined record';
564
        return;
565
    }
566
567
    # Clone record as it gets modified
568
    $record = $record->clone();
569
    my $dbh    = C4::Context->dbh;
570
    my @fields = $record->fields();
571
    if ( !$frameworkcode ) {
572
        $frameworkcode = "";
573
    }
574
    my $sth = $dbh->prepare("UPDATE holdings SET frameworkcode=? WHERE holding_id=?");
575
    $sth->execute( $frameworkcode, $holding_id );
576
    $sth->finish;
577
    my $encoding = C4::Context->preference("marcflavour");
578
579
    # deal with UNIMARC field 100 (encoding) : create it if needed & set encoding to unicode
580
    if ( $encoding eq "UNIMARC" ) {
581
        my $defaultlanguage = C4::Context->preference("UNIMARCField100Language");
582
        $defaultlanguage = "fre" if (!$defaultlanguage || length($defaultlanguage) != 3);
583
        my $string = $record->subfield( 100, "a" );
584
        if ( ($string) && ( length( $record->subfield( 100, "a" ) ) == 36 ) ) {
585
            my $f100 = $record->field(100);
586
            $record->delete_field($f100);
587
        } else {
588
            $string = POSIX::strftime( "%Y%m%d", localtime );
589
            $string =~ s/\-//g;
590
            $string = sprintf( "%-*s", 35, $string );
591
            substr ( $string, 22, 3, $defaultlanguage);
592
        }
593
        substr( $string, 25, 3, "y50" );
594
        unless ( $record->subfield( 100, "a" ) ) {
595
            $record->insert_fields_ordered( MARC::Field->new( 100, "", "", "a" => $string ) );
596
        }
597
    }
598
599
    #enhancement 5374: update transaction date (005) for marc21/unimarc
600
    if($encoding =~ /MARC21|UNIMARC/) {
601
      my @a= (localtime) [5,4,3,2,1,0]; $a[0]+=1900; $a[1]++;
602
        # YY MM DD HH MM SS (update year and month)
603
      my $f005= $record->field('005');
604
      $f005->update(sprintf("%4d%02d%02d%02d%02d%04.1f",@a)) if $f005;
605
    }
606
607
    my $metadata = {
608
        holding_id => $holding_id,
609
        format        => 'marcxml',
610
        marcflavour   => C4::Context->preference('marcflavour'),
611
    };
612
    # FIXME To replace with ->find_or_create?
613
    if ( my $m_rs = Koha::Holdings::Metadatas->find($metadata) ) {
614
        $m_rs->metadata( $record->as_xml_record($encoding) );
615
        $m_rs->store;
616
    } else {
617
        my $m_rs = Koha::Holdings::Metadata->new($metadata);
618
        $m_rs->metadata( $record->as_xml_record($encoding) );
619
        $m_rs->store;
620
    }
621
    return $holding_id;
622
}
623
624
=head2 GetMarcHoldingFromKohaField
625
626
    ( $field,$subfield ) = GetMarcHoldingFromKohaField( $kohafield );
627
    @fields = GetMarcHoldingFromKohaField( $kohafield );
628
    $field = GetMarcHoldingFromKohaField( $kohafield );
629
630
    Returns the MARC fields & subfields mapped to $kohafield.
631
    Uses the HLD framework that is considered as authoritative.
632
633
    In list context all mappings are returned; there can be multiple
634
    mappings. Note that in the above example you could miss a second
635
    mappings in the first call.
636
    In scalar context only the field tag of the first mapping is returned.
637
638
=cut
639
640
sub GetMarcHoldingFromKohaField {
641
    my ( $kohafield ) = @_;
642
643
    return unless $kohafield;
644
    # The next call uses the Default framework since it is AUTHORITATIVE
645
    # for all Koha to MARC mappings.
646
    my $mss = C4::Biblio::GetMarcSubfieldStructure( 'HLD' ); # Do not change framework
647
    my @retval;
648
    foreach( @{ $mss->{$kohafield} } ) {
649
        push @retval, $_->{tagfield}, $_->{tagsubfield};
650
    }
651
    return wantarray ? @retval : ( @retval ? $retval[0] : undef );
652
}
653
654
=head2 GetMarcHoldingSubfieldStructureFromKohaField
655
656
    my $str = GetMarcHoldingSubfieldStructureFromKohaField( $kohafield );
657
658
    Returns marc subfield structure information for $kohafield.
659
    Uses the HLD framework that is considered as authoritative.
660
661
    In list context returns a list of all hashrefs, since there may be
662
    multiple mappings. In scalar context the first hashref is returned.
663
664
=cut
665
666
sub GetMarcHoldingSubfieldStructureFromKohaField {
667
    my ( $kohafield ) = @_;
668
669
    return unless $kohafield;
670
671
    # The next call uses the Default framework since it is AUTHORITATIVE
672
    # for all Koha to MARC mappings.
673
    my $mss = C4::Biblio::GetMarcSubfieldStructure( 'HLD' ); # Do not change framework
674
    return unless $mss->{$kohafield};
675
    return wantarray ? @{$mss->{$kohafield}} : $mss->{$kohafield}->[0];
676
}
677
678
=head2 TransformMarcHoldingToKoha
679
680
    $result = TransformMarcHoldingToKoha( $record, undef )
681
682
Extract data from a MARC holdings record into a hashref representing
683
Koha holdings fields.
684
685
If passed an undefined record will log the error and return an empty
686
hash_ref.
687
688
=cut
689
690
sub TransformMarcHoldingToKoha {
691
    my ( $record ) = @_;
692
693
    my $result = {};
694
    if (!defined $record) {
695
        carp('TransformMarcToKoha called with undefined record');
696
        return $result;
697
    }
698
699
    my %tables = ( holdings => 1 );
700
701
    # The next call acknowledges HLD as the authoritative framework
702
    # for holdings to MARC mappings.
703
    my $mss = C4::Biblio::GetMarcSubfieldStructure( 'HLD' ); # Do not change framework
704
    foreach my $kohafield ( keys %{ $mss } ) {
705
        my ( $table, $column ) = split /[.]/, $kohafield, 2;
706
        next unless $tables{$table};
707
        my $val = TransformMarcHoldingToKohaOneField( $kohafield, $record );
708
        next if !defined $val;
709
        $result->{$column} = $val;
710
    }
711
    return $result;
712
}
713
714
=head2 TransformMarcHoldingToKohaOneField
715
716
    $val = TransformMarcHoldingToKohaOneField( 'biblio.title', $marc );
717
718
    Note: The authoritative Default framework is used implicitly.
719
720
=cut
721
722
sub TransformMarcHoldingToKohaOneField {
723
    my ( $kohafield, $marc ) = @_;
724
725
    my ( @rv, $retval );
726
    my @mss = GetMarcHoldingSubfieldStructureFromKohaField($kohafield);
727
    foreach my $fldhash ( @mss ) {
728
        my $tag = $fldhash->{tagfield};
729
        my $sub = $fldhash->{tagsubfield};
730
        foreach my $fld ( $marc->field($tag) ) {
731
            if( $sub eq '@' || $fld->is_control_field ) {
732
                push @rv, $fld->data if $fld->data;
733
            } else {
734
                push @rv, grep { $_ } $fld->subfield($sub);
735
            }
736
        }
737
    }
738
    return unless @rv;
739
    $retval = join ' | ', uniq(@rv);
740
741
    return $retval;
742
}
743
744
1;
745
746
747
__END__
748
749
=head1 AUTHOR
750
751
Koha Development Team <http://koha-community.org/>
752
753
Paul POULAIN paul.poulain@free.fr
754
755
Joshua Ferraro jmf@liblime.com
756
757
Ere Maijala ere.maijala@helsinki.fi
758
759
=cut
(-)a/C4/Items.pm (-1 / +38 lines)
Lines 464-469 sub _build_default_values_for_mod_marc { Link Here
464
        stocknumber              => undef,
464
        stocknumber              => undef,
465
        uri                      => undef,
465
        uri                      => undef,
466
        withdrawn                => 0,
466
        withdrawn                => 0,
467
        holding_id               => undef,
467
    };
468
    };
468
    my %default_values_for_mod_from_marc;
469
    my %default_values_for_mod_from_marc;
469
    while ( my ( $field, $default_value ) = each %$default_values ) {
470
    while ( my ( $field, $default_value ) = each %$default_values ) {
Lines 1641-1647 sub _koha_new_item { Link Here
1641
            more_subfields_xml  = ?,
1642
            more_subfields_xml  = ?,
1642
            copynumber          = ?,
1643
            copynumber          = ?,
1643
            stocknumber         = ?,
1644
            stocknumber         = ?,
1644
            new_status          = ?
1645
            new_status          = ?,
1646
            holding_id          = ?
1645
          ";
1647
          ";
1646
    my $sth = $dbh->prepare($query);
1648
    my $sth = $dbh->prepare($query);
1647
    my $today = output_pref({ dt => dt_from_string, dateformat => 'iso', dateonly => 1 });
1649
    my $today = output_pref({ dt => dt_from_string, dateformat => 'iso', dateonly => 1 });
Lines 1686-1691 sub _koha_new_item { Link Here
1686
            $item->{'copynumber'},
1688
            $item->{'copynumber'},
1687
            $item->{'stocknumber'},
1689
            $item->{'stocknumber'},
1688
            $item->{'new_status'},
1690
            $item->{'new_status'},
1691
            $item->{'holding_id'},
1689
    );
1692
    );
1690
1693
1691
    my $itemnumber;
1694
    my $itemnumber;
Lines 1725-1730 sub MoveItemFromBiblio { Link Here
1725
            AND biblionumber = ?
1728
            AND biblionumber = ?
1726
    |, undef, $tobiblioitem, $tobiblio, $itemnumber, $frombiblio );
1729
    |, undef, $tobiblioitem, $tobiblio, $itemnumber, $frombiblio );
1727
    if ($return == 1) {
1730
    if ($return == 1) {
1731
        # Check if the moved item is attached to a holdings record
1732
        my $item = GetItem($itemnumber);
1733
        if ($item->{'holding_id'}) {
1734
            use C4::Holdings;
1735
            my $oldHolding = C4::Holdings::GetHolding($item->{'holding_id'});
1736
            if ($oldHolding) {
1737
                # Check if there's a suitable holdings record in the new biblio.
1738
                # This is not perfect, but at least we try.
1739
                use Koha::Holdings;
1740
                my $newHolding = Koha::Holdings->find(
1741
                    {
1742
                        biblionumber     => $tobiblio,
1743
                        biblioitemnumber => $tobiblioitem,
1744
                        frameworkcode    => $oldHolding->{'frameworkcode'},
1745
                        holdingbranch    => $oldHolding->{'holdingbranch'},
1746
                        location         => $oldHolding->{'location'},
1747
                        callnumber       => $oldHolding->{'callnumber'},
1748
                        suppress         => $oldHolding->{'suppress'},
1749
                        deleted_on       => undef
1750
                    }
1751
                );
1752
                if ($newHolding) {
1753
                    $item->{'holding_id'} = $newHolding->holding_id;
1754
                } else {
1755
                    # No existing holdings record, make a copy of the old one.
1756
                    my $oldHoldingMarc = C4::Holdings::GetMarcHolding({ holding_id => $item->{'holding_id'} });
1757
                    $item->{'holding_id'} = C4::Holdings::AddHolding(
1758
                        $oldHoldingMarc, $oldHolding->{'frameworkcode'}, $tobiblio
1759
                    );
1760
                }
1761
                ModItem($item, $tobiblio, $itemnumber);
1762
            }
1763
        }
1764
1728
        ModZebra( $tobiblio, "specialUpdate", "biblioserver" );
1765
        ModZebra( $tobiblio, "specialUpdate", "biblioserver" );
1729
        ModZebra( $frombiblio, "specialUpdate", "biblioserver" );
1766
        ModZebra( $frombiblio, "specialUpdate", "biblioserver" );
1730
	    # Checking if the item we want to move is in an order 
1767
	    # Checking if the item we want to move is in an order 
(-)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 2063-2068 sub searchResults { Link Here
2063
        my $maxitems_pref = C4::Context->preference('maxItemsinSearchResults');
2064
        my $maxitems_pref = C4::Context->preference('maxItemsinSearchResults');
2064
        my $maxitems = $maxitems_pref ? $maxitems_pref - 1 : 1;
2065
        my $maxitems = $maxitems_pref ? $maxitems_pref - 1 : 1;
2065
        my @hiddenitems; # hidden itemnumbers based on OpacHiddenItems syspref
2066
        my @hiddenitems; # hidden itemnumbers based on OpacHiddenItems syspref
2067
        my $summary_holdings;
2066
2068
2067
        # loop through every item
2069
        # loop through every item
2068
        foreach my $field (@fields) {
2070
        foreach my $field (@fields) {
Lines 2246-2251 sub searchResults { Link Here
2246
            push @available_items_loop, $available_items->{$key}
2248
            push @available_items_loop, $available_items->{$key}
2247
        }
2249
        }
2248
2250
2251
        # Fetch summary holdings
2252
        if (C4::Context->preference('SummaryHoldings')) {
2253
            $summary_holdings = C4::Holdings::GetHoldingsByBiblionumber($oldbiblio->{biblionumber});
2254
        }
2255
2249
        # XSLT processing of some stuff
2256
        # XSLT processing of some stuff
2250
        # we fetched the sysprefs already before the loop through all retrieved record!
2257
        # we fetched the sysprefs already before the loop through all retrieved record!
2251
        if (!$scan && $xslfile) {
2258
        if (!$scan && $xslfile) {
Lines 2276-2281 sub searchResults { Link Here
2276
        $oldbiblio->{onholdcount}          = $item_onhold_count;
2283
        $oldbiblio->{onholdcount}          = $item_onhold_count;
2277
        $oldbiblio->{orderedcount}         = $ordered_count;
2284
        $oldbiblio->{orderedcount}         = $ordered_count;
2278
        $oldbiblio->{notforloancount}      = $notforloan_count;
2285
        $oldbiblio->{notforloancount}      = $notforloan_count;
2286
        $oldbiblio->{summary_holdings}     = $summary_holdings;
2279
2287
2280
        if (C4::Context->preference("AlternateHoldingsField") && $items_count == 0) {
2288
        if (C4::Context->preference("AlternateHoldingsField") && $items_count == 0) {
2281
            my $fieldspec = C4::Context->preference("AlternateHoldingsField");
2289
            my $fieldspec = C4::Context->preference("AlternateHoldingsField");
(-)a/C4/XSLT.pm (-1 / +45 lines)
Lines 160-165 sub _get_best_default_xslt_filename { Link Here
160
    return $xslfilename;
160
    return $xslfilename;
161
}
161
}
162
162
163
=head2 get_xslt_sysprefs
164
165
Returns XML for system preferences.
166
167
=cut
168
163
sub get_xslt_sysprefs {
169
sub get_xslt_sysprefs {
164
    my $sysxml = "<sysprefs>\n";
170
    my $sysxml = "<sysprefs>\n";
165
    foreach my $syspref ( qw/ hidelostitems OPACURLOpenInNewWindow
171
    foreach my $syspref ( qw/ hidelostitems OPACURLOpenInNewWindow
Lines 241-249 sub XSLTParse4Display { Link Here
241
    # grab the XML, run it through our stylesheet, push it out to the browser
247
    # grab the XML, run it through our stylesheet, push it out to the browser
242
    my $record = transformMARCXML4XSLT($biblionumber, $orig_record);
248
    my $record = transformMARCXML4XSLT($biblionumber, $orig_record);
243
    my $itemsxml  = buildKohaItemsNamespace($biblionumber, $hidden_items);
249
    my $itemsxml  = buildKohaItemsNamespace($biblionumber, $hidden_items);
250
    my $holdingsxml  = buildKohaHoldingsNamespace($biblionumber);
244
    my $xmlrecord = $record->as_xml(C4::Context->preference('marcflavour'));
251
    my $xmlrecord = $record->as_xml(C4::Context->preference('marcflavour'));
245
252
246
    $xmlrecord =~ s/\<\/record\>/$itemsxml$sysxml\<\/record\>/;
253
    $xmlrecord =~ s/\<\/record\>/$itemsxml$holdingsxml$sysxml\<\/record\>/;
247
    if ($fixamps) { # We need to correct the HTML entities that Zebra outputs
254
    if ($fixamps) { # We need to correct the HTML entities that Zebra outputs
248
        $xmlrecord =~ s/\&amp;amp;/\&amp;/g;
255
        $xmlrecord =~ s/\&amp;amp;/\&amp;/g;
249
        $xmlrecord =~ s/\&amp\;lt\;/\&lt\;/g;
256
        $xmlrecord =~ s/\&amp\;lt\;/\&lt\;/g;
Lines 342-347 sub buildKohaItemsNamespace { Link Here
342
    return $xml;
349
    return $xml;
343
}
350
}
344
351
352
=head2 buildKohaHoldingsNamespace
353
354
Returns XML for holdings records.
355
Is only used in this module currently.
356
357
=cut
358
359
sub buildKohaHoldingsNamespace {
360
    my ($biblionumber) = @_;
361
362
    my $holdings = C4::Holdings::GetHoldingsByBiblionumber( $biblionumber );
363
364
    my $shelflocations =
365
      { map { $_->{authorised_value} => $_->{opac_description} } Koha::AuthorisedValues->get_descriptions_by_koha_field( { frameworkcode => 'HLD', kohafield => 'holdings.location' } ) };
366
367
    my %branches = map { $_->branchcode => $_->branchname } Koha::Libraries->search({}, { order_by => 'branchname' });
368
369
    my $location = "";
370
    my $ccode = "";
371
    my $xml = '';
372
    for my $holding ( @{$holdings} ) {
373
        my $holdingbranch = $holding->{holdingbranch} ? xml_escape($branches{$holding->{holdingbranch}}) : '';
374
        my $location = $holding->{location} ? xml_escape($shelflocations->{$holding->{location}} || $holding->{location}) : '';
375
        my $callnumber = xml_escape($holding->{callnumber});
376
        my $suppress = $holding->{suppress} || '0';
377
        $xml .=
378
            "<holding>"
379
          . "<holdingbranch>$holdingbranch</holdingbranch>"
380
          . "<location>$location</location>"
381
          . "<callnumber>$callnumber</callnumber>"
382
          . "<suppress>$suppress</suppress>"
383
          . "</holding>";
384
    }
385
    $xml = "<holdings xmlns=\"http://www.koha-community.org/holdings\">$xml</holdings>";
386
    return $xml;
387
}
388
345
=head2 engine
389
=head2 engine
346
390
347
Returns reference to XSLT handler object.
391
Returns reference to XSLT handler object.
(-)a/Koha/Holding.pm (+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 (+48 lines)
Line 0 Link Here
1
package Koha::Holdings::Metadata;
2
3
# This file is part of Koha.
4
#
5
# Koha is free software; you can redistribute it and/or modify it under the
6
# terms of the GNU General Public License as published by the Free Software
7
# Foundation; either version 3 of the License, or (at your option) any later
8
# version.
9
#
10
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
11
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
12
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
13
#
14
# You should have received a copy of the GNU General Public License along
15
# with Koha; if not, write to the Free Software Foundation, Inc.,
16
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17
18
use Modern::Perl;
19
20
use Carp;
21
22
use Koha::Database;
23
24
use base qw(Koha::Object);
25
26
=head1 NAME
27
28
Koha::Holdings::Metadata - Koha Holdings Metadata Object class
29
30
=head1 API
31
32
=head2 Internal methods
33
34
=head3 _type
35
36
=cut
37
38
sub _type {
39
    return 'HoldingsMetadata';
40
}
41
42
=head1 AUTHOR
43
44
Ere Maijala ere.maijala@helsinki.fi
45
46
=cut
47
48
1;
(-)a/Koha/Holdings/Metadatas.pm (+58 lines)
Line 0 Link Here
1
package Koha::Holdings::Metadatas;
2
3
# This file is part of Koha.
4
#
5
# Koha is free software; you can redistribute it and/or modify it under the
6
# terms of the GNU General Public License as published by the Free Software
7
# Foundation; either version 3 of the License, or (at your option) any later
8
# version.
9
#
10
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
11
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
12
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
13
#
14
# You should have received a copy of the GNU General Public License along
15
# with Koha; if not, write to the Free Software Foundation, Inc.,
16
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17
18
use Modern::Perl;
19
20
use Carp;
21
22
use Koha::Database;
23
24
use Koha::Holdings::Metadata;
25
26
use base qw(Koha::Objects);
27
28
=head1 NAME
29
30
Koha::Holdings::Metadatas - Koha Holdings Metadata Object set class
31
32
=head1 API
33
34
=head2 Internal methods
35
36
=head3 _type
37
38
=cut
39
40
sub _type {
41
    return 'HoldingsMetadata';
42
}
43
44
=head3 object_class
45
46
=cut
47
48
sub object_class {
49
    return 'Koha::Holdings::Metadata';
50
}
51
52
=head1 AUTHOR
53
54
Ere Maijala ere.maijala@helsinki.fi
55
56
=cut
57
58
1;
(-)a/Koha/Schema/Result/Holding.pm (+250 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 ccode
67
68
  data_type: 'varchar'
69
  is_nullable: 1
70
  size: 80
71
72
=head2 callnumber
73
74
  data_type: 'varchar'
75
  is_nullable: 1
76
  size: 255
77
78
=head2 suppress
79
80
  data_type: 'tinyint'
81
  is_nullable: 1
82
83
=head2 timestamp
84
85
  data_type: 'timestamp'
86
  datetime_undef_if_invalid: 1
87
  default_value: 'current_timestamp()'
88
  is_nullable: 0
89
90
=head2 datecreated
91
92
  data_type: 'date'
93
  datetime_undef_if_invalid: 1
94
  is_nullable: 0
95
96
=head2 deleted_on
97
98
  data_type: 'datetime'
99
  datetime_undef_if_invalid: 1
100
  is_nullable: 1
101
102
=cut
103
104
__PACKAGE__->add_columns(
105
  "holding_id",
106
  { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
107
  "biblionumber",
108
  {
109
    data_type      => "integer",
110
    default_value  => 0,
111
    is_foreign_key => 1,
112
    is_nullable    => 0,
113
  },
114
  "biblioitemnumber",
115
  {
116
    data_type      => "integer",
117
    default_value  => 0,
118
    is_foreign_key => 1,
119
    is_nullable    => 0,
120
  },
121
  "frameworkcode",
122
  { data_type => "varchar", default_value => "", is_nullable => 0, size => 4 },
123
  "holdingbranch",
124
  { data_type => "varchar", is_foreign_key => 1, is_nullable => 1, size => 10 },
125
  "location",
126
  { data_type => "varchar", is_nullable => 1, size => 80 },
127
  "ccode",
128
  { data_type => "varchar", is_nullable => 1, size => 80 },
129
  "callnumber",
130
  { data_type => "varchar", is_nullable => 1, size => 255 },
131
  "suppress",
132
  { data_type => "tinyint", is_nullable => 1 },
133
  "timestamp",
134
  {
135
    data_type => "timestamp",
136
    datetime_undef_if_invalid => 1,
137
    default_value => "current_timestamp()",
138
    is_nullable => 0,
139
  },
140
  "datecreated",
141
  { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 0 },
142
  "deleted_on",
143
  {
144
    data_type => "datetime",
145
    datetime_undef_if_invalid => 1,
146
    is_nullable => 1,
147
  },
148
);
149
150
=head1 PRIMARY KEY
151
152
=over 4
153
154
=item * L</holding_id>
155
156
=back
157
158
=cut
159
160
__PACKAGE__->set_primary_key("holding_id");
161
162
=head1 RELATIONS
163
164
=head2 biblioitemnumber
165
166
Type: belongs_to
167
168
Related object: L<Koha::Schema::Result::Biblioitem>
169
170
=cut
171
172
__PACKAGE__->belongs_to(
173
  "biblioitemnumber",
174
  "Koha::Schema::Result::Biblioitem",
175
  { biblioitemnumber => "biblioitemnumber" },
176
  { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
177
);
178
179
=head2 biblionumber
180
181
Type: belongs_to
182
183
Related object: L<Koha::Schema::Result::Biblio>
184
185
=cut
186
187
__PACKAGE__->belongs_to(
188
  "biblionumber",
189
  "Koha::Schema::Result::Biblio",
190
  { biblionumber => "biblionumber" },
191
  { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
192
);
193
194
=head2 holdingbranch
195
196
Type: belongs_to
197
198
Related object: L<Koha::Schema::Result::Branch>
199
200
=cut
201
202
__PACKAGE__->belongs_to(
203
  "holdingbranch",
204
  "Koha::Schema::Result::Branch",
205
  { branchcode => "holdingbranch" },
206
  {
207
    is_deferrable => 1,
208
    join_type     => "LEFT",
209
    on_delete     => "RESTRICT",
210
    on_update     => "CASCADE",
211
  },
212
);
213
214
=head2 holdings_metadatas
215
216
Type: has_many
217
218
Related object: L<Koha::Schema::Result::HoldingsMetadata>
219
220
=cut
221
222
__PACKAGE__->has_many(
223
  "holdings_metadatas",
224
  "Koha::Schema::Result::HoldingsMetadata",
225
  { "foreign.holding_id" => "self.holding_id" },
226
  { cascade_copy => 0, cascade_delete => 0 },
227
);
228
229
=head2 items
230
231
Type: has_many
232
233
Related object: L<Koha::Schema::Result::Item>
234
235
=cut
236
237
__PACKAGE__->has_many(
238
  "items",
239
  "Koha::Schema::Result::Item",
240
  { "foreign.holding_id" => "self.holding_id" },
241
  { cascade_copy => 0, cascade_delete => 0 },
242
);
243
244
245
# Created by DBIx::Class::Schema::Loader v0.07048 @ 2018-11-27 15:20:47
246
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:PzvRAsqSEGDA5GU+FUJ/4w
247
248
249
# You can replace this text with custom code or comments, and it will be preserved on regeneration
250
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-11-27 15:20:47
134
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:V8R1I3CeEOWP+YO9gUAK3A
135
136
137
# You can replace this text with custom code or comments, and it will be preserved on regeneration
138
1;
(-)a/Koha/Template/Plugin/Holdings.pm (+119 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
=head1 NAME
33
34
Koha::Template::Plugin::Holdings - TT Plugin for holdings
35
36
=head1 SYNOPSIS
37
38
[% USE Holdings %]
39
40
[% Holdings.GetLocation(holding) | html %]
41
42
=head1 ROUTINES
43
44
=head2 GetLocation
45
46
Get a location string for a holdings record
47
48
    [% Holdings.GetLocation(holding) | html %]
49
50
=cut
51
52
sub GetLocation {
53
    my ( $self, $holding ) = @_;
54
    my $opac = shift || 0;
55
56
    if ( !$holding ) {
57
        return '';
58
    }
59
60
    if ( ref($holding) ne 'HASH' ) {
61
        $holding = Koha::Holdings->find( $holding )->unblessed;
62
        if ( !$holding ) {
63
            return '';
64
        }
65
    }
66
67
    my @parts;
68
69
    if ( $opac ) {
70
        if ( $holding->{'holdingbranch'}) {
71
            my $query = "SELECT branchname FROM branches WHERE branchcode = ?";
72
            my $sth   = C4::Context->dbh->prepare( $query );
73
            $sth->execute( $holding->{'holdingbranch'} );
74
            my $b = $sth->fetchrow_hashref();
75
            push @parts, $b->{'branchname'} if $b;
76
            $sth->finish();
77
        }
78
        if ( $holding->{'location'} ) {
79
            my $av = Koha::AuthorisedValues->search({ category => 'LOC', authorised_value => $holding->{'location'} });
80
            push @parts, $av->next->opac_description if $av->count;
81
        }
82
        push @parts, $holding->{'callnumber'} if $holding->{'callnumber'};
83
        return join(' - ', @parts);
84
    }
85
86
    push @parts, $holding->{'holding_id'};
87
    push @parts, $holding->{'holdingbranch'} if $holding->{'holdingbranch'};
88
    push @parts, $holding->{'location'} if $holding->{'location'};
89
    push @parts, $holding->{'ccode'} if $holding->{'ccode'};
90
    push @parts, $holding->{'callnumber'} if $holding->{'callnumber'};
91
    return join(' ', @parts);
92
}
93
94
=head2 GetDetails
95
96
Get the Koha fields for a holdings record
97
98
    [% details = Holdings.GetDetails(holding) %]
99
100
=cut
101
102
sub GetDetails {
103
    my ( $self, $holding ) = @_;
104
    my $opac = shift || 0;
105
106
    if ( !$holding ) {
107
        return '';
108
    }
109
110
    if ( ref($holding) eq 'HASH' ) {
111
        $holding = $holding->{'holding_id'};
112
    }
113
114
    my $marcHolding = C4::Holdings::GetMarcHolding({ holding_id => $holding, opac => $opac });
115
116
    return C4::Holdings::TransformMarcHoldingToKoha( $marcHolding );
117
}
118
119
1;
(-)a/admin/marc_subfields_structure.pl (+5 lines)
Lines 125-130 if ( $op eq 'add_form' ) { Link Here
125
    while ( ( my $field ) = $sth2->fetchrow_array ) {
125
    while ( ( my $field ) = $sth2->fetchrow_array ) {
126
        push @kohafields, "items." . $field;
126
        push @kohafields, "items." . $field;
127
    }
127
    }
128
    $sth2 = $dbh->prepare("SHOW COLUMNS from holdings");
129
    $sth2->execute;
130
    while ( ( my $field ) = $sth2->fetchrow_array ) {
131
        push @kohafields, "holdings." . $field;
132
    }
128
133
129
    # build authorised value list
134
    # build authorised value list
130
    $sth2->finish;
135
    $sth2->finish;
(-)a/catalogue/detail.pl (-5 / +13 lines)
Lines 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 190-195 foreach my $subscription (@subscriptions) { Link Here
190
    push @subs, \%cell;
191
    push @subs, \%cell;
191
}
192
}
192
193
194
# Summary holdings
195
my $summary_holdings;
196
if (C4::Context->preference('SummaryHoldings')) {
197
    $summary_holdings = C4::Holdings::GetHoldingsByBiblionumber($biblionumber);
198
}
193
199
194
# Get acquisition details
200
# Get acquisition details
195
if ( C4::Context->preference('AcquisitionDetails') ) {
201
if ( C4::Context->preference('AcquisitionDetails') ) {
Lines 383-395 $template->param( Link Here
383
    itemdata_copynumber => $itemfields{copynumber},
389
    itemdata_copynumber => $itemfields{copynumber},
384
    itemdata_stocknumber => $itemfields{stocknumber},
390
    itemdata_stocknumber => $itemfields{stocknumber},
385
    volinfo                => $itemfields{enumchron},
391
    volinfo                => $itemfields{enumchron},
386
        itemdata_itemnotes  => $itemfields{itemnotes},
392
    itemdata_itemnotes  => $itemfields{itemnotes},
387
        itemdata_nonpublicnotes => $itemfields{itemnotes_nonpublic},
393
    itemdata_nonpublicnotes => $itemfields{itemnotes_nonpublic},
388
    z3950_search_params    => C4::Search::z3950_search_args($dat),
394
    z3950_search_params    => C4::Search::z3950_search_args($dat),
389
        hostrecords         => $hostrecords,
395
    hostrecords         => $hostrecords,
390
    analytics_flag    => $analytics_flag,
396
    analytics_flag      => $analytics_flag,
391
    C4::Search::enabled_staff_search_views,
397
    C4::Search::enabled_staff_search_views,
392
        materials       => $materials_flag,
398
    materials       => $materials_flag,
399
    show_summary_holdings => C4::Context->preference('SummaryHoldings') ? 1 : 0,
400
    summary_holdings    => $summary_holdings,
393
);
401
);
394
402
395
if (C4::Context->preference("AlternateHoldingsField") && scalar @items == 0) {
403
if (C4::Context->preference("AlternateHoldingsField") && scalar @items == 0) {
(-)a/catalogue/showmarc.pl (-2 / +6 lines)
Lines 32-37 use C4::Context; Link Here
32
use C4::Output;
32
use C4::Output;
33
use C4::Auth;
33
use C4::Auth;
34
use C4::Biblio;
34
use C4::Biblio;
35
use C4::Holdings;
35
use C4::ImportBatch;
36
use C4::ImportBatch;
36
use C4::XSLT ();
37
use C4::XSLT ();
37
38
Lines 50-58 my ( $template, $loggedinuser, $cookie ) = get_template_and_user( Link Here
50
my $biblionumber= $input->param('id');
51
my $biblionumber= $input->param('id');
51
my $importid= $input->param('importid');
52
my $importid= $input->param('importid');
52
my $view= $input->param('viewas')||'';
53
my $view= $input->param('viewas')||'';
54
my $holding_id= $input->param('holding_id')||'';
53
55
54
my $record;
56
my $record;
55
if ($importid) {
57
if ($holding_id) {
58
    $record = C4::Holdings::GetMarcHolding({ holding_id => $holding_id });
59
} elsif ($importid) {
56
    $record = C4::ImportBatch::GetRecordFromImportBiblio( $importid, 'embed_items' );
60
    $record = C4::ImportBatch::GetRecordFromImportBiblio( $importid, 'embed_items' );
57
}
61
}
58
else {
62
else {
Lines 64-70 if(!ref $record) { Link Here
64
}
68
}
65
69
66
if($view eq 'card' || $view eq 'html') {
70
if($view eq 'card' || $view eq 'html') {
67
    my $xml = $importid ? $record->as_xml(): GetXmlBiblio($biblionumber);
71
    my $xml = $record->as_xml();
68
    my $xsl;
72
    my $xsl;
69
    if ( $view eq 'card' ){
73
    if ( $view eq 'card' ){
70
        $xsl = C4::Context->preference('marcflavour') eq 'UNIMARC'
74
        $xsl = C4::Context->preference('marcflavour') eq 'UNIMARC'
(-)a/cataloguing/addholding.pl (+735 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::Biblios;
41
use Koha::BiblioFrameworks;
42
use Koha::DateUtils;
43
use C4::Matcher;
44
45
use Koha::ItemTypes;
46
use Koha::Libraries;
47
48
use Date::Calc qw(Today);
49
use MARC::File::USMARC;
50
use MARC::File::XML;
51
use URI::Escape;
52
53
if ( C4::Context->preference('marcflavour') eq 'UNIMARC' ) {
54
    MARC::File::XML->default_record_format('UNIMARC');
55
}
56
57
our($tagslib,$authorised_values_sth,$is_a_modif,$usedTagsLib,$mandatory_z3950);
58
59
=head1 FUNCTIONS
60
61
=head2 build_authorized_values_list
62
63
=cut
64
65
sub build_authorized_values_list {
66
    my ( $tag, $subfield, $value, $dbh, $authorised_values_sth,$index_tag,$index_subfield ) = @_;
67
68
    my @authorised_values;
69
    my %authorised_lib;
70
71
    # builds list, depending on authorised value...
72
73
    #---- branch
74
    if ( $tagslib->{$tag}->{$subfield}->{'authorised_value'} eq "branches" ) {
75
        my $libraries = Koha::Libraries->search_filtered({}, {order_by => ['branchname']});
76
        while ( my $l = $libraries->next ) {
77
            push @authorised_values, $l->branchcode;
78
            $authorised_lib{$l->branchcode} = $l->branchname;
79
        }
80
    }
81
    elsif ( $tagslib->{$tag}->{$subfield}->{authorised_value} eq "LOC" ) {
82
        push @authorised_values, ""
83
          unless ( $tagslib->{$tag}->{$subfield}->{mandatory}
84
            && ( $value || $tagslib->{$tag}->{$subfield}->{defaultvalue} ) );
85
86
87
        my $branch_limit = C4::Context->userenv ? C4::Context->userenv->{"branch"} : "";
88
        my $avs = Koha::AuthorisedValues->search(
89
            {
90
                branchcode => $branch_limit,
91
                category => $tagslib->{$tag}->{$subfield}->{authorised_value},
92
            },
93
            {
94
                order_by => [ 'category', 'lib', 'lib_opac' ],
95
            }
96
        );
97
98
        while ( my $av = $avs->next ) {
99
            push @authorised_values, $av->authorised_value;
100
            $authorised_lib{$av->authorised_value} = $av->lib;
101
        }
102
    }
103
    elsif ( $tagslib->{$tag}->{$subfield}->{authorised_value} eq "cn_source" ) {
104
        push @authorised_values, ""
105
          unless ( $tagslib->{$tag}->{$subfield}->{mandatory} );
106
107
        my $class_sources = GetClassSources();
108
109
        my $default_source = C4::Context->preference("DefaultClassificationSource");
110
111
        foreach my $class_source (sort keys %$class_sources) {
112
            next unless $class_sources->{$class_source}->{'used'} or
113
                        ($value and $class_source eq $value) or
114
                        ($class_source eq $default_source);
115
            push @authorised_values, $class_source;
116
            $authorised_lib{$class_source} = $class_sources->{$class_source}->{'description'};
117
        }
118
        $value = $default_source unless $value;
119
    }
120
    else {
121
        my $branch_limit = C4::Context->userenv ? C4::Context->userenv->{"branch"} : "";
122
        $authorised_values_sth->execute(
123
            $tagslib->{$tag}->{$subfield}->{authorised_value},
124
            $branch_limit ? $branch_limit : (),
125
        );
126
127
        push @authorised_values, ""
128
          unless ( $tagslib->{$tag}->{$subfield}->{mandatory}
129
            && ( $value || $tagslib->{$tag}->{$subfield}->{defaultvalue} ) );
130
131
        while ( my ( $value, $lib ) = $authorised_values_sth->fetchrow_array ) {
132
            push @authorised_values, $value;
133
            $authorised_lib{$value} = $lib;
134
        }
135
    }
136
    $authorised_values_sth->finish;
137
    return {
138
        type     => 'select',
139
        id       => "tag_".$tag."_subfield_".$subfield."_".$index_tag."_".$index_subfield,
140
        name     => "tag_".$tag."_subfield_".$subfield."_".$index_tag."_".$index_subfield,
141
        default  => $value,
142
        values   => \@authorised_values,
143
        labels   => \%authorised_lib,
144
    };
145
146
}
147
148
=head2 CreateKey
149
150
    Create a random value to set it into the input name
151
152
=cut
153
154
sub CreateKey {
155
    return int(rand(1000000));
156
}
157
158
=head2 create_input
159
160
 builds the <input ...> entry for a subfield.
161
162
=cut
163
164
sub create_input {
165
    my ( $tag, $subfield, $value, $index_tag, $tabloop, $rec, $authorised_values_sth,$cgi ) = @_;
166
167
    my $index_subfield = CreateKey(); # create a specific key for each subfield
168
169
    $value =~ s/"/&quot;/g;
170
171
    # if there is no value provided but a default value in parameters, get it
172
    if ( $value eq '' ) {
173
        $value = $tagslib->{$tag}->{$subfield}->{defaultvalue};
174
175
        # get today date & replace <<YYYY>>, <<MM>>, <<DD>> if provided in the default value
176
        my $today_dt = dt_from_string;
177
        my $year = $today_dt->strftime('%Y');
178
        my $month = $today_dt->strftime('%m');
179
        my $day = $today_dt->strftime('%d');
180
        $value =~ s/<<YYYY>>/$year/g;
181
        $value =~ s/<<MM>>/$month/g;
182
        $value =~ s/<<DD>>/$day/g;
183
        # And <<USER>> with surname (?)
184
        my $username=(C4::Context->userenv?C4::Context->userenv->{'surname'}:"superlibrarian");
185
        $value=~s/<<USER>>/$username/g;
186
187
    }
188
    my $dbh = C4::Context->dbh;
189
190
    # map '@' as "subfield" label for fixed fields
191
    # to something that's allowed in a div id.
192
    my $id_subfield = $subfield;
193
    $id_subfield = "00" if $id_subfield eq "@";
194
195
    my %subfield_data = (
196
        tag        => $tag,
197
        subfield   => $id_subfield,
198
        marc_lib       => $tagslib->{$tag}->{$subfield}->{lib},
199
        tag_mandatory  => $tagslib->{$tag}->{mandatory},
200
        mandatory      => $tagslib->{$tag}->{$subfield}->{mandatory},
201
        repeatable     => $tagslib->{$tag}->{$subfield}->{repeatable},
202
        kohafield      => $tagslib->{$tag}->{$subfield}->{kohafield},
203
        index          => $index_tag,
204
        id             => "tag_".$tag."_subfield_".$id_subfield."_".$index_tag."_".$index_subfield,
205
        value          => $value,
206
        maxlength      => $tagslib->{$tag}->{$subfield}->{maxlength},
207
        random         => CreateKey(),
208
    );
209
210
    if(exists $mandatory_z3950->{$tag.$subfield}){
211
        $subfield_data{z3950_mandatory} = $mandatory_z3950->{$tag.$subfield};
212
    }
213
    # Subfield is hidden depending of hidden and mandatory flag, and is always
214
    # shown if it contains anything or if its field is mandatory.
215
    my $tdef = $tagslib->{$tag};
216
    $subfield_data{visibility} = "display:none;"
217
        if $tdef->{$subfield}->{hidden} % 2 == 1 &&
218
           $value eq '' &&
219
           !$tdef->{$subfield}->{mandatory} &&
220
           !$tdef->{mandatory};
221
    # expand all subfields of 773 if there is a host item provided in the input
222
    $subfield_data{visibility} ="" if ($tag eq 773 and $cgi->param('hostitemnumber'));
223
224
    # it's an authorised field
225
    if ( $tagslib->{$tag}->{$subfield}->{authorised_value} ) {
226
        $subfield_data{marc_value} =
227
          build_authorized_values_list( $tag, $subfield, $value, $dbh,
228
            $authorised_values_sth,$index_tag,$index_subfield );
229
230
    # it's a subfield $9 linking to an authority record - see bug 2206
231
    }
232
    elsif ($subfield eq "9" and
233
           exists($tagslib->{$tag}->{'a'}->{authtypecode}) and
234
           defined($tagslib->{$tag}->{'a'}->{authtypecode}) and
235
           $tagslib->{$tag}->{'a'}->{authtypecode} ne '') {
236
237
        $subfield_data{marc_value} = {
238
            type      => 'text',
239
            id        => $subfield_data{id},
240
            name      => $subfield_data{id},
241
            value     => $value,
242
            size      => 5,
243
            maxlength => $subfield_data{maxlength},
244
            readonly  => 1,
245
        };
246
247
    # it's a thesaurus / authority field
248
    }
249
    elsif ( $tagslib->{$tag}->{$subfield}->{authtypecode} ) {
250
        # when authorities auto-creation is allowed, do not set readonly
251
        my $is_readonly = !C4::Context->preference("BiblioAddsAuthorities");
252
253
        $subfield_data{marc_value} = {
254
            type      => 'text',
255
            id        => $subfield_data{id},
256
            name      => $subfield_data{id},
257
            value     => $value,
258
            size      => 67,
259
            maxlength => $subfield_data{maxlength},
260
            readonly  => ($is_readonly) ? 1 : 0,
261
            authtype  => $tagslib->{$tag}->{$subfield}->{authtypecode},
262
        };
263
264
    # it's a plugin field
265
    } elsif ( $tagslib->{$tag}->{$subfield}->{'value_builder'} ) {
266
        require Koha::FrameworkPlugin;
267
        my $plugin = Koha::FrameworkPlugin->new( {
268
            name => $tagslib->{$tag}->{$subfield}->{'value_builder'},
269
        });
270
        my $pars= { dbh => $dbh, record => $rec, tagslib => $tagslib,
271
            id => $subfield_data{id}, tabloop => $tabloop };
272
        $plugin->build( $pars );
273
        if( !$plugin->errstr ) {
274
            $subfield_data{marc_value} = {
275
                type           => 'text_complex',
276
                id             => $subfield_data{id},
277
                name           => $subfield_data{id},
278
                value          => $value,
279
                size           => 67,
280
                maxlength      => $subfield_data{maxlength},
281
                javascript     => $plugin->javascript,
282
                noclick        => $plugin->noclick,
283
            };
284
        } else {
285
            warn $plugin->errstr;
286
            # supply default input form
287
            $subfield_data{marc_value} = {
288
                type      => 'text',
289
                id        => $subfield_data{id},
290
                name      => $subfield_data{id},
291
                value     => $value,
292
                size      => 67,
293
                maxlength => $subfield_data{maxlength},
294
                readonly  => 0,
295
            };
296
        }
297
298
    # it's an hidden field
299
    } elsif ( $tag eq '' ) {
300
        $subfield_data{marc_value} = {
301
            type      => 'hidden',
302
            id        => $subfield_data{id},
303
            name      => $subfield_data{id},
304
            value     => $value,
305
            size      => 67,
306
            maxlength => $subfield_data{maxlength},
307
        };
308
309
    }
310
    else {
311
        # it's a standard field
312
        if (
313
            length($value) > 100
314
            or
315
            ( C4::Context->preference("marcflavour") eq "UNIMARC" && $tag >= 300
316
                and $tag < 400 && $subfield eq 'a' )
317
            or (    $tag >= 500
318
                and $tag < 600
319
                && C4::Context->preference("marcflavour") eq "MARC21" )
320
          )
321
        {
322
            $subfield_data{marc_value} = {
323
                type      => 'textarea',
324
                id        => $subfield_data{id},
325
                name      => $subfield_data{id},
326
                value     => $value,
327
            };
328
329
        }
330
        else {
331
            $subfield_data{marc_value} = {
332
                type      => 'text',
333
                id        => $subfield_data{id},
334
                name      => $subfield_data{id},
335
                value     => $value,
336
                size      => 67,
337
                maxlength => $subfield_data{maxlength},
338
                readonly  => 0,
339
            };
340
341
        }
342
    }
343
    $subfield_data{'index_subfield'} = $index_subfield;
344
    return \%subfield_data;
345
}
346
347
348
=head2 format_indicator
349
350
Translate indicator value for output form - specifically, map
351
indicator = ' ' to ''.  This is for the convenience of a cataloger
352
using a mouse to select an indicator input.
353
354
=cut
355
356
sub format_indicator {
357
    my $ind_value = shift;
358
    return '' if not defined $ind_value;
359
    return '' if $ind_value eq ' ';
360
    return $ind_value;
361
}
362
363
sub build_tabs {
364
    my ( $template, $record, $dbh, $encoding,$input ) = @_;
365
366
    # fill arrays
367
    my @loop_data = ();
368
    my $tag;
369
370
    my $branch_limit = C4::Context->userenv ? C4::Context->userenv->{"branch"} : "";
371
    my $query = "SELECT authorised_value, lib
372
                FROM authorised_values";
373
    $query .= qq{ LEFT JOIN authorised_values_branches ON ( id = av_id )} if $branch_limit;
374
    $query .= " WHERE category = ?";
375
    $query .= " AND ( branchcode = ? OR branchcode IS NULL )" if $branch_limit;
376
    $query .= " GROUP BY lib ORDER BY lib, lib_opac";
377
    my $authorised_values_sth = $dbh->prepare( $query );
378
379
    # in this array, we will push all the 10 tabs
380
    # to avoid having 10 tabs in the template : they will all be in the same BIG_LOOP
381
    my @BIG_LOOP;
382
    my %seen;
383
    my @tab_data; # all tags to display
384
385
    foreach my $used ( @$usedTagsLib ){
386
        push @tab_data,$used->{tagfield} if not $seen{$used->{tagfield}};
387
        $seen{$used->{tagfield}}++;
388
    }
389
390
    my $max_num_tab=-1;
391
    foreach(@$usedTagsLib){
392
        if($_->{tab} > -1 && $_->{tab} >= $max_num_tab && $_->{tagfield} != '995'){ # FIXME : MARC21 ?
393
            $max_num_tab = $_->{tab};
394
        }
395
    }
396
    if($max_num_tab >= 9){
397
        $max_num_tab = 9;
398
    }
399
    # loop through each tab 0 through 9
400
    for ( my $tabloop = 0 ; $tabloop <= $max_num_tab ; $tabloop++ ) {
401
        my @loop_data = (); #innerloop in the template.
402
        my $i = 0;
403
        foreach my $tag (@tab_data) {
404
            $i++;
405
            next if ! $tag;
406
            my ($indicator1, $indicator2);
407
            my $index_tag = CreateKey;
408
409
            # if MARC::Record is not empty =>use it as master loop, then add missing subfields that should be in the tab.
410
            # if MARC::Record is empty => use tab as master loop.
411
            if ( $record ne -1 && ( $record->field($tag) || $tag eq '000' ) ) {
412
                my @fields;
413
        if ( $tag ne '000' ) {
414
                    @fields = $record->field($tag);
415
        }
416
        else {
417
           push @fields, $record->leader(); # if tag == 000
418
        }
419
        # loop through each field
420
                foreach my $field (@fields) {
421
422
                    my @subfields_data;
423
                    if ( $tag < 10 ) {
424
                        my ( $value, $subfield );
425
                        if ( $tag ne '000' ) {
426
                            $value    = $field->data();
427
                            $subfield = "@";
428
                        }
429
                        else {
430
                            $value    = $field;
431
                            $subfield = '@';
432
                        }
433
                        next if ( $tagslib->{$tag}->{$subfield}->{tab} ne $tabloop );
434
                        next
435
                          if ( $tagslib->{$tag}->{$subfield}->{kohafield} eq
436
                            'biblio.biblionumber' );
437
                        push(
438
                            @subfields_data,
439
                            &create_input(
440
                                $tag, $subfield, $value, $index_tag, $tabloop, $record,
441
                                $authorised_values_sth,$input
442
                            )
443
                        );
444
                    }
445
                    else {
446
                        my @subfields = $field->subfields();
447
                        foreach my $subfieldcount ( 0 .. $#subfields ) {
448
                            my $subfield = $subfields[$subfieldcount][0];
449
                            my $value    = $subfields[$subfieldcount][1];
450
                            next if ( length $subfield != 1 );
451
                            next if ( $tagslib->{$tag}->{$subfield}->{tab} ne $tabloop );
452
                            push(
453
                                @subfields_data,
454
                                &create_input(
455
                                    $tag, $subfield, $value, $index_tag, $tabloop,
456
                                    $record, $authorised_values_sth,$input
457
                                )
458
                            );
459
                        }
460
                    }
461
462
                    # now, loop again to add parameter subfield that are not in the MARC::Record
463
                    foreach my $subfield ( sort( keys %{ $tagslib->{$tag} } ) )
464
                    {
465
                        next if ( length $subfield != 1 );
466
                        next if ( $tagslib->{$tag}->{$subfield}->{tab} ne $tabloop );
467
                        next if ( $tag < 10 );
468
                        next
469
                          if ( ( $tagslib->{$tag}->{$subfield}->{hidden} <= -4 )
470
                            or ( $tagslib->{$tag}->{$subfield}->{hidden} >= 5 ) )
471
                            and not ( $subfield eq "9" and
472
                                      exists($tagslib->{$tag}->{'a'}->{authtypecode}) and
473
                                      defined($tagslib->{$tag}->{'a'}->{authtypecode}) and
474
                                      $tagslib->{$tag}->{'a'}->{authtypecode} ne ""
475
                                    )
476
                          ;    #check for visibility flag
477
                               # if subfield is $9 in a field whose $a is authority-controlled,
478
                               # always include in the form regardless of the hidden setting - bug 2206
479
                        next if ( defined( $field->subfield($subfield) ) );
480
                        push(
481
                            @subfields_data,
482
                            &create_input(
483
                                $tag, $subfield, '', $index_tag, $tabloop, $record,
484
                                $authorised_values_sth,$input
485
                            )
486
                        );
487
                    }
488
                    if ( $#subfields_data >= 0 ) {
489
                        # build the tag entry.
490
                        # note that the random() field is mandatory. Otherwise, on repeated fields, you'll
491
                        # have twice the same "name" value, and cgi->param() will return only one, making
492
                        # all subfields to be merged in a single field.
493
                        my %tag_data = (
494
                            tag           => $tag,
495
                            index         => $index_tag,
496
                            tag_lib       => $tagslib->{$tag}->{lib},
497
                            repeatable       => $tagslib->{$tag}->{repeatable},
498
                            mandatory       => $tagslib->{$tag}->{mandatory},
499
                            subfield_loop => \@subfields_data,
500
                            fixedfield    => $tag < 10?1:0,
501
                            random        => CreateKey,
502
                        );
503
                        if ($tag >= 10){ # no indicator for 00x tags
504
                           $tag_data{indicator1} = format_indicator($field->indicator(1)),
505
                           $tag_data{indicator2} = format_indicator($field->indicator(2)),
506
                        }
507
                        push( @loop_data, \%tag_data );
508
                    }
509
                 } # foreach $field end
510
511
            # if breeding is empty
512
            }
513
            else {
514
                my @subfields_data;
515
                foreach my $subfield ( sort( keys %{ $tagslib->{$tag} } ) ) {
516
                    next if ( length $subfield != 1 );
517
                    next
518
                      if ( ( $tagslib->{$tag}->{$subfield}->{hidden} <= -4 )
519
                        or ( $tagslib->{$tag}->{$subfield}->{hidden} >= 5 ) )
520
                      and not ( $subfield eq "9" and
521
                                exists($tagslib->{$tag}->{'a'}->{authtypecode}) and
522
                                defined($tagslib->{$tag}->{'a'}->{authtypecode}) and
523
                                $tagslib->{$tag}->{'a'}->{authtypecode} ne ""
524
                              )
525
                      ;    #check for visibility flag
526
                           # if subfield is $9 in a field whose $a is authority-controlled,
527
                           # always include in the form regardless of the hidden setting - bug 2206
528
                    next
529
                      if ( $tagslib->{$tag}->{$subfield}->{tab} ne $tabloop );
530
                    push(
531
                        @subfields_data,
532
                        &create_input(
533
                            $tag, $subfield, '', $index_tag, $tabloop, $record,
534
                            $authorised_values_sth,$input
535
                        )
536
                    );
537
                }
538
                if ( $#subfields_data >= 0 ) {
539
                    my %tag_data = (
540
                        tag              => $tag,
541
                        index            => $index_tag,
542
                        tag_lib          => $tagslib->{$tag}->{lib},
543
                        repeatable       => $tagslib->{$tag}->{repeatable},
544
                        mandatory       => $tagslib->{$tag}->{mandatory},
545
                        indicator1       => $indicator1,
546
                        indicator2       => $indicator2,
547
                        subfield_loop    => \@subfields_data,
548
                        tagfirstsubfield => $subfields_data[0],
549
                        fixedfield       => $tag < 10?1:0,
550
                    );
551
552
                    push @loop_data, \%tag_data ;
553
                }
554
            }
555
        }
556
        if ( $#loop_data >= 0 ) {
557
            push @BIG_LOOP, {
558
                number    => $tabloop,
559
                innerloop => \@loop_data,
560
            };
561
        }
562
    }
563
    $authorised_values_sth->finish;
564
    $template->param( BIG_LOOP => \@BIG_LOOP );
565
}
566
567
##########################
568
#          MAIN
569
##########################
570
my $input = new CGI;
571
my $error = $input->param('error');
572
my $biblionumber  = $input->param('biblionumber');
573
my $holding_id = $input->param('holding_id'); # if holding_id exists, it's a modif, not a new holding.
574
my $op            = $input->param('op');
575
my $mode          = $input->param('mode');
576
my $frameworkcode = $input->param('frameworkcode');
577
my $redirect      = $input->param('redirect');
578
my $searchid      = $input->param('searchid');
579
my $dbh           = C4::Context->dbh;
580
581
my $userflags = 'edit_items';
582
583
my $changed_framework = $input->param('changed_framework');
584
$frameworkcode = &C4::Holdings::GetHoldingFrameworkCode($holding_id)
585
  if ( $holding_id and not( defined $frameworkcode) and $op ne 'add' );
586
587
$frameworkcode = 'HLD' if ( !$frameworkcode || $frameworkcode eq 'Default' );
588
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
589
    {
590
        template_name   => "cataloguing/addholding.tt",
591
        query           => $input,
592
        type            => "intranet",
593
        authnotrequired => 0,
594
        flagsrequired   => { editcatalogue => $userflags },
595
    }
596
);
597
598
# TODO: support in advanced editor?
599
#if ( $op ne "delete" && C4::Context->preference('EnableAdvancedCatalogingEditor') && $input->cookie( 'catalogue_editor_' . $loggedinuser ) eq 'advanced' ) {
600
#    print $input->redirect( '/cgi-bin/koha/cataloguing/editor.pl#catalog/' . $biblionumber . '/holdings/' . ( $holding_id ? $holding_id : '' ) );
601
#    exit;
602
#}
603
604
my $frameworks = Koha::BiblioFrameworks->search({}, { order_by => ['frameworktext'] });
605
$template->param(
606
    frameworks => $frameworks
607
);
608
609
# ++ Global
610
$tagslib         = &GetMarcStructure( 1, $frameworkcode );
611
$usedTagsLib     = &GetUsedMarcStructure( $frameworkcode );
612
# -- Global
613
614
my $record   = -1;
615
my $encoding = "";
616
617
if ($holding_id) {
618
    $record = C4::Holdings::GetMarcHolding({ holding_id => $holding_id });
619
}
620
621
$is_a_modif = 0;
622
623
if ($holding_id) {
624
    $is_a_modif = 1;
625
626
}
627
my ( $biblionumbertagfield, $biblionumbertagsubfield ) =
628
    &GetMarcFromKohaField( "biblio.biblionumber", $frameworkcode );
629
630
#-------------------------------------------------------------------------------------
631
if ( $op eq "add" ) {
632
#-------------------------------------------------------------------------------------
633
    $template->param(
634
        biblionumberdata => $biblionumber,
635
    );
636
    # getting html input
637
    my @params = $input->multi_param();
638
    $record = TransformHtmlToMarc( $input, 1 );
639
    if ( $is_a_modif ) {
640
        ModHolding( $record, $holding_id, $frameworkcode );
641
    }
642
    else {
643
        $holding_id = AddHolding( $record, $frameworkcode, $biblionumber );
644
    }
645
    if ($redirect eq "items" || ($mode ne "popup" && !$is_a_modif && $redirect ne "view" && $redirect ne "just_save")){
646
        print $input->redirect("/cgi-bin/koha/catalogue/detail.pl?biblionumber=$biblionumber&searchid=$searchid");
647
        exit;
648
    }
649
    elsif(($is_a_modif || $redirect eq "view") && $redirect ne "just_save"){
650
        print $input->redirect("/cgi-bin/koha/catalogue/detail.pl?biblionumber=$biblionumber&searchid=$searchid");
651
        exit;
652
    }
653
    elsif ($redirect eq "just_save"){
654
        my $tab = $input->param('current_tab');
655
        print $input->redirect("/cgi-bin/koha/cataloguing/addholding.pl?biblionumber=$biblionumber&holding_id=$holding_id&framework=$frameworkcode&tab=$tab&searchid=$searchid");
656
    }
657
    else {
658
          $template->param(
659
            biblionumber => $biblionumber,
660
            holding_id => $holding_id,
661
            done         =>1,
662
            popup        =>1
663
          );
664
          $template->param(
665
            popup => $mode,
666
            itemtype => $frameworkcode,
667
          );
668
          output_html_with_http_headers $input, $cookie, $template->output;
669
          exit;
670
    }
671
}
672
elsif ( $op eq "delete" ) {
673
674
    my $error = &DelHolding($holding_id);
675
    if ($error) {
676
        warn "ERROR when DELETING HOLDING $holding_id : $error";
677
        print "Content-Type: text/html\n\n<html><body><h1>ERROR when DELETING HOLDING $holding_id : $error</h1></body></html>";
678
        exit;
679
    }
680
681
    print $input->redirect("/cgi-bin/koha/catalogue/detail.pl?biblionumber=$biblionumber&searchid=$searchid");
682
    exit;
683
684
} else {
685
   #----------------------------------------------------------------------------
686
   # If we're in a duplication case, we have to set to "" the holding_id
687
   # as we'll save the holding as a new one.
688
    $template->param(
689
        holding_iddata => $holding_id,
690
        op                => $op,
691
    );
692
    if ( $op eq "duplicate" ) {
693
        $holding_id = "";
694
    }
695
696
    if($changed_framework eq "changed") {
697
        $record = TransformHtmlToMarc( $input, 1 );
698
    }
699
    elsif( $record ne -1 ) {
700
#FIXME: it's kind of silly to go from MARC::Record to MARC::File::XML and then back again just to fix the encoding
701
        eval {
702
            my $uxml = $record->as_xml;
703
            MARC::Record::default_record_format("UNIMARC")
704
            if ( C4::Context->preference("marcflavour") eq "UNIMARC" );
705
            my $urecord = MARC::Record::new_from_xml( $uxml, 'UTF-8' );
706
            $record = $urecord;
707
        };
708
    }
709
    if ( !$biblionumber ) {
710
        # we must have a holding_id if we don't have a biblionumber
711
        my $holdingRecord = Koha::Holdings->find( $holding_id );
712
        $biblionumber = $holdingRecord->biblionumber;
713
    }
714
    my $biblio = Koha::Biblios->find( $biblionumber );
715
    build_tabs( $template, $record, $dbh, $encoding,$input );
716
    $template->param(
717
        holding_id               => $holding_id,
718
        biblionumber             => $biblionumber,
719
        biblionumbertagfield     => $biblionumbertagfield,
720
        biblionumbertagsubfield  => $biblionumbertagsubfield,
721
        title                    => $biblio->title,
722
        author                   => $biblio->author
723
    );
724
}
725
726
$template->param(
727
    popup => $mode,
728
    frameworkcode => $frameworkcode,
729
    itemtype => $frameworkcode,
730
    borrowernumber => $loggedinuser,
731
    tab => scalar $input->param('tab')
732
);
733
$template->{'VARS'}->{'searchid'} = $searchid;
734
735
output_html_with_http_headers $input, $cookie, $template->output;
(-)a/cataloguing/additem.pl (+11 lines)
Lines 31-36 use C4::Circulation; Link Here
31
use C4::Koha;
31
use C4::Koha;
32
use C4::ClassSource;
32
use C4::ClassSource;
33
use Koha::DateUtils;
33
use Koha::DateUtils;
34
use Koha::Holdings;
34
use Koha::Items;
35
use Koha::Items;
35
use Koha::ItemTypes;
36
use Koha::ItemTypes;
36
use Koha::Libraries;
37
use Koha::Libraries;
Lines 209-214 sub generate_subfield_form { Link Here
209
        
210
        
210
                  #---- "true" authorised value
211
                  #---- "true" authorised value
211
            }
212
            }
213
            elsif ( $subfieldlib->{authorised_value} eq "holdings" ) {
214
                push @authorised_values, "" unless ( $subfieldlib->{mandatory} );
215
                my $holdings = Koha::Holdings->search({biblionumber => $biblionumber}, { order_by => ['holdingbranch'] })->unblessed;
216
                for my $holding ( @$holdings ) {
217
                    push @authorised_values, $holding->{holding_id};
218
                    $authorised_lib{$holding->{holding_id}} = $holding->{holding_id} . ' ' . $holding->{holdingbranch} . ' ' . $holding->{location} . ' ' . $holding->{ccode} . ' ' . $holding->{callnumber};
219
                }
220
                my $input = new CGI;
221
                $value = $input->param('holding_id') unless ($value);
222
            }
212
            else {
223
            else {
213
                  push @authorised_values, qq{};
224
                  push @authorised_values, qq{};
214
                  my $av = GetAuthorisedValues( $subfieldlib->{authorised_value} );
225
                  my $av = GetAuthorisedValues( $subfieldlib->{authorised_value} );
(-)a/cataloguing/value_builder/marc21_field_008_holdings.pl (+120 lines)
Line 0 Link Here
1
#!/usr/bin/perl
2
3
# Copyright 2000-2002 Katipo Communications
4
# Copyright 2017-2018 University of Helsinki (The National Library Of Finland)
5
#
6
# This file is part of Koha.
7
#
8
# Koha is free software; you can redistribute it and/or modify it
9
# under the terms of the GNU General Public License as published by
10
# the Free Software Foundation; either version 3 of the License, or
11
# (at your option) any later version.
12
#
13
# Koha is distributed in the hope that it will be useful, but
14
# WITHOUT ANY WARRANTY; without even the implied warranty of
15
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
# GNU General Public License for more details.
17
#
18
# You should have received a copy of the GNU General Public License
19
# along with Koha; if not, see <http://www.gnu.org/licenses>.
20
21
use Modern::Perl;
22
use C4::Auth;
23
use CGI qw ( -utf8 );
24
use C4::Context;
25
26
use C4::Search;
27
use C4::Output;
28
29
use XML::LibXML;
30
use Koha::Util::FrameworkPlugin qw|date_entered|;
31
32
my $builder = sub {
33
    my ( $params ) = @_;
34
35
    my $lang = C4::Context->preference('DefaultLanguageField008' );
36
    $lang = "eng" unless $lang;
37
    $lang = pack("A3", $lang);
38
39
    my $function_name = $params->{id};
40
    my $dateentered = date_entered();
41
    my $res           = "
42
<script type=\"text/javascript\">
43
//<![CDATA[
44
45
function Focus$function_name(event) {
46
    if ( document.getElementById(event.data.id).value ) {
47
    }
48
    else {
49
        document.getElementById(event.data.id).value='$dateentered' + '0u    0   4   uu${lang}0$dateentered';
50
    }
51
    return 1;
52
}
53
54
function Click$function_name(event) {
55
    defaultvalue=document.getElementById(event.data.id).value;
56
    //Retrieve full leader string and pass it to the 008 tag editor
57
    var leader_value = \$(\"input[id^='tag_000']\").val();
58
    var leader_parameter = \"\";
59
    if (leader_value){
60
        //Only add the parameter to the URL if there is a value to add
61
        leader_parameter = \"&leader=\"+leader_value;
62
    }
63
    newin=window.open(\"../cataloguing/plugin_launcher.pl?plugin_name=marc21_field_008_holdings.pl&index=\"+ event.data.id +\"&result=\"+defaultvalue+leader_parameter,\"tag_editor\",'width=1000,height=600,toolbar=false,scrollbars=yes');
64
65
}
66
//]]>
67
</script>
68
";
69
70
    return $res;
71
};
72
73
my $launcher = sub {
74
    my ( $params ) = @_;
75
    my $input = $params->{cgi};
76
    my $index= $input->param('index');
77
    my $result= $input->param('result');
78
79
    my $lang = C4::Context->preference('DefaultLanguageField008' );
80
    $lang = "eng" unless $lang;
81
    $lang = pack("A3", $lang);
82
83
    my ($template, $loggedinuser, $cookie)
84
    = get_template_and_user({template_name => "cataloguing/value_builder/marc21_field_008_holdings.tt",
85
                 query => $input,
86
                 type => "intranet",
87
                 authnotrequired => 0,
88
                 flagsrequired => {editcatalogue => '*'},
89
                 debug => 1,
90
                 });
91
    my $dateentered = date_entered();
92
    $result = $dateentered + '0u    0   0   uu' + $lang + '0' + $dateentered unless $result;
93
    my @f;
94
    for(0,6..8,12..17,20..22,25,26) {
95
        my $len = 1;
96
        if ($_ == 0 || $_ == 26) {
97
            $len = 6;
98
        } elsif ($_ == 8) {
99
            $len = 4;
100
        } elsif ($_ == 17 || $_ == 22) {
101
            $len = 3;
102
        }
103
        warn ($_ . ': ' . $len);
104
        $f[$_]=substr($result,$_,$len);
105
    }
106
    $template->param(index => $index);
107
108
    $f[0]= $dateentered if !$f[0] || $f[0]=~/\s/;
109
    $template->param(f1 => $f[0]);
110
111
    for(6..8,12..17,20..22,25,26) {
112
        $template->param(
113
            "f$_" => $f[$_],
114
            "f$_".($f[$_] eq '|'? 'pipe': $f[$_]) => $f[$_],
115
        );
116
    }
117
    output_html_with_http_headers $input, $cookie, $template->output;
118
};
119
120
return { builder => $builder, launcher => $launcher };
(-)a/cataloguing/value_builder/marc21_leader_holdings.pl (+85 lines)
Line 0 Link Here
1
#!/usr/bin/perl
2
3
# Copyright 2000-2002 Katipo Communications
4
# Copyright 2017-2018 University of Helsinki (The National Library Of Finland)
5
#
6
# This file is part of Koha.
7
#
8
# Koha is free software; you can redistribute it and/or modify it
9
# under the terms of the GNU General Public License as published by
10
# the Free Software Foundation; either version 3 of the License, or
11
# (at your option) any later version.
12
#
13
# Koha is distributed in the hope that it will be useful, but
14
# WITHOUT ANY WARRANTY; without even the implied warranty of
15
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
# GNU General Public License for more details.
17
#
18
# You should have received a copy of the GNU General Public License
19
# along with Koha; if not, see <http://www.gnu.org/licenses>.
20
21
use Modern::Perl;
22
use CGI qw ( -utf8 );
23
24
use C4::Auth;
25
use C4::Context;
26
use C4::Output;
27
28
my $builder = sub {
29
    my ( $params ) = @_;
30
    my $function_name = $params->{id};
31
    my $res           = "
32
<script type=\"text/javascript\">
33
//<![CDATA[
34
35
function Focus$function_name(event) {
36
    if(!document.getElementById(event.data.id).value){
37
        document.getElementById(event.data.id).value = '     nu  a22     ui 4500';
38
    }
39
}
40
41
function Click$function_name(event) {
42
    defaultvalue=document.getElementById(event.data.id).value;
43
    newin=window.open(\"../cataloguing/plugin_launcher.pl?plugin_name=marc21_leader_holdings.pl&index=\"+ event.data.id +\"&result=\"+defaultvalue,\"tag_editor\",'width=1000,height=600,toolbar=false,scrollbars=yes');
44
}
45
46
//]]>
47
</script>
48
";
49
50
    return $res;
51
};
52
53
my $launcher = sub {
54
    my ( $params ) = @_;
55
    my $input = $params->{cgi};
56
    my $index   = $input->param('index');
57
    my $result  = $input->param('result');
58
59
    my $dbh = C4::Context->dbh;
60
61
    my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
62
        {   template_name   => "cataloguing/value_builder/marc21_leader_holdings.tt",
63
            query           => $input,
64
            type            => "intranet",
65
            authnotrequired => 0,
66
            flagsrequired   => { editcatalogue => '*' },
67
            debug           => 1,
68
        }
69
    );
70
    $result = "     nu  a22     ui 4500" unless $result;
71
    my $f5    = substr( $result, 5,  1 );
72
    my $f6    = substr( $result, 6,  1 );
73
    my $f17   = substr( $result, 17, 1 );
74
    my $f18   = substr( $result, 18, 1 );
75
    $template->param(
76
        index     => $index,
77
        "f5$f5"   => 1,
78
        "f6$f6"   => 1,
79
        "f17$f17" => 1,
80
        "f18$f18" => 1,
81
    );
82
    output_html_with_http_headers $input, $cookie, $template->output;
83
};
84
85
return { builder => $builder, launcher => $launcher };
(-)a/installer/data/mysql/atomicupdate/bug_20447-add_holdings_tables.sql (+62 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
    `ccode` varchar(80) default NULL, -- authorized value for the collection code associated with this item (MARC21 852$g)
13
    `callnumber` varchar(255) default NULL, -- call number (852$h+$i in MARC21)
14
    `suppress` tinyint(1) default NULL, -- Boolean indicating whether the record is suppressed in OPAC
15
    `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, -- date and time this record was last touched
16
    `datecreated` DATE NOT NULL, -- the date this record was added to Koha
17
    `deleted_on` DATETIME DEFAULT NULL, -- the date this record was deleted
18
    PRIMARY KEY  (`holding_id`),
19
    KEY `hldnoidx` (`holding_id`),
20
    KEY `hldbinoidx` (`biblioitemnumber`),
21
    KEY `hldbibnoidx` (`biblionumber`),
22
    CONSTRAINT `holdings_ibfk_1` FOREIGN KEY (`biblionumber`) REFERENCES `biblio` (`biblionumber`) ON DELETE CASCADE ON UPDATE CASCADE,
23
    CONSTRAINT `holdings_ibfk_2` FOREIGN KEY (`biblioitemnumber`) REFERENCES `biblioitems` (`biblioitemnumber`) ON DELETE CASCADE ON UPDATE CASCADE,
24
    CONSTRAINT `holdings_ibfk_3` FOREIGN KEY (`holdingbranch`) REFERENCES `branches` (`branchcode`) ON UPDATE CASCADE
25
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
26
27
--
28
-- Table structure for table `holdings_metadata`
29
--
30
31
CREATE TABLE `holdings_metadata` (
32
    `id` INT(11) NOT NULL AUTO_INCREMENT,
33
    `holding_id` INT(11) NOT NULL,
34
    `format` VARCHAR(16) NOT NULL,
35
    `marcflavour` VARCHAR(16) NOT NULL,
36
    `metadata` LONGTEXT NOT NULL,
37
    `deleted_on` DATETIME DEFAULT NULL, -- the date this record was deleted
38
    PRIMARY KEY(id),
39
    UNIQUE KEY `holdings_metadata_uniq_key` (`holding_id`,`format`,`marcflavour`),
40
    KEY `hldnoidx` (`holding_id`),
41
    CONSTRAINT `holdings_metadata_fk_1` FOREIGN KEY (`holding_id`) REFERENCES `holdings` (`holding_id`) ON DELETE CASCADE ON UPDATE CASCADE
42
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
43
44
--
45
-- Add holding_id to items table
46
--
47
48
ALTER TABLE `items` ADD COLUMN `holding_id` int(11) default NULL;
49
ALTER TABLE `items` ADD CONSTRAINT `items_ibfk_5` FOREIGN KEY (`holding_id`) REFERENCES `holdings` (`holding_id`) ON DELETE CASCADE ON UPDATE CASCADE;
50
ALTER TABLE `items` ADD KEY `hldid_idx` (`holding_id`);
51
52
--
53
-- Add holding_id to deleteditems table
54
--
55
56
ALTER TABLE `deleteditems` ADD COLUMN `holding_id` int(11) default NULL;
57
58
--
59
-- Insert a new category to authorised_value_categories table
60
--
61
62
INSERT INTO authorised_value_categories( category_name ) VALUES ('holdings');
(-)a/installer/data/mysql/en/marcflavour/marc21/mandatory/marc21_framework_DEFAULT.sql (-1 / +544 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 4621-4623 SELECT tagfield, tagsubfield, liblibrarian, libopac, repeatable, mandatory, koha Link Here
4621
FROM marc_subfield_structure
4623
FROM marc_subfield_structure
4622
WHERE frameworkcode=""
4624
WHERE frameworkcode=""
4623
AND kohafield IN ("biblio.title", "biblio.author", "biblioitems.publishercode", "biblioitems.editionstatement", "biblio.copyrightdate", "biblioitems.isbn", "biblio.seriestitle" );
4625
AND kohafield IN ("biblio.title", "biblio.author", "biblioitems.publishercode", "biblioitems.editionstatement", "biblio.copyrightdate", "biblioitems.isbn", "biblio.seriestitle" );
4626
4627
4628
-- HOLDINGS RECORD FRAMEWORK
4629
4630
INSERT IGNORE INTO `biblio_framework` VALUES ('HLD', 'Default holdings framework');
4631
INSERT IGNORE INTO `marc_tag_structure` (`tagfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `authorised_value`, `frameworkcode`) VALUES
4632
        ('999', 'SYSTEM CONTROL NUMBERS (KOHA)', 'SYSTEM CONTROL NUMBERS (KOHA)', 1, 0, '', 'HLD');
4633
4634
INSERT IGNORE INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES
4635
        ('999', 'c', 'Koha biblionumber', 'Koha biblionumber', 0, 0, 'biblio.biblionumber', -1, NULL, NULL, '', NULL, -5, 'HLD', '', '', NULL),
4636
        ('999', 'd', 'Koha biblioitemnumber', 'Koha biblioitemnumber', 0, 0, 'biblioitems.biblioitemnumber', -1, NULL, NULL, '', NULL, -5, 'HLD', '', '', NULL),
4637
        ('999', 'e', 'Koha holding_id', 'Koha holding_id', 0, 0, 'holdings.holding_id', -1, NULL, NULL, '', NULL, -5, 'HLD', '', '', NULL);
4638
4639
4640
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
4641
        ('942', 'n', 'Suppress in OPAC', 'Suppress in OPAC', 0, 0, 'holdings.suppress', 9, '', '', '', 0, 0, 'HLD', '', '', NULL);
4642
4643
INSERT IGNORE INTO `marc_tag_structure` (`tagfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `authorised_value`, `frameworkcode`) VALUES
4644
        ('000', 'LEADER', 'LEADER', 0, 1, '', 'HLD'),
4645
        ('001', 'CONTROL NUMBER', 'CONTROL NUMBER', 0, 0, '', 'HLD'),
4646
        ('003', 'CONTROL NUMBER IDENTIFIER', 'CONTROL NUMBER IDENTIFIER', 0, 1, '', 'HLD'),
4647
        ('005', 'DATE AND TIME OF LATEST TRANSACTION', 'DATE AND TIME OF LATEST TRANSACTION', 0, 1, '', 'HLD'),
4648
        ('006', 'FIXED-LENGTH DATA ELEMENTS--ADDITIONAL MATERIAL CHARACTERISTICS', 'FIXED-LENGTH DATA ELEMENTS--ADDITIONAL MATERIAL CHARACTERISTICS', 1, 0, '', 'HLD'),
4649
        ('007', 'PHYSICAL DESCRIPTION FIXED FIELD--GENERAL INFORMATION', 'PHYSICAL DESCRIPTION FIXED FIELD--GENERAL INFORMATION', 1, 0, '', 'HLD'),
4650
        ('008', 'FIXED-LENGTH DATA ELEMENTS--GENERAL INFORMATION', 'FIXED-LENGTH DATA ELEMENTS--GENERAL INFORMATION', 0, 1, '', 'HLD');
4651
4652
INSERT IGNORE INTO `marc_tag_structure` (`tagfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `authorised_value`, `frameworkcode`) VALUES
4653
        ('010', 'LIBRARY OF CONGRESS CONTROL NUMBER', 'LIBRARY OF CONGRESS CONTROL NUMBER', 0, 0, '', 'HLD'),
4654
        ('014', 'LINKAGE NUMBER', 'LINKAGE NUMBER', 1, 0, '', 'HLD'),
4655
        ('016', 'NATIONAL BIBLIOGRAPHIC AGENCY CONTROL NUMBER', 'NATIONAL BIBLIOGRAPHIC AGENCY CONTROL NUMBER', 1, 0, '', 'HLD'),
4656
        ('017', 'COPYRIGHT OR LEGAL DEPOSIT NUMBER', 'COPYRIGHT OR LEGAL DEPOSIT NUMBER', 1, 0, '', 'HLD'),
4657
        ('020', 'INTERNATIONAL STANDARD BOOK NUMBER', 'INTERNATIONAL STANDARD BOOK NUMBER', 1, 0, NULL, 'HLD'),
4658
        ('022', 'INTERNATIONAL STANDARD SERIAL NUMBER', 'INTERNATIONAL STANDARD SERIAL NUMBER', 1, 0, NULL, 'HLD'),
4659
        ('024', 'OTHER STANDARD IDENTIFIER', 'OTHER STANDARD IDENTIFIER', 1, 0, NULL, 'HLD'),
4660
        ('027', 'STANDARD TECHNICAL REPORT NUMBER', 'STANDARD TECHNICAL REPORT NUMBER', 1, 0, '', 'HLD'),
4661
        ('030', 'CODEN DESIGNATION', 'CODEN DESIGNATION', 1, 0, '', 'HLD'),
4662
        ('035', 'SYSTEM CONTROL NUMBER', 'SYSTEM CONTROL NUMBER', 1, 0, NULL, 'HLD'),
4663
        ('040', 'CATALOGING SOURCE', 'CATALOGING SOURCE', 0, 1, NULL, 'HLD'),
4664
        ('066', 'CHARACTER SETS PRESENT', 'CHARACTER SETS PRESENT', 0, 0, NULL, 'HLD'),
4665
        ('337', 'MEDIA TYPE', 'MEDIA TYPE', 1, 0, NULL, 'HLD'),
4666
        ('338', 'CARRIER TYPE', 'CARRIER TYPE', 1, 0, NULL, 'HLD'),
4667
        ('347', 'DIGITAL FILE CHARACTERISTICS', 'DIGITAL FILE CHARACTERISTICS', 1, 0, NULL, 'HLD'),
4668
        ('506', 'RESTRICTIONS ON ACCESS NOTE', 'RESTRICTIONS ON ACCESS NOTE', 1, 0, NULL, 'HLD'),
4669
        ('538', 'SYSTEM DETAILS NOTE', 'SYSTEM DETAILS NOTE', 1, 0, NULL, 'HLD'),
4670
        ('541', 'IMMEDIATE SOURCE OF ACQUISITION NOTE', 'IMMEDIATE SOURCE OF ACQUISITION NOTE', 1, 0, NULL, 'HLD'),
4671
        ('561', 'OWNERSHIP AND CUSTODIAL HISTORY', 'OWNERSHIP AND CUSTODIAL HISTORY', 1, 0, NULL, 'HLD'),
4672
        ('562', 'COPY AND VERSION IDENTIFICATION NOTE', 'COPY AND VERSION IDENTIFICATION NOTE', 1, 0, NULL, 'HLD'),
4673
        ('563', 'BINDING INFORMATION', 'BINDING INFORMATION', 1, 0, NULL, 'HLD'),
4674
        ('583', 'ACTION NOTE', 'ACTION NOTE', 1, 0, NULL, 'HLD'),
4675
        ('842', 'TEXTUAL PHYSICAL FORM DESIGNATOR', 'TEXTUAL PHYSICAL FORM DESIGNATOR', 0, 0, NULL, 'HLD'),
4676
        ('843', 'REPRODUCTION NOTE', 'REPRODUCTION NOTE', 1, 0, NULL, 'HLD'),
4677
        ('844', 'NAME OF UNIT', 'NAME OF UNIT', 0, 0, NULL, 'HLD'),
4678
        ('845', 'TERMS GOVERNING USE AND REPRODUCTION NOTE', 'TERMS GOVERNING USE AND REPRODUCTION NOTE', 1, 0, NULL, 'HLD'),
4679
        ('850', 'HOLDING INSTITUTION', 'HOLDING INSTITUTION', 1, 0, NULL, 'HLD'),
4680
        ('852', 'LOCATION', 'LOCATION', 1, 0, NULL, 'HLD'),
4681
        ('853', 'CAPTIONS AND PATTERN--BASIC BIBLIOGRAPHIC UNIT', 'CAPTIONS AND PATTERN--BASIC BIBLIOGRAPHIC UNIT', 1, 0, NULL, 'HLD'),
4682
        ('854', 'CAPTIONS AND PATTERN--SUPPLEMENTARY MATERIAL', 'CAPTIONS AND PATTERN--SUPPLEMENTARY MATERIAL', 1, 0, NULL, 'HLD'),
4683
        ('855', 'CAPTIONS AND PATTERN--INDEXES', 'CAPTIONS AND PATTERN--INDEXES', 1, 0, NULL, 'HLD'),
4684
        ('856', 'ELECTRONIC LOCATION AND ACCESS', 'ELECTRONIC LOCATION AND ACCESS', 1, 0, NULL, 'HLD'),
4685
        ('863', 'ENUMERATION AND CHRONOLOGY--BASIC BIBLIOGRAPHIC UNIT', 'ENUMERATION AND CHRONOLOGY--BASIC BIBLIOGRAPHIC UNIT', 1, 0, NULL, 'HLD'),
4686
        ('864', 'ENUMERATION AND CHRONOLOGY--SUPPLEMENTARY MATERIAL', 'ENUMERATION AND CHRONOLOGY--SUPPLEMENTARY MATERIAL', 1, 0, NULL, 'HLD'),
4687
        ('865', 'ENUMERATION AND CHRONOLOGY--INDEXES', 'ENUMERATION AND CHRONOLOGY--INDEXES', 1, 0, NULL, 'HLD'),
4688
        ('866', 'TEXTUAL HOLDINGS--BASIC BIBLIOGRAPHIC UNIT', 'TEXTUAL HOLDINGS--BASIC BIBLIOGRAPHIC UNIT', 1, 0, NULL, 'HLD'),
4689
        ('867', 'TEXTUAL HOLDINGS--SUPPLEMENTARY MATERIAL', 'TEXTUAL HOLDINGS--SUPPLEMENTARY MATERIAL', 1, 0, NULL, 'HLD'),
4690
        ('868', 'TEXTUAL HOLDINGS--INDEXES', 'TEXTUAL HOLDINGS--INDEXES', 1, 0, NULL, 'HLD'),
4691
        ('876', 'ITEM INFORMATION--BASIC BIBLIOGRAPHIC UNIT', 'ITEM INFORMATION--BASIC BIBLIOGRAPHIC UNIT', 1, 0, NULL, 'HLD'),
4692
        ('877', 'ITEM INFORMATION--SUPPLEMENTARY MATERIAL', 'ITEM INFORMATION--SUPPLEMENTARY MATERIAL', 1, 0, NULL, 'HLD'),
4693
        ('878', 'ITEM INFORMATION--INDEXES', 'ITEM INFORMATION--INDEXES', 1, 0, NULL, 'HLD');
4694
4695
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
4696
        ('000', '@', 'fixed length control field', 'fixed length control field', 0, 1, '', 0, '', '', 'marc21_leader_holdings.pl', 0, 0, 'HLD', '', '', NULL),
4697
        ('001', '@', 'control field', 'control field', 0, 0, '', 0, '', '', '', 0, 0, 'HLD', '', '', NULL),
4698
        ('003', '@', 'control field', 'control field', 0, 1, '', 0, '', '', 'marc21_orgcode.pl', 0, 0, 'HLD', '', '', NULL),
4699
        ('005', '@', 'control field', 'control field', 0, 1, '', 0, '', '', 'marc21_field_005.pl', 0, 0, 'HLD', '', '', NULL),
4700
        ('006', '@', 'fixed length control field', 'fixed length control field', 0, 0, '', 0, '', '', 'marc21_field_006.pl', 0, -1, 'HLD', '', '', NULL),
4701
        ('007', '@', 'fixed length control field', 'fixed length control field', 0, 0, '', 0, '', '', 'marc21_field_007.pl', 0, 0, 'HLD', '', '', NULL),
4702
        ('008', '@', 'fixed length control field', 'fixed length control field', 0, 1, '', 0, '', '', 'marc21_field_008_holdings.pl', 0, 0, 'HLD', '', '', NULL),
4703
        ('010', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 0, '', '', NULL, 0, -6, 'HLD', '', '', NULL),
4704
        ('010', 'a', 'LC control number', 'LC control number', 0, 0, 'biblioitems.lccn', 0, '', '', '', 0, 0, 'HLD', '', '', NULL),
4705
        ('010', 'b', 'NUCMC control number', 'NUCMC control number', 1, 0, '', 0, '', '', '', 0, -1, '', '', '', NULL),
4706
        ('010', 'z', 'Canceled/invalid LC control number', 'Canceled/invalid LC control number', 1, 0, '', 0, '', '', '', 0, -1, 'HLD', '', '', NULL),
4707
        ('014', '6', 'Linkage', 'Linkage', 0, 0, '', 0, '', '', '', 0, -6, '', '', '', NULL),
4708
        ('014', 'a', 'Linkage number', 'Linkage number', 0, 0, '', 0, '', '', '', 0, 0, 'HLD', '', '', NULL),
4709
        ('014', 'b', 'Source of number', 'Source of number', 0, 0, '', 0, '', '', '', 0, -1, 'HLD', '', '', NULL),
4710
        ('014', 'z', 'Canceled/invalid linkage number', 'Canceled/invalid linkage number', 1, 0, '', 0, '', '', '', 0, -1, 'HLD', '', '', NULL),
4711
        ('016', '2', 'Source', 'Source', 0, 0, '', 0, '', '', '', 0, 0, '', '', '', NULL),
4712
        ('016', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 0, '', '', '', 0, -6, 'HLD', '', '', NULL),
4713
        ('016', 'a', 'Record control number', 'Record control number', 0, 0, '', 0, '', '', '', 0, 0, 'HLD', '', '', NULL),
4714
        ('016', 'z', 'Canceled/invalid control number', 'Canceled/invalid control number', 1, 0, '', 0, '', '', '', 0, -1, 'HLD', '', '', NULL),
4715
        ('017', '2', 'Source', 'Source', 0, 0, '', 0, '', '', '', 0, -6, '', '', '', NULL),
4716
        ('017', '6', 'Linkage', 'Linkage', 0, 0, '', 0, '', '', '', 0, -6, '', '', '', NULL),
4717
        ('017', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 0, '', '', '', 0, -6, 'HLD', '', '', NULL),
4718
        ('017', 'a', 'Copyright or legal deposit number', 'Copyright or legal deposit number', 1, 0, '', 0, '', '', '', 0, -6, 'HLD', '', '', NULL),
4719
        ('017', 'b', 'Assigning agency', 'Assigning agency', 0, 0, '', 0, '', '', '', 0, -6, 'HLD', '', '', NULL),
4720
        ('017', 'd', 'Date', 'Date', 0, 0, '', 0, '', '', NULL, 0, -6, 'HLD', '', '', NULL),
4721
        ('017', 'i', 'Display text', 'Display text', 0, 0, '', 0, '', '', '', 0, -6, 'HLD', '', '', NULL),
4722
        ('017', 'z', 'Canceled/invalid copyright or legal deposit number', 'Canceled/invalid copyright or legal deposit number', 1, 0, '', 0, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4723
        ('020', '6', 'Linkage', 'Linkage', 0, 0, '', 0, '', '', '', 0, -6, 'HLD', '', '', NULL),
4724
        ('020', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 0, '', '', '', 0, -6, 'HLD', '', '', NULL),
4725
        ('020', 'a', 'International Standard Book Number', 'International Standard Book Number', 0, 0, 'biblioitems.isbn', 0, '', '', '', 0, 0, 'HLD', '', '', NULL),
4726
        ('020', 'c', 'Terms of availability', 'Terms of availability', 0, 0, '', 0, '', '', '', 0, 0, 'HLD', '', '', NULL),
4727
        ('020', 'q', 'Qualifying information', 'Qualifying information', 1, 0, '', 0, '', '', '', 0, 0, 'HLD', '', '', NULL),
4728
        ('020', 'z', 'Canceled/invalid ISBN', 'Canceled/invalid ISBN', 1, 0, '', 0, '', '', '', 0, -1, 'HLD', '', '', NULL),
4729
        ('022', '2', 'Source', 'Source', 0, 0, '', 0, '', '', '', 0, 0, 'HLD', '', '', NULL),
4730
        ('022', '6', 'Linkage', 'Linkage', 0, 0, '', 0, '', '', '', 0, -6, 'HLD', '', '', NULL),
4731
        ('022', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 0, '', '', '', 0, -6, 'HLD', '', '', NULL),
4732
        ('022', 'a', 'International Standard Serial Number', 'International Standard Serial Number', 0, 0, 'biblioitems.issn', 0, '', '', '', 0, 0, 'HLD', '', '', NULL),
4733
        ('022', 'l', 'ISSN-L', 'ISSN-L', 0, 0, '', 0, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4734
        ('022', 'm', 'Canceled ISSN-L', 'Canceled ISSN-L', 1, 0, '', 0, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4735
        ('022', 'y', 'Incorrect ISSN', 'Incorrect ISSN', 1, 0, '', 0, '', '', '', 0, -1, 'HLD', '', '', NULL),
4736
        ('022', 'z', 'Canceled ISSN', 'Canceled ISSN', 1, 0, '', 0, '', '', '', 0, -1, 'HLD', '', '', NULL),
4737
        ('024', '2', 'Source of number or code', 'Source of number or code', 0, 0, '', 0, '', '', '', 0, 0, 'HLD', '', '', NULL),
4738
        ('024', '6', 'Linkage', 'Linkage', 0, 0, '', 0, '', '', '', 0, -6, 'HLD', '', '', NULL),
4739
        ('024', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 0, '', '', '', 0, -6, 'HLD', '', '', NULL),
4740
        ('024', 'a', 'Standard number or code', 'Standard number or code', 0, 0, '', 0, '', '', '', 0, 0, 'HLD', '', '', NULL),
4741
        ('024', 'b', 'Additional codes following the standard number [OBSOLETE]', 'Additional codes following the standard number [OBSOLETE]', 0, 0, '', 0, '', '', '', 0, -6, 'HLD', '', '', NULL),
4742
        ('024', 'c', 'Terms of availability', 'Terms of availability', 0, 0, '', 0, '', '', '', 0, 0, 'HLD', '', '', NULL),
4743
        ('024', 'd', 'Additional codes following the standard number or code', 'Additional codes following the standard number or code', 0, 0, '', 0, '', '', '', 0, 0, 'HLD', '', '', NULL),
4744
        ('024', 'q', 'Qualifying information', 'Qualifying information', 1, 0, '', 0, '', '', '', 0, 0, 'HLD', '', '', NULL),
4745
        ('024', 'z', 'Canceled/invalid standard number or code', 'Canceled/invalid standard number or code', 1, 0, '', 0, '', '', '', 0, -1, 'HLD', '', '', NULL),
4746
        ('027', '6', 'Linkage', 'Linkage', 0, 0, '', 0, '', '', '', 0, -6, 'HLD', '', '', NULL),
4747
        ('027', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 0, '', '', '', 0, -6, 'HLD', '', '', NULL),
4748
        ('027', 'a', 'Standard technical report number', 'Standard technical report number', 0, 0, '', 0, '', '', '', 0, -1, 'HLD', '', '', NULL),
4749
        ('027', 'q', 'Qualifying information', 'Qualifying information', 1, 0, '', 0, '', '', '', 0, 0, 'HLD', '', '', NULL),
4750
        ('027', 'z', 'Canceled/invalid number', 'Canceled/invalid number', 1, 0, '', 0, '', '', '', 0, -1, 'HLD', '', '', NULL),
4751
        ('030', '6', 'Linkage', 'Linkage', 0, 0, '', 0, '', '', '', 0, -6, 'HLD', '', '', NULL),
4752
        ('030', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 0, '', '', '', 0, -6, 'HLD', '', '', NULL),
4753
        ('030', 'a', 'CODEN', 'CODEN', 0, 0, '', 0, '', '', '', 0, -6, 'HLD', '', '', NULL),
4754
        ('030', 'z', 'Canceled/invalid CODEN', 'Canceled/invalid CODEN', 1, 0, '', 0, '', '', '', 0, -6, 'HLD', '', '', NULL),
4755
        ('035', '6', 'Linkage', 'Linkage', 0, 0, '', 0, '', '', '', 0, -6, 'HLD', '', '', NULL),
4756
        ('035', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 0, '', '', '', 0, -6, 'HLD', '', '', NULL),
4757
        ('035', 'a', 'System control number', 'System control number', 0, 0, '', 0, '', '', '', 0, 0, 'HLD', '', '', NULL),
4758
        ('035', 'z', 'Canceled/invalid control number', 'Canceled/invalid control number', 1, 0, '', 0, '', '', '', 0, -1, 'HLD', '', '', NULL),
4759
        ('040', '6', 'Linkage', 'Linkage', 0, 0, '', 0, '', '', '', 0, -6, 'HLD', '', '', NULL),
4760
        ('040', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 0, '', '', '', 0, -6, 'HLD', '', '', NULL),
4761
        ('040', 'a', 'Original cataloging agency', 'Original cataloging agency', 0, 0, '', 0, '', '', '', 0, 0, 'HLD', '', '', NULL),
4762
        ('040', 'b', 'Language of cataloging', 'Language of cataloging', 0, 0, '', 0, '', '', '', 0, 0, 'HLD', '', '', NULL),
4763
        ('040', 'c', 'Transcribing agency', 'Transcribing agency', 0, 1, '', 0, '', '', '', 0, 0, 'HLD', '', '', NULL),
4764
        ('040', 'd', 'Modifying agency', 'Modifying agency', 1, 0, '', 0, '', '', '', 0, 0, 'HLD', '', '', NULL),
4765
        ('066', 'a', 'Primary G0 character set', 'Primary G0 character set', 0, 0, NULL, 0, NULL, NULL, '', NULL, -6, 'HLD', '', '', NULL),
4766
        ('066', 'b', 'Primary G1 character set', 'Primary G1 character set', 0, 0, NULL, 0, NULL, NULL, '', NULL, -6, 'HLD', '', '', NULL),
4767
        ('066', 'c', 'Alternate G0 or G1 character set', 'Alternate G0 or G1 character set', 1, 0, NULL, 0, NULL, NULL, '', NULL, -6, 'HLD', '', '', NULL),
4768
4769
        ('337', '0', 'Authority record control number or standard number', 'Authority record control number or standard number', 1, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4770
        ('337', '1', 'Real World Object URI', 'Real World Object URI', 1, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4771
        ('337', '2', 'Source', 'Source', 0, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4772
        ('337', '3', 'Materials specified', 'Materials specified', 0, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4773
        ('337', '6', 'Linkage', 'Linkage', 0, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4774
        ('337', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4775
        ('337', 'a', 'Media type term', 'Media type term', 1, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4776
        ('337', 'b', 'Media type code', 'Media type code', 1, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4777
        ('338', '0', 'Authority record control number or standard number', 'Authority record control number or standard number', 1, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4778
        ('338', '1', 'Real World Object URI', 'Real World Object URI', 1, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4779
        ('338', '2', 'Source', 'Source', 0, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4780
        ('338', '3', 'Materials specified', 'Materials specified', 0, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4781
        ('338', '6', 'Linkage', 'Linkage', 0, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4782
        ('338', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4783
        ('338', 'a', 'Carrier type term', 'Carrier type term', 1, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4784
        ('338', 'b', 'Carrier type code', 'Carrier type code', 1, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4785
        ('347', 'a', 'File type', 'File type', 1, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4786
        ('347', '0', 'Authority record control number or standard number', 'Authority record control number or standard number', 1, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4787
        ('347', '1', 'Real World Object URI', 'Real World Object URI', 1, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4788
        ('347', '2', 'Source', 'Source', 0, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4789
        ('347', '3', 'Materials specified', 'Materials specified', 0, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4790
        ('347', '6', 'Linkage', 'Linkage', 0, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4791
        ('347', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4792
        ('347', 'b', 'Encoding format', 'Encoding format', 1, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4793
        ('347', 'c', 'File size', 'File size', 1, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4794
        ('347', 'd', 'Resolution', 'Resolution', 1, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4795
        ('347', 'e', 'Regional encoding', 'Regional encoding', 1, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4796
        ('347', 'f', 'Encoded bitrate', 'Encoded bitrate', 1, 0, '', 3, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4797
        ('506', '2', 'Source of term', 'Source of term', 0, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4798
        ('506', '3', 'Materials specified', 'Materials specified', 0, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4799
        ('506', '5', 'Institution to which field applies', 'Institution to which field applies', 0, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4800
        ('506', '6', 'Linkage', 'Linkage', 0, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4801
        ('506', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4802
        ('506', 'a', 'Terms governing access', 'Terms governing access', 0, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4803
        ('506', 'b', 'Jurisdiction', 'Jurisdiction', 1, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4804
        ('506', 'c', 'Physical access provisions', 'Physical access provisions', 1, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4805
        ('506', 'd', 'Authorized users', 'Authorized users', 1, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4806
        ('506', 'e', 'Authorization', 'Authorization', 1, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4807
        ('506', 'f', 'Standardized terminology for access restriction', 'Standardized terminology for access restriction', 1, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4808
        ('506', 'u', 'Uniform Resource Identifier', 'Uniform Resource Identifier', 1, 0, '', 5, '', '', '', 1, -6, 'HLD', '', '', NULL),
4809
        ('538', '3', 'Materials specified', 'Materials specified', 0, 0, NULL, 5, NULL, NULL, '', NULL, -6, 'HLD', '', '', NULL),
4810
        ('538', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4811
        ('538', '6', 'Linkage', 'Linkage', 0, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4812
        ('538', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4813
        ('538', 'a', 'System details note', 'System details note', 0, 0, '', 5, '', '', '', NULL, -1, 'HLD', '', '', NULL),
4814
        ('538', 'i', 'Display text', 'Display text', 0, 0, '', 5, '', '', '', NULL, -1, 'HLD', '', '', NULL),
4815
        ('538', 'u', 'Uniform Resource Identifier', 'Uniform Resource Identifier', 1, 0, '', 5, '', '', '', 1, -1, 'HLD', '', '', NULL),
4816
        ('541', '3', 'Materials specified', 'Materials specified', 0, 0, NULL, 5, NULL, NULL, '', NULL, -6, 'HLD', '', '', NULL),
4817
        ('541', '5', 'Institution to which field applies', 'Institution to which field applies', 0, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4818
        ('541', '6', 'Linkage', 'Linkage', 0, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4819
        ('541', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4820
        ('541', 'a', 'Source of acquisition', 'Source of acquisition', 0, 0, '', 5, '', '', '', NULL, 1, 'HLD', '', '', NULL),
4821
        ('541', 'b', 'Address', 'Address', 0, 0, '', 5, '', '', '', NULL, 1, 'HLD', '', '', NULL),
4822
        ('541', 'c', 'Method of acquisition', 'Method of acquisition', 0, 0, '', 5, '', '', '', NULL, 1, 'HLD', '', '', NULL),
4823
        ('541', 'd', 'Date of acquisition', 'Date of acquisition', 0, 0, '', 5, '', '', '', NULL, 1, 'HLD', '', '', NULL),
4824
        ('541', 'e', 'Accession number', 'Accession number', 0, 0, '', 5, '', '', '', NULL, 1, 'HLD', '', '', NULL),
4825
        ('541', 'f', 'Owner', 'Owner', 0, 0, '', 5, '', '', '', NULL, 1, 'HLD', '', '', NULL),
4826
        ('541', 'h', 'Purchase price', 'Purchase price', 0, 0, '', 5, '', '', '', NULL, 1, 'HLD', '', '', NULL),
4827
        ('541', 'n', 'Extent', 'Extent', 1, 0, '', 5, '', '', '', NULL, 1, 'HLD', '', '', NULL),
4828
        ('541', 'o', 'Type of unit', 'Type of unit', 1, 0, '', 5, '', '', '', NULL, 1, 'HLD', '', '', NULL),
4829
        ('561', '3', 'Materials specified', 'Materials specified', 0, 0, NULL, 5, NULL, NULL, '', NULL, -6, 'HLD', '', '', NULL),
4830
        ('561', '5', 'Institution to which field applies', 'Institution to which field applies', 0, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4831
        ('561', '6', 'Linkage', 'Linkage', 0, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4832
        ('561', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4833
        ('561', 'a', 'History', 'History', 0, 0, '', 5, '', '', '', NULL, 6, 'HLD', '', '', NULL),
4834
        ('561', 'b', 'Time of collation [OBSOLETE]', 'Time of collation [OBSOLETE]', 0, 0, '', 5, '', '', '', NULL, 6, 'HLD', '', '', NULL),
4835
        ('561', 'u', 'Uniform Resource Identifier', 'Uniform Resource Identifier', 1, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4836
        ('562', '3', 'Materials specified', 'Materials specified', 0, 0, NULL, 5, NULL, NULL, '', NULL, -6, 'HLD', '', '', NULL),
4837
        ('562', '5', 'Institution to which field applies', 'Institution to which field applies', 0, 0, NULL, -1, NULL, NULL, '', NULL, -6, 'HLD', '', '', NULL),
4838
        ('562', '6', 'Linkage', 'Linkage', 0, 0, NULL, 5, NULL, NULL, '', NULL, -6, 'HLD', '', '', NULL),
4839
        ('562', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, NULL, 5, NULL, NULL, '', NULL, -6, 'HLD', '', '', NULL),
4840
        ('562', 'a', 'Identifying markings', 'Identifying markings', 1, 0, NULL, 5, NULL, NULL, '', NULL, -1, 'HLD', '', '', NULL),
4841
        ('562', 'b', 'Copy identification', 'Copy identification', 1, 0, NULL, 5, NULL, NULL, '', NULL, -1, 'HLD', '', '', NULL),
4842
        ('562', 'c', 'Version identification', 'Version identification', 1, 0, NULL, 5, NULL, NULL, '', NULL, -1, 'HLD', '', '', NULL),
4843
        ('562', 'd', 'Presentation format', 'Presentation format', 1, 0, NULL, 5, NULL, NULL, '', NULL, -1, 'HLD', '', '', NULL),
4844
        ('562', 'e', 'Number of copies', 'Number of copies', 1, 0, NULL, 5, NULL, NULL, '', NULL, -1, 'HLD', '', '', NULL),
4845
        ('563', '3', 'Materials specified', 'Materials specified', 0, 0, NULL, 5, NULL, NULL, '', NULL, -6, 'HLD', '', '', NULL),
4846
        ('563', '5', 'Institution to which field applies', 'Institution to which field applies', 0, 0, NULL, -1, NULL, NULL, '', NULL, -6, 'HLD', '', '', NULL),
4847
        ('563', '6', 'Linkage', 'Linkage', 0, 0, NULL, 5, NULL, NULL, '', NULL, -6, 'HLD', '', '', NULL),
4848
        ('563', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, NULL, 5, NULL, NULL, '', NULL, -6, 'HLD', '', '', NULL),
4849
        ('563', 'a', 'Binding note', 'Binding note', 0, 0, NULL, 5, NULL, NULL, '', NULL, -1, 'HLD', '', '', NULL),
4850
        ('563', 'u', 'Uniform Resource Identifier', 'Uniform Resource Identifier', 1, 0, NULL, 5, NULL, NULL, '', 1, -1, 'HLD', '', '', NULL),
4851
        ('583', '2', 'Source of term', 'Source of term', 0, 0, NULL, 5, NULL, NULL, '', NULL, -6, 'HLD', '', '', NULL),
4852
        ('583', '3', 'Materials specified', 'Materials specified', 0, 0, NULL, 5, NULL, NULL, '', NULL, -6, 'HLD', '', '', NULL),
4853
        ('583', '5', 'Institution to which field applies', 'Institution to which field applies', 0, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4854
        ('583', '6', 'Linkage', 'Linkage', 0, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4855
        ('583', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4856
        ('583', 'a', 'Action', 'Action', 0, 0, '', 5, '', '', '', NULL, -1, 'HLD', '', '', NULL),
4857
        ('583', 'b', 'Action identification', 'Action identification', 1, 0, '', 5, '', '', '', NULL, -1, 'HLD', '', '', NULL),
4858
        ('583', 'c', 'Time/date of action', 'Time/date of action', 1, 0, '', 5, '', '', '', NULL, -1, 'HLD', '', '', NULL),
4859
        ('583', 'd', 'Action interval', 'Action interval', 1, 0, '', 5, '', '', '', NULL, -1, 'HLD', '', '', NULL),
4860
        ('583', 'e', 'Contingency for action', 'Contingency for action', 1, 0, '', 5, '', '', '', NULL, -1, 'HLD', '', '', NULL),
4861
        ('583', 'f', 'Authorization', 'Authorization', 1, 0, '', 5, '', '', '', NULL, -1, 'HLD', '', '', NULL),
4862
        ('583', 'h', 'Jurisdiction', 'Jurisdiction', 1, 0, '', 5, '', '', '', NULL, -1, 'HLD', '', '', NULL),
4863
        ('583', 'i', 'Method of action', 'Method of action', 1, 0, '', 5, '', '', '', NULL, -1, 'HLD', '', '', NULL),
4864
        ('583', 'j', 'Site of action', 'Site of action', 1, 0, '', 5, '', '', '', NULL, -1, 'HLD', '', '', NULL),
4865
        ('583', 'k', 'Action agent', 'Action agent', 1, 0, '', 5, '', '', '', NULL, -1, 'HLD', '', '', NULL),
4866
        ('583', 'l', 'Status', 'Status', 1, 0, '', 5, '', '', '', NULL, -1, 'HLD', '', '', NULL),
4867
        ('583', 'n', 'Extent', 'Extent', 1, 0, '', 5, '', '', '', NULL, -1, 'HLD', '', '', NULL),
4868
        ('583', 'o', 'Type of unit', 'Type of unit', 1, 0, '', 5, '', '', '', NULL, -1, 'HLD', '', '', NULL),
4869
        ('583', 'u', 'Uniform Resource Identifier', 'Uniform Resource Identifier', 1, 0, '', 5, '', '', '', 1, -1, 'HLD', '', '', NULL),
4870
        ('583', 'x', 'Nonpublic note', 'Nonpublic note', 1, 0, '', 5, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4871
        ('583', 'z', 'Public note', 'Public note', 1, 0, '', 5, '', '', '', NULL, -1, 'HLD', '', '', NULL),
4872
        ('842', '6', 'Linkage', 'Linkage', 0, 0, '', 8, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4873
        ('842', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 8, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4874
        ('842', 'a', 'Textual physical form designator', 'Textual physical form designator', 0, 0, '', 8, '', '', '', NULL, -1, 'HLD', '', '', NULL),
4875
        ('843', '3', 'Materials specified', 'Materials specified', 0, 0, NULL, 8, NULL, NULL, '', NULL, -6, 'HLD', '', '', NULL),
4876
        ('843', '5', 'Institution to which field applies', 'Institution to which field applies', 0, 0, NULL, -1, NULL, NULL, '', NULL, -6, 'HLD', '', '', NULL),
4877
        ('843', '6', 'Linkage', 'Linkage', 0, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4878
        ('843', '7', 'Fixed-length data elements of reproduction', 'Fixed-length data elements of reproduction', 0, 0, NULL, 8, NULL, NULL, '', NULL, -6, 'HLD', '', '', NULL),
4879
        ('843', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 8, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4880
        ('843', 'a', 'Type of reproduction', 'Type of reproduction', 0, 0, NULL, 8, NULL, NULL, '', NULL, -1, 'HLD', '', '', NULL),
4881
        ('843', 'b', 'Place of reproduction', 'Place of reproduction', 1, 0, NULL, 8, NULL, NULL, '', NULL, -1, 'HLD', '', '', NULL),
4882
        ('843', 'c', 'Agency responsible for reproduction', 'Agency responsible for reproduction', 1, 0, NULL, 8, NULL, NULL, '', NULL, -1, 'HLD', '', '', NULL),
4883
        ('843', 'd', 'Date of reproduction', 'Date of reproduction', 0, 0, NULL, 8, NULL, NULL, '', NULL, -1, 'HLD', '', '', NULL),
4884
        ('843', 'e', 'Physical description of reproduction', 'Physical description of reproduction', 0, 0, NULL, 8, NULL, NULL, '', NULL, -1, 'HLD', '', '', NULL),
4885
        ('843', 'f', 'Series statement of reproduction', 'Series statement of reproduction', 1, 0, NULL, 8, NULL, NULL, '', NULL, -1, 'HLD', '', '', NULL),
4886
        ('843', 'm', 'Dates and/or sequential designation of issues reproduced', 'Dates and/or sequential designation of issues reproduced', 1, 0, NULL, 8, NULL, NULL, '', NULL, -1, 'HLD', '', '', NULL),
4887
        ('843', 'n', 'Note about reproduction', 'Note about reproduction', 1, 0, NULL, 8, NULL, NULL, '', NULL, -1, 'HLD', '', '', NULL),
4888
        ('844', '6', 'Linkage', 'Linkage', 0, 0, '', 8, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4889
        ('844', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 8, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4890
        ('844', 'a', 'Name of unit', 'Name of unit', 0, 0, '', 8, '', '', '', NULL, -1, 'HLD', '', '', NULL),
4891
        ('845', 'a', 'Terms governing use and reproduction', 'Terms governing use and reproduction', 0, 0, '', 5, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4892
        ('845', 'b', 'Jurisdiction', 'Jurisdiction', 0, 0, '', 8, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4893
        ('845', 'c', 'Authorization', 'Authorization', 0, 0, '', 8, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4894
        ('845', 'd', 'Authorized users', 'Authorized users', 0, 0, '', 8, '', '', '', NULL, -6, 'HLD', '', '', NULL),
4895
        ('845', 'u', 'Uniform Resource Identifier', 'Uniform Resource Identifier', 1, 0, '', 8, '', '', '', 1, -6, 'HLD', '', '', NULL),
4896
        ('850', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, NULL, 8, NULL, NULL, '', NULL, 4, 'HLD', '', '', NULL),
4897
        ('850', 'a', 'Holding institution', 'Holding institution', 1, 0, NULL, 8, NULL, NULL, '', NULL, 4, 'HLD', '', '', NULL),
4898
        ('850', 'b', 'Holdings (NR) (MU VM SE) [OBSOLETE]', 'Holdings (NR) (MU VM SE) [OBSOLETE]', 0, 0, NULL, 8, NULL, NULL, '', NULL, 4, 'HLD', '', '', NULL),
4899
        ('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),
4900
        ('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),
4901
        ('852', '2', 'Source of classification or shelving scheme', 'Source of classification or shelving scheme', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4902
        ('852', '3', 'Materials specified', 'Materials specified', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4903
        ('852', '6', 'Linkage', 'Linkage', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4904
        ('852', '8', 'Sequence number', 'Sequence number', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4905
        ('852', 'a', 'Location', 'Location', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4906
        ('852', 'b', 'Sublocation or collection', 'Sublocation or collection', 1, 0, 'holdings.holdingbranch', 8, 'branches', '', '', NULL, 4, 'HLD', '', '', NULL),
4907
        ('852', 'c', 'Shelving location', 'Shelving location', 1, 0, 'holdings.location', 8, 'LOC', '', '', NULL, 4, 'HLD', '', '', NULL),
4908
        ('852', 'd', 'Former shelving location', 'Former shelving location', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4909
        ('852', 'e', 'Address', 'Address', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4910
        ('852', 'f', 'Coded location qualifier', 'Coded location qualifier', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4911
        ('852', 'g', 'Non-coded location qualifier', 'Non-coded location qualifier', 1, 0, 'holdings.ccode', 8, 'CCODE', '', '', NULL, 4, 'HLD', '', '', NULL),
4912
        ('852', 'h', 'Classification part', 'Classification part', 0, 0, 'holdings.callnumber', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4913
        ('852', 'i', 'Item part', 'Item part', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4914
        ('852', 'j', 'Shelving control number', 'Shelving control number', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4915
        ('852', 'k', 'Call number prefix', 'Call number prefix', 1, 0, 'holdings.callnumber', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4916
        ('852', 'l', 'Shelving form of title', 'Shelving form of title', 0, 0, 'holdings.callnumber', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4917
        ('852', 'm', 'Call number suffix', 'Call number suffix', 1, 0, 'holdings.callnumber', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4918
        ('852', 'n', 'Country code', 'Country code', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4919
        ('852', 'p', 'Piece designation', 'Piece designation', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4920
        ('852', 'q', 'Piece physical condition', 'Piece physical condition', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4921
        ('852', 's', 'Copyright article-fee code', 'Copyright article-fee code', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4922
        ('852', 't', 'Copy number', 'Copy number', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4923
        ('852', 'u', 'Uniform Resource Identifier', 'Uniform Resource Identifier', 1, 0, '', 8, '', '', '', 1, 4, 'HLD', '', '', NULL),
4924
        ('852', 'x', 'Nonpublic note', 'Nonpublic note', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4925
        ('852', 'z', 'Public note', 'Public note', 1, 0, 'holdings.public_note', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4926
        ('853', '3', 'Materials specified', 'Materials specified', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4927
        ('853', '6', 'Linkage', 'Linkage', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4928
        ('853', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4929
        ('853', 'a', 'First level of enumeration', 'First level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4930
        ('853', 'b', 'Second level of enumeration', 'Second level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4931
        ('853', 'c', 'Third level of enumeration', 'Third level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4932
        ('853', 'd', 'Fourth level of enumeration', 'Fourth level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4933
        ('853', 'e', 'Fifth level of enumeration', 'Fifth level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4934
        ('853', 'f', 'Sixth level of enumeration', 'Sixth level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4935
        ('853', 'g', 'Alternative numbering scheme, first level of enumeration', 'Alternative numbering scheme, first level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4936
        ('853', 'h', 'Alternative numbering scheme, second level of enumeration', 'Alternative numbering scheme, second level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4937
        ('853', 'i', 'First level of chronology', 'First level of chronology', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4938
        ('853', 'j', 'Second level of chronology', 'Second level of chronology', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4939
        ('853', 'k', 'Third level of chronology', 'Third level of chronology', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4940
        ('853', 'l', 'Fourth level of chronology', 'Fourth level of chronology', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4941
        ('853', 'm', 'Alternative numbering scheme, chronology', 'Alternative numbering scheme, chronology', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4942
        ('853', 'n', 'Pattern note', 'Pattern note', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4943
        ('853', 'p', 'Number of pieces per issuance', 'Number of pieces per issuance', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4944
        ('853', 't', 'Copy', 'Copy', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4945
        ('853', 'u', 'Bibliographic units per next higher level', 'Bibliographic units per next higher level', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4946
        ('853', 'v', 'Numbering continuity', 'Numbering continuity', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4947
        ('853', 'w', 'Frequency', 'Frequency', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4948
        ('853', 'x', 'Calendar change', 'Calendar change', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4949
        ('853', 'y', 'Regularity pattern', 'Regularity pattern', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4950
        ('853', 'z', 'Numbering scheme', 'Numbering scheme', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4951
        ('854', '3', 'Materials specified', 'Materials specified', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4952
        ('854', '6', 'Linkage', 'Linkage', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4953
        ('854', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4954
        ('854', 'a', 'First level of enumeration', 'First level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4955
        ('854', 'b', 'Second level of enumeration', 'Second level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4956
        ('854', 'c', 'Third level of enumeration', 'Third level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4957
        ('854', 'd', 'Fourth level of enumeration', 'Fourth level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4958
        ('854', 'e', 'Fifth level of enumeration', 'Fifth level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4959
        ('854', 'f', 'Sixth level of enumeration', 'Sixth level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4960
        ('854', 'g', 'Alternative numbering scheme, first level of enumeration', 'Alternative numbering scheme, first level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4961
        ('854', 'h', 'Alternative numbering scheme, second level of enumeration', 'Alternative numbering scheme, second level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4962
        ('854', 'i', 'First level of chronology', 'First level of chronology', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4963
        ('854', 'j', 'Second level of chronology', 'Second level of chronology', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4964
        ('854', 'k', 'Third level of chronology', 'Third level of chronology', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4965
        ('854', 'l', 'Fourth level of chronology', 'Fourth level of chronology', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4966
        ('854', 'm', 'Alternative numbering scheme, chronology', 'Alternative numbering scheme, chronology', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4967
        ('854', 'n', 'Pattern note', 'Pattern note', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4968
        ('854', 'p', 'Number of pieces per issuance', 'Number of pieces per issuance', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4969
        ('854', 't', 'Copy', 'Copy', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4970
        ('854', 'u', 'Bibliographic units per next higher level', 'Bibliographic units per next higher level', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4971
        ('854', 'v', 'Numbering continuity', 'Numbering continuity', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4972
        ('854', 'w', 'Frequency', 'Frequency', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4973
        ('854', 'x', 'Calendar change', 'Calendar change', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4974
        ('854', 'y', 'Regularity pattern', 'Regularity pattern', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4975
        ('854', 'z', 'Numbering scheme', 'Numbering scheme', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4976
        ('855', '3', 'Materials specified', 'Materials specified', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4977
        ('855', '6', 'Linkage', 'Linkage', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4978
        ('855', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4979
        ('855', 'a', 'First level of enumeration', 'First level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4980
        ('855', 'b', 'Second level of enumeration', 'Second level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4981
        ('855', 'c', 'Third level of enumeration', 'Third level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4982
        ('855', 'd', 'Fourth level of enumeration', 'Fourth level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4983
        ('855', 'e', 'Fifth level of enumeration', 'Fifth level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4984
        ('855', 'f', 'Sixth level of enumeration', 'Sixth level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4985
        ('855', 'g', 'Alternative numbering scheme, first level of enumeration', 'Alternative numbering scheme, first level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4986
        ('855', 'h', 'Alternative numbering scheme, second level of enumeration', 'Alternative numbering scheme, second level of enumeration', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4987
        ('855', 'i', 'First level of chronology', 'First level of chronology', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4988
        ('855', 'j', 'Second level of chronology', 'Second level of chronology', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4989
        ('855', 'k', 'Third level of chronology', 'Third level of chronology', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4990
        ('855', 'l', 'Fourth level of chronology', 'Fourth level of chronology', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4991
        ('855', 'm', 'Alternative numbering scheme, chronology', 'Alternative numbering scheme, chronology', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4992
        ('855', 'n', 'Pattern note', 'Pattern note', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4993
        ('855', 'p', 'Number of pieces per issuance', 'Number of pieces per issuance', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4994
        ('855', 't', 'Copy', 'Copy', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4995
        ('855', 'u', 'Bibliographic units per next higher level', 'Bibliographic units per next higher level', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4996
        ('855', 'v', 'Numbering continuity', 'Numbering continuity', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4997
        ('855', 'w', 'Frequency', 'Frequency', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4998
        ('855', 'x', 'Calendar change', 'Calendar change', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
4999
        ('855', 'y', 'Regularity pattern', 'Regularity pattern', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5000
        ('855', 'z', 'Numbering scheme', 'Numbering scheme', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5001
        ('856', '2', 'Access method', 'Access method', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5002
        ('856', '3', 'Materials specified', 'Materials specified', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5003
        ('856', '6', 'Linkage', 'Linkage', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5004
        ('856', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5005
        ('856', 'a', 'Host name', 'Host name', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5006
        ('856', 'b', 'Access number', 'Access number', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5007
        ('856', 'c', 'Compression information', 'Compression information', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5008
        ('856', 'd', 'Path', 'Path', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5009
        ('856', 'f', 'Electronic name', 'Electronic name', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5010
        ('856', 'h', 'Processor of request', 'Processor of request', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5011
        ('856', 'i', 'Instruction', 'Instruction', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5012
        ('856', 'j', 'Bits per second', 'Bits per second', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5013
        ('856', 'k', 'Password', 'Password', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5014
        ('856', 'l', 'Logon', 'Logon', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5015
        ('856', 'm', 'Contact for access assistance', 'Contact for access assistance', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5016
        ('856', 'n', 'Name of location of host', 'Name of location of host', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5017
        ('856', 'o', 'Operating system', 'Operating system', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5018
        ('856', 'p', 'Port', 'Port', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5019
        ('856', 'q', 'Electronic format type', 'Electronic format type', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5020
        ('856', 'r', 'Settings', 'Settings', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5021
        ('856', 's', 'File size', 'File size', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5022
        ('856', 't', 'Terminal emulation', 'Terminal emulation', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5023
        ('856', 'u', 'Uniform Resource Identifier', 'Uniform Resource Identifier', 1, 0, 'biblioitems.url', 8, '', '', '', 1, 4, 'HLD', '', '', NULL),
5024
        ('856', 'v', 'Hours access method available', 'Hours access method available', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5025
        ('856', 'w', 'Record control number', 'Record control number', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5026
        ('856', 'x', 'Nonpublic note', 'Nonpublic note', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5027
        ('856', 'y', 'Link text', 'Link text', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5028
        ('856', 'z', 'Public note', 'Public note', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5029
        ('863', '6', 'Linkage', 'Linkage', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5030
        ('863', '8', 'Field link and sequence number', 'Field link and sequence number', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5031
        ('863', 'a', 'First level of enumeration', 'First level of enumeration', 0, 0, 'holdings.summary', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5032
        ('863', 'b', 'Second level of enumeration', 'Second level of enumeration', 0, 0, 'holdings.summary', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5033
        ('863', 'c', 'Third level of enumeration', 'Third level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5034
        ('863', 'd', 'Fourth level of enumeration', 'Fourth level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5035
        ('863', 'e', 'Fifth level of enumeration', 'Fifth level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5036
        ('863', 'f', 'Sixth level of enumeration', 'Sixth level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5037
        ('863', 'g', 'Alternative numbering scheme, first level of enumeration', 'Alternative numbering scheme, first level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5038
        ('863', 'h', 'Alternative numbering scheme, second level of enumeration', 'Alternative numbering scheme, second level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5039
        ('863', 'i', 'First level of chronology', 'First level of chronology', 0, 0, 'holdings.summary', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5040
        ('863', 'j', 'Second level of chronology', 'Second level of chronology', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5041
        ('863', 'k', 'Third level of chronology', 'Third level of chronology', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5042
        ('863', 'l', 'Fourth level of chronology', 'Fourth level of chronology', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5043
        ('863', 'm', 'Alternative numbering scheme, chronology', 'Alternative numbering scheme, chronology', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5044
        ('863', 'n', 'Converted Gregorian year', 'Converted Gregorian year', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5045
        ('863', 'o', 'Type of unit', 'Type of unit', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5046
        ('863', 'p', 'Piece designation', 'Piece designation', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5047
        ('863', 'q', 'Piece physical condition', 'Piece physical condition', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5048
        ('863', 's', 'Copyright article-fee code', 'Copyright article-fee code', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5049
        ('863', 't', 'Copy number', 'Copy number', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5050
        ('863', 'v', 'Issuing date', 'Issuing date', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5051
        ('863', 'w', 'Break indicator', 'Break indicator', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5052
        ('863', 'x', 'Nonpublic note', 'Nonpublic note', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5053
        ('863', 'z', 'Public note', 'Public note', 1, 0, 'holdings.summary', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5054
        ('864', '6', 'Linkage', 'Linkage', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5055
        ('864', '8', 'Field link and sequence number', 'Field link and sequence number', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5056
        ('864', 'a', 'First level of enumeration', 'First level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5057
        ('864', 'b', 'Second level of enumeration', 'Second level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5058
        ('864', 'c', 'Third level of enumeration', 'Third level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5059
        ('864', 'd', 'Fourth level of enumeration', 'Fourth level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5060
        ('864', 'e', 'Fifth level of enumeration', 'Fifth level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5061
        ('864', 'f', 'Sixth level of enumeration', 'Sixth level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5062
        ('864', 'g', 'Alternative numbering scheme, first level of enumeration', 'Alternative numbering scheme, first level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5063
        ('864', 'h', 'Alternative numbering scheme, second level of enumeration', 'Alternative numbering scheme, second level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5064
        ('864', 'i', 'First level of chronology', 'First level of chronology', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5065
        ('864', 'j', 'Second level of chronology', 'Second level of chronology', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5066
        ('864', 'k', 'Third level of chronology', 'Third level of chronology', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5067
        ('864', 'l', 'Fourth level of chronology', 'Fourth level of chronology', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5068
        ('864', 'm', 'Alternative numbering scheme, chronology', 'Alternative numbering scheme, chronology', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5069
        ('864', 'n', 'Converted Gregorian year', 'Converted Gregorian year', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5070
        ('864', 'o', 'Type of unit', 'Type of unit', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5071
        ('864', 'p', 'Piece designation', 'Piece designation', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5072
        ('864', 'q', 'Piece physical condition', 'Piece physical condition', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5073
        ('864', 's', 'Copyright article-fee code', 'Copyright article-fee code', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5074
        ('864', 't', 'Copy number', 'Copy number', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5075
        ('864', 'v', 'Issuing date', 'Issuing date', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5076
        ('864', 'w', 'Break indicator', 'Break indicator', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5077
        ('864', 'x', 'Nonpublic note', 'Nonpublic note', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5078
        ('864', 'z', 'Public note', 'Public note', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5079
        ('865', '6', 'Linkage', 'Linkage', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5080
        ('865', '8', 'Field link and sequence number', 'Field link and sequence number', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5081
        ('865', 'a', 'First level of enumeration', 'First level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5082
        ('865', 'b', 'Second level of enumeration', 'Second level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5083
        ('865', 'c', 'Third level of enumeration', 'Third level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5084
        ('865', 'd', 'Fourth level of enumeration', 'Fourth level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5085
        ('865', 'e', 'Fifth level of enumeration', 'Fifth level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5086
        ('865', 'f', 'Sixth level of enumeration', 'Sixth level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5087
        ('865', 'g', 'Alternative numbering scheme, first level of enumeration', 'Alternative numbering scheme, first level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5088
        ('865', 'h', 'Alternative numbering scheme, second level of enumeration', 'Alternative numbering scheme, second level of enumeration', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5089
        ('865', 'i', 'First level of chronology', 'First level of chronology', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5090
        ('865', 'j', 'Second level of chronology', 'Second level of chronology', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5091
        ('865', 'k', 'Third level of chronology', 'Third level of chronology', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5092
        ('865', 'l', 'Fourth level of chronology', 'Fourth level of chronology', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5093
        ('865', 'm', 'Alternative numbering scheme, chronology', 'Alternative numbering scheme, chronology', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5094
        ('865', 'n', 'Converted Gregorian year', 'Converted Gregorian year', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5095
        ('865', 'o', 'Type of unit', 'Type of unit', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5096
        ('865', 'p', 'Piece designation', 'Piece designation', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5097
        ('865', 'q', 'Piece physical condition', 'Piece physical condition', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5098
        ('865', 's', 'Copyright article-fee code', 'Copyright article-fee code', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5099
        ('865', 't', 'Copy number', 'Copy number', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5100
        ('865', 'v', 'Issuing date', 'Issuing date', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5101
        ('865', 'w', 'Break indicator', 'Break indicator', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5102
        ('865', 'x', 'Nonpublic note', 'Nonpublic note', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5103
        ('865', 'z', 'Public note', 'Public note', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5104
        ('866', '6', 'Linkage', 'Linkage', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5105
        ('866', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5106
        ('866', 'a', 'Textual string', 'Textual string', 0, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5107
        ('866', 'x', 'Nonpublic note', 'Nonpublic note', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5108
        ('866', 'z', 'Public note', 'Public note', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5109
        ('867', '6', 'Linkage', 'Linkage', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5110
        ('867', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5111
        ('867', 'a', 'Textual string', 'Textual string', 0, 0, 'holdings.supplements', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5112
        ('867', 'x', 'Nonpublic note', 'Nonpublic note', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5113
        ('867', 'z', 'Public note', 'Public note', 1, 0, 'holdings.supplements', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5114
        ('868', '6', 'Linkage', 'Linkage', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5115
        ('868', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5116
        ('868', 'a', 'Textual string', 'Textual string', 0, 0, 'holdings.indexes', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5117
        ('868', 'x', 'Nonpublic note', 'Nonpublic note', 1, 0, '', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5118
        ('868', 'z', 'Public note', 'Public note', 1, 0, 'holdings.indexes', 8, '', '', '', 0, 4, 'HLD', '', '', NULL),
5119
        ('876', '3', 'Materials specified', 'Materials specified', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5120
        ('876', '6', 'Linkage', 'Linkage', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5121
        ('876', '8', 'Sequence number', 'Sequence number', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5122
        ('876', 'a', 'Internal item number', 'Internal item number', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5123
        ('876', 'b', 'Invalid or canceled internal item number', 'Invalid or canceled internal item number', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5124
        ('876', 'c', 'Cost', 'Cost', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5125
        ('876', 'd', 'Date acquired', 'Date acquired', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5126
        ('876', 'e', 'Source of acquisition', 'Source of acquisition', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5127
        ('876', 'h', 'Use restrictions', 'Use restrictions', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5128
        ('876', 'j', 'Item status', 'Item status', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5129
        ('876', 'l', 'Temporary location', 'Temporary location', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5130
        ('876', 'p', 'Piece designation', 'Piece designation', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5131
        ('876', 'r', 'Invalid or canceled piece designation', 'Invalid or canceled piece designation', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5132
        ('876', 't', 'Copy number', 'Copy number', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5133
        ('876', 'x', 'Nonpublic note', 'Nonpublic note', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5134
        ('876', 'z', 'Public note', 'Public note', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5135
        ('877', '3', 'Materials specified', 'Materials specified', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5136
        ('877', '6', 'Linkage', 'Linkage', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5137
        ('877', '8', 'Sequence number', 'Sequence number', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5138
        ('877', 'a', 'Internal item number', 'Internal item number', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5139
        ('877', 'b', 'Invalid or canceled internal item number', 'Invalid or canceled internal item number', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5140
        ('877', 'c', 'Cost', 'Cost', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5141
        ('877', 'd', 'Date acquired', 'Date acquired', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5142
        ('877', 'e', 'Source of acquisition', 'Source of acquisition', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5143
        ('877', 'h', 'Use restrictions', 'Use restrictions', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5144
        ('877', 'j', 'Item status', 'Item status', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5145
        ('877', 'l', 'Temporary location', 'Temporary location', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5146
        ('877', 'p', 'Piece designation', 'Piece designation', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5147
        ('877', 'r', 'Invalid or canceled piece designation', 'Invalid or canceled piece designation', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5148
        ('877', 't', 'Copy number', 'Copy number', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5149
        ('877', 'x', 'Nonpublic note', 'Nonpublic note', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5150
        ('877', 'z', 'Public note', 'Public note', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5151
        ('878', '3', 'Materials specified', 'Materials specified', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5152
        ('878', '6', 'Linkage', 'Linkage', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5153
        ('878', '8', 'Sequence number', 'Sequence number', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5154
        ('878', 'a', 'Internal item number', 'Internal item number', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5155
        ('878', 'b', 'Invalid or canceled internal item number', 'Invalid or canceled internal item number', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5156
        ('878', 'c', 'Cost', 'Cost', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5157
        ('878', 'd', 'Date acquired', 'Date acquired', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5158
        ('878', 'e', 'Source of acquisition', 'Source of acquisition', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5159
        ('878', 'h', 'Use restrictions', 'Use restrictions', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5160
        ('878', 'j', 'Item status', 'Item status', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5161
        ('878', 'l', 'Temporary location', 'Temporary location', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5162
        ('878', 'p', 'Piece designation', 'Piece designation', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5163
        ('878', 'r', 'Invalid or canceled piece designation', 'Invalid or canceled piece designation', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5164
        ('878', 't', 'Copy number', 'Copy number', 0, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5165
        ('878', 'x', 'Nonpublic note', 'Nonpublic note', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL),
5166
        ('878', 'z', 'Public note', 'Public note', 1, 0, '', 8, '', '', '', NULL, 4, 'HLD', '', '', NULL);
(-)a/installer/data/mysql/kohastructure.sql (-2 / +51 lines)
Lines 698-703 CREATE TABLE `deleteditems` ( Link Here
698
  `copynumber` varchar(32) default NULL, -- copy number (MARC21 952$t)
698
  `copynumber` varchar(32) default NULL, -- copy number (MARC21 952$t)
699
  `stocknumber` varchar(32) default NULL, -- inventory number (MARC21 952$i)
699
  `stocknumber` varchar(32) default NULL, -- inventory number (MARC21 952$i)
700
  `new_status` VARCHAR(32) DEFAULT NULL, -- 'new' value, you can put whatever free-text information. This field is intented to be managed by the automatic_item_modification_by_age cronjob.
700
  `new_status` VARCHAR(32) DEFAULT NULL, -- 'new' value, you can put whatever free-text information. This field is intented to be managed by the automatic_item_modification_by_age cronjob.
701
  `holding_id` int(11) default NULL, -- foreign key from holdings table used to link this item to the right holdings record
701
  PRIMARY KEY  (`itemnumber`),
702
  PRIMARY KEY  (`itemnumber`),
702
  KEY `delitembarcodeidx` (`barcode`),
703
  KEY `delitembarcodeidx` (`barcode`),
703
  KEY `delitemstocknumberidx` (`stocknumber`),
704
  KEY `delitemstocknumberidx` (`stocknumber`),
Lines 912-922 CREATE TABLE `refund_lost_item_fee_rules` ( -- refund lost item fee rules tbale Link Here
912
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
913
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
913
914
914
--
915
--
916
-- Table structure for table `holdings`
917
--
918
919
DROP TABLE IF EXISTS `holdings`;
920
CREATE TABLE `holdings` ( -- table that stores summary holdings information
921
  `holding_id` int(11) NOT NULL auto_increment, -- unique identifier assigned to each holdings record
922
  `biblionumber` int(11) NOT NULL default 0, -- foreign key from biblio table used to link this record to the right bib record
923
  `biblioitemnumber` int(11) NOT NULL default 0, -- foreign key from the biblioitems table to link record to additional information
924
  `frameworkcode` varchar(4) NOT NULL default '', -- foreign key from the biblio_framework table to identify which framework was used in cataloging this record
925
  `holdingbranch` varchar(10) default NULL, -- foreign key from the branches table for the library that owns this record (MARC21 852$a)
926
  `location` varchar(80) default NULL, -- authorized value for the shelving location for this record (MARC21 852$b)
927
  `ccode` varchar(80) default NULL, -- authorized value for the collection code associated with this item (MARC21 852$g)
928
  `callnumber` varchar(255) default NULL, -- call number (852$h+$i in MARC21)
929
  `suppress` tinyint(1) default NULL, -- Boolean indicating whether the record is suppressed in OPAC
930
  `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, -- date and time this record was last touched
931
  `datecreated` DATE NOT NULL, -- the date this record was added to Koha
932
	`deleted_on` DATETIME DEFAULT NULL, -- the date this record was deleted
933
  PRIMARY KEY  (`holding_id`),
934
  KEY `hldnoidx` (`holding_id`),
935
  KEY `hldbinoidx` (`biblioitemnumber`),
936
  KEY `hldbibnoidx` (`biblionumber`),
937
  CONSTRAINT `holdings_ibfk_1` FOREIGN KEY (`biblionumber`) REFERENCES `biblio` (`biblionumber`) ON DELETE CASCADE ON UPDATE CASCADE,
938
  CONSTRAINT `holdings_ibfk_2` FOREIGN KEY (`biblioitemnumber`) REFERENCES `biblioitems` (`biblioitemnumber`) ON DELETE CASCADE ON UPDATE CASCADE,
939
  CONSTRAINT `holdings_ibfk_3` FOREIGN KEY (`holdingbranch`) REFERENCES `branches` (`branchcode`) ON UPDATE CASCADE
940
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
941
942
--
943
-- Table structure for table `holdings_metadata`
944
--
945
946
DROP TABLE IF EXISTS `holdings_metadata`;
947
CREATE TABLE `holdings_metadata` (
948
  `id` INT(11) NOT NULL AUTO_INCREMENT,
949
  `holding_id` INT(11) NOT NULL,
950
  `format` VARCHAR(16) NOT NULL,
951
  `marcflavour` VARCHAR(16) NOT NULL,
952
  `metadata` LONGTEXT NOT NULL,
953
	`deleted_on` DATETIME DEFAULT NULL, -- the date this record was deleted
954
  PRIMARY KEY(id),
955
  UNIQUE KEY `holdings_metadata_uniq_key` (`holding_id`,`format`,`marcflavour`),
956
  KEY `hldnoidx` (`holding_id`),
957
  CONSTRAINT `holdings_metadata_fk_1` FOREIGN KEY (`holding_id`) REFERENCES `holdings` (`holding_id`) ON DELETE CASCADE ON UPDATE CASCADE
958
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
959
960
--
915
-- Table structure for table `items`
961
-- Table structure for table `items`
916
--
962
--
917
963
918
DROP TABLE IF EXISTS `items`;
964
DROP TABLE IF EXISTS `items`;
919
CREATE TABLE `items` ( -- holdings/item information
965
CREATE TABLE `items` ( -- item information
920
  `itemnumber` int(11) NOT NULL auto_increment, -- primary key and unique identifier added by Koha
966
  `itemnumber` int(11) NOT NULL auto_increment, -- primary key and unique identifier added by Koha
921
  `biblionumber` int(11) NOT NULL default 0, -- foreign key from biblio table used to link this item to the right bib record
967
  `biblionumber` int(11) NOT NULL default 0, -- foreign key from biblio table used to link this item to the right bib record
922
  `biblioitemnumber` int(11) NOT NULL default 0, -- foreign key from the biblioitems table to link to item to additional information
968
  `biblioitemnumber` int(11) NOT NULL default 0, -- foreign key from the biblioitems table to link to item to additional information
Lines 962-967 CREATE TABLE `items` ( -- holdings/item information Link Here
962
  `copynumber` varchar(32) default NULL, -- copy number (MARC21 952$t)
1008
  `copynumber` varchar(32) default NULL, -- copy number (MARC21 952$t)
963
  `stocknumber` varchar(32) default NULL, -- inventory number (MARC21 952$i)
1009
  `stocknumber` varchar(32) default NULL, -- inventory number (MARC21 952$i)
964
  `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.
1010
  `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.
1011
  `holding_id` int(11) default NULL, -- foreign key from holdings table used to link this item to the right holdings record
965
  PRIMARY KEY  (`itemnumber`),
1012
  PRIMARY KEY  (`itemnumber`),
966
  UNIQUE KEY `itembarcodeidx` (`barcode`),
1013
  UNIQUE KEY `itembarcodeidx` (`barcode`),
967
  KEY `itemstocknumberidx` (`stocknumber`),
1014
  KEY `itemstocknumberidx` (`stocknumber`),
Lines 974-983 CREATE TABLE `items` ( -- holdings/item information Link Here
974
  KEY `items_ccode` (`ccode`),
1021
  KEY `items_ccode` (`ccode`),
975
  KEY `itype_idx` (`itype`),
1022
  KEY `itype_idx` (`itype`),
976
  KEY `timestamp` (`timestamp`),
1023
  KEY `timestamp` (`timestamp`),
1024
  KEY `hldid_idx` (`holding_id`),
977
  CONSTRAINT `items_ibfk_1` FOREIGN KEY (`biblioitemnumber`) REFERENCES `biblioitems` (`biblioitemnumber`) ON DELETE CASCADE ON UPDATE CASCADE,
1025
  CONSTRAINT `items_ibfk_1` FOREIGN KEY (`biblioitemnumber`) REFERENCES `biblioitems` (`biblioitemnumber`) ON DELETE CASCADE ON UPDATE CASCADE,
978
  CONSTRAINT `items_ibfk_2` FOREIGN KEY (`homebranch`) REFERENCES `branches` (`branchcode`) ON UPDATE CASCADE,
1026
  CONSTRAINT `items_ibfk_2` FOREIGN KEY (`homebranch`) REFERENCES `branches` (`branchcode`) ON UPDATE CASCADE,
979
  CONSTRAINT `items_ibfk_3` FOREIGN KEY (`holdingbranch`) REFERENCES `branches` (`branchcode`) ON UPDATE CASCADE,
1027
  CONSTRAINT `items_ibfk_3` FOREIGN KEY (`holdingbranch`) REFERENCES `branches` (`branchcode`) ON UPDATE CASCADE,
980
  CONSTRAINT `items_ibfk_4` FOREIGN KEY (`biblionumber`) REFERENCES `biblio` (`biblionumber`) ON DELETE CASCADE ON UPDATE CASCADE
1028
  CONSTRAINT `items_ibfk_4` FOREIGN KEY (`biblionumber`) REFERENCES `biblio` (`biblionumber`) ON DELETE CASCADE ON UPDATE CASCADE,
1029
  CONSTRAINT `items_ibfk_5` FOREIGN KEY (`holding_id`) REFERENCES `holdings` (`holding_id`) ON DELETE CASCADE ON UPDATE CASCADE
981
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
1030
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
982
1031
983
--
1032
--
(-)a/installer/data/mysql/mandatory/auth_val_cat.sql (+1 lines)
Lines 22-27 INSERT IGNORE INTO authorised_value_categories( category_name ) Link Here
22
INSERT IGNORE INTO authorised_value_categories( category_name )
22
INSERT IGNORE INTO authorised_value_categories( category_name )
23
    VALUES
23
    VALUES
24
    ('branches'),
24
    ('branches'),
25
    ('holdings'),
25
    ('itemtypes'),
26
    ('itemtypes'),
26
    ('cn_source');
27
    ('cn_source');
27
28
(-)a/koha-tmpl/intranet-tmpl/prog/css/addholding.css (+171 lines)
Line 0 Link Here
1
#addholdingtabs {
2
	margin-top : 1em;
3
}
4
5
#addholdingtabs .ui-tabs-panel {
6
	float : left;
7
}
8
9
.buttonPlus {
10
	font-weight : bold;
11
	text-decoration : none;
12
}
13
14
.buttonMinus {
15
	font-weight : bold;
16
	text-decoration : none;
17
}
18
19
a.expandfield {
20
	text-decoration : none;
21
}
22
23
#authoritytabs {
24
	margin-top : 1em;
25
	margin-bottom : 1em;
26
}
27
28
.toptabs .ui-tabs-nav li a {
29
	padding : .2em 1.2em;
30
}
31
32
div.tag {
33
    clear: both;
34
}
35
36
div.subfield_line {
37
    padding-bottom: .3em;
38
    float: left;
39
    clear: left;
40
    width: 100%;
41
}
42
43
div.subfield_line label {
44
    font-size:89%;
45
    float: left;
46
	 padding-right : .4em;
47
    width: 16em;
48
    text-align: left;
49
    clear:left;
50
}
51
52
.subfieldcode img {
53
    cursor: pointer;
54
}
55
56
.tag_title {
57
	font-size : 90%;
58
	padding : .2em 0;
59
}
60
61
.tagnum {
62
	font-size : 110%;
63
	font-weight : bold;
64
	color : #000;
65
	padding : .1em .3em .1em 0;
66
}
67
68
a.tagnum {
69
	font-size : 110%;
70
	font-weight : bold;
71
	color : #000;
72
	padding : .1em .3em .1em 0;
73
	text-decoration : none;
74
}
75
76
.subfield {
77
	color : #00698a;
78
	float: left;
79
	width: 10em;
80
	text-align:right;
81
}
82
83
.subfieldcode {
84
	display: block;
85
	float: left;
86
}
87
88
.labelsubfield {
89
	float:left;
90
}
91
92
.input_marceditor {
93
	float:left;
94
	width:30em;
95
}
96
97
.indicator {
98
    width: 1em;
99
    box-sizing: content-box;
100
}
101
102
*html .input_marceditor {
103
	width : 15em;
104
}
105
106
#cataloguing_additem_newitem fieldset.rows label, #cataloguing_additem_newitem fieldset.rows span.label {
107
	font-size : 100%;
108
	width : 25%;
109
}
110
111
#cataloguing_additem_newitem fieldset.rows li {
112
	padding-bottom : 3px;
113
}
114
#cataloguing_additem_newitem .input_marceditor {
115
	width : auto;
116
}
117
118
#cataloguing_additem_newitem textarea.input_marceditor {
119
     width : 31em;
120
}
121
122
.mandatory_marker {
123
	color: red;
124
}
125
.linktools { display: block; white-space: nowrap; }
126
.linktools a { font-size : 75%; display:block;text-decoration:none;}
127
.linktools a {margin:0 2px;padding:2px;background-color:#FFF;text-align:center; }
128
.linktools a:first-child { border-bottom: 1px solid #DDD; }
129
.linktools a:hover { background-color: #FFC; }
130
.subfield_controls { margin : 0 .5em; }
131
.readonly { border-width : 1px; border-style: inset; padding-left : 15px; background: #EEE url(../img/locked.png) center left no-repeat; width:29em; }
132
133
#cataloguing_additem_itemlist {
134
	margin-bottom : 1em;
135
}
136
.yui-gf div.first {
137
	width : 19%;
138
}
139
140
.yui-gf .yui-u {
141
	width: 79.2%;
142
}
143
144
tbody tr.active:nth-child(2n+1) td,
145
tbody tr.active td {
146
    background-color: #FFFFCC;
147
}
148
149
#loading {
150
    background-color: #FFF;
151
    cursor: wait;
152
    height: 100%;
153
    left: 0;
154
    opacity: .7;
155
    position: fixed;
156
    top: 0;
157
    width: 100%;
158
    z-index: 1000;
159
}
160
#loading div {
161
    background : transparent url(../img/loading.gif) top left no-repeat;
162
    font-size : 175%;
163
    font-weight: bold;
164
    height: 2em;
165
    left: 50%;
166
    margin: -1em 0 0 -2.5em;
167
    padding-left : 50px;
168
    position: absolute;
169
    top: 50%;
170
    width: 15em;
171
}
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc (+4 lines)
Lines 10-15 CAN_user_serials_create_subscription ) %] Link Here
10
             <li><a id="newbiblio" href="/cgi-bin/koha/cataloguing/addbiblio.pl">New record</a></li>
10
             <li><a id="newbiblio" href="/cgi-bin/koha/cataloguing/addbiblio.pl">New record</a></li>
11
            [% END %]
11
            [% END %]
12
12
13
            [% IF ( show_summary_holdings && CAN_user_editcatalogue_edit_items ) %]
14
            <li><a id="newholding" href="/cgi-bin/koha/cataloguing/addholding.pl?biblionumber=[% biblionumber %]#addholding">New holdings record</a></li>
15
            [% END %]
16
13
            [% IF ( CAN_user_editcatalogue_edit_items ) %]
17
            [% IF ( CAN_user_editcatalogue_edit_items ) %]
14
             <li><a id="newitem" href="/cgi-bin/koha/cataloguing/additem.pl?biblionumber=[% biblionumber | html %]#additema">New item</a></li>
18
             <li><a id="newitem" href="/cgi-bin/koha/cataloguing/additem.pl?biblionumber=[% biblionumber | html %]#additema">New item</a></li>
15
            [% END %]
19
            [% END %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/biblio_framework.tt (-2 / +1 lines)
Lines 133-139 Link Here
133
    <tbody>
133
    <tbody>
134
    <tr>
134
    <tr>
135
        <td>&nbsp;</td>
135
        <td>&nbsp;</td>
136
        <td>Default framework</td>
136
        <td>Default bibliographic framework</td>
137
        <td>
137
        <td>
138
          <div class="dropdown">
138
          <div class="dropdown">
139
            <a class="btn btn-default btn-xs dropdown-toggle" id="frameworkactions[% loo.frameworkcode | html %]" role="button" data-toggle="dropdown" href="#">
139
            <a class="btn btn-default btn-xs dropdown-toggle" id="frameworkactions[% loo.frameworkcode | html %]" role="button" data-toggle="dropdown" href="#">
Lines 198-204 Link Here
198
          </div>
198
          </div>
199
        </td>
199
        </td>
200
    </tr>
200
    </tr>
201
202
    [% FOREACH loo IN frameworks %]
201
    [% FOREACH loo IN frameworks %]
203
        <tr>
202
        <tr>
204
            <td>[% loo.frameworkcode | html %]</td>
203
            <td>[% loo.frameworkcode | html %]</td>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref (+7 lines)
Lines 291-293 Cataloging: Link Here
291
            - "All values of repeating tags and subfields will be printed with the given RIS tag."
291
            - "All values of repeating tags and subfields will be printed with the given RIS tag."
292
            - "<br/>"
292
            - "<br/>"
293
            - "Use of TY ( record type ) as a key will <i>replace</i> the default TY with the field value of your choosing."
293
            - "Use of TY ( record type ) as a key will <i>replace</i> the default TY with the field value of your choosing."
294
    Holdings:
295
        -
296
            - pref: SummaryHoldings
297
              choices:
298
                  yes: Use
299
                  no: "Don't use"
300
            - summary holdings records.
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt (-4 / +64 lines)
Lines 6-11 Link Here
6
[% USE Branches %]
6
[% USE Branches %]
7
[% USE Biblio %]
7
[% USE Biblio %]
8
[% USE ColumnsSettings %]
8
[% USE ColumnsSettings %]
9
[% USE Holdings %]
9
[% SET AdlibrisEnabled = Koha.Preference('AdlibrisCoversEnabled') %]
10
[% SET AdlibrisEnabled = Koha.Preference('AdlibrisCoversEnabled') %]
10
[% SET AdlibrisURL = Koha.Preference('AdlibrisCoversURL') %]
11
[% SET AdlibrisURL = Koha.Preference('AdlibrisCoversURL') %]
11
12
Lines 302-317 Link Here
302
<div id="bibliodetails" class="toptabs">
303
<div id="bibliodetails" class="toptabs">
303
304
304
<ul>
305
<ul>
306
    [% IF (show_summary_holdings) %]
307
        <li><a href="#summaryholdings">Holdings ([% summary_holdings.size() || 0 | html %])</a></li>
308
    [% END %]
305
    [% IF (SeparateHoldings) %]
309
    [% IF (SeparateHoldings) %]
306
        <li>
310
        <li>
307
            <a href="#holdings">[% LoginBranchname | html %] holdings ([% itemloop.size() || 0 | html %])</a>
311
            <a href="#holdings">[% LoginBranchname | html %] [% IF (show_summary_holdings) %]items[% ELSE %]holdings[% END %] ([% itemloop.size() || 0 | html %])</a>
308
        </li>
312
        </li>
309
        <li>
313
        <li>
310
            <a href="#otherholdings">Other holdings ([% otheritemloop.size() || 0 | html %])</a>
314
            <a href="#otherholdings">[% IF (show_summary_holdings) %]Other items[% ELSE %]Other holdings[% END %] ([% otheritemloop.size() || 0 | html %])</a>
311
        </li>
315
        </li>
312
    [% ELSE %]
316
    [% ELSE %]
313
        <li>
317
        <li>
314
            <a href="#holdings">Holdings ([% itemloop.size() || 0 | html %])</a>
318
            <a href="#holdings">[% IF (show_summary_holdings) %]Items[% ELSE %]Holdings[% END %] ([% itemloop.size() || 0 | html %])</a>
315
        </li>
319
        </li>
316
    [% END %]
320
    [% END %]
317
[% IF ( MARCNOTES || notes ) %]<li><a href="#description">Descriptions</a></li>[% END %]
321
[% IF ( MARCNOTES || notes ) %]<li><a href="#description">Descriptions</a></li>[% END %]
Lines 331-336 Link Here
331
[% END %]
335
[% END %]
332
</ul>
336
</ul>
333
337
338
[% IF ( show_summary_holdings ) %]
339
    <div id="summaryholdings">
340
341
    [% IF ( summary_holdings ) %]
342
        <div class="summaryholdings_table_controls">
343
        </div>
344
        <table class="summaryholdings_table">
345
            <thead>
346
                <tr>
347
                    <th>Library</th>
348
                    <th>Location</th>
349
                    <th>Collection</th>
350
                    <th>Call number</th>
351
                    <th>Status</th>
352
                    [% IF ( CAN_user_editcatalogue_edit_items ) %]<th class="NoSort">&nbsp;</th>[% END %]
353
                </tr>
354
            </thead>
355
            <tbody>
356
                [% FOREACH holding IN summary_holdings %]
357
                    <tr>
358
                        <td class="branch">[% UNLESS ( singlebranchmode ) %][% Branches.GetName( holding.holdingbranch ) | html %] [% END %]</td>
359
                        <td class="location"><span class="shelvingloc">[% holding.location | html %][% IF ( holding.sub_location ) %] ([% holding.sub_location | html %])[% END %]</span>
360
                        <td class="collection">[% holding.ccode | html %]</span>
361
                        <td class="itemcallnumber">[% IF ( holding.callnumber ) %] [% holding.callnumber | html %][% END %]</td>
362
                        <td class="status">
363
                            [% IF ( holding.suppress ) %]
364
                                <span class="suppressed">Suppressed in OPAC</span>
365
                            [% END %]
366
                        </td>
367
                    [% IF CAN_user_editcatalogue_edit_items %]
368
                        <td class="actions">
369
                            <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>
370
                            <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>
371
                            <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>
372
                            <a class="btn btn-default btn-xs previewMARC" href="/cgi-bin/koha/catalogue/showmarc.pl?holding_id=[% holding.holding_id | uri %]&amp;viewas=html" title="MARC">Show MARC</a>
373
                        </td>
374
                    [% END %]
375
                    </tr>
376
                [% END %]
377
            </tbody>
378
        </table>
379
    [% ELSE %]
380
        <div id="noitems">No holdings records</div>
381
    [% END %]
382
383
    </div>
384
[% END %]
385
334
[% items_table_block_iter = 0 %]
386
[% items_table_block_iter = 0 %]
335
[% BLOCK items_table %]
387
[% BLOCK items_table %]
336
    [% items_table_block_iter = items_table_block_iter + 1 %]
388
    [% items_table_block_iter = items_table_block_iter + 1 %]
Lines 354-359 Link Here
354
            <tr>
406
            <tr>
355
                [% IF (StaffDetailItemSelection) %]<th class="NoSort"></th>[% END %]
407
                [% IF (StaffDetailItemSelection) %]<th class="NoSort"></th>[% END %]
356
                [% IF ( item_level_itypes ) %]<th>Item type</th>[% END %]
408
                [% IF ( item_level_itypes ) %]<th>Item type</th>[% END %]
409
                [% IF ( show_summary_holdings ) %]<th>Holding</th>[% END %]
357
                <th>Current location</th>
410
                <th>Current location</th>
358
                <th>Home library</th>
411
                <th>Home library</th>
359
                [% IF ( itemdata_ccode ) %]<th>Collection</th>[% END %]
412
                [% IF ( itemdata_ccode ) %]<th>Collection</th>[% END %]
Lines 392-397 Link Here
392
                            [% item.translated_description | html %]
445
                            [% item.translated_description | html %]
393
                        </td>
446
                        </td>
394
                    [% END %]
447
                    [% END %]
448
                    [% IF ( show_summary_holdings ) %]
449
                        <td class="holding">[% Holdings.GetLocation(item.holding_id) | html %]</td>
450
                    [% END %]
395
                    <td class="location">[% UNLESS ( singlebranchmode ) %][% Branches.GetName( item.branchcode ) | html %] [% END %]</td>
451
                    <td class="location">[% UNLESS ( singlebranchmode ) %][% Branches.GetName( item.branchcode ) | html %] [% END %]</td>
396
                    <td class="homebranch">[% Branches.GetName(item.homebranch) | html %]<span class="shelvingloc">[% item.location | html %]</span> </td>
452
                    <td class="homebranch">[% Branches.GetName(item.homebranch) | html %]<span class="shelvingloc">[% item.location | html %]</span> </td>
397
                    [% IF ( itemdata_ccode ) %]<td>[% item.ccode | html %]</td>[% END %]
453
                    [% IF ( itemdata_ccode ) %]<td>[% item.ccode | html %]</td>[% END %]
Lines 1028-1039 Link Here
1028
                    $("input[name='itemnumber'][type='checkbox']", $("#"+tab)).prop('checked', false);
1084
                    $("input[name='itemnumber'][type='checkbox']", $("#"+tab)).prop('checked', false);
1029
                    itemSelectionBuildActionLinks(tab);
1085
                    itemSelectionBuildActionLinks(tab);
1030
                });
1086
                });
1087
1088
                $('a.delete').click(function() {
1089
                    return confirm(_("Are you sure?"));
1090
                });
1031
            });
1091
            });
1032
        [% END %]
1092
        [% END %]
1033
1093
1034
        $(document).ready(function() {
1094
        $(document).ready(function() {
1035
            $('#bibliodetails').tabs();
1095
            $('#bibliodetails').tabs();
1036
            [% IF count == 0 %]
1096
            [% IF count == 0 and not show_summary_holdings %]
1037
                $('#bibliodetails').tabs("option", "active", 3);
1097
                $('#bibliodetails').tabs("option", "active", 3);
1038
            [% END %]
1098
            [% END %]
1039
            $('#search-form').focus();
1099
            $('#search-form').focus();
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt (+2 lines)
Lines 2-7 Link Here
2
[% USE Asset %]
2
[% USE Asset %]
3
[% USE Koha %]
3
[% USE Koha %]
4
[% USE Branches %]
4
[% USE Branches %]
5
[% USE Holdings %]
5
[% SET footerjs = 1 %]
6
[% SET footerjs = 1 %]
6
[% INCLUDE 'doc-head-open.inc' %]
7
[% INCLUDE 'doc-head-open.inc' %]
7
<title>Koha &rsaquo; Catalog &rsaquo; Item details for [% title | html %] [% FOREACH subtitl IN subtitle %] [% subtitl.subfield | html %][% END %]</title>
8
<title>Koha &rsaquo; Catalog &rsaquo; Item details for [% title | html %] [% FOREACH subtitl IN subtitle %] [% subtitl.subfield | html %][% END %]</title>
Lines 55-60 Link Here
55
         [% END %]
56
         [% END %]
56
         [% END %][% END %]</h4>
57
         [% END %][% END %]</h4>
57
            <ol class="bibliodetails">
58
            <ol class="bibliodetails">
59
            <li><span class="label">Holding:</span> [% Holdings.GetLocation( ITEM_DAT.holding_id ) | html %]&nbsp;</li>
58
            <li><span class="label">Home library:</span> [% Branches.GetName( ITEM_DAT.homebranch ) | html %]&nbsp;</li>
60
            <li><span class="label">Home library:</span> [% Branches.GetName( ITEM_DAT.homebranch ) | html %]&nbsp;</li>
59
	    [% IF ( item_level_itypes ) %]
61
	    [% IF ( item_level_itypes ) %]
60
            <li><span class="label">Item type:</span> [% ITEM_DAT.itype | html %]&nbsp;</li>
62
            <li><span class="label">Item type:</span> [% ITEM_DAT.itype | html %]&nbsp;</li>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt (+14 lines)
Lines 2-7 Link Here
2
[% USE Asset %]
2
[% USE Asset %]
3
[% USE Koha %]
3
[% USE Koha %]
4
[% USE Biblio %]
4
[% USE Biblio %]
5
[% USE Holdings %]
5
[% USE KohaDates %]
6
[% USE KohaDates %]
6
[% PROCESS 'i18n.inc' %]
7
[% PROCESS 'i18n.inc' %]
7
[% SET footerjs = 1 %]
8
[% SET footerjs = 1 %]
Lines 484-489 Link Here
484
                                </td>
485
                                </td>
485
486
486
                                <td><div class="availability">
487
                                <td><div class="availability">
488
                                    [% IF ( SEARCH_RESULT.summary_holdings ) %]
489
                                        <div class="holdings">
490
                                            <strong>Holdings</strong>
491
                                            <ul>
492
                                            [% FOREACH holding IN SEARCH_RESULT.summary_holdings %]
493
                                                <li>
494
                                                    [% Holdings.GetLocation(holding) | html %]
495
                                                </li>
496
                                            [% END %]
497
                                            </ul>
498
                                        </div>
499
                                    [% END %]
500
487
                                    [% IF ( SEARCH_RESULT.items_count ) %]
501
                                    [% IF ( SEARCH_RESULT.items_count ) %]
488
                                        <strong>
502
                                        <strong>
489
                                            [% IF MaxSearchResultsItemsPerRecordStatusCheck && SEARCH_RESULT.items_count > MaxSearchResultsItemsPerRecordStatusCheck %]
503
                                            [% IF MaxSearchResultsItemsPerRecordStatusCheck && SEARCH_RESULT.items_count > MaxSearchResultsItemsPerRecordStatusCheck %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addholding.tt (+618 lines)
Line 0 Link Here
1
[% USE raw %]
2
[% USE Asset %]
3
[% USE Koha %]
4
[% INCLUDE 'doc-head-open.inc' %]
5
<title>Koha &rsaquo; Cataloging &rsaquo; [% title | html %] [% IF ( author ) %] by [% author | html %][% END %] (Record #[% biblionumber | html %]) &rsaquo; Holdings</title>
6
[% INCLUDE 'doc-head-close.inc' %]
7
[% Asset.js("lib/jquery/plugins/jquery.fixFloat.js") | $raw %]
8
[% Asset.js("js/cataloging.js") | $raw %]
9
[% INCLUDE 'browser-strings.inc' %]
10
[% Asset.js("js/browser.js") | $raw %]
11
<script type="text/javascript">
12
//<![CDATA[
13
    var browser = KOHA.browser('[% searchid | html %]', parseInt('[% biblionumber | html %]', 10));
14
    browser.show();
15
16
    $(window).load(function() {
17
        $("#loading").hide();
18
    });
19
    $(document).ready(function() {
20
        $('#addholdingtabs').tabs().bind('show.ui-tabs', function(e, ui) {
21
            $("#"+ui.panel.id+" input:eq(0)").focus();
22
        });
23
24
        [% IF tab %]
25
            $('#addholdingtabs').selectTabByID("#[% tab | html %]");
26
        [% END %]
27
28
        $('#toolbar').fixFloat();
29
30
        /* check cookie to hide/show marcdocs*/
31
        if($.cookie("marcdocs_[% borrowernumber | html %]") == 'hide'){
32
            toggleMARCdocLinks(false);
33
        } else {
34
            toggleMARCdocLinks(true);
35
        }
36
37
        $("#marcDocsSelect").click(function(){
38
            if($.cookie("marcdocs_[% borrowernumber | html %]") == 'hide'){
39
                toggleMARCdocLinks(true);
40
            } else {
41
                toggleMARCdocLinks(false);
42
            }
43
        });
44
45
        /* check cookie to hide/show marc tags*/
46
        var marctags_cookie = $.cookie("marctags_[% borrowernumber | html %]");
47
        if (marctags_cookie == 'hide'){
48
            toggleMARCTagLinks(false);
49
        } else if( marctags_cookie == 'show'){
50
            toggleMARCTagLinks(true)
51
        } else {
52
            [% UNLESS Koha.Preference("hide_marc") %]
53
                toggleMARCTagLinks(true)
54
            [% ELSE %]
55
                toggleMARCTagLinks(false);
56
            [% END %]
57
        }
58
59
        $("#marcTagsSelect").click(function(){
60
            if( $.cookie("marctags_[% borrowernumber | html %]") == 'hide'){
61
                toggleMARCTagLinks(true)
62
            } else {
63
                toggleMARCTagLinks(false);
64
            }
65
        });
66
67
        $("#saverecord").click(function(){
68
            $(".btn-group").removeClass("open");
69
            onOption();
70
            return false;
71
        });
72
73
        $("#saveandview").click(function(){
74
            $(".btn-group").removeClass("open");
75
            redirect("view");
76
            return false;
77
        });
78
79
        $("#saveanditems").click(function(){
80
            $(".btn-group").removeClass("open");
81
            redirect("items");
82
            return false;
83
        });
84
        $("#saveandcontinue").click(function(){
85
            $(".btn-group").removeClass("open");
86
            var tab = $("#addholdingtabs li.ui-tabs-active:first a").attr('href');
87
            tab = tab.replace('#', '');
88
            $("#current_tab").val(tab);
89
            redirect("just_save", tab);
90
            return false;
91
        });
92
93
        $( '#switcheditor' ).click( function() {
94
95
            if ( !confirm( _("Any changes will not be saved. Continue?") ) ) return false;
96
97
            $.cookie( 'catalogue_editor_[% USER_INFO.borrowernumber | html %]', 'advanced', { expires: 365, path: '/' } );
98
99
            var holding_id = [% holding_id || "''" | html %];
100
            window.location = '/cgi-bin/koha/cataloguing/editor.pl#catalog/' + biblionumber + '/holdings/' + holding_id;
101
102
            return false;
103
        } );
104
        $(".change-framework").on("click", function(){
105
            var frameworkcode = $(this).data("frameworkcode");
106
            $("#frameworkcode").val( frameworkcode );
107
            Changefwk();
108
        });
109
    });
110
111
function redirect(dest){
112
    $("#redirect").attr("value",dest);
113
    return Check();
114
}
115
116
[% IF ( CAN_user_editcatalogue_edit_items ) %]
117
    var onOption = function () {
118
        return Check();
119
    }
120
[% END %]
121
122
function Dopop(link,i) {
123
    defaultvalue = document.getElementById(i).value;
124
    window.open(link+"&result="+defaultvalue,"valuebuilder",'width=700,height=550,toolbar=false,scrollbars=yes');
125
}
126
127
function PopupMARCFieldDoc(field) {
128
    [% IF ( marcflavour == 'MARC21' ) %]
129
        _MARC21FieldDoc(field);
130
    [% ELSIF ( marcflavour == 'UNIMARC' ) %]
131
        _UNIMARCFieldDoc(field);
132
    [% END %]
133
}
134
135
function _MARC21FieldDoc(field) {
136
    if(field == 0) {
137
        window.open("http://www.loc.gov/marc/holdings/hdleader.html");
138
    } else if (field < 900) {
139
        window.open("http://www.loc.gov/marc/holdings/hd" + ("000"+field).slice(-3) + ".html");
140
    } else {
141
        window.open("http://www.loc.gov/marc/holdings/hd9xx.html");
142
    }
143
}
144
145
function _UNIMARCFieldDoc(field) {
146
    /* http://archive.ifla.org/VI/3/p1996-1/ is an outdated version of UNIMARC, but
147
       seems to be the only version available that can be linked to per tag.  More recent
148
       versions of the UNIMARC standard are available on the IFLA website only as
149
       PDFs!
150
    */
151
    var url;
152
    if (field == 0) {
153
        url = "http://archive.ifla.org/VI/3/p1996-1/uni.htm";
154
    } else {
155
        var first = field.substring(0,1);
156
        url = "http://archive.ifla.org/VI/3/p1996-1/uni" + first + ".htm#";
157
        if (first == 0) url = url + "b";
158
        url = first == 9
159
              ? "http://archive.ifla.org/VI/3/p1996-1/uni9.htm"
160
              : url + field;
161
    }
162
    window.open(url);
163
}
164
165
/*
166
 * Functions to hide/show marc docs and tags links
167
 */
168
169
function toggleMARCdocLinks(flag){
170
    if( flag === true ){
171
        $(".marcdocs").show();
172
        $.cookie("marcdocs_[% borrowernumber | html %]",'show', { path: "/", expires: 365 });
173
        $("#marcDocsSelect i").addClass('fa-check-square-o').removeClass('fa-square-o');
174
    } else {
175
        $(".marcdocs").hide();
176
        $.cookie("marcdocs_[% borrowernumber | html %]",'hide', { path: "/", expires: 365 });
177
        $("#marcDocsSelect i").removeClass('fa-check-square-o').addClass('fa-square-o');
178
    }
179
}
180
181
function toggleMARCTagLinks(flag){
182
    if( flag === true ){
183
        $(".tagnum").show();
184
        $(".subfieldcode").show();
185
        $.cookie("marctags_[% borrowernumber | html %]",'show', { path: "/", expires: 365 });
186
        $("#marcTagsSelect i").addClass('fa-check-square-o').removeClass('fa-square-o');
187
    } else {
188
        $(".tagnum").hide();
189
        $(".subfieldcode").hide();
190
        $.cookie("marctags_[% borrowernumber | html %]",'hide', { path: "/", expires: 365 });
191
        $("#marcTagsSelect i").removeClass('fa-check-square-o').addClass('fa-square-o');
192
    }
193
}
194
195
/**
196
 * check if mandatory subfields are written
197
 */
198
function AreMandatoriesNotOk(){
199
    var mandatories = new Array();
200
    var mandatoriesfields = new Array();
201
    var tab = new Array();
202
    var label = new Array();
203
    var flag=0;
204
    var tabflag= new Array();
205
    [% FOREACH BIG_LOO IN BIG_LOOP %]
206
        [% FOREACH innerloo IN BIG_LOO.innerloop %]
207
            [% IF ( innerloo.mandatory ) %]
208
                mandatoriesfields.push(new Array("[% innerloo.tag | html %]","[% innerloo.index | html %][% innerloo.random | html %]","[% innerloo.index | html %]"));
209
            [% END %]
210
            [% FOREACH subfield_loo IN innerloo.subfield_loop %]
211
                [% IF ( subfield_loo.mandatory ) %]
212
                    mandatories.push("[% subfield_loo.id | html %]");
213
                    tab.push("[% BIG_LOO.number | html %]");
214
                    label.push("[% subfield_loo.marc_lib | $raw %]");
215
                [% END %]
216
            [% END %]
217
        [% END %]
218
    [% END %]
219
    var StrAlert = _("Can't save this record because the following field aren't filled:");
220
    StrAlert += "\n\n";
221
    for (var i=0,len=mandatories.length; i<len ; i++) {
222
        var tag=mandatories[i].substr(4,3);
223
        var subfield=mandatories[i].substr(17,1);
224
        var tagnumber=mandatories[i].substr(19,mandatories[i].lastIndexOf("_")-19);
225
        if (tabflag[tag+subfield+tagnumber] ==  null) {
226
            tabflag[tag+subfield+tagnumber]=new Array();
227
            tabflag[tag+subfield+tagnumber][0]=0;
228
        }
229
        if (tabflag[tag+subfield+tagnumber][0] != 1 && (document.getElementById(mandatories[i]) != null && ! document.getElementById(mandatories[i]).value || document.getElementById(mandatories[i]) == null)) {
230
            tabflag[tag+subfield+tagnumber][0] = 0 + tabflag[tag+subfield+tagnumber] ;
231
            document.getElementById(mandatories[i]).setAttribute('class','subfield_not_filled');
232
            $('#' + mandatories[i]).focus();
233
            tabflag[tag+subfield+tagnumber][1]=label[i];
234
            tabflag[tag+subfield+tagnumber][2]=tab[i];
235
        } else {
236
            tabflag[tag+subfield+tagnumber][0] = 1;
237
        }
238
    }
239
    for (var tagsubfieldid in tabflag) {
240
      if (tabflag[tagsubfieldid][0]==0) {
241
        var tag=tagsubfieldid.substr(0,3);
242
        var subfield=tagsubfieldid.substr(3,1);
243
        StrAlert += "\t* "+_("tag %s subfield %s %s in tab %s").format(tag, subfield, tabflag[tagsubfieldid][1], tabflag[tagsubfieldid][2]) + "\n";
244
        flag=1;
245
      }
246
    }
247
248
    /* Check for mandatories field(not subfields) */
249
    for (var i=0,len=mandatoriesfields.length; i<len; i++) {
250
        isempty  = true;
251
        arr      = mandatoriesfields[i];
252
        divid    = "tag_" + arr[0] + "_" + arr[1];
253
        varegexp = new RegExp("^tag_" + arr[0] + "_code_");
254
255
        if(parseInt(arr[0]) >= 10) {
256
            elem = document.getElementById(divid);
257
            eleminputs = elem.getElementsByTagName('input');
258
259
            for(var j=0,len2=eleminputs.length; j<len2; j++){
260
261
                if(eleminputs[j].name.match(varegexp) && eleminputs[j].value){
262
                        inputregexp = new RegExp("^tag_" + arr[0] + "_subfield_" + eleminputs[j].value + "_" + arr[2]);
263
264
                        for( var k=0; k<len2; k++){
265
                            if(eleminputs[k].id.match(inputregexp) && eleminputs[k].value){
266
                                isempty = false
267
                            }
268
                        }
269
270
                        elemselect = elem.getElementsByTagName('select');
271
                        for( var k=0; k<elemselect.length; k++){
272
                            if(elemselect[k].id.match(inputregexp) && elemselect[k].value){
273
                                isempty = false
274
                            }
275
                        }
276
                }
277
            }
278
279
            elemtextareas = elem.getElementsByTagName('textarea');
280
            for(var j=0,len2=elemtextareas.length; j<len2; j++){
281
                // this bit assumes that the only textareas in this context would be for subfields
282
                if (elemtextareas[j].value) {
283
                    isempty = false;
284
                }
285
            }
286
        } else {
287
            isempty = false;
288
        }
289
290
        if (isempty) {
291
            flag = 1;
292
                    StrAlert += "\t* " + _("Field %s is mandatory, at least one of its subfields must be filled.").format(arr[0]) + "\n";
293
        }
294
    }
295
296
    if (flag) {
297
        return StrAlert;
298
    } else {
299
        return flag;
300
    }
301
}
302
303
/**
304
 *
305
 *
306
 */
307
function Check(){
308
    var StrAlert = AreMandatoriesNotOk();
309
    if( ! StrAlert ){
310
        document.f.submit();
311
        return true;
312
    } else {
313
        alert(StrAlert);
314
        return false;
315
    }
316
}
317
318
function Changefwk() {
319
    var f = document.f;
320
    f.op.value = "[% op | html %]";
321
    f.biblionumber.value = "[% biblionumber | html %]";
322
    f.holding_id.value = "[% holding_iddata | html %]";
323
    f.changed_framework.value = "changed";
324
    f.submit();
325
}
326
327
//]]>
328
</script>
329
[% Asset.css("css/addholding.css") | $raw %]
330
331
[% INCLUDE 'select2.inc' %]
332
<script>
333
  $(document).ready(function() {
334
    $('.subfield_line select').select2();
335
  });
336
</script>
337
338
[% IF ( bidi ) %]
339
   [% Asset.css("css/right-to-left.css") | $raw %]
340
[% END %]
341
</head>
342
<body id="cat_addholding" class="cat">
343
344
   <div id="loading">
345
       <div>Loading, please wait...</div>
346
   </div>
347
348
[% INCLUDE 'header.inc' %]
349
350
<div id="breadcrumbs">
351
          <a href="/cgi-bin/koha/mainpage.pl">Home</a>
352
 &rsaquo; <a href="/cgi-bin/koha/cataloguing/addbooks.pl">Cataloging</a>
353
 &rsaquo; Edit <a href="/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=[% biblionumber | html %]">[% title | html %] [% IF ( author ) %] by [% author | html %][% END %] (Record #[% biblionumber | html %])</a>
354
 &rsaquo; <a href="/cgi-bin/koha/cataloguing/addholding.pl?biblionumber=[% biblionumber | html %]">Holdings</a>
355
</div>
356
357
<div id="doc" class="yui-t7">
358
359
<div id="bd">
360
        <div id="yui-main">
361
        <div class="yui-g">
362
363
<h1>
364
[% IF ( holding_id ) %]Editing holdings record number [% holding_id | html %]
365
[% ELSE %]Add holdings record
366
[% END %]
367
</h1>
368
369
[% IF ( done ) %]
370
    <script type="text/javascript">
371
        opener.document.forms['f'].holding_id.value=[% holding_id | html %];
372
        window.close();
373
    </script>
374
[% ELSE %]
375
    <form method="post" name="f" id="f" action="/cgi-bin/koha/cataloguing/addholding.pl" onsubmit="return Check();">
376
    <input type="hidden" value="[% IF ( holding_id ) %]view[% ELSE %]holdings[% END %]" id="redirect" name="redirect" />
377
    <input type="hidden" value="" id="current_tab" name="current_tab" />
378
[% END %]
379
380
<div id="toolbar" class="btn-toolbar">
381
    [% IF CAN_user_editcatalogue_edit_items %]
382
        <div class="btn-group">
383
            <button class="btn btn-default btn-sm" id="saverecord"><i class="fa fa-save"></i> Save</button>
384
            <button class="btn btn-default btn-sm dropdown-toggle" data-toggle="dropdown">
385
            <span class="caret"></span>
386
            </button>
387
            <ul class="dropdown-menu">
388
                <li><a id="saveandview" href="#">Save and view record</a></li>
389
                <li><a id="saveanditems" href="#">Save and edit items</a></li>
390
                <li><a id="saveandcontinue" href="#">Save and continue editing</a></li>
391
            </ul>
392
        </div>
393
    [% END %]
394
395
    <div class="btn-group">
396
        <button class="btn btn-default btn-sm dropdown-toggle" data-toggle="dropdown"><i class="fa fa-cog"></i> Settings <span class="caret"></span></button>
397
        <ul id="settings-menu" class="dropdown-menu">
398
            [% IF Koha.Preference( 'EnableAdvancedCatalogingEditor' ) == 1 %]
399
                <li><a href="#" id="switcheditor">Switch to advanced editor</a></li>
400
            [% END %]
401
            [% IF marcflavour != 'NORMARC' AND NOT advancedMARCEditor %]
402
                <li>
403
                    <a href="#" id="marcDocsSelect"><i class="fa fa-check-square-o"></i> Show MARC tag documentation links</a>
404
                <li>
405
                    <a href="#" id="marcTagsSelect"><i class="fa fa-check-square-o"></i> Show tags</a>
406
                </li>
407
            [% END %]
408
            <li class="divider"></li>
409
            <li class="nav-header">Change framework</li>
410
            <li>
411
                <a href="#" class="change-framework" data-frameworkcode="">
412
                    [% IF ( frameworkcode ) %]
413
                       <i class="fa fa-fw">&nbsp;</i>
414
                    [% ELSE %]
415
                        <i class="fa fa-fw fa-check"></i>
416
                    [% END %]
417
                    Default
418
                </a>
419
            </li>
420
            [% FOREACH framework IN frameworks%]
421
                <li>
422
                    <a href="#" class="change-framework" data-frameworkcode="[% framework.frameworkcode | html %]">
423
                        [% IF framework.frameworkcode == frameworkcode %]
424
                            <i class="fa fa-fw fa-check"></i>
425
                        [% ELSE %]
426
                            <i class="fa fa-fw">&nbsp;</i>
427
                        [% END %]
428
                        [% framework.frameworktext | html %]
429
                    </a>
430
                </li>
431
            [% END %]
432
        </ul>
433
    </div>
434
    <div class="btn-group">
435
        <a class="btn btn-default btn-sm" id="cancel" href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblionumber | url %]">Cancel</a>
436
    </div>
437
</div>
438
439
[% IF ( popup ) %]
440
        <input type="hidden" name="mode" value="popup" />
441
[% END %]
442
        <input type="hidden" name="op" value="add" />
443
        <input type="hidden" id="frameworkcode" name="frameworkcode" value="[% frameworkcode | html %]" />
444
        <input type="hidden" name="biblionumber" value="[% biblionumber | html %]" />
445
        <input type="hidden" name="holding_id" value="[% holding_id | html %]" />
446
        <input type="hidden" name="changed_framework" value="" />
447
448
<div id="addholdingtabs" class="toptabs numbered">
449
    <ul>
450
        [% FOREACH BIG_LOO IN BIG_LOOP %]
451
        <li><a href="#tab[% BIG_LOO.number | html %]XX">[% BIG_LOO.number | html %]</a></li>
452
        [% END %]
453
    </ul>
454
455
[% FOREACH BIG_LOO IN BIG_LOOP %]
456
    <div id="tab[% BIG_LOO.number | html %]XX">
457
458
    [% FOREACH innerloo IN BIG_LOO.innerloop %]
459
    [% IF ( innerloo.tag ) %]
460
    <div class="tag" id="tag_[% innerloo.tag | html %]_[% innerloo.index | html %][% innerloo.random | html %]">
461
        <div class="tag_title" id="div_indicator_tag_[% innerloo.tag | html %]_[% innerloo.index | html %][% innerloo.random | html %]">
462
            [% IF advancedMARCEditor %]
463
                <a href="#" tabindex="1" class="tagnum" title="[% innerloo.tag_lib | html %] - Click to Expand this Tag" onclick="ExpandField('tag_[% innerloo.tag | html %]_[% innerloo.index | html %][% innerloo.random | html %]'); return false;">[% innerloo.tag %]</a>
464
            [% ELSE %]
465
                <span class="tagnum" title="[% innerloo.tag_lib %]">[% innerloo.tag | html %]</span>
466
                [% IF marcflavour != 'NORMARC' %]<a href="#" class="marcdocs" onclick="PopupMARCFieldDoc('[% innerloo.tag | html %]'); return false;">&nbsp;?</a>[% END %]
467
            [% END %]
468
                [% IF ( innerloo.fixedfield ) %]
469
                    <input type="text"
470
                        tabindex="1"
471
                        class="indicator flat"
472
                        style="display:none;"
473
                        name="tag_[% innerloo.tag | html %]_indicator1_[% innerloo.index | html %][% innerloo.random | html %]"
474
                        size="1"
475
                        maxlength="1"
476
                        value="[% innerloo.indicator1 | html %]" />
477
                    <input type="text"
478
                        tabindex="1"
479
                        class="indicator flat"
480
                        style="display:none;"
481
                        name="tag_[% innerloo.tag | html %]_indicator2_[% innerloo.index | html %][% innerloo.random | html %]"
482
                        size="1"
483
                        maxlength="1"
484
                        value="[% innerloo.indicator2 | html %]" />
485
                [% ELSE %]
486
                    <input type="text"
487
                        tabindex="1"
488
                        class="indicator flat"
489
                        name="tag_[% innerloo.tag | html %]_indicator1_[% innerloo.index | html %][% innerloo.random | html %]"
490
                        size="1"
491
                        maxlength="1"
492
                        value="[% innerloo.indicator1 | html %]" />
493
                    <input type="text"
494
                        tabindex="1"
495
                        class="indicator flat"
496
                        name="tag_[% innerloo.tag | html %]_indicator2_[% innerloo.index | html %][% innerloo.random | html %]"
497
                        size="1"
498
                        maxlength="1"
499
                        value="[% innerloo.indicator2 | html %]" />
500
                [% END %] -
501
502
            [% UNLESS advancedMARCEditor %]
503
                <a href="#" tabindex="1" class="expandfield" onclick="ExpandField('tag_[% innerloo.tag | html %]_[% innerloo.index | html %][% innerloo.random | html %]'); return false;" title="Click to Expand this Tag">[% innerloo.tag_lib | html %]</a>
504
            [% END %]
505
                <span class="field_controls">
506
                [% IF ( innerloo.repeatable ) %]
507
                    <a href="#" tabindex="1" class="buttonPlus" onclick="CloneField('tag_[% innerloo.tag | html %]_[% innerloo.index | html %][% innerloo.random | html %]','0','[% advancedMARCEditor | html %]'); return false;" title="Repeat this Tag">
508
                        <img src="[% interface | html %]/[% theme | html %]/img/repeat-tag.png" alt="Repeat this Tag" />
509
                    </a>
510
                [% END %]
511
                    <a href="#" tabindex="1" class="buttonMinus" onclick="UnCloneField('tag_[% innerloo.tag | html %]_[% innerloo.index | html %][% innerloo.random | html %]'); return false;" title="Delete this Tag">
512
                        <img src="[% interface | html %]/[% theme | html %]/img/delete-tag.png" alt="Delete this Tag" />
513
                    </a>
514
                </span>
515
516
        </div>
517
518
        [% FOREACH subfield_loo IN innerloo.subfield_loop %]
519
            <!--  One line on the marc editor -->
520
            <div class="subfield_line" style="[% subfield_loo.visibility | html %]" id="subfield[% subfield_loo.tag | html %][% subfield_loo.subfield | html %][% subfield_loo.random | html %]">
521
522
                [% UNLESS advancedMARCEditor %]
523
                    [% IF ( subfield_loo.fixedfield ) %]<label for="tag_[% subfield_loo.tag | html %]_subfield_[% subfield_loo.subfield | html %]_[% subfield_loo.index | html %]_[% subfield_loo.index_subfield | html %]" style="display:none;" class="labelsubfield">
524
                    [% ELSE %]<label for="tag_[% subfield_loo.tag | html %]_subfield_[% subfield_loo.subfield | html %]_[% subfield_loo.index | html %]_[% subfield_loo.index_subfield | html %]" class="labelsubfield">
525
                    [% END %]
526
                [% END %]
527
528
                <span class="subfieldcode">
529
                    [% IF ( subfield_loo.fixedfield ) %]
530
                        <img class="buttonUp" style="display:none;" src="[% interface | html %]/[% theme | html %]/img/up.png" onclick="upSubfield('subfield[% subfield_loo.tag | html %][% subfield_loo.subfield | html %][% subfield_loo.random | html %]')" alt="Move Up" title="Move Up" />
531
                    [% ELSE %]
532
                        <img class="buttonUp" src="[% interface | html %]/[% theme | html %]/img/up.png" onclick="upSubfield('subfield[% subfield_loo.tag | html %][% subfield_loo.subfield | html %][% subfield_loo.random | html %]')" alt="Move Up" title="Move Up" />
533
                    [% END %]
534
                        <input type="text"
535
                            title="[% subfield_loo.marc_lib | html %]"
536
                            style=" [% IF ( subfield_loo.fixedfield ) %]display:none; [% END %]border:0;"
537
                            name="tag_[% subfield_loo.tag | html %]_code_[% subfield_loo.subfield | html %]_[% subfield_loo.index | html %]_[% subfield_loo.index_subfield | html %]"
538
                            value="[% subfield_loo.subfield | html %]"
539
                            size="1"
540
                            maxlength="1"
541
                            class="flat"
542
                            tabindex="0" />
543
                </span>
544
545
                [% UNLESS advancedMARCEditor %]
546
                    [% IF ( subfield_loo.mandatory ) %]<span class="subfield subfield_mandatory">[% ELSE %]<span class="subfield">[% END %]
547
                        [% subfield_loo.marc_lib %]
548
                        [% IF ( subfield_loo.mandatory ) %]<span class="mandatory_marker" title="This field is mandatory">*</span>[% END %]
549
                    </span>
550
                    </label>
551
                [% END %]
552
553
                [% SET mv = subfield_loo.marc_value %]
554
                [% IF ( mv.type == 'text' ) %]
555
                    [% IF ( mv.readonly == 1 ) %]
556
                    <input type="text" id="[%- mv.id | html -%]" name="[%- mv.name | html -%]" value="[%- mv.value | html -%]" class="input_marceditor readonly" tabindex="1" size="[%- mv.size | html -%]" maxlength="[%- mv.maxlength | html -%]" readonly="readonly" />
557
                    [% ELSE %]
558
                    <input type="text" id="[%- mv.id | html -%]" name="[%- mv.name | html -%]" value="[%- mv.value | html -%]" class="input_marceditor" tabindex="1" size="[%- mv.size | html -%]" maxlength="[%- mv.maxlength | html -%]" />
559
                    [% END %]
560
                    [% IF ( mv.authtype ) %]
561
                    <span class="subfield_controls"><a href="#" class="buttonDot tag_editor" onclick="openAuth(this.parentNode.parentNode.getElementsByTagName('input')[1].id,'[%- mv.authtype | html -%]','holding'); return false;" tabindex="1" title="Tag editor">Tag editor</a></span>
562
                    [% END %]
563
                [% ELSIF ( mv.type == 'text_complex' ) %]
564
                    <input type="text" id="[%- mv.id | html -%]" name="[%- mv.name | html -%]" value="[%- mv.value | html -%]" class="input_marceditor framework_plugin" tabindex="1" size="[%- mv.size | html -%]" maxlength="[%- mv.maxlength | html -%]" />
565
                    <span class="subfield_controls">
566
                        [% IF mv.noclick %]
567
                            <a href="#" class="buttonDot tag_editor disabled" tabindex="-1" title="No popup"></a>
568
                        [% ELSE %]
569
                            <a href="#" id="buttonDot_[% mv.id | html %]" class="buttonDot tag_editor framework_plugin" tabindex="1" title="Tag editor">Tag editor</a>
570
                        [% END %]
571
                    </span>
572
                    [% mv.javascript %]
573
                [% ELSIF ( mv.type == 'hidden' ) %]
574
                    <input tabindex="1" type="hidden" id="[%- mv.id | html -%]" name="[%- mv.name | html -%]" size="[%- mv.size | html -%]" maxlength="[%- mv.maxlength | html -%]" value="[%- mv.value | html -%]" />
575
                [% ELSIF ( mv.type == 'textarea' ) %]
576
                    <textarea cols="70" rows="4" id="[%- mv.id | html -%]" name="[%- mv.name | html -%]" class="input_marceditor" tabindex="1">[%- mv.value -%]</textarea>
577
                [% ELSIF ( mv.type == 'select' ) %]
578
                    <select name="[%- mv.name | html -%]" tabindex="1" size="1" class="input_marceditor" id="[%- mv.id | html -%]">
579
                    [% FOREACH aval IN mv.values %]
580
                        [% IF aval == mv.default %]
581
                        <option value="[%- aval | html -%]" selected="selected">[%- mv.labels.$aval | html -%]</option>
582
                        [% ELSE %]
583
                        <option value="[%- aval | html -%]">[%- mv.labels.$aval | html -%]</option>
584
                        [% END %]
585
                    [% END %]
586
                    </select>
587
                [% END %]
588
589
                <span class="subfield_controls">
590
                [% IF ( subfield_loo.repeatable ) %]
591
                    <a href="#" class="buttonPlus" tabindex="1" onclick="CloneSubfield('subfield[% subfield_loo.tag | html %][% subfield_loo.subfield | html %][% subfield_loo.random | html %]','[% advancedMARCEditor | html %]'); return false;">
592
                        <img src="[% interface | html %]/[% theme | html %]/img/clone-subfield.png" alt="Clone" title="Clone this subfield" />
593
                    </a>
594
                    <a href="#" class="buttonMinus" tabindex="1" onclick="UnCloneField('subfield[% subfield_loo.tag | html %][% subfield_loo.subfield | html %][% subfield_loo.random | html %]'); return false;">
595
                        <img src="[% interface | html %]/[% theme | html %]/img/delete-subfield.png" alt="Delete" title="Delete this subfield" />
596
                    </a>
597
                [% END %]
598
                </span>
599
600
            </div>
601
            <!-- End of the line -->
602
        [% END %]
603
604
    </div>
605
    [% END %]<!-- if innerloo.tag -->
606
    [% END %]<!-- BIG_LOO.innerloop -->
607
    </div>
608
[% END %]<!-- BIG_LOOP -->
609
610
</div><!-- tabs -->
611
612
</form>
613
614
</div>
615
</div>
616
</div>
617
618
[% INCLUDE 'intranet-bottom.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_008_holdings.tt (+194 lines)
Line 0 Link Here
1
[% USE raw %]
2
[% INCLUDE 'doc-head-open.inc' %]
3
<title>Koha &rsaquo; Holdings &rsaquo; 008 builder</title>
4
[% INCLUDE 'doc-head-close.inc' %]
5
</head>
6
<body id="cat_marc21_field_008_holdings" class="cat" style="padding:1em;">
7
<h3> 008 Fixed-length data elements</h3>
8
<form name="f_pop" onsubmit="report()" action="">
9
<input type="hidden" name="plugin_name" value="marc21_field_008_holdings.pl" />
10
<input name="f1" value="[% f1 | html %]" type="hidden" />
11
<table>
12
    <tr>
13
        <td>00-05 - Date entered on file</td>
14
        <td>[% f1 | html %]</td>
15
    </tr>
16
    <tr>
17
        <td><label for="f6">06 - Receipt or acquisition status</label></td>
18
        <td>
19
            <select name="f6" id="f6" size="1">
20
                <option value="0"[%- IF ( f60 ) -%] selected="selected"[%- END -%]>0 - Unknown</option>
21
                <option value="1"[%- IF ( f61 ) -%] selected="selected"[%- END -%]>1 - Other receipt or acquisition status</option>
22
                <option value="2"[%- IF ( f62 ) -%] selected="selected"[%- END -%]>2 - Received and complete or ceased</option>
23
                <option value="3"[%- IF ( f63 ) -%] selected="selected"[%- END -%]>3 - On order</option>
24
                <option value="4"[%- IF ( f64 ) -%] selected="selected"[%- END -%]>4 - Currently received</option>
25
                <option value="5"[%- IF ( f65 ) -%] selected="selected"[%- END -%]>5 - Not currently received</option>
26
            </select>
27
        </td>
28
    </tr>
29
    <tr>
30
        <td><label for="f7">07 - Method of acquisition</label></td>
31
        <td>
32
            <select name="f7" id="f7" size="1">
33
                <option value="c"[%- IF ( f7c ) -%] selected="selected"[%- END -%]>c - Cooperative or consortial purchase</option>
34
                <option value="d"[%- IF ( f7d ) -%] selected="selected"[%- END -%]>d - Deposit</option>
35
                <option value="e"[%- IF ( f7e ) -%] selected="selected"[%- END -%]>e - Exchange</option>
36
                <option value="f"[%- IF ( f7f ) -%] selected="selected"[%- END -%]>f - Free</option>
37
                <option value="g"[%- IF ( f7g ) -%] selected="selected"[%- END -%]>g - Gift</option>
38
                <option value="l"[%- IF ( f7l ) -%] selected="selected"[%- END -%]>l - Legal deposit</option>
39
                <option value="m"[%- IF ( f7m ) -%] selected="selected"[%- END -%]>m - Membership</option>
40
                <option value="n"[%- IF ( f7n ) -%] selected="selected"[%- END -%]>n - Non-library purchase</option>
41
                <option value="p"[%- IF ( f7p ) -%] selected="selected"[%- END -%]>p - Purchase</option>
42
                <option value="q"[%- IF ( f7q ) -%] selected="selected"[%- END -%]>q - Lease</option>
43
                <option value="u"[%- IF ( f7u ) -%] selected="selected"[%- END -%]>u - Unknown</option>
44
                <option value="z"[%- IF ( f7z ) -%] selected="selected"[%- END -%]>z - Other method of acquisition</option>
45
            </select>
46
        </td>
47
    </tr>
48
    <tr>
49
        <td><label for="f8">08-11 - Expected acquisition end date</label></td>
50
        <td><input type="text" name="f8" id="f8" maxlength="4" size="5" value="[% f8 | html %]" /></td>
51
    </tr>
52
    <tr>
53
        <td><label for="f12">12- General retention policy</label></td>
54
        <td>
55
            <select name="f12" id="f12" size="1">
56
                <option value="0"[%- IF ( f120 ) -%] selected="selected"[%- END -%]>0 - Unknown</option>
57
                <option value="1"[%- IF ( f121 ) -%] selected="selected"[%- END -%]>1 - Other general retention policy</option>
58
                <option value="2"[%- IF ( f122 ) -%] selected="selected"[%- END -%]>2 - Retained except as replaced by updates</option>
59
                <option value="3"[%- IF ( f123 ) -%] selected="selected"[%- END -%]>3 - Sample issue retained</option>
60
                <option value="4"[%- IF ( f124 ) -%] selected="selected"[%- END -%]>4 - Retained until replaced by microform</option>
61
                <option value="5"[%- IF ( f125 ) -%] selected="selected"[%- END -%]>5 - Retained until replaced by cumulation, replacement volume, or revision</option>
62
                <option value="6"[%- IF ( f126 ) -%] selected="selected"[%- END -%]>6 - Retained for a limited period</option>
63
                <option value="7"[%- IF ( f127 ) -%] selected="selected"[%- END -%]>7 - Not retained</option>
64
                <option value="8"[%- IF ( f128 ) -%] selected="selected"[%- END -%]>8 - Permanently retained</option>
65
            </select>
66
        </td>
67
    </tr>
68
    <tr>
69
        <td><label for="f13">13 - Policy type</label></td>
70
        <td>
71
            <select name="f13" id="f13" size="1">
72
                <option value=" "[%- IF ( f13 ) -%] selected="selected"[%- END -%]># - No information provided</option>
73
                <option value="l"[%- IF ( f13l ) -%] selected="selected"[%- END -%]>l - Latest</option>
74
                <option value="p"[%- IF ( f13p ) -%] selected="selected"[%- END -%]>p - Previous</option>
75
            </select>
76
        </td>
77
    </tr>
78
    <tr>
79
        <td><label for="f14">14 - Number of units</label></td>
80
        <td>
81
            <select name="f14" id="f14" size="1">
82
                <option value=" "[%- IF ( f14 ) -%] selected="selected"[%- END -%]># - No information provided</option>
83
                <option value="1"[%- IF ( f141 ) -%] selected="selected"[%- END -%]>1</option>
84
                <option value="2"[%- IF ( f142 ) -%] selected="selected"[%- END -%]>2</option>
85
                <option value="3"[%- IF ( f143 ) -%] selected="selected"[%- END -%]>3</option>
86
                <option value="4"[%- IF ( f144 ) -%] selected="selected"[%- END -%]>4</option>
87
                <option value="5"[%- IF ( f145 ) -%] selected="selected"[%- END -%]>5</option>
88
                <option value="6"[%- IF ( f146 ) -%] selected="selected"[%- END -%]>6</option>
89
                <option value="7"[%- IF ( f147 ) -%] selected="selected"[%- END -%]>7</option>
90
                <option value="8"[%- IF ( f148 ) -%] selected="selected"[%- END -%]>8</option>
91
                <option value="9"[%- IF ( f149 ) -%] selected="selected"[%- END -%]>9 </option>
92
            </select>
93
        </td>
94
    </tr>
95
    <tr>
96
        <td><label for="f15">15 - Unit type</label></td>
97
        <td>
98
            <select name="f15" id="f15" size="1">
99
                <option value=" "[%- IF ( f15 ) -%] selected="selected"[%- END -%]># - No information provided</option>
100
                <option value="m"[%- IF ( f15m ) -%] selected="selected"[%- END -%]>m - Month(s)</option>
101
                <option value="w"[%- IF ( f15w ) -%] selected="selected"[%- END -%]>w - Week(s)</option>
102
                <option value="y"[%- IF ( f15y ) -%] selected="selected"[%- END -%]>y - Year(s)</option>
103
                <option value="e"[%- IF ( f15e ) -%] selected="selected"[%- END -%]>e - Edition(s)</option>
104
                <option value="i"[%- IF ( f15i ) -%] selected="selected"[%- END -%]>i - Issue(s)</option>
105
                <option value="s"[%- IF ( f15s ) -%] selected="selected"[%- END -%]>s - Supplement(s)</option>
106
            </select>
107
        </td>
108
    </tr>
109
    <tr>
110
        <td><label for="f16">16 - Completeness</label></td>
111
        <td>
112
            <select name="f16" id="f16" size="1">
113
                <option value="0"[%- IF ( f160 ) -%] selected="selected"[%- END -%]>0 - Other</option>
114
                <option value="1"[%- IF ( f161 ) -%] selected="selected"[%- END -%]>1 - Complete</option>
115
                <option value="2"[%- IF ( f162 ) -%] selected="selected"[%- END -%]>2 - Incomplete</option>
116
                <option value="3"[%- IF ( f163 ) -%] selected="selected"[%- END -%]>3 - Scattered</option>
117
                <option value="4"[%- IF ( f164 ) -%] selected="selected"[%- END -%]>4 - Not applicable</option>
118
            </select>
119
        </td>
120
    </tr>
121
    <tr>
122
        <td><label for="f17">17-19 - Number of copies reported</label></td>
123
        <td><input type="text" name="f17" id="f17" maxlength="3" size="4" value="[% f17 | html %]" /></td>
124
    </tr>
125
    <tr>
126
        <td><label for="f20">20 - Lending policy</label></td>
127
        <td>
128
            <select name="f20" id="f20" size="1">
129
                <option value="a"[%- IF ( f20a ) -%] selected="selected"[%- END -%]>a - Will lend</option>
130
                <option value="b"[%- IF ( f20b ) -%] selected="selected"[%- END -%]>b - Will not lend</option>
131
                <option value="c"[%- IF ( f20c ) -%] selected="selected"[%- END -%]>c - Will lend hard copy only</option>
132
                <option value="l"[%- IF ( f20l ) -%] selected="selected"[%- END -%]>l - Limited lending policy</option>
133
                <option value="u"[%- IF ( f20u ) -%] selected="selected"[%- END -%]>u - Unknown</option>
134
            </select>
135
        </td>
136
    </tr>
137
    <tr>
138
        <td><label for="f21">21 - Reproduction policy</label></td>
139
        <td>
140
            <select name="f21" id="f21" size="1">
141
                <option value="a"[%- IF ( f21a ) -%] selected="selected"[%- END -%]>a - Will reproduce</option>
142
                <option value="b"[%- IF ( f21b ) -%] selected="selected"[%- END -%]>b - Will not reproduce</option>
143
                <option value="u"[%- IF ( f21u ) -%] selected="selected"[%- END -%]>u - Unknown</option>
144
            </select>
145
        </td>
146
    </tr>
147
    <tr>
148
        <td><label for="f22">22-24 - Language</label></td>
149
        <td><input type="text" name="f22" id="f22" maxlength="3" size="4" value="[% f22 | html %]" /></td>
150
    </tr>
151
    <tr>
152
        <td><label for="f25">25 - Separate or composite copy report</label></td>
153
        <td>
154
            <select name="f25" id="f25" size="1">
155
                <option value="0"[%- IF ( f250 ) -%] selected="selected"[%- END -%]>0 - Separate copy report</option>
156
                <option value="1"[%- IF ( f251 ) -%] selected="selected"[%- END -%]>1 - Composite copy report</option>
157
            </select>
158
        </td>
159
    </tr>
160
    <tr>
161
        <td><label for="f26">26-31 - Date of report</label></td>
162
        <td><input type="text" name="f26" id="f26" maxlength="6" size="7" value="[% f26 | html %]" /></td>
163
    </tr>
164
</table>
165
<fieldset class="action"><input type="submit" value="OK" /> <a href="#" class="cancel close">Cancel</a></fieldset>
166
</form>
167
<script type="text/javascript">//<![CDATA[
168
    function report() {
169
            var doc   = opener.document;
170
            var field = doc.getElementById("[% index | html %]");
171
172
            field.value =
173
            document.f_pop.f1.value+
174
            document.f_pop.f6.value+
175
            document.f_pop.f7.value+
176
            (document.f_pop.f8.value + '    ').substr(0, 4)+
177
            document.f_pop.f12.value+
178
            document.f_pop.f13.value+
179
            document.f_pop.f14.value+
180
            document.f_pop.f15.value+
181
            document.f_pop.f16.value+
182
            (document.f_pop.f17.value + '   ').substr(0, 3)+
183
            document.f_pop.f20.value+
184
            document.f_pop.f21.value+
185
            (document.f_pop.f22.value + '   ').substr(0, 3)+
186
            document.f_pop.f25.value+
187
            document.f_pop.f26.value;
188
        self.close();
189
        return false;
190
    }
191
    //]]>
192
</script>
193
194
[% INCLUDE 'popup-bottom.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_leader_holdings.tt (+105 lines)
Line 0 Link Here
1
[% INCLUDE 'doc-head-open.inc' %]
2
<title>Koha &rsaquo; Holdings &rsaquo; 000 - Leader builder</title>
3
[% INCLUDE 'doc-head-close.inc' %]
4
</head>
5
<body id="cat_marc21_leader_holdings" class="cat" style="padding:1em;">
6
<form name="f_pop" onsubmit="report()" action="">
7
<input type="hidden" name="plugin_name" value="marc21_leader_holdings.pl" />
8
<h3>000 - Leader</h3>
9
<table>
10
    <tr>
11
        <td><span class="label">0-4 Record size</span></td>
12
        <td>(auto-filled)</td>
13
    </tr>
14
    <tr>
15
        <td><label for="f5">5 - Record status</label></td>
16
        <td>
17
            <select name="f5" id="f5" size="1">
18
                <option value="c"[%- IF ( f5c ) -%] selected="selected"[%- END -%]>c - Corrected or revised</option>
19
                <option value="d"[%- IF ( f5d ) -%] selected="selected"[%- END -%]>d - Deleted</option>
20
                <option value="n"[%- IF ( f5n ) -%] selected="selected"[%- END -%]>n - New</option>
21
            </select>
22
        </td>
23
    </tr>
24
    <tr>
25
        <td><label for="f6">6 - Type of record</label></td>
26
        <td>
27
            <select name="f6" id="f6" size="1">
28
                <option value="u"[%- IF ( f6u ) -%] selected="selected"[%- END -%]>u - Unknown</option>
29
                <option value="v"[%- IF ( f6v ) -%] selected="selected"[%- END -%]>v - Multipart item holdings</option>
30
                <option value="x"[%- IF ( f6x ) -%] selected="selected"[%- END -%]>x - Single-part item holdings</option>
31
                <option value="y"[%- IF ( f6y ) -%] selected="selected"[%- END -%]>y - Serial item holdings</option>
32
            </select>
33
        </td>
34
    </tr>
35
    <tr>
36
        <tr>07-08 - Undefined</tr>
37
        <tr>  </tr>
38
    </tr>
39
    <tr>
40
        <td>9 - Character coding scheme</td>
41
        <td>a - UCS/Unicode (auto-filled)</td>
42
    </tr>
43
    <tr>
44
        <td>10-16 - indicator/subfields/size</td>
45
        <td>(auto-filled)</td>
46
    </tr>
47
    <tr>
48
        <td><label for="f17">17 - Encoding level</label></td>
49
        <td>
50
            <select name="f17" id="f17" size="1">
51
                <option value="1"[%- IF ( f171 ) -%] selected="selected"[%- END -%]>1 - Holdings level 1</option>
52
                <option value="2"[%- IF ( f172 ) -%] selected="selected"[%- END -%]>2 - Holdings level 2</option>
53
                <option value="3"[%- IF ( f173 ) -%] selected="selected"[%- END -%]>3 - Holdings level 3</option>
54
                <option value="4"[%- IF ( f174 ) -%] selected="selected"[%- END -%]>4 - Holdings level 4</option>
55
                <option value="5"[%- IF ( f175 ) -%] selected="selected"[%- END -%]>5 - Holdings level 4 with piece designation</option>
56
                <option value="m"[%- IF ( f17m ) -%] selected="selected"[%- END -%]>m - Mixed level</option>
57
                <option value="u"[%- IF ( f17u ) -%] selected="selected"[%- END -%]>u - Unknown</option>
58
                <option value="z"[%- IF ( f17z ) -%] selected="selected"[%- END -%]>z - Other level</option>
59
            </select>
60
        </td>
61
    </tr>
62
    <tr>
63
        <td><label for="f18">18 - Item information in record</label></td>
64
        <td>
65
            <select name="f18" id="f18" size="1">
66
                <option value="i"[%- IF ( f18i ) -%] selected="selected"[%- END -%]>i - Item information</option>
67
                <option value="n"[%- IF ( f18n ) -%] selected="selected"[%- END -%]>n - No item information</option>
68
            </select>
69
        </td>
70
    </tr>
71
    <tr>
72
        <td>19 - Undefined</td>
73
        <td></td>
74
    </tr>
75
    <tr>
76
        <td>20-24 - entry map &amp; lengths</td>
77
        <td>(auto-filled)</td>
78
    </tr>
79
80
</table>
81
<fieldset class="action"><input type="submit" value="OK" /> <a href="#" class="cancel close">Cancel</a></fieldset>
82
</form>
83
<script type="text/javascript">
84
//<![CDATA[
85
function report() {
86
            var doc   = opener.document;
87
            var field = doc.getElementById("[% index | html %]");
88
89
            field.value =
90
            '     '+
91
            document.f_pop.f5.value+
92
            document.f_pop.f6.value+
93
            '  '+
94
            'a'+ // MARC21 UNICODE flag - must be 'a' for Koha
95
            '22     '+
96
            document.f_pop.f17.value+
97
            document.f_pop.f18.value+
98
            ' '+
99
            '4500';
100
        self.close();
101
        return false;
102
    }
103
    //]]>
104
</script>
105
[% INCLUDE 'popup-bottom.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tt (+2 lines)
Lines 230-235 Link Here
230
                                                        <a href="/cgi-bin/koha/catalogue/moredetail.pl?item=[% loopro.object | uri %]&amp;biblionumber=[% loopro.biblionumber | uri %]&amp;bi=[% loopro.biblioitemnumber | uri %]#item[% loopro.object | uri %]">Item [% loopro.object | html %]</a>
230
                                                        <a href="/cgi-bin/koha/catalogue/moredetail.pl?item=[% loopro.object | uri %]&amp;biblionumber=[% loopro.biblionumber | uri %]&amp;bi=[% loopro.biblioitemnumber | uri %]#item[% loopro.object | uri %]">Item [% loopro.object | html %]</a>
231
                                                    [% ELSIF ( loopro.info.substr(0, 6) == 'biblio' ) %]
231
                                                    [% ELSIF ( loopro.info.substr(0, 6) == 'biblio' ) %]
232
                                                        <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% loopro.object | uri %]" title="Display detail for this biblio">Biblio [% loopro.object | html %]</a>
232
                                                        <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% loopro.object | uri %]" title="Display detail for this biblio">Biblio [% loopro.object | html %]</a>
233
                                                    [% ELSIF ( loopro.info.substr(0, 7) == 'holding' ) %]
234
                                                        <a href="/cgi-bin/koha/cataloguing/addholding.pl?op=edit&amp;holding_id=[% loopro.object | uri %]" title="Display detail for this holding">Holding [% loopro.object | html %]</a>
233
                                                    [% ELSE %]
235
                                                    [% ELSE %]
234
                                                        [% loopro.object | html %]
236
                                                        [% loopro.object | html %]
235
                                                    [% END %]
237
                                                    [% END %]
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt (+28 lines)
Lines 6-11 Link Here
6
[% USE Branches %]
6
[% USE Branches %]
7
[% USE ColumnsSettings %]
7
[% USE ColumnsSettings %]
8
[% USE AuthorisedValues %]
8
[% USE AuthorisedValues %]
9
[% USE Holdings %]
9
[% SET TagsShowEnabled = ( ( Koha.Preference( 'TagsEnabled' ) == 1 ) && TagsShowOnDetail ) %]
10
[% SET TagsShowEnabled = ( ( Koha.Preference( 'TagsEnabled' ) == 1 ) && TagsShowOnDetail ) %]
10
[% SET TagsInputEnabled = ( ( Koha.Preference( 'opacuserlogin' ) == 1 ) && ( Koha.Preference( 'TagsEnabled' ) == 1 ) && TagsInputOnDetail ) %]
11
[% SET TagsInputEnabled = ( ( Koha.Preference( 'opacuserlogin' ) == 1 ) && ( Koha.Preference( 'TagsEnabled' ) == 1 ) && TagsInputOnDetail ) %]
11
[% IF Koha.Preference('AmazonAssocTag') %]
12
[% IF Koha.Preference('AmazonAssocTag') %]
Lines 682-687 Link Here
682
                                [% END %]
683
                                [% END %]
683
                            [% END %]
684
                            [% END %]
684
                        [% END # IF itemloop.size %]
685
                        [% END # IF itemloop.size %]
686
                        [% IF summary_holdings %]
687
                            [% FOREACH holding IN summary_holdings %]
688
                                [% UNLESS holding.suppress %]
689
                                    [% holding_details = Holdings.GetDetails(holding) %]
690
                                    [% IF holding_details.public_note || holding_details.summary || holding_details.supplements || holding_details.indexes %]
691
                                        <span class="summary-holdings">
692
                                            <br>
693
                                            <strong>Additional information for [% Holdings.GetLocation(holding, 1) | html %]</strong>
694
                                            <ul>
695
                                                [% IF holding_details.public_note %]
696
                                                    <li>Public note: [% holding_details.public_note | html %]</li>
697
                                                [% END %]
698
                                                [% IF holding_details.summary %]
699
                                                    <li>Summary: [% holding_details.summary | html %]</li>
700
                                                [% END %]
701
                                                [% IF holding_details.supplements %]
702
                                                    <li>Supplements: [% holding_details.supplements | html %]</li>
703
                                                [% END %]
704
                                                [% IF holding_details.indexes %]
705
                                                    <li>Indexes: [% holding_details.indexes | html %]</li>
706
                                                [% END %]
707
                                            </ul>
708
                                        </span>
709
                                    [% END %]
710
                                [% END %]
711
                            [% END %]
712
                        [% END %]
685
                        [% PROCESS 'shelfbrowser.inc' %]
713
                        [% PROCESS 'shelfbrowser.inc' %]
686
                        [% INCLUDE shelfbrowser tab='holdings' %]
714
                        [% INCLUDE shelfbrowser tab='holdings' %]
687
                        <br style="clear:both;" />
715
                        <br style="clear:both;" />
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt (+10 lines)
Lines 1-6 Link Here
1
[% USE raw %]
1
[% USE raw %]
2
[% USE Asset %]
2
[% USE Asset %]
3
[% USE Koha %]
3
[% USE Koha %]
4
[% USE Holdings %]
4
[% SET TagsShowEnabled = ( ( Koha.Preference( 'TagsEnabled' ) == 1 ) && TagsShowOnList ) %]
5
[% SET TagsShowEnabled = ( ( Koha.Preference( 'TagsEnabled' ) == 1 ) && TagsShowOnList ) %]
5
[% SET TagsInputEnabled = ( ( Koha.Preference( 'opacuserlogin' ) == 1 ) && ( Koha.Preference( 'TagsEnabled' ) == 1 ) && TagsInputOnList ) %]
6
[% SET TagsInputEnabled = ( ( Koha.Preference( 'opacuserlogin' ) == 1 ) && ( Koha.Preference( 'TagsEnabled' ) == 1 ) && TagsInputOnList ) %]
6
[% SET AdlibrisEnabled = Koha.Preference('AdlibrisCoversEnabled') %]
7
[% SET AdlibrisEnabled = Koha.Preference('AdlibrisCoversEnabled') %]
Lines 407-412 Link Here
407
                                                                    [% END %]
408
                                                                    [% END %]
408
                                                                [% ELSE %]
409
                                                                [% ELSE %]
409
                                                                    <span class="unavailable">No items available:</span>
410
                                                                    <span class="unavailable">No items available:</span>
411
                                                                    [% IF ( SEARCH_RESULT.summary_holdings ) %]
412
                                                                        <span class="summary-holdings">
413
                                                                            [% FOREACH holding IN SEARCH_RESULT.summary_holdings %]
414
                                                                                [% UNLESS holding.suppress %]
415
                                                                                    [% Holdings.GetLocation(holding, 1) | html %],
416
                                                                                [% END %]
417
                                                                            [% END %]
418
                                                                        </span>
419
                                                                    [% END %]
410
                                                                [% END %]
420
                                                                [% END %]
411
                                                            [% END # / IF SEARCH_RESULT.available_items_loop.size %]
421
                                                            [% END # / IF SEARCH_RESULT.available_items_loop.size %]
412
422
(-)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 1160-1166 Link Here
1160
                            </xsl:for-each>
1161
                            </xsl:for-each>
1161
                            (<xsl:value-of select="$AlternateHoldingsCount"/>)
1162
                            (<xsl:value-of select="$AlternateHoldingsCount"/>)
1162
                            </xsl:when>
1163
                            </xsl:when>
1163
                            <xsl:otherwise>No items available </xsl:otherwise>
1164
                            <xsl:otherwise>
1165
                                <xsl:text>No items available</xsl:text>
1166
                                <xsl:if test="//holdings:holdings/holdings:holding/holdings:suppress[.='0']">:
1167
                                    <xsl:for-each select="//holdings:holdings/holdings:holding[./holdings:suppress='0']">
1168
                                        <xsl:if test="position() > 1">, </xsl:if>
1169
                                        <xsl:value-of select="./holdings:holdingbranch"/>
1170
                                        <xsl:if test="string-length(./holdings:location) > 0">
1171
                                        - <xsl:value-of select="./holdings:location"/>
1172
                                        </xsl:if>
1173
                                        <xsl:if test="string-length(./holdings:callnumber) > 0">
1174
                                        - <xsl:value-of select="./holdings:callnumber"/>
1175
                                        </xsl:if>
1176
                                    </xsl:for-each>
1177
                                </xsl:if>
1178
                            </xsl:otherwise>
1164
                        </xsl:choose>
1179
                        </xsl:choose>
1165
				   </xsl:when>
1180
				   </xsl:when>
1166
                   <xsl:when test="count(key('item-by-status', 'available'))>0">
1181
                   <xsl:when test="count(key('item-by-status', 'available'))>0">
(-)a/opac/opac-detail.pl (-1 / +7 lines)
Lines 746-751 if (scalar(@itemloop) == 0 || scalar(@otheritemloop) == 0) { Link Here
746
    }
746
    }
747
}
747
}
748
748
749
# Fetch summary holdings
750
if (C4::Context->preference('SummaryHoldings')) {
751
    my $summary_holdings = C4::Holdings::GetHoldingsByBiblionumber($biblionumber);
752
    $template->param( summary_holdings => $summary_holdings );
753
}
754
755
749
## get notes and subjects from MARC record
756
## get notes and subjects from MARC record
750
if (!C4::Context->preference("OPACXSLTDetailsDisplay") ) {
757
if (!C4::Context->preference("OPACXSLTDetailsDisplay") ) {
751
    my $marcisbnsarray   = GetMarcISBN    ($record,$marcflavour);
758
    my $marcisbnsarray   = GetMarcISBN    ($record,$marcflavour);
752
- 

Return to bug 20447