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 1542-1547 sub GetAuthorisedValueDesc { Link Here
1542
            return $itemtype ? $itemtype->translated_description : q||;
1543
            return $itemtype ? $itemtype->translated_description : q||;
1543
        }
1544
        }
1544
1545
1546
        #---- holdings
1547
        if ( $tagslib->{$tag}->{$subfield}->{'authorised_value'} eq "holdings" ) {
1548
            my $holding = Koha::Holdings->find( $value );
1549
            if ( $holding ) {
1550
                my @parts;
1551
1552
                push @parts, $value;
1553
                push @parts, $holding->holdingbranch() if $holding->holdingbranch();
1554
                push @parts, $holding->location() if $holding->location();
1555
                push @parts, $holding->ccode() if $holding->ccode();
1556
                push @parts, $holding->callnumber() if $holding->callnumber();
1557
1558
                return join(' ', @parts);
1559
            }
1560
            return q||;
1561
        }
1562
1545
        #---- "true" authorized value
1563
        #---- "true" authorized value
1546
        $category = $tagslib->{$tag}->{$subfield}->{'authorised_value'};
1564
        $category = $tagslib->{$tag}->{$subfield}->{'authorised_value'};
1547
    }
1565
    }
(-)a/C4/Holdings.pm (+746 lines)
Line 0 Link Here
1
package C4::Holdings;
2
3
# Copyright 2000-2002 Katipo Communications
4
# Copyright 2010 BibLibre
5
# Copyright 2011 Equinox Software, Inc.
6
# Copyright 2017-2018 University of Helsinki (The National Library Of Finland)
7
#
8
# This file is part of Koha.
9
#
10
# Koha is free software; you can redistribute it and/or modify it
11
# under the terms of the GNU General Public License as published by
12
# the Free Software Foundation; either version 3 of the License, or
13
# (at your option) any later version.
14
#
15
# Koha is distributed in the hope that it will be useful, but
16
# WITHOUT ANY WARRANTY; without even the implied warranty of
17
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18
# GNU General Public License for more details.
19
#
20
# You should have received a copy of the GNU General Public License
21
# along with Koha; if not, see <http://www.gnu.org/licenses>.
22
23
use Modern::Perl;
24
use Carp;
25
26
# TODO check which use's are really necessary
27
28
use Encode qw( decode is_utf8 );
29
use List::MoreUtils qw( uniq );
30
use MARC::Record;
31
use MARC::File::USMARC;
32
use MARC::File::XML;
33
use POSIX qw(strftime);
34
35
use C4::Koha;
36
use C4::Log;    # logaction
37
use C4::ClassSource;
38
use C4::Charset;
39
use C4::Debug;
40
41
use Koha::Caches;
42
use Koha::Holdings::Metadata;
43
use Koha::Holdings::Metadatas;
44
use Koha::Libraries;
45
46
use vars qw(@ISA @EXPORT);
47
use vars qw($debug $cgi_debug);
48
49
BEGIN {
50
51
    require Exporter;
52
    @ISA = qw( Exporter );
53
54
    # to add holdings
55
    # EXPORTED FUNCTIONS.
56
    push @EXPORT, qw(
57
      &AddHolding
58
    );
59
60
    # to get something
61
    push @EXPORT, qw(
62
      GetHolding
63
    );
64
65
    # To modify something
66
    push @EXPORT, qw(
67
      &ModHolding
68
    );
69
70
    # To delete something
71
    push @EXPORT, qw(
72
      &DelHolding
73
    );
74
}
75
76
=head1 NAME
77
78
C4::Holding - cataloging management functions
79
80
=head1 DESCRIPTION
81
82
Holding.pm contains functions for managing storage and editing of holdings data within Koha. Most of the functions in this module are used for cataloging holdings records: adding, editing, or removing holdings. Koha stores holdings information in two places:
83
84
=over 4
85
86
=item 1. in the holdings table which is limited to a one-to-one mapping to underlying MARC data
87
88
=item 2. as MARC XML in holdings_metadata.metadata
89
90
=back
91
92
In the 3.0 version of Koha, the authoritative record-level information is in holdings_metadata.metadata
93
94
Because the data isn't completely normalized there's a chance for information to get out of sync. The design choice to go with a un-normalized schema was driven by performance and stability concerns. However, if this occur, it can be considered as a bug : The API is (or should be) complete & the only entry point for all holdings management.
95
96
=over 4
97
98
=item 1. Add*/Mod*/Del*/ - high-level external functions suitable for being called from external scripts to manage the collection
99
100
=back
101
102
The MARC record (in holdings_metadata.metadata) contains the MARC holdings record. It also contains the holding_id. That is the reason why it is not stored directly by AddHolding, with all other fields. To save a holding, we need to:
103
104
=over 4
105
106
=item 1. save data in holdings table, that gives us a holding_id
107
108
=item 2. add the holding_id into the MARC record
109
110
=item 3. save the marc record
111
112
=back
113
114
=head1 EXPORTED FUNCTIONS
115
116
=head2 AddHolding
117
118
  $holding_id = AddHolding($record, $frameworkcode, $biblionumber);
119
120
Exported function (core API) for adding a new holding to koha.
121
122
The first argument is a C<MARC::Record> object containing the
123
holding to add, while the second argument is the desired MARC
124
framework code and third the biblionumber to link to.
125
126
=cut
127
128
sub AddHolding {
129
    my $record          = shift;
130
    my $frameworkcode   = shift;
131
    my $biblionumber    = shift;
132
    if (!$record) {
133
        carp('AddHolding called with undefined record');
134
        return;
135
    }
136
137
    my $dbh = C4::Context->dbh;
138
139
    my $biblio = Koha::Biblios->find( $biblionumber );
140
    my $biblioitemnumber = $biblio->biblioitem->biblioitemnumber;
141
142
    # transform the data into koha-table style data
143
    SetUTF8Flag($record);
144
    my $rowData = TransformMarcHoldingToKoha( $record );
145
    my ($holding_id) = _koha_add_holding( $dbh, $rowData, $frameworkcode, $biblionumber, $biblioitemnumber );
146
147
    _koha_marc_update_ids( $record, $frameworkcode, $holding_id, $biblionumber, $biblioitemnumber );
148
149
    # now add the record
150
    ModHoldingMarc( $record, $holding_id, $frameworkcode );
151
152
    logaction( "CATALOGUING", "ADD", $holding_id, "holding" ) if C4::Context->preference("CataloguingLog");
153
    return $holding_id;
154
}
155
156
=head2 ModHolding
157
158
  ModHolding($record, $holding_id, $frameworkcode);
159
160
Replace an existing holding record identified by C<$holding_id>
161
with one supplied by the MARC::Record object C<$record>.
162
163
C<$frameworkcode> specifies the MARC framework to use
164
when storing the modified holdings record.
165
166
Returns 1 on success 0 on failure
167
168
=cut
169
170
sub ModHolding {
171
    my ( $record, $holding_id, $frameworkcode ) = @_;
172
    if (!$record) {
173
        carp 'No record passed to ModHolding';
174
        return 0;
175
    }
176
177
    if ( C4::Context->preference("CataloguingLog") ) {
178
        my $newrecord = GetMarcHolding($holding_id);
179
        logaction( "CATALOGUING", "MODIFY", $holding_id, "holding BEFORE=>" . $newrecord->as_formatted );
180
    }
181
182
    # Cleaning up invalid fields must be done early or SetUTF8Flag is liable to
183
    # throw an exception which probably won't be handled.
184
    foreach my $field ($record->fields()) {
185
        if (! $field->is_control_field()) {
186
            if (scalar($field->subfields()) == 0 || (scalar($field->subfields()) == 1 && $field->subfield('9'))) {
187
                $record->delete_field($field);
188
            }
189
        }
190
    }
191
192
    SetUTF8Flag($record);
193
    my $dbh = C4::Context->dbh;
194
195
    $frameworkcode = 'HLD' if !$frameworkcode || $frameworkcode eq 'Default';
196
197
    # update holding_id in MARC
198
    _koha_marc_update_ids( $record, $frameworkcode, $holding_id );
199
200
    # load the koha-table data object
201
    my $rowData = TransformMarcHoldingToKoha( $record );
202
    # update the MARC record (that now contains biblio and items) with the new record data
203
    &ModHoldingMarc( $record, $holding_id, $frameworkcode );
204
205
    # modify the other koha tables
206
    _koha_modify_holding( $dbh, $holding_id, $rowData, $frameworkcode );
207
208
    return 1;
209
}
210
211
=head2 DelHolding
212
213
  my $error = &DelHolding($holding_id);
214
215
Exported function (core API) for deleting a holding in koha.
216
Deletes holding record from Koha tables (holdings, holdings_metadata)
217
Also backs it up to deleted* tables.
218
Checks to make sure that the holding has no items attached.
219
return:
220
C<$error> : undef unless an error occurs
221
222
=cut
223
224
sub DelHolding {
225
    my ($holding_id) = @_;
226
    my $dbh = C4::Context->dbh;
227
    my $error;    # for error handling
228
229
    # First make sure this holding has no items attached
230
    my $sth = $dbh->prepare("SELECT itemnumber FROM items WHERE holding_id=?");
231
    $sth->execute($holding_id);
232
    if ( my $itemnumber = $sth->fetchrow ) {
233
234
        # Fix this to use a status the template can understand
235
        $error .= "This holding record has items attached, please delete them first before deleting this holding record ";
236
    }
237
238
    return $error if $error;
239
240
    # delete holding
241
    _koha_delete_holding( $dbh, $holding_id );
242
243
    logaction( "CATALOGUING", "DELETE", $holding_id, "holding" ) if C4::Context->preference("CataloguingLog");
244
245
    return;
246
}
247
248
=head2 GetHolding
249
250
  my $holding = &GetHolding($holding_id);
251
252
=cut
253
254
sub GetHolding {
255
    my ($holding_id) = @_;
256
    
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
    my $dbh = C4::Context->dbh;
278
    my $sth = $dbh->prepare("SELECT * FROM holdings WHERE holdings.biblionumber = ? AND deleted_on IS NULL") || die $dbh->errstr;
279
    # Get all holdings attached to a biblioitem
280
    my $i = 0;
281
    my @results;
282
    $sth->execute($bib) || die $sth->errstr;
283
    while ( my $data = $sth->fetchrow_hashref ) {
284
        push(@results, $data);
285
    }
286
    return (\@results);
287
}
288
289
=head2 GetMarcHolding
290
291
  my $record = GetMarcHolding(holding_id, [$opac]);
292
293
Returns MARC::Record representing a holding record, or C<undef> if the
294
record doesn't exist.
295
296
=over 4
297
298
=item C<$holding_id>
299
300
the holding_id
301
302
=item C<$opac>
303
304
set to true to make the result suited for OPAC view. This causes things like
305
OpacHiddenItems to be applied.
306
307
=back
308
309
=cut
310
311
sub GetMarcHolding {
312
    my $holding_id = shift;
313
    my $opac         = shift || 0;
314
315
    if (not defined $holding_id) {
316
        carp 'GetMarcHolding called with undefined holding_id';
317
        return;
318
    }
319
320
    my $marcflavour = C4::Context->preference('marcflavour');
321
322
    my $marcxml = GetXmlHolding( $holding_id );
323
    $marcxml = StripNonXmlChars( $marcxml );
324
    my $frameworkcode = GetHoldingFrameworkCode( $holding_id );
325
    MARC::File::XML->default_record_format( $marcflavour );
326
327
    if ($marcxml) {
328
        my $record = eval {
329
            MARC::Record::new_from_xml( $marcxml, "utf8", $marcflavour );
330
        };
331
        if ($@) { warn " problem with holding $holding_id : $@ \n$marcxml"; }
332
        return unless $record;
333
334
        _koha_marc_update_ids( $record, $frameworkcode, $holding_id );
335
336
        return $record;
337
    }
338
    return;
339
}
340
341
=head2 GetXmlHolding
342
343
  my $marcxml = GetXmlHolding($holding_id);
344
345
Returns holdings_metadata.metadata/marcxml of the holding_id passed in parameter.
346
347
=cut
348
349
sub GetXmlHolding {
350
    my ($holding_id) = @_;
351
    return unless $holding_id;
352
353
    my $marcflavour = C4::Context->preference('marcflavour');
354
    my $sth = C4::Context->dbh->prepare(
355
        q|
356
        SELECT metadata
357
        FROM holdings_metadata
358
        WHERE holding_id=?
359
            AND format='marcxml'
360
            AND marcflavour=?
361
        |
362
    );
363
364
    $sth->execute( $holding_id, $marcflavour );
365
    my ($marcxml) = $sth->fetchrow();
366
    $sth->finish();
367
    return $marcxml;
368
}
369
370
=head2 GetHoldingFrameworkCode
371
372
  $frameworkcode = GetFrameworkCode( $holding_id )
373
374
=cut
375
376
sub GetHoldingFrameworkCode {
377
    my ($holding_id) = @_;
378
    my $sth = C4::Context->dbh->prepare("SELECT frameworkcode FROM holdings WHERE holding_id=?");
379
    $sth->execute($holding_id);
380
    my ($frameworkcode) = $sth->fetchrow;
381
    $sth->finish();
382
    return $frameworkcode;
383
}
384
385
=head1 INTERNAL FUNCTIONS
386
387
=head2 _koha_add_holding
388
389
  my ($holding_id,$error) = _koha_add_hodings($dbh, $holding, $frameworkcode, $biblionumber, $biblioitemnumber);
390
391
Internal function to add a holding ($holding is a hash with the values)
392
393
=cut
394
395
sub _koha_add_holding {
396
    my ( $dbh, $holding, $frameworkcode, $biblionumber, $biblioitemnumber ) = @_;
397
398
    my $error;
399
400
    my $query = "INSERT INTO holdings
401
        SET biblionumber = ?,
402
            biblioitemnumber = ?,
403
            frameworkcode = ?,
404
            holdingbranch = ?,
405
            location = ?,
406
            ccode = ?
407
            callnumber = ?,
408
            suppress = ?,
409
            datecreated = NOW()
410
        ";
411
412
    my $sth = $dbh->prepare($query);
413
    $sth->execute(
414
        $biblionumber, $biblioitemnumber, $frameworkcode,
415
        $holding->{holdingbranch}, $holding->{location}, $holding->{ccode}, $holding->{callnumber}, $holding->{suppress} ? 1 : 0
416
    );
417
418
    my $holding_id = $dbh->{'mysql_insertid'};
419
    if ( $dbh->errstr ) {
420
        $error .= "ERROR in _koha_add_holding $query" . $dbh->errstr;
421
        warn $error;
422
    }
423
424
    $sth->finish();
425
426
    return ( $holding_id, $error );
427
}
428
429
=head2 _koha_modify_holding
430
431
  my ($biblionumber,$error) == _koha_modify_holding($dbh, $holding, $frameworkcode);
432
433
Internal function for updating the holdings table
434
435
=cut
436
437
sub _koha_modify_holding {
438
    my ( $dbh, $holding_id, $holding, $frameworkcode ) = @_;
439
    my $error;
440
441
    my $query = "
442
        UPDATE holdings
443
        SET    frameworkcode = ?,
444
               holdingbranch = ?,
445
               location = ?,
446
               ccode = ?,
447
               callnumber = ?,
448
               suppress = ?
449
        WHERE  holding_id = ?
450
        "
451
      ;
452
    my $sth = $dbh->prepare($query);
453
454
    $sth->execute(
455
        $frameworkcode, $holding->{holdingbranch}, $holding->{location}, $holding->{ccode}, $holding->{callnumber}, 
456
        $holding->{suppress} ? 1 : 0, $holding_id
457
    ) if $holding_id;
458
459
    if ( $dbh->errstr || !$holding_id ) {
460
        die "ERROR in _koha_modify_holding for holding $holding_id: " . $dbh->errstr;
461
    }
462
    return ( $holding_id, $error );
463
}
464
465
=head2 _koha_delete_holding
466
467
  $error = _koha_delete_holding($dbh, $holding_id);
468
469
Internal sub for deleting from holdings table
470
471
C<$dbh> - the database handle
472
473
C<$holding_id> - the holding_id of the holding to be deleted
474
475
=cut
476
477
sub _koha_delete_holding {
478
    my ( $dbh, $holding_id ) = @_;
479
480
    my $schema = Koha::Database->new->schema;
481
    $schema->txn_do(
482
        sub {
483
            $dbh->do('UPDATE holdings_metadata SET deleted_on = NOW() WHERE holding_id=?', undef, $holding_id);
484
            $dbh->do('UPDATE holdings SET deleted_on = NOW() WHERE holding_id=?', undef, $holding_id);
485
        }
486
    );
487
    return;
488
}
489
490
=head1 INTERNAL FUNCTIONS
491
492
=head2 _koha_marc_update_ids
493
494
495
  _koha_marc_update_ids($record, $frameworkcode, $holding_id[, $biblionumber, $biblioitemnumber]);
496
497
Internal function to add or update holding_id, biblionumber and biblioitemnumber to
498
the MARC XML.
499
500
=cut
501
502
sub _koha_marc_update_ids {
503
    my ( $record, $frameworkcode, $holding_id, $biblionumber, $biblioitemnumber ) = @_;
504
505
    my ( $holding_tag, $holding_subfield ) = GetMarcHoldingFromKohaField( "holdings.holding_id" );
506
    die qq{No holding_id tag for framework "$frameworkcode"} unless $holding_tag;
507
508
    if ( $holding_tag < 10 ) {
509
        C4::Biblio::UpsertMarcControlField( $record, $holding_tag, $holding_id );
510
    } else {
511
        C4::Biblio::UpsertMarcSubfield($record, $holding_tag, $holding_subfield, $holding_id);
512
    }
513
514
    if ( defined $biblionumber ) {
515
        my ( $biblio_tag, $biblio_subfield ) = GetMarcHoldingFromKohaField( "biblio.biblionumber" );
516
        die qq{No biblionumber tag for framework "$frameworkcode"} unless $biblio_tag;
517
        if ( $biblio_tag < 10 ) {
518
            C4::Biblio::UpsertMarcControlField( $record, $biblio_tag, $biblionumber );
519
        } else {
520
            C4::Biblio::UpsertMarcSubfield($record, $biblio_tag, $biblio_subfield, $biblionumber);
521
        }
522
    }
523
    if ( defined $biblioitemnumber ) {
524
        my ( $biblioitem_tag, $biblioitem_subfield ) = GetMarcHoldingFromKohaField( "biblioitems.biblioitemnumber" );
525
        die qq{No biblioitemnumber tag for framework "$frameworkcode"} unless $biblioitem_tag;
526
        if ( $biblioitem_tag < 10 ) {
527
            C4::Biblio::UpsertMarcControlField( $record, $biblioitem_tag, $biblioitemnumber );
528
        } else {
529
            C4::Biblio::UpsertMarcSubfield($record, $biblioitem_tag, $biblioitem_subfield, $biblioitemnumber);
530
        }
531
    }
532
}
533
534
=head1 UNEXPORTED FUNCTIONS
535
536
=head2 ModHoldingMarc
537
538
  &ModHoldingMarc($newrec,$holding_id,$frameworkcode);
539
540
Add MARC XML data for a holding to koha
541
542
Function exported, but should NOT be used, unless you really know what you're doing
543
544
=cut
545
546
sub ModHoldingMarc {
547
    # pass the MARC::Record to this function, and it will create the records in
548
    # the marcxml field
549
    my ( $record, $holding_id, $frameworkcode ) = @_;
550
    if ( !$record ) {
551
        carp 'ModHoldingMarc passed an undefined record';
552
        return;
553
    }
554
555
    # Clone record as it gets modified
556
    $record = $record->clone();
557
    my $dbh    = C4::Context->dbh;
558
    my @fields = $record->fields();
559
    if ( !$frameworkcode ) {
560
        $frameworkcode = "";
561
    }
562
    my $sth = $dbh->prepare("UPDATE holdings SET frameworkcode=? WHERE holding_id=?");
563
    $sth->execute( $frameworkcode, $holding_id );
564
    $sth->finish;
565
    my $encoding = C4::Context->preference("marcflavour");
566
567
    # deal with UNIMARC field 100 (encoding) : create it if needed & set encoding to unicode
568
    if ( $encoding eq "UNIMARC" ) {
569
        my $defaultlanguage = C4::Context->preference("UNIMARCField100Language");
570
        $defaultlanguage = "fre" if (!$defaultlanguage || length($defaultlanguage) != 3);
571
        my $string = $record->subfield( 100, "a" );
572
        if ( ($string) && ( length( $record->subfield( 100, "a" ) ) == 36 ) ) {
573
            my $f100 = $record->field(100);
574
            $record->delete_field($f100);
575
        } else {
576
            $string = POSIX::strftime( "%Y%m%d", localtime );
577
            $string =~ s/\-//g;
578
            $string = sprintf( "%-*s", 35, $string );
579
            substr ( $string, 22, 3, $defaultlanguage);
580
        }
581
        substr( $string, 25, 3, "y50" );
582
        unless ( $record->subfield( 100, "a" ) ) {
583
            $record->insert_fields_ordered( MARC::Field->new( 100, "", "", "a" => $string ) );
584
        }
585
    }
586
587
    #enhancement 5374: update transaction date (005) for marc21/unimarc
588
    if($encoding =~ /MARC21|UNIMARC/) {
589
      my @a= (localtime) [5,4,3,2,1,0]; $a[0]+=1900; $a[1]++;
590
        # YY MM DD HH MM SS (update year and month)
591
      my $f005= $record->field('005');
592
      $f005->update(sprintf("%4d%02d%02d%02d%02d%04.1f",@a)) if $f005;
593
    }
594
595
    my $metadata = {
596
        holding_id => $holding_id,
597
        format        => 'marcxml',
598
        marcflavour   => C4::Context->preference('marcflavour'),
599
    };
600
    # FIXME To replace with ->find_or_create?
601
    if ( my $m_rs = Koha::Holdings::Metadatas->find($metadata) ) {
602
        $m_rs->metadata( $record->as_xml_record($encoding) );
603
        $m_rs->store;
604
    } else {
605
        my $m_rs = Koha::Holdings::Metadata->new($metadata);
606
        $m_rs->metadata( $record->as_xml_record($encoding) );
607
        $m_rs->store;
608
    }
609
    return $holding_id;
610
}
611
612
=head2 GetMarcHoldingFromKohaField
613
614
    ( $field,$subfield ) = GetMarcHoldingFromKohaField( $kohafield );
615
    @fields = GetMarcHoldingFromKohaField( $kohafield );
616
    $field = GetMarcHoldingFromKohaField( $kohafield );
617
618
    Returns the MARC fields & subfields mapped to $kohafield.
619
    Uses the HLD framework that is considered as authoritative.
620
621
    In list context all mappings are returned; there can be multiple
622
    mappings. Note that in the above example you could miss a second
623
    mappings in the first call.
624
    In scalar context only the field tag of the first mapping is returned.
625
626
=cut
627
628
sub GetMarcHoldingFromKohaField {
629
    my ( $kohafield ) = @_;
630
    return unless $kohafield;
631
    # The next call uses the Default framework since it is AUTHORITATIVE
632
    # for all Koha to MARC mappings.
633
    my $mss = C4::Biblio::GetMarcSubfieldStructure( 'HLD' ); # Do not change framework
634
    my @retval;
635
    foreach( @{ $mss->{$kohafield} } ) {
636
        push @retval, $_->{tagfield}, $_->{tagsubfield};
637
    }
638
    return wantarray ? @retval : ( @retval ? $retval[0] : undef );
639
}
640
641
=head2 GetMarcHoldingSubfieldStructureFromKohaField
642
643
    my $str = GetMarcHoldingSubfieldStructureFromKohaField( $kohafield );
644
645
    Returns marc subfield structure information for $kohafield.
646
    Uses the HLD framework that is considered as authoritative.
647
648
    In list context returns a list of all hashrefs, since there may be
649
    multiple mappings. In scalar context the first hashref is returned.
650
651
=cut
652
653
sub GetMarcHoldingSubfieldStructureFromKohaField {
654
    my ( $kohafield ) = @_;
655
656
    return unless $kohafield;
657
658
    # The next call uses the Default framework since it is AUTHORITATIVE
659
    # for all Koha to MARC mappings.
660
    my $mss = C4::Biblio::GetMarcSubfieldStructure( 'HLD' ); # Do not change framework
661
    return unless $mss->{$kohafield};
662
    return wantarray ? @{$mss->{$kohafield}} : $mss->{$kohafield}->[0];
663
}
664
665
=head2 TransformMarcHoldingToKoha
666
667
    $result = TransformMarcHoldingToKoha( $record, undef )
668
669
Extract data from a MARC holdings record into a hashref representing
670
Koha holdings fields.
671
672
If passed an undefined record will log the error and return an empty
673
hash_ref.
674
675
=cut
676
677
sub TransformMarcHoldingToKoha {
678
    my ( $record ) = @_;
679
680
    my $result = {};
681
    if (!defined $record) {
682
        carp('TransformMarcToKoha called with undefined record');
683
        return $result;
684
    }
685
686
    my %tables = ( holdings => 1 );
687
688
    # The next call acknowledges HLD as the authoritative framework
689
    # for holdings to MARC mappings.
690
    my $mss = C4::Biblio::GetMarcSubfieldStructure( 'HLD' ); # Do not change framework
691
    foreach my $kohafield ( keys %{ $mss } ) {
692
        my ( $table, $column ) = split /[.]/, $kohafield, 2;
693
        next unless $tables{$table};
694
        my $val = TransformMarcHoldingToKohaOneField( $kohafield, $record );
695
        next if !defined $val;
696
        $result->{$column} = $val;
697
    }
698
    return $result;
699
}
700
701
=head2 TransformMarcHoldingToKohaOneField
702
703
    $val = TransformMarcHoldingToKohaOneField( 'biblio.title', $marc );
704
705
    Note: The authoritative Default framework is used implicitly.
706
707
=cut
708
709
sub TransformMarcHoldingToKohaOneField {
710
    my ( $kohafield, $marc ) = @_;
711
712
    my ( @rv, $retval );
713
    my @mss = GetMarcHoldingSubfieldStructureFromKohaField($kohafield);
714
    foreach my $fldhash ( @mss ) {
715
        my $tag = $fldhash->{tagfield};
716
        my $sub = $fldhash->{tagsubfield};
717
        foreach my $fld ( $marc->field($tag) ) {
718
            if( $sub eq '@' || $fld->is_control_field ) {
719
                push @rv, $fld->data if $fld->data;
720
            } else {
721
                push @rv, grep { $_ } $fld->subfield($sub);
722
            }
723
        }
724
    }
725
    return unless @rv;
726
    $retval = join ' | ', uniq(@rv);
727
728
    return $retval;
729
}
730
731
1;
732
733
734
__END__
735
736
=head1 AUTHOR
737
738
Koha Development Team <http://koha-community.org/>
739
740
Paul POULAIN paul.poulain@free.fr
741
742
Joshua Ferraro jmf@liblime.com
743
744
Ere Maijala ere.maijala@helsinki.fi
745
746
=cut
(-)a/C4/Items.pm (-1 / +38 lines)
Lines 465-470 sub _build_default_values_for_mod_marc { Link Here
465
        stocknumber              => undef,
465
        stocknumber              => undef,
466
        uri                      => undef,
466
        uri                      => undef,
467
        withdrawn                => 0,
467
        withdrawn                => 0,
468
        holding_id               => undef,
468
    };
469
    };
469
    my %default_values_for_mod_from_marc;
470
    my %default_values_for_mod_from_marc;
470
    while ( my ( $field, $default_value ) = each %$default_values ) {
471
    while ( my ( $field, $default_value ) = each %$default_values ) {
Lines 1679-1685 sub _koha_new_item { Link Here
1679
            more_subfields_xml  = ?,
1680
            more_subfields_xml  = ?,
1680
            copynumber          = ?,
1681
            copynumber          = ?,
1681
            stocknumber         = ?,
1682
            stocknumber         = ?,
1682
            new_status          = ?
1683
            new_status          = ?,
1684
            holding_id          = ?
1683
          ";
1685
          ";
1684
    my $sth = $dbh->prepare($query);
1686
    my $sth = $dbh->prepare($query);
1685
    my $today = output_pref({ dt => dt_from_string, dateformat => 'iso', dateonly => 1 });
1687
    my $today = output_pref({ dt => dt_from_string, dateformat => 'iso', dateonly => 1 });
Lines 1724-1729 sub _koha_new_item { Link Here
1724
            $item->{'copynumber'},
1726
            $item->{'copynumber'},
1725
            $item->{'stocknumber'},
1727
            $item->{'stocknumber'},
1726
            $item->{'new_status'},
1728
            $item->{'new_status'},
1729
            $item->{'holding_id'},
1727
    );
1730
    );
1728
1731
1729
    my $itemnumber;
1732
    my $itemnumber;
Lines 1763-1768 sub MoveItemFromBiblio { Link Here
1763
            AND biblionumber = ?
1766
            AND biblionumber = ?
1764
    |, undef, $tobiblioitem, $tobiblio, $itemnumber, $frombiblio );
1767
    |, undef, $tobiblioitem, $tobiblio, $itemnumber, $frombiblio );
1765
    if ($return == 1) {
1768
    if ($return == 1) {
1769
        # Check if the moved item is attached to a holdings record
1770
        my $item = GetItem($itemnumber);
1771
        if ($item->{'holding_id'}) {
1772
            use C4::Holdings;
1773
            my $oldHolding = C4::Holdings::GetHolding($item->{'holding_id'});
1774
            if ($oldHolding) {
1775
                # Check if there's a suitable holdings record in the new biblio.
1776
                # This is not perfect, but at least we try.
1777
                use Koha::Holdings;
1778
                my $newHolding = Koha::Holdings->find(
1779
                    {
1780
                        biblionumber     => $tobiblio,
1781
                        biblioitemnumber => $tobiblioitem,
1782
                        frameworkcode    => $oldHolding->{'frameworkcode'},
1783
                        holdingbranch    => $oldHolding->{'holdingbranch'},
1784
                        location         => $oldHolding->{'location'},
1785
                        callnumber       => $oldHolding->{'callnumber'},
1786
                        suppress         => $oldHolding->{'suppress'},
1787
                        deleted_on       => undef
1788
                    }
1789
                );
1790
                if ($newHolding) {
1791
                    $item->{'holding_id'} = $newHolding->holding_id;
1792
                } else {
1793
                    # No existing holdings record, make a copy of the old one.
1794
                    my $oldHoldingMarc = C4::Holdings::GetMarcHolding($item->{'holding_id'});
1795
                    $item->{'holding_id'} = C4::Holdings::AddHolding(
1796
                        $oldHoldingMarc, $oldHolding->{'frameworkcode'}, $tobiblio
1797
                    );
1798
                }
1799
                ModItem($item, $tobiblio, $itemnumber);
1800
            }
1801
        }
1802
1766
        ModZebra( $tobiblio, "specialUpdate", "biblioserver" );
1803
        ModZebra( $tobiblio, "specialUpdate", "biblioserver" );
1767
        ModZebra( $frombiblio, "specialUpdate", "biblioserver" );
1804
        ModZebra( $frombiblio, "specialUpdate", "biblioserver" );
1768
	    # Checking if the item we want to move is in an order 
1805
	    # 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 2060-2065 sub searchResults { Link Here
2060
        my $maxitems_pref = C4::Context->preference('maxItemsinSearchResults');
2061
        my $maxitems_pref = C4::Context->preference('maxItemsinSearchResults');
2061
        my $maxitems = $maxitems_pref ? $maxitems_pref - 1 : 1;
2062
        my $maxitems = $maxitems_pref ? $maxitems_pref - 1 : 1;
2062
        my @hiddenitems; # hidden itemnumbers based on OpacHiddenItems syspref
2063
        my @hiddenitems; # hidden itemnumbers based on OpacHiddenItems syspref
2064
        my $summary_holdings;
2063
2065
2064
        # loop through every item
2066
        # loop through every item
2065
        foreach my $field (@fields) {
2067
        foreach my $field (@fields) {
Lines 2243-2248 sub searchResults { Link Here
2243
            push @available_items_loop, $available_items->{$key}
2245
            push @available_items_loop, $available_items->{$key}
2244
        }
2246
        }
2245
2247
2248
        # Fetch summary holdings
2249
        if (C4::Context->preference('SummaryHoldings')) {
2250
            $summary_holdings = C4::Holdings::GetHoldingsByBiblionumber($oldbiblio->{biblionumber});
2251
        }
2252
2246
        # XSLT processing of some stuff
2253
        # XSLT processing of some stuff
2247
        # we fetched the sysprefs already before the loop through all retrieved record!
2254
        # we fetched the sysprefs already before the loop through all retrieved record!
2248
        if (!$scan && $xslfile) {
2255
        if (!$scan && $xslfile) {
Lines 2275-2280 sub searchResults { Link Here
2275
        $oldbiblio->{onholdcount}          = $item_onhold_count;
2282
        $oldbiblio->{onholdcount}          = $item_onhold_count;
2276
        $oldbiblio->{orderedcount}         = $ordered_count;
2283
        $oldbiblio->{orderedcount}         = $ordered_count;
2277
        $oldbiblio->{notforloancount}      = $notforloan_count;
2284
        $oldbiblio->{notforloancount}      = $notforloan_count;
2285
        $oldbiblio->{summary_holdings}     = $summary_holdings;
2278
2286
2279
        if (C4::Context->preference("AlternateHoldingsField") && $items_count == 0) {
2287
        if (C4::Context->preference("AlternateHoldingsField") && $items_count == 0) {
2280
            my $fieldspec = C4::Context->preference("AlternateHoldingsField");
2288
            my $fieldspec = C4::Context->preference("AlternateHoldingsField");
(-)a/C4/XSLT.pm (-1 / +32 lines)
Lines 241-249 sub XSLTParse4Display { Link Here
241
    # grab the XML, run it through our stylesheet, push it out to the browser
241
    # grab the XML, run it through our stylesheet, push it out to the browser
242
    my $record = transformMARCXML4XSLT($biblionumber, $orig_record);
242
    my $record = transformMARCXML4XSLT($biblionumber, $orig_record);
243
    my $itemsxml  = buildKohaItemsNamespace($biblionumber, $hidden_items);
243
    my $itemsxml  = buildKohaItemsNamespace($biblionumber, $hidden_items);
244
    my $holdingsxml  = buildKohaHoldingsNamespace($biblionumber);
244
    my $xmlrecord = $record->as_xml(C4::Context->preference('marcflavour'));
245
    my $xmlrecord = $record->as_xml(C4::Context->preference('marcflavour'));
245
246
246
    $xmlrecord =~ s/\<\/record\>/$itemsxml$sysxml\<\/record\>/;
247
    $xmlrecord =~ s/\<\/record\>/$itemsxml$holdingsxml$sysxml\<\/record\>/;
247
    if ($fixamps) { # We need to correct the HTML entities that Zebra outputs
248
    if ($fixamps) { # We need to correct the HTML entities that Zebra outputs
248
        $xmlrecord =~ s/\&amp;amp;/\&amp;/g;
249
        $xmlrecord =~ s/\&amp;amp;/\&amp;/g;
249
        $xmlrecord =~ s/\&amp\;lt\;/\&lt\;/g;
250
        $xmlrecord =~ s/\&amp\;lt\;/\&lt\;/g;
Lines 342-347 sub buildKohaItemsNamespace { Link Here
342
    return $xml;
343
    return $xml;
343
}
344
}
344
345
346
sub buildKohaHoldingsNamespace {
347
    my ($biblionumber) = @_;
348
349
    my $holdings = C4::Holdings::GetHoldingsByBiblionumber( $biblionumber );
350
351
    my $shelflocations =
352
      { map { $_->{authorised_value} => $_->{opac_description} } Koha::AuthorisedValues->get_descriptions_by_koha_field( { frameworkcode => 'HLD', kohafield => 'holdings.location' } ) };
353
354
    my %branches = map { $_->branchcode => $_->branchname } Koha::Libraries->search({}, { order_by => 'branchname' });
355
356
    my $location = "";
357
    my $ccode = "";
358
    my $xml = '';
359
    for my $holding ( @{$holdings} ) {
360
        my $holdingbranch = $holding->{holdingbranch} ? xml_escape($branches{$holding->{holdingbranch}}) : '';
361
        my $location = $holding->{location} ? xml_escape($shelflocations->{$holding->{location}} || $holding->{location}) : '';
362
        my $callnumber = xml_escape($holding->{callnumber});
363
        my $suppress = $holding->{suppress} || '0';
364
        $xml .=
365
            "<holding>"
366
          . "<holdingbranch>$holdingbranch</holdingbranch>"
367
          . "<location>$location</location>"
368
          . "<callnumber>$callnumber</callnumber>"
369
          . "<suppress>$suppress</suppress>"
370
          . "</holding>";
371
    }
372
    $xml = "<holdings xmlns=\"http://www.koha-community.org/holdings\">$xml</holdings>";
373
    return $xml;
374
}
375
345
=head2 engine
376
=head2 engine
346
377
347
Returns reference to XSLT handler object.
378
Returns reference to XSLT handler object.
(-)a/Koha/Holding.pm (+72 lines)
Line 0 Link Here
1
package Koha::Holding;
2
3
# Copyright ByWater Solutions 2014
4
# Copyright 2017-2018 University of Helsinki (The National Library Of Finland)
5
#
6
# This file is part of Koha.
7
#
8
# Koha is free software; you can redistribute it and/or modify it under the
9
# terms of the GNU General Public License as published by the Free Software
10
# Foundation; either version 3 of the License, or (at your option) any later
11
# version.
12
#
13
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
14
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
15
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
16
#
17
# You should have received a copy of the GNU General Public License along
18
# with Koha; if not, write to the Free Software Foundation, Inc.,
19
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20
21
use Modern::Perl;
22
23
use Carp;
24
25
use Koha::Database;
26
27
use base qw(Koha::Object);
28
29
=head1 NAME
30
31
Koha::Holding - Koha Holding Object class
32
33
=head1 API
34
35
=head2 Class Methods
36
37
=cut
38
39
=head3 items
40
41
my @items = $holding->items();
42
my $items = $holding->items();
43
44
Returns the related Koha::Items object for this holding in scalar context,
45
or list of Koha::Item objects in list context.
46
47
=cut
48
49
sub items {
50
    my ($self) = @_;
51
52
    $self->{_items} ||= Koha::Items->search( { holding_id => $self->holding_id() } );
53
54
    return wantarray ? $self->{_items}->as_list : $self->{_items};
55
}
56
57
=head3 type
58
59
=cut
60
61
sub _type {
62
    return 'Holding';
63
}
64
65
=head1 AUTHOR
66
67
Kyle M Hall <kyle@bywatersolutions.com>
68
Ere Maijala <ere.maijala@helsinki.fi>
69
70
=cut
71
72
1;
(-)a/Koha/Holdings.pm (+64 lines)
Line 0 Link Here
1
package Koha::Holdings;
2
3
# Copyright ByWater Solutions 2015
4
# Copyright 2017-2018 University of Helsinki (The National Library Of Finland)
5
#
6
# This file is part of Koha.
7
#
8
# Koha is free software; you can redistribute it and/or modify it under the
9
# terms of the GNU General Public License as published by the Free Software
10
# Foundation; either version 3 of the License, or (at your option) any later
11
# version.
12
#
13
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
14
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
15
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
16
#
17
# You should have received a copy of the GNU General Public License along
18
# with Koha; if not, write to the Free Software Foundation, Inc.,
19
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20
21
use Modern::Perl;
22
23
use Carp;
24
25
use Koha::Database;
26
27
use Koha::Holding;
28
29
use base qw(Koha::Objects);
30
31
=head1 NAME
32
33
Koha::Holdings - Koha Holdings object set class
34
35
=head1 API
36
37
=head2 Class Methods
38
39
=cut
40
41
=head3 type
42
43
=cut
44
45
sub _type {
46
    return 'Holding';
47
}
48
49
=head3 object_class
50
51
=cut
52
53
sub object_class {
54
    return 'Koha::Holding';
55
}
56
57
=head1 AUTHOR
58
59
Kyle M Hall <kyle@bywatersolutions.com>
60
Ere Maijala <ere.maijala@helsinki.fi>
61
62
=cut
63
64
1;
(-)a/Koha/Holdings/Metadata.pm (+44 lines)
Line 0 Link Here
1
package Koha::Holdings::Metadata;
2
3
# This file is part of Koha.
4
#
5
# Koha is free software; you can redistribute it and/or modify it under the
6
# terms of the GNU General Public License as published by the Free Software
7
# Foundation; either version 3 of the License, or (at your option) any later
8
# version.
9
#
10
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
11
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
12
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
13
#
14
# You should have received a copy of the GNU General Public License along
15
# with Koha; if not, write to the Free Software Foundation, Inc.,
16
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17
18
use Modern::Perl;
19
20
use Carp;
21
22
use Koha::Database;
23
24
use base qw(Koha::Object);
25
26
=head1 NAME
27
28
Koha::Metadata - Koha Metadata Object class
29
30
=head1 API
31
32
=head2 Class Methods
33
34
=cut
35
36
=head3 type
37
38
=cut
39
40
sub _type {
41
    return 'HoldingsMetadata';
42
}
43
44
1;
(-)a/Koha/Holdings/Metadatas.pm (+50 lines)
Line 0 Link Here
1
package Koha::Holdings::Metadatas;
2
3
# This file is part of Koha.
4
#
5
# Koha is free software; you can redistribute it and/or modify it under the
6
# terms of the GNU General Public License as published by the Free Software
7
# Foundation; either version 3 of the License, or (at your option) any later
8
# version.
9
#
10
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
11
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
12
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
13
#
14
# You should have received a copy of the GNU General Public License along
15
# with Koha; if not, write to the Free Software Foundation, Inc.,
16
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17
18
use Modern::Perl;
19
20
use Carp;
21
22
use Koha::Database;
23
24
use Koha::Biblio::Metadata;
25
26
use base qw(Koha::Objects);
27
28
=head1 NAME
29
30
Koha::Biblio::Metadatas - Koha Metadata Object set class
31
32
=head1 API
33
34
=head2 Class Methods
35
36
=cut
37
38
=head3 type
39
40
=cut
41
42
sub _type {
43
    return 'HoldingsMetadata';
44
}
45
46
sub object_class {
47
    return 'Koha::Holdings::Metadata';
48
}
49
50
1;
(-)a/Koha/Template/Plugin/Holdings.pm (+91 lines)
Line 0 Link Here
1
package Koha::Template::Plugin::Holdings;
2
3
# Copyright ByWater Solutions 2012
4
# Copyright BibLibre 2014
5
# Copyright 2017-2018 University of Helsinki (The National Library Of Finland)
6
7
# This file is part of Koha.
8
#
9
# Koha is free software; you can redistribute it and/or modify it
10
# under the terms of the GNU General Public License as published by
11
# the Free Software Foundation; either version 3 of the License, or
12
# (at your option) any later version.
13
#
14
# Koha is distributed in the hope that it will be useful, but
15
# WITHOUT ANY WARRANTY; without even the implied warranty of
16
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
# GNU General Public License for more details.
18
#
19
# You should have received a copy of the GNU General Public License
20
# along with Koha; if not, see <http://www.gnu.org/licenses>.
21
22
use Modern::Perl;
23
24
use Template::Plugin;
25
use base qw( Template::Plugin );
26
27
use C4::Context;
28
use C4::Holdings;
29
30
use Koha::Holdings;
31
32
sub GetLocation {
33
    my ( $self, $holding ) = @_;
34
    my $opac = shift || 0;
35
36
    if ( !$holding ) {
37
        return '';
38
    }
39
40
    if ( ref($holding) ne 'HASH' ) {
41
        $holding = Koha::Holdings->find( $holding )->unblessed;
42
        if ( !$holding ) {
43
            return '';
44
        }
45
    }
46
47
    my @parts;
48
49
    if ( $opac ) {
50
        if ( $holding->{'holdingbranch'}) {
51
            my $query = "SELECT branchname FROM branches WHERE branchcode = ?";
52
            my $sth   = C4::Context->dbh->prepare( $query );
53
            $sth->execute( $holding->{'holdingbranch'} );
54
            my $b = $sth->fetchrow_hashref();
55
            push @parts, $b->{'branchname'} if $b;
56
            $sth->finish();
57
        }
58
        if ( $holding->{'location'} ) {
59
            my $av = Koha::AuthorisedValues->search({ category => 'LOC', authorised_value => $holding->{'location'} });
60
            push @parts, $av->next->opac_description if $av->count;
61
        }
62
        push @parts, $holding->{'callnumber'} if $holding->{'callnumber'};
63
        return join(' - ', @parts);
64
    }
65
66
    push @parts, $holding->{'holding_id'};
67
    push @parts, $holding->{'holdingbranch'} if $holding->{'holdingbranch'};
68
    push @parts, $holding->{'location'} if $holding->{'location'};
69
    push @parts, $holding->{'ccode'} if $holding->{'ccode'};
70
    push @parts, $holding->{'callnumber'} if $holding->{'callnumber'};
71
    return join(' ', @parts);
72
}
73
74
sub GetDetails {
75
    my ( $self, $holding ) = @_;
76
    my $opac = shift || 0;
77
78
    if ( !$holding ) {
79
        return '';
80
    }
81
82
    if ( ref($holding) eq 'HASH' ) {
83
        $holding = $holding->{'holding_id'};
84
    }
85
86
    my $marcHolding = C4::Holdings::GetMarcHolding( $holding, $opac );
87
88
    return C4::Holdings::TransformMarcHoldingToKoha( $marcHolding );
89
}
90
91
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 (-1 / +9 lines)
Lines 25-30 use C4::Koha; Link Here
25
use C4::Serials;    #uses getsubscriptionfrom biblionumber
25
use C4::Serials;    #uses getsubscriptionfrom biblionumber
26
use C4::Output;
26
use C4::Output;
27
use C4::Biblio;
27
use C4::Biblio;
28
use C4::Holdings;
28
use C4::Items;
29
use C4::Items;
29
use C4::Circulation;
30
use C4::Circulation;
30
use C4::Reserves;
31
use C4::Reserves;
Lines 176-181 foreach my $subscription (@subscriptions) { Link Here
176
    push @subs, \%cell;
177
    push @subs, \%cell;
177
}
178
}
178
179
180
# Summary holdings
181
my $summary_holdings;
182
if (C4::Context->preference('SummaryHoldings')) {
183
    $summary_holdings = C4::Holdings::GetHoldingsByBiblionumber($biblionumber);
184
}
179
185
180
# Get acquisition details
186
# Get acquisition details
181
if ( C4::Context->preference('AcquisitionDetails') ) {
187
if ( C4::Context->preference('AcquisitionDetails') ) {
Lines 375-381 $template->param( Link Here
375
        hostrecords         => $hostrecords,
381
        hostrecords         => $hostrecords,
376
	analytics_flag	=> $analytics_flag,
382
	analytics_flag	=> $analytics_flag,
377
	C4::Search::enabled_staff_search_views,
383
	C4::Search::enabled_staff_search_views,
378
        materials       => $materials_flag,
384
    materials       => $materials_flag,
385
    show_summary_holdings => C4::Context->preference('SummaryHoldings') ? 1 : 0,
386
    summary_holdings => $summary_holdings,
379
);
387
);
380
388
381
if (C4::Context->preference("AlternateHoldingsField") && scalar @items == 0) {
389
if (C4::Context->preference("AlternateHoldingsField") && scalar @items == 0) {
(-)a/cataloguing/addholding.pl (+736 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
225
    # it's an authorised field
226
    if ( $tagslib->{$tag}->{$subfield}->{authorised_value} ) {
227
        $subfield_data{marc_value} =
228
          build_authorized_values_list( $tag, $subfield, $value, $dbh,
229
            $authorised_values_sth,$index_tag,$index_subfield );
230
231
    # it's a subfield $9 linking to an authority record - see bug 2206
232
    }
233
    elsif ($subfield eq "9" and
234
           exists($tagslib->{$tag}->{'a'}->{authtypecode}) and
235
           defined($tagslib->{$tag}->{'a'}->{authtypecode}) and
236
           $tagslib->{$tag}->{'a'}->{authtypecode} ne '') {
237
238
        $subfield_data{marc_value} = {
239
            type      => 'text',
240
            id        => $subfield_data{id},
241
            name      => $subfield_data{id},
242
            value     => $value,
243
            size      => 5,
244
            maxlength => $subfield_data{maxlength},
245
            readonly  => 1,
246
        };
247
248
    # it's a thesaurus / authority field
249
    }
250
    elsif ( $tagslib->{$tag}->{$subfield}->{authtypecode} ) {
251
        # when authorities auto-creation is allowed, do not set readonly
252
        my $is_readonly = !C4::Context->preference("BiblioAddsAuthorities");
253
254
        $subfield_data{marc_value} = {
255
            type      => 'text',
256
            id        => $subfield_data{id},
257
            name      => $subfield_data{id},
258
            value     => $value,
259
            size      => 67,
260
            maxlength => $subfield_data{maxlength},
261
            readonly  => ($is_readonly) ? 1 : 0,
262
            authtype  => $tagslib->{$tag}->{$subfield}->{authtypecode},
263
        };
264
265
    # it's a plugin field
266
    } elsif ( $tagslib->{$tag}->{$subfield}->{'value_builder'} ) {
267
        require Koha::FrameworkPlugin;
268
        my $plugin = Koha::FrameworkPlugin->new( {
269
            name => $tagslib->{$tag}->{$subfield}->{'value_builder'},
270
        });
271
        my $pars= { dbh => $dbh, record => $rec, tagslib => $tagslib,
272
            id => $subfield_data{id}, tabloop => $tabloop };
273
        $plugin->build( $pars );
274
        if( !$plugin->errstr ) {
275
            $subfield_data{marc_value} = {
276
                type           => 'text_complex',
277
                id             => $subfield_data{id},
278
                name           => $subfield_data{id},
279
                value          => $value,
280
                size           => 67,
281
                maxlength      => $subfield_data{maxlength},
282
                javascript     => $plugin->javascript,
283
                noclick        => $plugin->noclick,
284
            };
285
        } else {
286
            warn $plugin->errstr;
287
            # supply default input form
288
            $subfield_data{marc_value} = {
289
                type      => 'text',
290
                id        => $subfield_data{id},
291
                name      => $subfield_data{id},
292
                value     => $value,
293
                size      => 67,
294
                maxlength => $subfield_data{maxlength},
295
                readonly  => 0,
296
            };
297
        }
298
299
    # it's an hidden field
300
    } elsif ( $tag eq '' ) {
301
        $subfield_data{marc_value} = {
302
            type      => 'hidden',
303
            id        => $subfield_data{id},
304
            name      => $subfield_data{id},
305
            value     => $value,
306
            size      => 67,
307
            maxlength => $subfield_data{maxlength},
308
        };
309
310
    }
311
    else {
312
        # it's a standard field
313
        if (
314
            length($value) > 100
315
            or
316
            ( C4::Context->preference("marcflavour") eq "UNIMARC" && $tag >= 300
317
                and $tag < 400 && $subfield eq 'a' )
318
            or (    $tag >= 500
319
                and $tag < 600
320
                && C4::Context->preference("marcflavour") eq "MARC21" )
321
          )
322
        {
323
            $subfield_data{marc_value} = {
324
                type      => 'textarea',
325
                id        => $subfield_data{id},
326
                name      => $subfield_data{id},
327
                value     => $value,
328
            };
329
330
        }
331
        else {
332
            $subfield_data{marc_value} = {
333
                type      => 'text',
334
                id        => $subfield_data{id},
335
                name      => $subfield_data{id},
336
                value     => $value,
337
                size      => 67,
338
                maxlength => $subfield_data{maxlength},
339
                readonly  => 0,
340
            };
341
342
        }
343
    }
344
    $subfield_data{'index_subfield'} = $index_subfield;
345
    return \%subfield_data;
346
}
347
348
349
=head2 format_indicator
350
351
Translate indicator value for output form - specifically, map
352
indicator = ' ' to ''.  This is for the convenience of a cataloger
353
using a mouse to select an indicator input.
354
355
=cut
356
357
sub format_indicator {
358
    my $ind_value = shift;
359
    return '' if not defined $ind_value;
360
    return '' if $ind_value eq ' ';
361
    return $ind_value;
362
}
363
364
sub build_tabs {
365
    my ( $template, $record, $dbh, $encoding,$input ) = @_;
366
367
    # fill arrays
368
    my @loop_data = ();
369
    my $tag;
370
371
    my $branch_limit = C4::Context->userenv ? C4::Context->userenv->{"branch"} : "";
372
    my $query = "SELECT authorised_value, lib
373
                FROM authorised_values";
374
    $query .= qq{ LEFT JOIN authorised_values_branches ON ( id = av_id )} if $branch_limit;
375
    $query .= " WHERE category = ?";
376
    $query .= " AND ( branchcode = ? OR branchcode IS NULL )" if $branch_limit;
377
    $query .= " GROUP BY lib ORDER BY lib, lib_opac";
378
    my $authorised_values_sth = $dbh->prepare( $query );
379
380
    # in this array, we will push all the 10 tabs
381
    # to avoid having 10 tabs in the template : they will all be in the same BIG_LOOP
382
    my @BIG_LOOP;
383
    my %seen;
384
    my @tab_data; # all tags to display
385
386
    foreach my $used ( @$usedTagsLib ){
387
        push @tab_data,$used->{tagfield} if not $seen{$used->{tagfield}};
388
        $seen{$used->{tagfield}}++;
389
    }
390
391
    my $max_num_tab=-1;
392
    foreach(@$usedTagsLib){
393
        if($_->{tab} > -1 && $_->{tab} >= $max_num_tab && $_->{tagfield} != '995'){ # FIXME : MARC21 ?
394
            $max_num_tab = $_->{tab};
395
        }
396
    }
397
    if($max_num_tab >= 9){
398
        $max_num_tab = 9;
399
    }
400
    # loop through each tab 0 through 9
401
    for ( my $tabloop = 0 ; $tabloop <= $max_num_tab ; $tabloop++ ) {
402
        my @loop_data = (); #innerloop in the template.
403
        my $i = 0;
404
        foreach my $tag (@tab_data) {
405
            $i++;
406
            next if ! $tag;
407
            my ($indicator1, $indicator2);
408
            my $index_tag = CreateKey;
409
410
            # if MARC::Record is not empty =>use it as master loop, then add missing subfields that should be in the tab.
411
            # if MARC::Record is empty => use tab as master loop.
412
            if ( $record ne -1 && ( $record->field($tag) || $tag eq '000' ) ) {
413
                my @fields;
414
		if ( $tag ne '000' ) {
415
                    @fields = $record->field($tag);
416
		}
417
		else {
418
		   push @fields, $record->leader(); # if tag == 000
419
		}
420
		# loop through each field
421
                foreach my $field (@fields) {
422
423
                    my @subfields_data;
424
                    if ( $tag < 10 ) {
425
                        my ( $value, $subfield );
426
                        if ( $tag ne '000' ) {
427
                            $value    = $field->data();
428
                            $subfield = "@";
429
                        }
430
                        else {
431
                            $value    = $field;
432
                            $subfield = '@';
433
                        }
434
                        next if ( $tagslib->{$tag}->{$subfield}->{tab} ne $tabloop );
435
                        next
436
                          if ( $tagslib->{$tag}->{$subfield}->{kohafield} eq
437
                            'biblio.biblionumber' );
438
                        push(
439
                            @subfields_data,
440
                            &create_input(
441
                                $tag, $subfield, $value, $index_tag, $tabloop, $record,
442
                                $authorised_values_sth,$input
443
                            )
444
                        );
445
                    }
446
                    else {
447
                        my @subfields = $field->subfields();
448
                        foreach my $subfieldcount ( 0 .. $#subfields ) {
449
                            my $subfield = $subfields[$subfieldcount][0];
450
                            my $value    = $subfields[$subfieldcount][1];
451
                            next if ( length $subfield != 1 );
452
                            next if ( $tagslib->{$tag}->{$subfield}->{tab} ne $tabloop );
453
                            push(
454
                                @subfields_data,
455
                                &create_input(
456
                                    $tag, $subfield, $value, $index_tag, $tabloop,
457
                                    $record, $authorised_values_sth,$input
458
                                )
459
                            );
460
                        }
461
                    }
462
463
                    # now, loop again to add parameter subfield that are not in the MARC::Record
464
                    foreach my $subfield ( sort( keys %{ $tagslib->{$tag} } ) )
465
                    {
466
                        next if ( length $subfield != 1 );
467
                        next if ( $tagslib->{$tag}->{$subfield}->{tab} ne $tabloop );
468
                        next if ( $tag < 10 );
469
                        next
470
                          if ( ( $tagslib->{$tag}->{$subfield}->{hidden} <= -4 )
471
                            or ( $tagslib->{$tag}->{$subfield}->{hidden} >= 5 ) )
472
                            and not ( $subfield eq "9" and
473
                                      exists($tagslib->{$tag}->{'a'}->{authtypecode}) and
474
                                      defined($tagslib->{$tag}->{'a'}->{authtypecode}) and
475
                                      $tagslib->{$tag}->{'a'}->{authtypecode} ne ""
476
                                    )
477
                          ;    #check for visibility flag
478
                               # if subfield is $9 in a field whose $a is authority-controlled,
479
                               # always include in the form regardless of the hidden setting - bug 2206
480
                        next if ( defined( $field->subfield($subfield) ) );
481
                        push(
482
                            @subfields_data,
483
                            &create_input(
484
                                $tag, $subfield, '', $index_tag, $tabloop, $record,
485
                                $authorised_values_sth,$input
486
                            )
487
                        );
488
                    }
489
                    if ( $#subfields_data >= 0 ) {
490
                        # build the tag entry.
491
                        # note that the random() field is mandatory. Otherwise, on repeated fields, you'll
492
                        # have twice the same "name" value, and cgi->param() will return only one, making
493
                        # all subfields to be merged in a single field.
494
                        my %tag_data = (
495
                            tag           => $tag,
496
                            index         => $index_tag,
497
                            tag_lib       => $tagslib->{$tag}->{lib},
498
                            repeatable       => $tagslib->{$tag}->{repeatable},
499
                            mandatory       => $tagslib->{$tag}->{mandatory},
500
                            subfield_loop => \@subfields_data,
501
                            fixedfield    => $tag < 10?1:0,
502
                            random        => CreateKey,
503
                        );
504
                        if ($tag >= 10){ # no indicator for 00x tags
505
                           $tag_data{indicator1} = format_indicator($field->indicator(1)),
506
                           $tag_data{indicator2} = format_indicator($field->indicator(2)),
507
                        }
508
                        push( @loop_data, \%tag_data );
509
                    }
510
                 } # foreach $field end
511
512
            # if breeding is empty
513
            }
514
            else {
515
                my @subfields_data;
516
                foreach my $subfield ( sort( keys %{ $tagslib->{$tag} } ) ) {
517
                    next if ( length $subfield != 1 );
518
                    next
519
                      if ( ( $tagslib->{$tag}->{$subfield}->{hidden} <= -4 )
520
                        or ( $tagslib->{$tag}->{$subfield}->{hidden} >= 5 ) )
521
                      and not ( $subfield eq "9" and
522
                                exists($tagslib->{$tag}->{'a'}->{authtypecode}) and
523
                                defined($tagslib->{$tag}->{'a'}->{authtypecode}) and
524
                                $tagslib->{$tag}->{'a'}->{authtypecode} ne ""
525
                              )
526
                      ;    #check for visibility flag
527
                           # if subfield is $9 in a field whose $a is authority-controlled,
528
                           # always include in the form regardless of the hidden setting - bug 2206
529
                    next
530
                      if ( $tagslib->{$tag}->{$subfield}->{tab} ne $tabloop );
531
			push(
532
                        @subfields_data,
533
                        &create_input(
534
                            $tag, $subfield, '', $index_tag, $tabloop, $record,
535
                            $authorised_values_sth,$input
536
                        )
537
                    );
538
                }
539
                if ( $#subfields_data >= 0 ) {
540
                    my %tag_data = (
541
                        tag              => $tag,
542
                        index            => $index_tag,
543
                        tag_lib          => $tagslib->{$tag}->{lib},
544
                        repeatable       => $tagslib->{$tag}->{repeatable},
545
                        mandatory       => $tagslib->{$tag}->{mandatory},
546
                        indicator1       => $indicator1,
547
                        indicator2       => $indicator2,
548
                        subfield_loop    => \@subfields_data,
549
                        tagfirstsubfield => $subfields_data[0],
550
                        fixedfield       => $tag < 10?1:0,
551
                    );
552
553
                    push @loop_data, \%tag_data ;
554
                }
555
            }
556
        }
557
        if ( $#loop_data >= 0 ) {
558
            push @BIG_LOOP, {
559
                number    => $tabloop,
560
                innerloop => \@loop_data,
561
            };
562
        }
563
    }
564
    $authorised_values_sth->finish;
565
    $template->param( BIG_LOOP => \@BIG_LOOP );
566
}
567
568
# ========================
569
#          MAIN
570
#=========================
571
my $input = new CGI;
572
my $error = $input->param('error');
573
my $biblionumber  = $input->param('biblionumber');
574
my $holding_id = $input->param('holding_id'); # if holding_id exists, it's a modif, not a new holding.
575
my $op            = $input->param('op');
576
my $mode          = $input->param('mode');
577
my $frameworkcode = $input->param('frameworkcode');
578
my $redirect      = $input->param('redirect');
579
my $searchid      = $input->param('searchid');
580
my $dbh           = C4::Context->dbh;
581
582
my $userflags = 'edit_items';
583
584
my $changed_framework = $input->param('changed_framework');
585
$frameworkcode = &C4::Holdings::GetHoldingFrameworkCode($holding_id)
586
  if ( $holding_id and not( defined $frameworkcode) and $op ne 'add' );
587
588
$frameworkcode = 'HLD' if ( !$frameworkcode || $frameworkcode eq 'Default' );
589
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
590
    {
591
        template_name   => "cataloguing/addholding.tt",
592
        query           => $input,
593
        type            => "intranet",
594
        authnotrequired => 0,
595
        flagsrequired   => { editcatalogue => $userflags },
596
    }
597
);
598
599
# TODO: support in advanced editor?
600
#if ( $op ne "delete" && C4::Context->preference('EnableAdvancedCatalogingEditor') && $input->cookie( 'catalogue_editor_' . $loggedinuser ) eq 'advanced' ) {
601
#    print $input->redirect( '/cgi-bin/koha/cataloguing/editor.pl#catalog/' . $biblionumber . '/holdings/' . ( $holding_id ? $holding_id : '' ) );
602
#    exit;
603
#}
604
605
my $frameworks = Koha::BiblioFrameworks->search({}, { order_by => ['frameworktext'] });
606
$template->param(
607
    frameworks => $frameworks
608
);
609
610
# ++ Global
611
$tagslib         = &GetMarcStructure( 1, $frameworkcode );
612
$usedTagsLib     = &GetUsedMarcStructure( $frameworkcode );
613
# -- Global
614
615
my $record   = -1;
616
my $encoding = "";
617
618
if ($holding_id) {
619
    $record = C4::Holdings::GetMarcHolding($holding_id);
620
}
621
622
$is_a_modif = 0;
623
624
if ($holding_id) {
625
    $is_a_modif = 1;
626
627
}
628
my ( $biblionumbertagfield, $biblionumbertagsubfield ) =
629
    &GetMarcFromKohaField( "biblio.biblionumber", $frameworkcode );
630
631
#-------------------------------------------------------------------------------------
632
if ( $op eq "add" ) {
633
#-------------------------------------------------------------------------------------
634
    $template->param(
635
        biblionumberdata => $biblionumber,
636
    );
637
    # getting html input
638
    my @params = $input->multi_param();
639
    $record = TransformHtmlToMarc( $input, 1 );
640
    if ( $is_a_modif ) {
641
        ModHolding( $record, $holding_id, $frameworkcode );
642
    }
643
    else {
644
        $holding_id = AddHolding( $record, $frameworkcode, $biblionumber );
645
    }
646
    if ($redirect eq "items" || ($mode ne "popup" && !$is_a_modif && $redirect ne "view" && $redirect ne "just_save")){
647
        print $input->redirect("/cgi-bin/koha/catalogue/detail.pl?biblionumber=$biblionumber&searchid=$searchid");
648
        exit;
649
    }
650
    elsif(($is_a_modif || $redirect eq "view") && $redirect ne "just_save"){
651
        print $input->redirect("/cgi-bin/koha/catalogue/detail.pl?biblionumber=$biblionumber&searchid=$searchid");
652
        exit;
653
    }
654
    elsif ($redirect eq "just_save"){
655
        my $tab = $input->param('current_tab');
656
        print $input->redirect("/cgi-bin/koha/cataloguing/addholding.pl?biblionumber=$biblionumber&holding_id=$holding_id&framework=$frameworkcode&tab=$tab&searchid=$searchid");
657
    }
658
    else {
659
          $template->param(
660
            biblionumber => $biblionumber,
661
            holding_id => $holding_id,
662
            done         =>1,
663
            popup        =>1
664
          );
665
          $template->param(
666
            popup => $mode,
667
            itemtype => $frameworkcode,
668
          );
669
          output_html_with_http_headers $input, $cookie, $template->output;
670
          exit;
671
    }
672
}
673
elsif ( $op eq "delete" ) {
674
675
    my $error = &DelHolding($holding_id);
676
    if ($error) {
677
        warn "ERROR when DELETING HOLDING $holding_id : $error";
678
        print "Content-Type: text/html\n\n<html><body><h1>ERROR when DELETING HOLDING $holding_id : $error</h1></body></html>";
679
        exit;
680
    }
681
682
    print $input->redirect("/cgi-bin/koha/catalogue/detail.pl?biblionumber=$biblionumber&searchid=$searchid");
683
    exit;
684
685
} else {
686
   #----------------------------------------------------------------------------
687
   # If we're in a duplication case, we have to set to "" the holding_id
688
   # as we'll save the holding as a new one.
689
    $template->param(
690
        holding_iddata => $holding_id,
691
        op                => $op,
692
    );
693
    if ( $op eq "duplicate" ) {
694
        $holding_id = "";
695
    }
696
697
    if($changed_framework eq "changed") {
698
        $record = TransformHtmlToMarc( $input, 1 );
699
    }
700
    elsif( $record ne -1 ) {
701
#FIXME: it's kind of silly to go from MARC::Record to MARC::File::XML and then back again just to fix the encoding
702
        eval {
703
            my $uxml = $record->as_xml;
704
            MARC::Record::default_record_format("UNIMARC")
705
            if ( C4::Context->preference("marcflavour") eq "UNIMARC" );
706
            my $urecord = MARC::Record::new_from_xml( $uxml, 'UTF-8' );
707
            $record = $urecord;
708
        };
709
    }
710
    if ( !$biblionumber ) {
711
        # we must have a holding_id if we don't have a biblionumber
712
        my $holdingRecord = Koha::Holdings->find( $holding_id );
713
        $biblionumber = $holdingRecord->biblionumber;
714
    }
715
    my $biblio = Koha::Biblios->find( $biblionumber );
716
    build_tabs( $template, $record, $dbh, $encoding,$input );
717
    $template->param(
718
        holding_id               => $holding_id,
719
        biblionumber             => $biblionumber,
720
        biblionumbertagfield     => $biblionumbertagfield,
721
        biblionumbertagsubfield  => $biblionumbertagsubfield,
722
        title                    => $biblio->title,
723
        author                   => $biblio->author
724
    );
725
}
726
727
$template->param(
728
    popup => $mode,
729
    frameworkcode => $frameworkcode,
730
    itemtype => $frameworkcode,
731
    borrowernumber => $loggedinuser,
732
    tab => scalar $input->param('tab')
733
);
734
$template->{'VARS'}->{'searchid'} = $searchid;
735
736
output_html_with_http_headers $input, $cookie, $template->output;
(-)a/cataloguing/additem.pl (+11 lines)
Lines 31-36 use C4::Circulation; Link Here
31
use C4::Koha;
31
use C4::Koha;
32
use C4::ClassSource;
32
use C4::ClassSource;
33
use Koha::DateUtils;
33
use Koha::DateUtils;
34
use Koha::Holdings;
34
use Koha::Items;
35
use Koha::Items;
35
use Koha::ItemTypes;
36
use Koha::ItemTypes;
36
use Koha::Libraries;
37
use Koha::Libraries;
Lines 211-216 sub generate_subfield_form { Link Here
211
        
212
        
212
                  #---- "true" authorised value
213
                  #---- "true" authorised value
213
            }
214
            }
215
            elsif ( $subfieldlib->{authorised_value} eq "holdings" ) {
216
                push @authorised_values, "" unless ( $subfieldlib->{mandatory} );
217
                my $holdings = Koha::Holdings->search({biblionumber => $biblionumber}, { order_by => ['holdingbranch'] })->unblessed;
218
                for my $holding ( @$holdings ) {
219
                    push @authorised_values, $holding->{holding_id};
220
                    $authorised_lib{$holding->{holding_id}} = $holding->{holding_id} . ' ' . $holding->{holdingbranch} . ' ' . $holding->{location} . ' ' . $holding->{ccode} . ' ' . $holding->{callnumber};
221
                }
222
		    my $input = new CGI;
223
                $value = $input->param('holding_id') unless ($value);
224
            }
214
            else {
225
            else {
215
                  push @authorised_values, qq{};
226
                  push @authorised_values, qq{};
216
                  my $av = GetAuthorisedValues( $subfieldlib->{authorised_value} );
227
                  my $av = GetAuthorisedValues( $subfieldlib->{authorised_value} );
(-)a/cataloguing/value_builder/marc21_field_008_holdings.pl (+120 lines)
Line 0 Link Here
1
#!/usr/bin/perl
2
3
# Copyright 2000-2002 Katipo Communications
4
# Copyright 2017-2018 University of Helsinki (The National Library Of Finland)
5
#
6
# This file is part of Koha.
7
#
8
# Koha is free software; you can redistribute it and/or modify it
9
# under the terms of the GNU General Public License as published by
10
# the Free Software Foundation; either version 3 of the License, or
11
# (at your option) any later version.
12
#
13
# Koha is distributed in the hope that it will be useful, but
14
# WITHOUT ANY WARRANTY; without even the implied warranty of
15
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
# GNU General Public License for more details.
17
#
18
# You should have received a copy of the GNU General Public License
19
# along with Koha; if not, see <http://www.gnu.org/licenses>.
20
21
use Modern::Perl;
22
use C4::Auth;
23
use CGI qw ( -utf8 );
24
use C4::Context;
25
26
use C4::Search;
27
use C4::Output;
28
29
use XML::LibXML;
30
use Koha::Util::FrameworkPlugin qw|date_entered|;
31
32
my $builder = sub {
33
    my ( $params ) = @_;
34
35
    my $lang = C4::Context->preference('DefaultLanguageField008' );
36
    $lang = "eng" unless $lang;
37
    $lang = pack("A3", $lang);
38
39
    my $function_name = $params->{id};
40
    my $dateentered = date_entered();
41
    my $res           = "
42
<script type=\"text/javascript\">
43
//<![CDATA[
44
45
function Focus$function_name(event) {
46
    if ( document.getElementById(event.data.id).value ) {
47
	}
48
	else {
49
        document.getElementById(event.data.id).value='$dateentered' + '0u    0   4   uu${lang}0$dateentered';
50
	}
51
    return 1;
52
}
53
54
function Click$function_name(event) {
55
    defaultvalue=document.getElementById(event.data.id).value;
56
    //Retrieve full leader string and pass it to the 008 tag editor
57
    var leader_value = \$(\"input[id^='tag_000']\").val();
58
    var leader_parameter = \"\";
59
    if (leader_value){
60
        //Only add the parameter to the URL if there is a value to add
61
        leader_parameter = \"&leader=\"+leader_value;
62
    }
63
    newin=window.open(\"../cataloguing/plugin_launcher.pl?plugin_name=marc21_field_008_holdings.pl&index=\"+ event.data.id +\"&result=\"+defaultvalue+leader_parameter,\"tag_editor\",'width=1000,height=600,toolbar=false,scrollbars=yes');
64
65
}
66
//]]>
67
</script>
68
";
69
70
    return $res;
71
};
72
73
my $launcher = sub {
74
    my ( $params ) = @_;
75
    my $input = $params->{cgi};
76
    my $index= $input->param('index');
77
    my $result= $input->param('result');
78
79
    my $lang = C4::Context->preference('DefaultLanguageField008' );
80
    $lang = "eng" unless $lang;
81
    $lang = pack("A3", $lang);
82
83
    my ($template, $loggedinuser, $cookie)
84
    = get_template_and_user({template_name => "cataloguing/value_builder/marc21_field_008_holdings.tt",
85
                 query => $input,
86
                 type => "intranet",
87
                 authnotrequired => 0,
88
                 flagsrequired => {editcatalogue => '*'},
89
                 debug => 1,
90
                 });
91
    my $dateentered = date_entered();
92
    $result = $dateentered + '0u    0   0   uu' + $lang + '0' + $dateentered unless $result;
93
    my @f;
94
    for(0,6..8,12..17,20..22,25,26) {
95
        my $len = 1;
96
        if ($_ == 0 || $_ == 26) {
97
            $len = 6;
98
        } elsif ($_ == 8) {
99
            $len = 4;
100
        } elsif ($_ == 17 || $_ == 22) {
101
            $len = 3;
102
        }
103
        warn ($_ . ': ' . $len);
104
        $f[$_]=substr($result,$_,$len);
105
    }
106
    $template->param(index => $index);
107
108
    $f[0]= $dateentered if !$f[0] || $f[0]=~/\s/;
109
    $template->param(f1 => $f[0]);
110
111
    for(6..8,12..17,20..22,25,26) {
112
        $template->param(
113
            "f$_" => $f[$_],
114
            "f$_".($f[$_] eq '|'? 'pipe': $f[$_]) => $f[$_],
115
        );
116
    }
117
    output_html_with_http_headers $input, $cookie, $template->output;
118
};
119
120
return { builder => $builder, launcher => $launcher };
(-)a/cataloguing/value_builder/marc21_leader_holdings.pl (+85 lines)
Line 0 Link Here
1
#!/usr/bin/perl
2
3
# Copyright 2000-2002 Katipo Communications
4
# Copyright 2017-2018 University of Helsinki (The National Library Of Finland)
5
#
6
# This file is part of Koha.
7
#
8
# Koha is free software; you can redistribute it and/or modify it
9
# under the terms of the GNU General Public License as published by
10
# the Free Software Foundation; either version 3 of the License, or
11
# (at your option) any later version.
12
#
13
# Koha is distributed in the hope that it will be useful, but
14
# WITHOUT ANY WARRANTY; without even the implied warranty of
15
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
# GNU General Public License for more details.
17
#
18
# You should have received a copy of the GNU General Public License
19
# along with Koha; if not, see <http://www.gnu.org/licenses>.
20
21
use Modern::Perl;
22
use CGI qw ( -utf8 );
23
24
use C4::Auth;
25
use C4::Context;
26
use C4::Output;
27
28
my $builder = sub {
29
    my ( $params ) = @_;
30
    my $function_name = $params->{id};
31
    my $res           = "
32
<script type=\"text/javascript\">
33
//<![CDATA[
34
35
function Focus$function_name(event) {
36
    if(!document.getElementById(event.data.id).value){
37
        document.getElementById(event.data.id).value = '     nu  a22     ui 4500';
38
    }
39
}
40
41
function Click$function_name(event) {
42
    defaultvalue=document.getElementById(event.data.id).value;
43
    newin=window.open(\"../cataloguing/plugin_launcher.pl?plugin_name=marc21_leader_holdings.pl&index=\"+ event.data.id +\"&result=\"+defaultvalue,\"tag_editor\",'width=1000,height=600,toolbar=false,scrollbars=yes');
44
}
45
46
//]]>
47
</script>
48
";
49
50
    return $res;
51
};
52
53
my $launcher = sub {
54
    my ( $params ) = @_;
55
    my $input = $params->{cgi};
56
    my $index   = $input->param('index');
57
    my $result  = $input->param('result');
58
59
    my $dbh = C4::Context->dbh;
60
61
    my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
62
        {   template_name   => "cataloguing/value_builder/marc21_leader_holdings.tt",
63
            query           => $input,
64
            type            => "intranet",
65
            authnotrequired => 0,
66
            flagsrequired   => { editcatalogue => '*' },
67
            debug           => 1,
68
        }
69
    );
70
    $result = "     nu  a22     ui 4500" unless $result;
71
    my $f5    = substr( $result, 5,  1 );
72
    my $f6    = substr( $result, 6,  1 );
73
    my $f17   = substr( $result, 17, 1 );
74
    my $f18   = substr( $result, 18, 1 );
75
    $template->param(
76
        index     => $index,
77
        "f5$f5"   => 1,
78
        "f6$f6"   => 1,
79
        "f17$f17" => 1,
80
        "f18$f18" => 1,
81
    );
82
    output_html_with_http_headers $input, $cookie, $template->output;
83
};
84
85
return { builder => $builder, launcher => $launcher };
(-)a/installer/data/mysql/atomicupdate/bug_20447-add_holdings_tables.sql (+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 681-686 CREATE TABLE `deleteditems` ( Link Here
681
  `copynumber` varchar(32) default NULL, -- copy number (MARC21 952$t)
681
  `copynumber` varchar(32) default NULL, -- copy number (MARC21 952$t)
682
  `stocknumber` varchar(32) default NULL, -- inventory number (MARC21 952$i)
682
  `stocknumber` varchar(32) default NULL, -- inventory number (MARC21 952$i)
683
  `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.
683
  `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.
684
  `holding_id` int(11) default NULL, -- foreign key from holdings table used to link this item to the right holdings record
684
  PRIMARY KEY  (`itemnumber`),
685
  PRIMARY KEY  (`itemnumber`),
685
  KEY `delitembarcodeidx` (`barcode`),
686
  KEY `delitembarcodeidx` (`barcode`),
686
  KEY `delitemstocknumberidx` (`stocknumber`),
687
  KEY `delitemstocknumberidx` (`stocknumber`),
Lines 893-903 CREATE TABLE `refund_lost_item_fee_rules` ( -- refund lost item fee rules tbale Link Here
893
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
894
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
894
895
895
--
896
--
897
-- Table structure for table `holdings`
898
--
899
900
DROP TABLE IF EXISTS `holdings`;
901
CREATE TABLE `holdings` ( -- table that stores summary holdings information
902
  `holding_id` int(11) NOT NULL auto_increment, -- unique identifier assigned to each holdings record
903
  `biblionumber` int(11) NOT NULL default 0, -- foreign key from biblio table used to link this record to the right bib record
904
  `biblioitemnumber` int(11) NOT NULL default 0, -- foreign key from the biblioitems table to link record to additional information
905
  `frameworkcode` varchar(4) NOT NULL default '', -- foreign key from the biblio_framework table to identify which framework was used in cataloging this record
906
  `holdingbranch` varchar(10) default NULL, -- foreign key from the branches table for the library that owns this record (MARC21 852$a)
907
  `location` varchar(80) default NULL, -- authorized value for the shelving location for this record (MARC21 852$b)
908
  `ccode` varchar(80) default NULL, -- authorized value for the collection code associated with this item (MARC21 852$g)
909
  `callnumber` varchar(255) default NULL, -- call number (852$h+$i in MARC21)
910
  `suppress` tinyint(1) default NULL, -- Boolean indicating whether the record is suppressed in OPAC
911
  `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, -- date and time this record was last touched
912
  `datecreated` DATE NOT NULL, -- the date this record was added to Koha
913
	`deleted_on` DATETIME DEFAULT NULL, -- the date this record was deleted
914
  PRIMARY KEY  (`holding_id`),
915
  KEY `hldnoidx` (`holding_id`),
916
  KEY `hldbinoidx` (`biblioitemnumber`),
917
  KEY `hldbibnoidx` (`biblionumber`),
918
  CONSTRAINT `holdings_ibfk_1` FOREIGN KEY (`biblionumber`) REFERENCES `biblio` (`biblionumber`) ON DELETE CASCADE ON UPDATE CASCADE,
919
  CONSTRAINT `holdings_ibfk_2` FOREIGN KEY (`biblioitemnumber`) REFERENCES `biblioitems` (`biblioitemnumber`) ON DELETE CASCADE ON UPDATE CASCADE,
920
  CONSTRAINT `holdings_ibfk_3` FOREIGN KEY (`holdingbranch`) REFERENCES `branches` (`branchcode`) ON UPDATE CASCADE
921
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
922
923
--
924
-- Table structure for table `holdings_metadata`
925
--
926
927
DROP TABLE IF EXISTS `holdings_metadata`;
928
CREATE TABLE `holdings_metadata` (
929
  `id` INT(11) NOT NULL AUTO_INCREMENT,
930
  `holding_id` INT(11) NOT NULL,
931
  `format` VARCHAR(16) NOT NULL,
932
  `marcflavour` VARCHAR(16) NOT NULL,
933
  `metadata` LONGTEXT NOT NULL,
934
	`deleted_on` DATETIME DEFAULT NULL, -- the date this record was deleted
935
  PRIMARY KEY(id),
936
  UNIQUE KEY `holdings_metadata_uniq_key` (`holding_id`,`format`,`marcflavour`),
937
  KEY `hldnoidx` (`holding_id`),
938
  CONSTRAINT `holdings_metadata_fk_1` FOREIGN KEY (`holding_id`) REFERENCES `holdings` (`holding_id`) ON DELETE CASCADE ON UPDATE CASCADE
939
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
940
941
--
896
-- Table structure for table `items`
942
-- Table structure for table `items`
897
--
943
--
898
944
899
DROP TABLE IF EXISTS `items`;
945
DROP TABLE IF EXISTS `items`;
900
CREATE TABLE `items` ( -- holdings/item information
946
CREATE TABLE `items` ( -- item information
901
  `itemnumber` int(11) NOT NULL auto_increment, -- primary key and unique identifier added by Koha
947
  `itemnumber` int(11) NOT NULL auto_increment, -- primary key and unique identifier added by Koha
902
  `biblionumber` int(11) NOT NULL default 0, -- foreign key from biblio table used to link this item to the right bib record
948
  `biblionumber` int(11) NOT NULL default 0, -- foreign key from biblio table used to link this item to the right bib record
903
  `biblioitemnumber` int(11) NOT NULL default 0, -- foreign key from the biblioitems table to link to item to additional information
949
  `biblioitemnumber` int(11) NOT NULL default 0, -- foreign key from the biblioitems table to link to item to additional information
Lines 943-948 CREATE TABLE `items` ( -- holdings/item information Link Here
943
  `copynumber` varchar(32) default NULL, -- copy number (MARC21 952$t)
989
  `copynumber` varchar(32) default NULL, -- copy number (MARC21 952$t)
944
  `stocknumber` varchar(32) default NULL, -- inventory number (MARC21 952$i)
990
  `stocknumber` varchar(32) default NULL, -- inventory number (MARC21 952$i)
945
  `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.
991
  `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.
992
  `holding_id` int(11) default NULL, -- foreign key from holdings table used to link this item to the right holdings record
946
  PRIMARY KEY  (`itemnumber`),
993
  PRIMARY KEY  (`itemnumber`),
947
  UNIQUE KEY `itembarcodeidx` (`barcode`),
994
  UNIQUE KEY `itembarcodeidx` (`barcode`),
948
  KEY `itemstocknumberidx` (`stocknumber`),
995
  KEY `itemstocknumberidx` (`stocknumber`),
Lines 955-964 CREATE TABLE `items` ( -- holdings/item information Link Here
955
  KEY `items_ccode` (`ccode`),
1002
  KEY `items_ccode` (`ccode`),
956
  KEY `itype_idx` (`itype`),
1003
  KEY `itype_idx` (`itype`),
957
  KEY `timestamp` (`timestamp`),
1004
  KEY `timestamp` (`timestamp`),
1005
  KEY `hldid_idx` (`holding_id`),
958
  CONSTRAINT `items_ibfk_1` FOREIGN KEY (`biblioitemnumber`) REFERENCES `biblioitems` (`biblioitemnumber`) ON DELETE CASCADE ON UPDATE CASCADE,
1006
  CONSTRAINT `items_ibfk_1` FOREIGN KEY (`biblioitemnumber`) REFERENCES `biblioitems` (`biblioitemnumber`) ON DELETE CASCADE ON UPDATE CASCADE,
959
  CONSTRAINT `items_ibfk_2` FOREIGN KEY (`homebranch`) REFERENCES `branches` (`branchcode`) ON UPDATE CASCADE,
1007
  CONSTRAINT `items_ibfk_2` FOREIGN KEY (`homebranch`) REFERENCES `branches` (`branchcode`) ON UPDATE CASCADE,
960
  CONSTRAINT `items_ibfk_3` FOREIGN KEY (`holdingbranch`) REFERENCES `branches` (`branchcode`) ON UPDATE CASCADE,
1008
  CONSTRAINT `items_ibfk_3` FOREIGN KEY (`holdingbranch`) REFERENCES `branches` (`branchcode`) ON UPDATE CASCADE,
961
  CONSTRAINT `items_ibfk_4` FOREIGN KEY (`biblionumber`) REFERENCES `biblio` (`biblionumber`) ON DELETE CASCADE ON UPDATE CASCADE
1009
  CONSTRAINT `items_ibfk_4` FOREIGN KEY (`biblionumber`) REFERENCES `biblio` (`biblionumber`) ON DELETE CASCADE ON UPDATE CASCADE,
1010
  CONSTRAINT `items_ibfk_5` FOREIGN KEY (`holding_id`) REFERENCES `holdings` (`holding_id`) ON DELETE CASCADE ON UPDATE CASCADE
962
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
1011
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
963
1012
964
--
1013
--
(-)a/installer/data/mysql/mandatory/auth_val_cat.sql (+1 lines)
Lines 21-26 INSERT IGNORE INTO authorised_value_categories( category_name ) Link Here
21
INSERT IGNORE INTO authorised_value_categories( category_name )
21
INSERT IGNORE INTO authorised_value_categories( category_name )
22
    VALUES
22
    VALUES
23
    ('branches'),
23
    ('branches'),
24
    ('holdings'),
24
    ('itemtypes'),
25
    ('itemtypes'),
25
    ('cn_source');
26
    ('cn_source');
26
27
(-)a/koha-tmpl/intranet-tmpl/prog/css/addholding.css (+171 lines)
Line 0 Link Here
1
#addholdingtabs {
2
	margin-top : 1em;
3
}
4
5
#addholdingtabs .ui-tabs-panel {
6
	float : left;
7
}
8
9
.buttonPlus {
10
	font-weight : bold;
11
	text-decoration : none;
12
}
13
14
.buttonMinus {
15
	font-weight : bold;
16
	text-decoration : none;
17
}
18
19
a.expandfield {
20
	text-decoration : none;
21
}
22
23
#authoritytabs {
24
	margin-top : 1em;
25
	margin-bottom : 1em;
26
}
27
28
.toptabs .ui-tabs-nav li a {
29
	padding : .2em 1.2em;
30
}
31
32
div.tag {
33
    clear: both;
34
}
35
36
div.subfield_line {
37
    padding-bottom: .3em;
38
    float: left;
39
    clear: left;
40
    width: 100%;
41
}
42
43
div.subfield_line label {
44
    font-size:89%;
45
    float: left;
46
	 padding-right : .4em;
47
    width: 16em;
48
    text-align: left;
49
    clear:left;
50
}
51
52
.subfieldcode img {
53
    cursor: pointer;
54
}
55
56
.tag_title {
57
	font-size : 90%;
58
	padding : .2em 0;
59
}
60
61
.tagnum {
62
	font-size : 110%;
63
	font-weight : bold;
64
	color : #000;
65
	padding : .1em .3em .1em 0;
66
}
67
68
a.tagnum {
69
	font-size : 110%;
70
	font-weight : bold;
71
	color : #000;
72
	padding : .1em .3em .1em 0;
73
	text-decoration : none;
74
}
75
76
.subfield {
77
	color : #00698a;
78
	float: left;
79
	width: 10em;
80
	text-align:right;
81
}
82
83
.subfieldcode {
84
	display: block;
85
	float: left;
86
}
87
88
.labelsubfield {
89
	float:left;
90
}
91
92
.input_marceditor {
93
	float:left;
94
	width:30em;
95
}
96
97
.indicator {
98
    width: 1em;
99
    box-sizing: content-box;
100
}
101
102
*html .input_marceditor {
103
	width : 15em;
104
}
105
106
#cataloguing_additem_newitem fieldset.rows label, #cataloguing_additem_newitem fieldset.rows span.label {
107
	font-size : 100%;
108
	width : 25%;
109
}
110
111
#cataloguing_additem_newitem fieldset.rows li {
112
	padding-bottom : 3px;
113
}
114
#cataloguing_additem_newitem .input_marceditor {
115
	width : auto;
116
}
117
118
#cataloguing_additem_newitem textarea.input_marceditor {
119
     width : 31em;
120
}
121
122
.mandatory_marker {
123
	color: red;
124
}
125
.linktools { display: block; white-space: nowrap; }
126
.linktools a { font-size : 75%; display:block;text-decoration:none;}
127
.linktools a {margin:0 2px;padding:2px;background-color:#FFF;text-align:center; }
128
.linktools a:first-child { border-bottom: 1px solid #DDD; }
129
.linktools a:hover { background-color: #FFC; }
130
.subfield_controls { margin : 0 .5em; }
131
.readonly { border-width : 1px; border-style: inset; padding-left : 15px; background: #EEE url(../img/locked.png) center left no-repeat; width:29em; }
132
133
#cataloguing_additem_itemlist {
134
	margin-bottom : 1em;
135
}
136
.yui-gf div.first {
137
	width : 19%;
138
}
139
140
.yui-gf .yui-u {
141
	width: 79.2%;
142
}
143
144
tbody tr.active:nth-child(2n+1) td,
145
tbody tr.active td {
146
    background-color: #FFFFCC;
147
}
148
149
#loading {
150
    background-color: #FFF;
151
    cursor: wait;
152
    height: 100%;
153
    left: 0;
154
    opacity: .7;
155
    position: fixed;
156
    top: 0;
157
    width: 100%;
158
    z-index: 1000;
159
}
160
#loading div {
161
    background : transparent url(../img/loading.gif) top left no-repeat;
162
    font-size : 175%;
163
    font-weight: bold;
164
    height: 2em;
165
    left: 50%;
166
    margin: -1em 0 0 -2.5em;
167
    padding-left : 50px;
168
    position: absolute;
169
    top: 50%;
170
    width: 15em;
171
}
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc (+4 lines)
Lines 10-15 CAN_user_serials_create_subscription ) %] Link Here
10
             <li><a id="newbiblio" href="/cgi-bin/koha/cataloguing/addbiblio.pl">New record</a></li>
10
             <li><a id="newbiblio" href="/cgi-bin/koha/cataloguing/addbiblio.pl">New record</a></li>
11
            [% END %]
11
            [% END %]
12
12
13
            [% IF ( show_summary_holdings && CAN_user_editcatalogue_edit_items ) %]
14
            <li><a id="newholding" href="/cgi-bin/koha/cataloguing/addholding.pl?biblionumber=[% biblionumber %]#addholding">New holding</a></li>
15
            [% END %]
16
13
            [% IF ( CAN_user_editcatalogue_edit_items ) %]
17
            [% IF ( CAN_user_editcatalogue_edit_items ) %]
14
             <li><a id="newitem" href="/cgi-bin/koha/cataloguing/additem.pl?biblionumber=[% biblionumber | 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 280-282 Cataloging: Link Here
280
            - "All values of repeating tags and subfields will be printed with the given RIS tag."
280
            - "All values of repeating tags and subfields will be printed with the given RIS tag."
281
            - "<br/>"
281
            - "<br/>"
282
            - "Use of TY ( record type ) as a key will <i>replace</i> the default TY with the field value of your choosing."
282
            - "Use of TY ( record type ) as a key will <i>replace</i> the default TY with the field value of your choosing."
283
    Holdings:
284
        -
285
            - pref: SummaryHoldings
286
              choices:
287
                  yes: Use
288
                  no: "Don't use"
289
            - summary holdings records.
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt (-4 / +63 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
10
10
[% IF Koha.Preference('AmazonAssocTag') %]
11
[% IF Koha.Preference('AmazonAssocTag') %]
11
    [% AmazonAssocTag = '?tag=' _ Koha.Preference('AmazonAssocTag') | html %]
12
    [% AmazonAssocTag = '?tag=' _ Koha.Preference('AmazonAssocTag') | html %]
Lines 297-312 Link Here
297
<div id="bibliodetails" class="toptabs">
298
<div id="bibliodetails" class="toptabs">
298
299
299
<ul>
300
<ul>
301
    [% IF (show_summary_holdings) %]
302
        <li><a href="#summaryholdings">Holdings ([% summary_holdings.size() || 0 | html %])</a></li>
303
    [% END %]
300
    [% IF (SeparateHoldings) %]
304
    [% IF (SeparateHoldings) %]
301
        <li>
305
        <li>
302
            <a href="#holdings">[% LoginBranchname | html %] holdings ([% itemloop.size() || 0 | html %])</a>
306
            <a href="#holdings">[% LoginBranchname | html %] [% IF (show_summary_holdings) %]items[% ELSE %]holdings[% END %] ([% itemloop.size() || 0 | html %])</a>
303
        </li>
307
        </li>
304
        <li>
308
        <li>
305
            <a href="#otherholdings">Other holdings ([% otheritemloop.size() || 0 | html %])</a>
309
            <a href="#otherholdings">[% IF (show_summary_holdings) %]Other items[% ELSE %]Other holdings[% END %] ([% otheritemloop.size() || 0 | html %])</a>
306
        </li>
310
        </li>
307
    [% ELSE %]
311
    [% ELSE %]
308
        <li>
312
        <li>
309
            <a href="#holdings">Holdings ([% itemloop.size() || 0 | html %])</a>
313
            <a href="#holdings">[% IF (show_summary_holdings) %]Items[% ELSE %]Holdings[% END %] ([% itemloop.size() || 0 | html %])</a>
310
        </li>
314
        </li>
311
    [% END %]
315
    [% END %]
312
[% IF ( MARCNOTES || notes ) %]<li><a href="#description">Descriptions</a></li>[% END %]
316
[% IF ( MARCNOTES || notes ) %]<li><a href="#description">Descriptions</a></li>[% END %]
Lines 326-331 Link Here
326
[% END %]
330
[% END %]
327
</ul>
331
</ul>
328
332
333
[% IF ( show_summary_holdings ) %]
334
    <div id="summaryholdings">
335
336
    [% IF ( summary_holdings ) %]
337
        <div class="summaryholdings_table_controls">
338
        </div>
339
        <table class="summaryholdings_table">
340
            <thead>
341
                <tr>
342
                    <th>Library</th>
343
                    <th>Location</th>
344
                    <th>Collection</th>
345
                    <th>Call number</th>
346
                    <th>Status</th>
347
                    [% IF ( CAN_user_editcatalogue_edit_items ) %]<th class="NoSort">&nbsp;</th>[% END %]
348
                </tr>
349
            </thead>
350
            <tbody>
351
                [% FOREACH holding IN summary_holdings %]
352
                    <tr>
353
                        <td class="branch">[% UNLESS ( singlebranchmode ) %][% Branches.GetName( holding.holdingbranch ) | html %] [% END %]</td>
354
                        <td class="location"><span class="shelvingloc">[% holding.location | html %][% IF ( holding.sub_location ) %] ([% holding.sub_location | html %])[% END %]</span>
355
                        <td class="collection">[% holding.ccode | html %]</span>
356
                        <td class="itemcallnumber">[% IF ( holding.callnumber ) %] [% holding.callnumber | html %][% END %]</td>
357
                        <td class="status">
358
                            [% IF ( holding.suppress ) %]
359
                                <span class="suppressed">Suppressed in OPAC</span>
360
                            [% END %]
361
                        </td>
362
                    [% IF CAN_user_editcatalogue_edit_items %]
363
                        <td class="actions">
364
                            <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>
365
                            <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>
366
                            <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>
367
                        </td>
368
                    [% END %]
369
                    </tr>
370
                [% END %]
371
            </tbody>
372
        </table>
373
    [% ELSE %]
374
        <div id="noitems">No holdings records</div>
375
    [% END %]
376
377
    </div>
378
[% END %]
379
329
[% items_table_block_iter = 0 %]
380
[% items_table_block_iter = 0 %]
330
[% BLOCK items_table %]
381
[% BLOCK items_table %]
331
    [% items_table_block_iter = items_table_block_iter + 1 %]
382
    [% items_table_block_iter = items_table_block_iter + 1 %]
Lines 349-354 Link Here
349
            <tr>
400
            <tr>
350
                [% IF (StaffDetailItemSelection) %]<th class="NoSort"></th>[% END %]
401
                [% IF (StaffDetailItemSelection) %]<th class="NoSort"></th>[% END %]
351
                [% IF ( item_level_itypes ) %]<th>Item type</th>[% END %]
402
                [% IF ( item_level_itypes ) %]<th>Item type</th>[% END %]
403
                [% IF ( show_summary_holdings ) %]<th>Holding</th>[% END %]
352
                <th>Current location</th>
404
                <th>Current location</th>
353
                <th>Home library</th>
405
                <th>Home library</th>
354
                [% IF ( itemdata_ccode ) %]<th>Collection</th>[% END %]
406
                [% IF ( itemdata_ccode ) %]<th>Collection</th>[% END %]
Lines 387-392 Link Here
387
                            [% item.translated_description | html %]
439
                            [% item.translated_description | html %]
388
                        </td>
440
                        </td>
389
                    [% END %]
441
                    [% END %]
442
                    [% IF ( show_summary_holdings ) %]
443
                        <td class="holding">[% Holdings.GetLocation(item.holding_id) | html %]</td>
444
                    [% END %]
390
                    <td class="location">[% UNLESS ( singlebranchmode ) %][% Branches.GetName( item.branchcode ) | html %] [% END %]</td>
445
                    <td class="location">[% UNLESS ( singlebranchmode ) %][% Branches.GetName( item.branchcode ) | html %] [% END %]</td>
391
                    <td class="homebranch">[% Branches.GetName(item.homebranch) | html %]<span class="shelvingloc">[% item.location | html %]</span> </td>
446
                    <td class="homebranch">[% Branches.GetName(item.homebranch) | html %]<span class="shelvingloc">[% item.location | html %]</span> </td>
392
                    [% IF ( itemdata_ccode ) %]<td>[% item.ccode | html %]</td>[% END %]
447
                    [% IF ( itemdata_ccode ) %]<td>[% item.ccode | html %]</td>[% END %]
Lines 1023-1034 Link Here
1023
                    $("input[name='itemnumber'][type='checkbox']", $("#"+tab)).prop('checked', false);
1078
                    $("input[name='itemnumber'][type='checkbox']", $("#"+tab)).prop('checked', false);
1024
                    itemSelectionBuildActionLinks(tab);
1079
                    itemSelectionBuildActionLinks(tab);
1025
                });
1080
                });
1081
1082
                $('a.delete').click(function() {
1083
                    return confirm(_('Are you sure?'));
1084
                });
1026
            });
1085
            });
1027
        [% END %]
1086
        [% END %]
1028
1087
1029
        $(document).ready(function() {
1088
        $(document).ready(function() {
1030
            $('#bibliodetails').tabs();
1089
            $('#bibliodetails').tabs();
1031
            [% IF count == 0 %]
1090
            [% IF count == 0 and not show_summary_holdings %]
1032
                $('#bibliodetails').tabs("option", "active", 3);
1091
                $('#bibliodetails').tabs("option", "active", 3);
1033
            [% END %]
1092
            [% END %]
1034
            $('#search-form').focus();
1093
            $('#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
[% SET footerjs = 1 %]
7
[% SET footerjs = 1 %]
7
[% USE AuthorisedValues %]
8
[% USE AuthorisedValues %]
Lines 478-483 Link Here
478
                                </td>
479
                                </td>
479
480
480
                                <td><div class="availability">
481
                                <td><div class="availability">
482
                                    [% IF ( SEARCH_RESULT.summary_holdings ) %]
483
                                        <div class="holdings">
484
                                            <strong>Holdings</strong>
485
                                            <ul>
486
                                            [% FOREACH holding IN SEARCH_RESULT.summary_holdings %]
487
                                                <li>
488
                                                    [% Holdings.GetLocation(holding) | html %]
489
                                                </li>
490
                                            [% END %]
491
                                            </ul>
492
                                        </div>
493
                                    [% END %]
494
481
                                    [% IF ( SEARCH_RESULT.items_count ) %]
495
                                    [% IF ( SEARCH_RESULT.items_count ) %]
482
                                        <strong>
496
                                        <strong>
483
                                            [% IF MaxSearchResultsItemsPerRecordStatusCheck && SEARCH_RESULT.items_count > MaxSearchResultsItemsPerRecordStatusCheck %]
497
                                            [% IF MaxSearchResultsItemsPerRecordStatusCheck && SEARCH_RESULT.items_count > MaxSearchResultsItemsPerRecordStatusCheck %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addholding.tt (+620 lines)
Line 0 Link Here
1
[% USE Koha %]
2
[% SET KOHA_VERSION = Koha.Preference('Version') %]
3
[% INCLUDE 'doc-head-open.inc' %]
4
<title>Koha &rsaquo; Cataloging &rsaquo; [% title | html %] [% IF ( author ) %] by [% author | html %][% END %] (Record #[% biblionumber | html %]) &rsaquo; Holdings</title>
5
[% INCLUDE 'doc-head-close.inc' %]
6
<script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.fixFloat_[% KOHA_VERSION %].js"></script>
7
<script type="text/javascript" src="[% interface %]/[% theme %]/js/cataloging_[% KOHA_VERSION %].js"></script>
8
[% INCLUDE 'browser-strings.inc' %]
9
<!--[if lt IE 9]>
10
<script type="text/javascript" src="[% interface %]/lib/shims/json2.min_[% KOHA_VERSION %].js"></script>
11
<![endif]-->
12
<script type="text/javascript" src="[% interface %]/js/browser_[% KOHA_VERSION %].js"></script>
13
<script type="text/javascript">
14
//<![CDATA[
15
    var browser = KOHA.browser('[% searchid %]', parseInt('[% biblionumber %]', 10));
16
    browser.show();
17
18
    $(window).load(function() {
19
        $("#loading").hide();
20
    });
21
    $(document).ready(function() {
22
        $('#addholdingtabs').tabs().bind('show.ui-tabs', function(e, ui) {
23
            $("#"+ui.panel.id+" input:eq(0)").focus();
24
        });
25
26
        [% IF tab %]
27
            $('#addholdingtabs').selectTabByID("#[% tab %]");
28
        [% END %]
29
30
        $('#toolbar').fixFloat();
31
32
        /* check cookie to hide/show marcdocs*/
33
        if($.cookie("marcdocs_[% borrowernumber %]") == 'hide'){
34
            toggleMARCdocLinks(false);
35
        } else {
36
            toggleMARCdocLinks(true);
37
        }
38
39
        $("#marcDocsSelect").click(function(){
40
            if($.cookie("marcdocs_[% borrowernumber %]") == 'hide'){
41
                toggleMARCdocLinks(true);
42
            } else {
43
                toggleMARCdocLinks(false);
44
            }
45
        });
46
47
        /* check cookie to hide/show marc tags*/
48
        var marctags_cookie = $.cookie("marctags_[% borrowernumber %]");
49
        if (marctags_cookie == 'hide'){
50
            toggleMARCTagLinks(false);
51
        } else if( marctags_cookie == 'show'){
52
            toggleMARCTagLinks(true)
53
        } else {
54
            [% UNLESS Koha.Preference("hide_marc") %]
55
                toggleMARCTagLinks(true)
56
            [% ELSE %]
57
                toggleMARCTagLinks(false);
58
            [% END %]
59
        }
60
61
        $("#marcTagsSelect").click(function(){
62
            if( $.cookie("marctags_[% borrowernumber %]") == 'hide'){
63
                toggleMARCTagLinks(true)
64
            } else {
65
                toggleMARCTagLinks(false);
66
            }
67
        });
68
69
        $("#saverecord").click(function(){
70
            $(".btn-group").removeClass("open");
71
            onOption();
72
            return false;
73
        });
74
75
        $("#saveandview").click(function(){
76
            $(".btn-group").removeClass("open");
77
            redirect("view");
78
            return false;
79
        });
80
81
        $("#saveanditems").click(function(){
82
            $(".btn-group").removeClass("open");
83
            redirect("items");
84
            return false;
85
        });
86
        $("#saveandcontinue").click(function(){
87
            $(".btn-group").removeClass("open");
88
            var tab = $("#addholdingtabs li.ui-tabs-active:first a").attr('href');
89
            tab = tab.replace('#', '');
90
            $("#current_tab").val(tab);
91
            redirect("just_save", tab);
92
            return false;
93
        });
94
95
        $( '#switcheditor' ).click( function() {
96
97
            if ( !confirm( _("Any changes will not be saved. Continue?") ) ) return false;
98
99
            $.cookie( 'catalogue_editor_[% USER_INFO.borrowernumber %]', 'advanced', { expires: 365, path: '/' } );
100
101
            var holding_id = [% holding_id || "''" %];
102
            window.location = '/cgi-bin/koha/cataloguing/editor.pl#catalog/' + biblionumber + '/holdings/' + holding_id;
103
104
            return false;
105
        } );
106
        $(".change-framework").on("click", function(){
107
            var frameworkcode = $(this).data("frameworkcode");
108
            $("#frameworkcode").val( frameworkcode );
109
            Changefwk();
110
        });
111
    });
112
113
function redirect(dest){
114
    $("#redirect").attr("value",dest);
115
    return Check();
116
}
117
118
[% IF ( CAN_user_editcatalogue_edit_items ) %]
119
    var onOption = function () {
120
        return Check();
121
    }
122
[% END %]
123
124
function Dopop(link,i) {
125
    defaultvalue = document.getElementById(i).value;
126
    window.open(link+"&result="+defaultvalue,"valuebuilder",'width=700,height=550,toolbar=false,scrollbars=yes');
127
}
128
129
function PopupMARCFieldDoc(field) {
130
    [% IF ( marcflavour == 'MARC21' ) %]
131
        _MARC21FieldDoc(field);
132
    [% ELSIF ( marcflavour == 'UNIMARC' ) %]
133
        _UNIMARCFieldDoc(field);
134
    [% END %]
135
}
136
137
function _MARC21FieldDoc(field) {
138
    if(field == 0) {
139
        window.open("http://www.loc.gov/marc/holdings/hdleader.html");
140
    } else if (field < 900) {
141
        window.open("http://www.loc.gov/marc/holdings/hd" + ("000"+field).slice(-3) + ".html");
142
    } else {
143
        window.open("http://www.loc.gov/marc/holdings/hd9xx.html");
144
    }
145
}
146
147
function _UNIMARCFieldDoc(field) {
148
    /* http://archive.ifla.org/VI/3/p1996-1/ is an outdated version of UNIMARC, but
149
       seems to be the only version available that can be linked to per tag.  More recent
150
       versions of the UNIMARC standard are available on the IFLA website only as
151
       PDFs!
152
    */
153
    var url;
154
    if (field == 0) {
155
        url = "http://archive.ifla.org/VI/3/p1996-1/uni.htm";
156
    } else {
157
        var first = field.substring(0,1);
158
        url = "http://archive.ifla.org/VI/3/p1996-1/uni" + first + ".htm#";
159
        if (first == 0) url = url + "b";
160
        url = first == 9
161
              ? "http://archive.ifla.org/VI/3/p1996-1/uni9.htm"
162
              : url + field;
163
    }
164
    window.open(url);
165
}
166
167
/*
168
 * Functions to hide/show marc docs and tags links
169
 */
170
171
function toggleMARCdocLinks(flag){
172
    if( flag === true ){
173
        $(".marcdocs").show();
174
        $.cookie("marcdocs_[% borrowernumber %]",'show', { path: "/", expires: 365 });
175
        $("#marcDocsSelect i").addClass('fa-check-square-o').removeClass('fa-square-o');
176
    } else {
177
        $(".marcdocs").hide();
178
        $.cookie("marcdocs_[% borrowernumber %]",'hide', { path: "/", expires: 365 });
179
        $("#marcDocsSelect i").removeClass('fa-check-square-o').addClass('fa-square-o');
180
    }
181
}
182
183
function toggleMARCTagLinks(flag){
184
    if( flag === true ){
185
        $(".tagnum").show();
186
        $(".subfieldcode").show();
187
        $.cookie("marctags_[% borrowernumber %]",'show', { path: "/", expires: 365 });
188
        $("#marcTagsSelect i").addClass('fa-check-square-o').removeClass('fa-square-o');
189
    } else {
190
        $(".tagnum").hide();
191
        $(".subfieldcode").hide();
192
        $.cookie("marctags_[% borrowernumber %]",'hide', { path: "/", expires: 365 });
193
        $("#marcTagsSelect i").removeClass('fa-check-square-o').addClass('fa-square-o');
194
    }
195
}
196
197
/**
198
 * check if mandatory subfields are written
199
 */
200
function AreMandatoriesNotOk(){
201
    var mandatories = new Array();
202
    var mandatoriesfields = new Array();
203
    var tab = new Array();
204
    var label = new Array();
205
    var flag=0;
206
    var tabflag= new Array();
207
    [% FOREACH BIG_LOO IN BIG_LOOP %]
208
        [% FOREACH innerloo IN BIG_LOO.innerloop %]
209
            [% IF ( innerloo.mandatory ) %]
210
                mandatoriesfields.push(new Array("[% innerloo.tag %]","[% innerloo.index %][% innerloo.random %]","[% innerloo.index %]"));
211
            [% END %]
212
            [% FOREACH subfield_loo IN innerloo.subfield_loop %]
213
                [% IF ( subfield_loo.mandatory ) %]
214
                    mandatories.push("[% subfield_loo.id %]");
215
                    tab.push("[% BIG_LOO.number %]");
216
                    label.push("[% subfield_loo.marc_lib %]");
217
                [% END %]
218
            [% END %]
219
        [% END %]
220
    [% END %]
221
    var StrAlert = _("Can't save this record because the following field aren't filled:");
222
    StrAlert += "\n\n";
223
    for (var i=0,len=mandatories.length; i<len ; i++) {
224
        var tag=mandatories[i].substr(4,3);
225
        var subfield=mandatories[i].substr(17,1);
226
        var tagnumber=mandatories[i].substr(19,mandatories[i].lastIndexOf("_")-19);
227
        if (tabflag[tag+subfield+tagnumber] ==  null) {
228
            tabflag[tag+subfield+tagnumber]=new Array();
229
            tabflag[tag+subfield+tagnumber][0]=0;
230
        }
231
        if (tabflag[tag+subfield+tagnumber][0] != 1 && (document.getElementById(mandatories[i]) != null && ! document.getElementById(mandatories[i]).value || document.getElementById(mandatories[i]) == null)) {
232
            tabflag[tag+subfield+tagnumber][0] = 0 + tabflag[tag+subfield+tagnumber] ;
233
            document.getElementById(mandatories[i]).setAttribute('class','subfield_not_filled');
234
            $('#' + mandatories[i]).focus();
235
            tabflag[tag+subfield+tagnumber][1]=label[i];
236
            tabflag[tag+subfield+tagnumber][2]=tab[i];
237
        } else {
238
            tabflag[tag+subfield+tagnumber][0] = 1;
239
        }
240
    }
241
    for (var tagsubfieldid in tabflag) {
242
      if (tabflag[tagsubfieldid][0]==0) {
243
        var tag=tagsubfieldid.substr(0,3);
244
        var subfield=tagsubfieldid.substr(3,1);
245
        StrAlert += "\t* "+_("tag %s subfield %s %s in tab %s").format(tag, subfield, tabflag[tagsubfieldid][1], tabflag[tagsubfieldid][2]) + "\n";
246
        flag=1;
247
      }
248
    }
249
250
    /* Check for mandatories field(not subfields) */
251
    for (var i=0,len=mandatoriesfields.length; i<len; i++) {
252
        isempty  = true;
253
        arr      = mandatoriesfields[i];
254
        divid    = "tag_" + arr[0] + "_" + arr[1];
255
        varegexp = new RegExp("^tag_" + arr[0] + "_code_");
256
257
        if(parseInt(arr[0]) >= 10) {
258
            elem = document.getElementById(divid);
259
            eleminputs = elem.getElementsByTagName('input');
260
261
            for(var j=0,len2=eleminputs.length; j<len2; j++){
262
263
                if(eleminputs[j].name.match(varegexp) && eleminputs[j].value){
264
                        inputregexp = new RegExp("^tag_" + arr[0] + "_subfield_" + eleminputs[j].value + "_" + arr[2]);
265
266
                        for( var k=0; k<len2; k++){
267
                            if(eleminputs[k].id.match(inputregexp) && eleminputs[k].value){
268
                                isempty = false
269
                            }
270
                        }
271
272
                        elemselect = elem.getElementsByTagName('select');
273
                        for( var k=0; k<elemselect.length; k++){
274
                            if(elemselect[k].id.match(inputregexp) && elemselect[k].value){
275
                                isempty = false
276
                            }
277
                        }
278
                }
279
            }
280
281
            elemtextareas = elem.getElementsByTagName('textarea');
282
            for(var j=0,len2=elemtextareas.length; j<len2; j++){
283
                // this bit assumes that the only textareas in this context would be for subfields
284
                if (elemtextareas[j].value) {
285
                    isempty = false;
286
                }
287
            }
288
        } else {
289
            isempty = false;
290
        }
291
292
        if (isempty) {
293
            flag = 1;
294
                    StrAlert += "\t* " + _("Field %s is mandatory, at least one of its subfields must be filled.").format(arr[0]) + "\n";
295
        }
296
    }
297
298
    if (flag) {
299
        return StrAlert;
300
    } else {
301
        return flag;
302
    }
303
}
304
305
/**
306
 *
307
 *
308
 */
309
function Check(){
310
    var StrAlert = AreMandatoriesNotOk();
311
    if( ! StrAlert ){
312
        document.f.submit();
313
        return true;
314
    } else {
315
        alert(StrAlert);
316
        return false;
317
    }
318
}
319
320
function Changefwk() {
321
    var f = document.f;
322
    f.op.value = "[% op %]";
323
    f.biblionumber.value = "[% biblionumber %]";
324
    f.holding_id.value = "[% holding_iddata %]";
325
    f.changed_framework.value = "changed";
326
    f.submit();
327
}
328
329
//]]>
330
</script>
331
<link type="text/css" rel="stylesheet" href="[% interface %]/[% theme %]/css/addholding.css" />
332
333
[% INCLUDE 'select2.inc' %]
334
<script>
335
  $(document).ready(function() {
336
    $('.subfield_line select').select2();
337
  });
338
</script>
339
340
[% IF ( bidi ) %]
341
   <link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/right-to-left_[% KOHA_VERSION %].css" />
342
[% END %]
343
</head>
344
<body id="cat_addholding" class="cat">
345
346
   <div id="loading">
347
       <div>Loading, please wait...</div>
348
   </div>
349
350
[% INCLUDE 'header.inc' %]
351
352
<div id="breadcrumbs">
353
          <a href="/cgi-bin/koha/mainpage.pl">Home</a>
354
 &rsaquo; <a href="/cgi-bin/koha/cataloguing/addbooks.pl">Cataloging</a>
355
 &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>
356
 &rsaquo; <a href="/cgi-bin/koha/cataloguing/addholding.pl?biblionumber=[% biblionumber | html %]">Holdings</a>
357
</div>
358
359
<div id="doc" class="yui-t7">
360
361
<div id="bd">
362
        <div id="yui-main">
363
        <div class="yui-g">
364
365
<h1>
366
[% IF ( holding_id ) %]Editing record number [% holding_id %]
367
[% ELSE %]Add holdings record
368
[% END %]
369
</h1>
370
371
[% IF ( done ) %]
372
    <script type="text/javascript">
373
        opener.document.forms['f'].holding_id.value=[% holding_id %];
374
        window.close();
375
    </script>
376
[% ELSE %]
377
    <form method="post" name="f" id="f" action="/cgi-bin/koha/cataloguing/addholding.pl" onsubmit="return Check();">
378
    <input type="hidden" value="[% IF ( holding_id ) %]view[% ELSE %]items[% END %]" id="redirect" name="redirect" />
379
    <input type="hidden" value="" id="current_tab" name="current_tab" />
380
[% END %]
381
382
<div id="toolbar" class="btn-toolbar">
383
    [% IF CAN_user_editcatalogue_edit_items %]
384
        <div class="btn-group">
385
            <button class="btn btn-default btn-sm" id="saverecord"><i class="fa fa-save"></i> Save</button>
386
            <button class="btn btn-default btn-sm dropdown-toggle" data-toggle="dropdown">
387
            <span class="caret"></span>
388
            </button>
389
            <ul class="dropdown-menu">
390
                <li><a id="saveandview" href="#">Save and view record</a></li>
391
                <li><a id="saveanditems" href="#">Save and edit items</a></li>
392
                <li><a id="saveandcontinue" href="#">Save and continue editing</a></li>
393
            </ul>
394
        </div>
395
    [% END %]
396
397
    <div class="btn-group">
398
        <button class="btn btn-default btn-sm dropdown-toggle" data-toggle="dropdown"><i class="fa fa-cog"></i> Settings <span class="caret"></span></button>
399
        <ul id="settings-menu" class="dropdown-menu">
400
            [% IF Koha.Preference( 'EnableAdvancedCatalogingEditor' ) == 1 %]
401
                <li><a href="#" id="switcheditor">Switch to advanced editor</a></li>
402
            [% END %]
403
            [% IF marcflavour != 'NORMARC' AND NOT advancedMARCEditor %]
404
                <li>
405
                    <a href="#" id="marcDocsSelect"><i class="fa fa-check-square-o"></i> Show MARC tag documentation links</a>
406
                <li>
407
                    <a href="#" id="marcTagsSelect"><i class="fa fa-check-square-o"></i> Show tags</a>
408
                </li>
409
            [% END %]
410
            <li class="divider"></li>
411
            <li class="nav-header">Change framework</li>
412
            <li>
413
                <a href="#" class="change-framework" data-frameworkcode="">
414
                    [% IF ( frameworkcode ) %]
415
                       <i class="fa fa-fw">&nbsp;</i>
416
                    [% ELSE %]
417
                        <i class="fa fa-fw fa-check"></i>
418
                    [% END %]
419
                    Default
420
                </a>
421
            </li>
422
            [% FOREACH framework IN frameworks%]
423
                <li>
424
                    <a href="#" class="change-framework" data-frameworkcode="[% framework.frameworkcode %]">
425
                        [% IF framework.frameworkcode == frameworkcode %]
426
                            <i class="fa fa-fw fa-check"></i>
427
                        [% ELSE %]
428
                            <i class="fa fa-fw">&nbsp;</i>
429
                        [% END %]
430
                        [% framework.frameworktext %]
431
                    </a>
432
                </li>
433
            [% END %]
434
        </ul>
435
    </div>
436
    <div class="btn-group">
437
        <a class="btn btn-default btn-sm" id="cancel" href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblionumber |url %]">Cancel</a>
438
    </div>
439
</div>
440
441
[% IF ( popup ) %]
442
        <input type="hidden" name="mode" value="popup" />
443
[% END %]
444
        <input type="hidden" name="op" value="add" />
445
        <input type="hidden" id="frameworkcode" name="frameworkcode" value="[% frameworkcode %]" />
446
        <input type="hidden" name="biblionumber" value="[% biblionumber %]" />
447
        <input type="hidden" name="holding_id" value="[% holding_id %]" />
448
        <input type="hidden" name="changed_framework" value="" />
449
450
<div id="addholdingtabs" class="toptabs numbered">
451
    <ul>
452
        [% FOREACH BIG_LOO IN BIG_LOOP %]
453
        <li><a href="#tab[% BIG_LOO.number %]XX">[% BIG_LOO.number %]</a></li>
454
        [% END %]
455
    </ul>
456
457
[% FOREACH BIG_LOO IN BIG_LOOP %]
458
    <div id="tab[% BIG_LOO.number %]XX">
459
460
    [% FOREACH innerloo IN BIG_LOO.innerloop %]
461
    [% IF ( innerloo.tag ) %]
462
    <div class="tag" id="tag_[% innerloo.tag %]_[% innerloo.index %][% innerloo.random %]">
463
        <div class="tag_title" id="div_indicator_tag_[% innerloo.tag %]_[% innerloo.index %][% innerloo.random %]">
464
            [% IF advancedMARCEditor %]
465
                <a href="#" tabindex="1" class="tagnum" title="[% innerloo.tag_lib %] - Click to Expand this Tag" onclick="ExpandField('tag_[% innerloo.tag %]_[% innerloo.index %][% innerloo.random %]'); return false;">[% innerloo.tag %]</a>
466
            [% ELSE %]
467
                <span class="tagnum" title="[% innerloo.tag_lib %]">[% innerloo.tag %]</span>
468
                [% IF marcflavour != 'NORMARC' %]<a href="#" class="marcdocs" onclick="PopupMARCFieldDoc('[% innerloo.tag %]'); return false;">&nbsp;?</a>[% END %]
469
            [% END %]
470
                [% IF ( innerloo.fixedfield ) %]
471
                    <input type="text"
472
                        tabindex="1"
473
                        class="indicator flat"
474
                        style="display:none;"
475
                        name="tag_[% innerloo.tag %]_indicator1_[% innerloo.index %][% innerloo.random %]"
476
                        size="1"
477
                        maxlength="1"
478
                        value="[% innerloo.indicator1 %]" />
479
                    <input type="text"
480
                        tabindex="1"
481
                        class="indicator flat"
482
                        style="display:none;"
483
                        name="tag_[% innerloo.tag %]_indicator2_[% innerloo.index %][% innerloo.random %]"
484
                        size="1"
485
                        maxlength="1"
486
                        value="[% innerloo.indicator2 %]" />
487
                [% ELSE %]
488
                    <input type="text"
489
                        tabindex="1"
490
                        class="indicator flat"
491
                        name="tag_[% innerloo.tag %]_indicator1_[% innerloo.index %][% innerloo.random %]"
492
                        size="1"
493
                        maxlength="1"
494
                        value="[% innerloo.indicator1 %]" />
495
                    <input type="text"
496
                        tabindex="1"
497
                        class="indicator flat"
498
                        name="tag_[% innerloo.tag %]_indicator2_[% innerloo.index %][% innerloo.random %]"
499
                        size="1"
500
                        maxlength="1"
501
                        value="[% innerloo.indicator2 %]" />
502
                [% END %] -
503
504
            [% UNLESS advancedMARCEditor %]
505
                <a href="#" tabindex="1" class="expandfield" onclick="ExpandField('tag_[% innerloo.tag %]_[% innerloo.index %][% innerloo.random %]'); return false;" title="Click to Expand this Tag">[% innerloo.tag_lib %]</a>
506
            [% END %]
507
                <span class="field_controls">
508
                [% IF ( innerloo.repeatable ) %]
509
                    <a href="#" tabindex="1" class="buttonPlus" onclick="CloneField('tag_[% innerloo.tag %]_[% innerloo.index %][% innerloo.random %]','0','[% advancedMARCEditor %]'); return false;" title="Repeat this Tag">
510
                        <img src="[% interface %]/[% theme %]/img/repeat-tag.png" alt="Repeat this Tag" />
511
                    </a>
512
                [% END %]
513
                    <a href="#" tabindex="1" class="buttonMinus" onclick="UnCloneField('tag_[% innerloo.tag %]_[% innerloo.index %][% innerloo.random %]'); return false;" title="Delete this Tag">
514
                        <img src="[% interface %]/[% theme %]/img/delete-tag.png" alt="Delete this Tag" />
515
                    </a>
516
                </span>
517
518
        </div>
519
520
        [% FOREACH subfield_loo IN innerloo.subfield_loop %]
521
            <!--  One line on the marc editor -->
522
            <div class="subfield_line" style="[% subfield_loo.visibility %]" id="subfield[% subfield_loo.tag %][% subfield_loo.subfield %][% subfield_loo.random %]">
523
524
                [% UNLESS advancedMARCEditor %]
525
                    [% IF ( subfield_loo.fixedfield ) %]<label for="tag_[% subfield_loo.tag %]_subfield_[% subfield_loo.subfield %]_[% subfield_loo.index %]_[% subfield_loo.index_subfield %]" style="display:none;" class="labelsubfield">
526
                    [% ELSE %]<label for="tag_[% subfield_loo.tag %]_subfield_[% subfield_loo.subfield %]_[% subfield_loo.index %]_[% subfield_loo.index_subfield %]" class="labelsubfield">
527
                    [% END %]
528
                [% END %]
529
530
                <span class="subfieldcode">
531
                    [% IF ( subfield_loo.fixedfield ) %]
532
                        <img class="buttonUp" style="display:none;" src="[% interface %]/[% theme %]/img/up.png" onclick="upSubfield('subfield[% subfield_loo.tag %][% subfield_loo.subfield %][% subfield_loo.random %]')" alt="Move Up" title="Move Up" />
533
                    [% ELSE %]
534
                        <img class="buttonUp" src="[% interface %]/[% theme %]/img/up.png" onclick="upSubfield('subfield[% subfield_loo.tag %][% subfield_loo.subfield %][% subfield_loo.random %]')" alt="Move Up" title="Move Up" />
535
                    [% END %]
536
                        <input type="text"
537
                            title="[% subfield_loo.marc_lib %]"
538
                            style=" [% IF ( subfield_loo.fixedfield ) %]display:none; [% END %]border:0;"
539
                            name="tag_[% subfield_loo.tag %]_code_[% subfield_loo.subfield %]_[% subfield_loo.index %]_[% subfield_loo.index_subfield %]"
540
                            value="[% subfield_loo.subfield %]"
541
                            size="1"
542
                            maxlength="1"
543
                            class="flat"
544
                            tabindex="0" />
545
                </span>
546
547
                [% UNLESS advancedMARCEditor %]
548
                    [% IF ( subfield_loo.mandatory ) %]<span class="subfield subfield_mandatory">[% ELSE %]<span class="subfield">[% END %]
549
                        [% subfield_loo.marc_lib %]
550
                        [% IF ( subfield_loo.mandatory ) %]<span class="mandatory_marker" title="This field is mandatory">*</span>[% END %]
551
                    </span>
552
                    </label>
553
                [% END %]
554
555
                [% SET mv = subfield_loo.marc_value %]
556
                [% IF ( mv.type == 'text' ) %]
557
                    [% IF ( mv.readonly == 1 ) %]
558
                    <input type="text" id="[%- mv.id -%]" name="[%- mv.name -%]" value="[%- mv.value -%]" class="input_marceditor readonly" tabindex="1" size="[%- mv.size -%]" maxlength="[%- mv.maxlength -%]" readonly="readonly" />
559
                    [% ELSE %]
560
                    <input type="text" id="[%- mv.id -%]" name="[%- mv.name -%]" value="[%- mv.value -%]" class="input_marceditor" tabindex="1" size="[%- mv.size -%]" maxlength="[%- mv.maxlength -%]" />
561
                    [% END %]
562
                    [% IF ( mv.authtype ) %]
563
                    <span class="subfield_controls"><a href="#" class="buttonDot tag_editor" onclick="openAuth(this.parentNode.parentNode.getElementsByTagName('input')[1].id,'[%- mv.authtype -%]','holding'); return false;" tabindex="1" title="Tag editor">Tag editor</a></span>
564
                    [% END %]
565
                [% ELSIF ( mv.type == 'text_complex' ) %]
566
                    <input type="text" id="[%- mv.id -%]" name="[%- mv.name -%]" value="[%- mv.value -%]" class="input_marceditor framework_plugin" tabindex="1" size="[%- mv.size -%]" maxlength="[%- mv.maxlength -%]" />
567
                    <span class="subfield_controls">
568
                        [% IF mv.noclick %]
569
                            <a href="#" class="buttonDot tag_editor disabled" tabindex="-1" title="No popup"></a>
570
                        [% ELSE %]
571
                            <a href="#" id="buttonDot_[% mv.id %]" class="buttonDot tag_editor framework_plugin" tabindex="1" title="Tag editor">Tag editor</a>
572
                        [% END %]
573
                    </span>
574
                    [% mv.javascript %]
575
                [% ELSIF ( mv.type == 'hidden' ) %]
576
                    <input tabindex="1" type="hidden" id="[%- mv.id -%]" name="[%- mv.name -%]" size="[%- mv.size -%]" maxlength="[%- mv.maxlength -%]" value="[%- mv.value -%]" />
577
                [% ELSIF ( mv.type == 'textarea' ) %]
578
                    <textarea cols="70" rows="4" id="[%- mv.id -%]" name="[%- mv.name -%]" class="input_marceditor" tabindex="1">[%- mv.value -%]</textarea>
579
                [% ELSIF ( mv.type == 'select' ) %]
580
                    <select name="[%- mv.name -%]" tabindex="1" size="1" class="input_marceditor" id="[%- mv.id -%]">
581
                    [% FOREACH aval IN mv.values %]
582
                        [% IF aval == mv.default %]
583
                        <option value="[%- aval -%]" selected="selected">[%- mv.labels.$aval -%]</option>
584
                        [% ELSE %]
585
                        <option value="[%- aval -%]">[%- mv.labels.$aval -%]</option>
586
                        [% END %]
587
                    [% END %]
588
                    </select>
589
                [% END %]
590
591
                <span class="subfield_controls">
592
                [% IF ( subfield_loo.repeatable ) %]
593
                    <a href="#" class="buttonPlus" tabindex="1" onclick="CloneSubfield('subfield[% subfield_loo.tag %][% subfield_loo.subfield %][% subfield_loo.random %]','[% advancedMARCEditor %]'); return false;">
594
                        <img src="[% interface %]/[% theme %]/img/clone-subfield.png" alt="Clone" title="Clone this subfield" />
595
                    </a>
596
                    <a href="#" class="buttonMinus" tabindex="1" onclick="UnCloneField('subfield[% subfield_loo.tag %][% subfield_loo.subfield %][% subfield_loo.random %]'); return false;">
597
                        <img src="[% interface %]/[% theme %]/img/delete-subfield.png" alt="Delete" title="Delete this subfield" />
598
                    </a>
599
                [% END %]
600
                </span>
601
602
            </div>
603
            <!-- End of the line -->
604
        [% END %]
605
606
    </div>
607
    [% END %]<!-- if innerloo.tag -->
608
    [% END %]<!-- BIG_LOO.innerloop -->
609
    </div>
610
[% END %]<!-- BIG_LOOP -->
611
612
</div><!-- tabs -->
613
614
</form>
615
616
</div>
617
</div>
618
</div>
619
620
[% INCLUDE 'intranet-bottom.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_008_holdings.tt (+193 lines)
Line 0 Link Here
1
[% INCLUDE 'doc-head-open.inc' %]
2
<title>Koha &rsaquo; Holdings &rsaquo; 008 builder</title>
3
[% INCLUDE 'doc-head-close.inc' %]
4
</head>
5
<body id="cat_marc21_field_008_holdings" class="cat" style="padding:1em;">
6
<h3> 008 Fixed-length data elements</h3>
7
<form name="f_pop" onsubmit="report()" action="">
8
<input type="hidden" name="plugin_name" value="marc21_field_008_holdings.pl" />
9
<input name="f1" value="[% f1 %]" type="hidden" />
10
<table>
11
	<tr>
12
		<td>00-05 - Date entered on file</td>
13
		<td>[% f1 %]</td>
14
	</tr>
15
	<tr>
16
		<td><label for="f6">06 - Receipt or acquisition status</label></td>
17
		<td>
18
			<select name="f6" id="f6" size="1">
19
                <option value="0"[% IF ( f60 ) %] selected="selected"[% END %]>0 - Unknown</option>
20
                <option value="1"[% IF ( f61 ) %] selected="selected"[% END %]>1 - Other receipt or acquisition status</option>
21
                <option value="2"[% IF ( f62 ) %] selected="selected"[% END %]>2 - Received and complete or ceased</option>
22
                <option value="3"[% IF ( f63 ) %] selected="selected"[% END %]>3 - On order</option>
23
                <option value="4"[% IF ( f64 ) %] selected="selected"[% END %]>4 - Currently received</option>
24
                <option value="5"[% IF ( f65 ) %] selected="selected"[% END %]>5 - Not currently received</option>
25
			</select>
26
		</td>
27
	</tr>
28
    <tr>
29
        <td><label for="f7">07 - Method of acquisition</label></td>
30
        <td>
31
            <select name="f7" id="f7" size="1">
32
                <option value="c"[% IF ( f7c ) %] selected="selected"[% END %]>c - Cooperative or consortial purchase</option>
33
                <option value="d"[% IF ( f7d ) %] selected="selected"[% END %]>d - Deposit</option>
34
                <option value="e"[% IF ( f7e ) %] selected="selected"[% END %]>e - Exchange</option>
35
                <option value="f"[% IF ( f7f ) %] selected="selected"[% END %]>f - Free</option>
36
                <option value="g"[% IF ( f7g ) %] selected="selected"[% END %]>g - Gift</option>
37
                <option value="l"[% IF ( f7l ) %] selected="selected"[% END %]>l - Legal deposit</option>
38
                <option value="m"[% IF ( f7m ) %] selected="selected"[% END %]>m - Membership</option>
39
                <option value="n"[% IF ( f7n ) %] selected="selected"[% END %]>n - Non-library purchase</option>
40
                <option value="p"[% IF ( f7p ) %] selected="selected"[% END %]>p - Purchase</option>
41
                <option value="q"[% IF ( f7q ) %] selected="selected"[% END %]>q - Lease</option>
42
                <option value="u"[% IF ( f7u ) %] selected="selected"[% END %]>u - Unknown</option>
43
                <option value="z"[% IF ( f7z ) %] selected="selected"[% END %]>z - Other method of acquisition</option>
44
            </select>
45
        </td>
46
    </tr>
47
	<tr>
48
		<td><label for="f8">08-11 - Expected acquisition end date</label></td>
49
		<td><input type="text" name="f8" id="f8" maxlength="4" size="5" value="[% f8 %]" /></td>
50
	</tr>
51
    <tr>
52
        <td><label for="f12">12- General retention policy</label></td>
53
        <td>
54
            <select name="f12" id="f12" size="1">
55
                <option value="0"[% IF ( f120 ) %] selected="selected"[% END %]>0 - Unknown</option>
56
                <option value="1"[% IF ( f121 ) %] selected="selected"[% END %]>1 - Other general retention policy</option>
57
                <option value="2"[% IF ( f122 ) %] selected="selected"[% END %]>2 - Retained except as replaced by updates</option>
58
                <option value="3"[% IF ( f123 ) %] selected="selected"[% END %]>3 - Sample issue retained</option>
59
                <option value="4"[% IF ( f124 ) %] selected="selected"[% END %]>4 - Retained until replaced by microform</option>
60
                <option value="5"[% IF ( f125 ) %] selected="selected"[% END %]>5 - Retained until replaced by cumulation, replacement volume, or revision</option>
61
                <option value="6"[% IF ( f126 ) %] selected="selected"[% END %]>6 - Retained for a limited period</option>
62
                <option value="7"[% IF ( f127 ) %] selected="selected"[% END %]>7 - Not retained</option>
63
                <option value="8"[% IF ( f128 ) %] selected="selected"[% END %]>8 - Permanently retained</option>
64
            </select>
65
        </td>
66
    </tr>
67
    <tr>
68
        <td><label for="f13">13 - Policy type</label></td>
69
        <td>
70
            <select name="f13" id="f13" size="1">
71
                <option value=" "[% IF ( f13 ) %] selected="selected"[% END %]># - No information provided</option>
72
                <option value="l"[% IF ( f13l ) %] selected="selected"[% END %]>l - Latest</option>
73
                <option value="p"[% IF ( f13p ) %] selected="selected"[% END %]>p - Previous</option>
74
            </select>
75
        </td>
76
    </tr>
77
    <tr>
78
        <td><label for="f14">14 - Number of units</label></td>
79
        <td>
80
            <select name="f14" id="f14" size="1">
81
                <option value=" "[% IF ( f14 ) %] selected="selected"[% END %]># - No information provided</option>
82
                <option value="1"[% IF ( f141 ) %] selected="selected"[% END %]>1</option>
83
                <option value="2"[% IF ( f142 ) %] selected="selected"[% END %]>2</option>
84
                <option value="3"[% IF ( f143 ) %] selected="selected"[% END %]>3</option>
85
                <option value="4"[% IF ( f144 ) %] selected="selected"[% END %]>4</option>
86
                <option value="5"[% IF ( f145 ) %] selected="selected"[% END %]>5</option>
87
                <option value="6"[% IF ( f146 ) %] selected="selected"[% END %]>6</option>
88
                <option value="7"[% IF ( f147 ) %] selected="selected"[% END %]>7</option>
89
                <option value="8"[% IF ( f148 ) %] selected="selected"[% END %]>8</option>
90
                <option value="9"[% IF ( f149 ) %] selected="selected"[% END %]>9 </option>
91
            </select>
92
        </td>
93
    </tr>
94
    <tr>
95
        <td><label for="f15">15 - Unit type</label></td>
96
        <td>
97
            <select name="f15" id="f15" size="1">
98
                <option value=" "[% IF ( f15 ) %] selected="selected"[% END %]># - No information provided</option>
99
                <option value="m"[% IF ( f15m ) %] selected="selected"[% END %]>m - Month(s)</option>
100
                <option value="w"[% IF ( f15w ) %] selected="selected"[% END %]>w - Week(s)</option>
101
                <option value="y"[% IF ( f15y ) %] selected="selected"[% END %]>y - Year(s)</option>
102
                <option value="e"[% IF ( f15e ) %] selected="selected"[% END %]>e - Edition(s)</option>
103
                <option value="i"[% IF ( f15i ) %] selected="selected"[% END %]>i - Issue(s)</option>
104
                <option value="s"[% IF ( f15s ) %] selected="selected"[% END %]>s - Supplement(s)</option>
105
            </select>
106
        </td>
107
    </tr>
108
    <tr>
109
        <td><label for="f16">16 - Completeness</label></td>
110
        <td>
111
            <select name="f16" id="f16" size="1">
112
                <option value="0"[% IF ( f160 ) %] selected="selected"[% END %]>0 - Other</option>
113
                <option value="1"[% IF ( f161 ) %] selected="selected"[% END %]>1 - Complete</option>
114
                <option value="2"[% IF ( f162 ) %] selected="selected"[% END %]>2 - Incomplete</option>
115
                <option value="3"[% IF ( f163 ) %] selected="selected"[% END %]>3 - Scattered</option>
116
                <option value="4"[% IF ( f164 ) %] selected="selected"[% END %]>4 - Not applicable</option>
117
            </select>
118
        </td>
119
    </tr>
120
	<tr>
121
		<td><label for="f17">17-19 - Number of copies reported</label></td>
122
		<td><input type="text" name="f17" id="f17" maxlength="3" size="4" value="[% f17 %]" /></td>
123
	</tr>
124
    <tr>
125
        <td><label for="f20">20 - Lending policy</label></td>
126
        <td>
127
            <select name="f20" id="f20" size="1">
128
                <option value="a"[% IF ( f20a ) %] selected="selected"[% END %]>a - Will lend</option>
129
                <option value="b"[% IF ( f20b ) %] selected="selected"[% END %]>b - Will not lend</option>
130
                <option value="c"[% IF ( f20c ) %] selected="selected"[% END %]>c - Will lend hard copy only</option>
131
                <option value="l"[% IF ( f20l ) %] selected="selected"[% END %]>l - Limited lending policy</option>
132
                <option value="u"[% IF ( f20u ) %] selected="selected"[% END %]>u - Unknown</option>
133
            </select>
134
        </td>
135
    </tr>
136
    <tr>
137
        <td><label for="f21">21 - Reproduction policy</label></td>
138
        <td>
139
            <select name="f21" id="f21" size="1">
140
                <option value="a"[% IF ( f21a ) %] selected="selected"[% END %]>a - Will reproduce</option>
141
                <option value="b"[% IF ( f21b ) %] selected="selected"[% END %]>b - Will not reproduce</option>
142
                <option value="u"[% IF ( f21u ) %] selected="selected"[% END %]>u - Unknown</option>
143
            </select>
144
        </td>
145
    </tr>
146
	<tr>
147
		<td><label for="f22">22-24 - Language</label></td>
148
		<td><input type="text" name="f22" id="f22" maxlength="3" size="4" value="[% f22 %]" /></td>
149
	</tr>
150
    <tr>
151
        <td><label for="f25">25 - Separate or composite copy report</label></td>
152
        <td>
153
            <select name="f25" id="f25" size="1">
154
                <option value="0"[% IF ( f250 ) %] selected="selected"[% END %]>0 - Separate copy report</option>
155
                <option value="1"[% IF ( f251 ) %] selected="selected"[% END %]>1 - Composite copy report</option>
156
            </select>
157
        </td>
158
    </tr>
159
	<tr>
160
		<td><label for="f26">26-31 - Date of report</label></td>
161
		<td><input type="text" name="f26" id="f26" maxlength="6" size="7" value="[% f26 %]" /></td>
162
	</tr>
163
</table>
164
<fieldset class="action"><input type="submit" value="OK" /> <a href="#" class="cancel close">Cancel</a></fieldset>
165
</form>
166
<script type="text/javascript">//<![CDATA[
167
function report() {
168
            var doc   = opener.document;
169
            var field = doc.getElementById("[% index %]");
170
171
            field.value =
172
			document.f_pop.f1.value+
173
			document.f_pop.f6.value+
174
			document.f_pop.f7.value+
175
			(document.f_pop.f8.value + '    ').substr(0, 4)+
176
			document.f_pop.f12.value+
177
			document.f_pop.f13.value+
178
			document.f_pop.f14.value+
179
			document.f_pop.f15.value+
180
			document.f_pop.f16.value+
181
			(document.f_pop.f17.value + '   ').substr(0, 3)+
182
			document.f_pop.f20.value+
183
			document.f_pop.f21.value+
184
			(document.f_pop.f22.value + '   ').substr(0, 3)+
185
			document.f_pop.f25.value+
186
			document.f_pop.f26.value;
187
		self.close();
188
		return false;
189
	}
190
	//]]>
191
</script>
192
193
[% INCLUDE 'popup-bottom.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_leader_holdings.tt (+105 lines)
Line 0 Link Here
1
[% INCLUDE 'doc-head-open.inc' %]
2
<title>Koha &rsaquo; Holdings &rsaquo; 000 - Leader builder</title>
3
[% INCLUDE 'doc-head-close.inc' %]
4
</head>
5
<body id="cat_marc21_leader_holdings" class="cat" style="padding:1em;">
6
<form name="f_pop" onsubmit="report()" action="">
7
<input type="hidden" name="plugin_name" value="marc21_leader_holdings.pl" />
8
<h3>000 - Leader</h3>
9
<table>
10
	<tr>
11
        <td><span class="label">0-4 Record size</span></td>
12
		<td>(auto-filled)</td>
13
	</tr>
14
	<tr>
15
		<td><label for="f5">5 - Record status</label></td>
16
		<td>
17
			<select name="f5" id="f5" size="1">
18
				<option value="c"[% IF ( f5c ) %] selected="selected"[% END %]>c - Corrected or revised</option>
19
				<option value="d"[% IF ( f5d ) %] selected="selected"[% END %]>d - Deleted</option>
20
				<option value="n"[% IF ( f5n ) %] selected="selected"[% END %]>n - New</option>
21
			</select>
22
		</td>
23
	</tr>
24
	<tr>
25
		<td><label for="f6">6 - Type of record</label></td>
26
		<td>
27
			<select name="f6" id="f6" size="1">
28
				<option value="u"[% IF ( f6u ) %] selected="selected"[% END %]>u - Unknown</option>
29
				<option value="v"[% IF ( f6v ) %] selected="selected"[% END %]>v - Multipart item holdings</option>
30
				<option value="x"[% IF ( f6x ) %] selected="selected"[% END %]>x - Single-part item holdings</option>
31
				<option value="y"[% IF ( f6y ) %] selected="selected"[% END %]>y - Serial item holdings</option>
32
			</select>
33
		</td>
34
	</tr>
35
    <tr>
36
        <tr>07-08 - Undefined</tr>
37
        <tr>  </tr>
38
    </tr>
39
	<tr>
40
		<td>9 - Character coding scheme</td>
41
		<td>a - UCS/Unicode (auto-filled)</td>
42
	</tr>
43
	<tr>
44
		<td>10-16 - indicator/subfields/size</td>
45
		<td>(auto-filled)</td>
46
    </tr>
47
	<tr>
48
		<td><label for="f17">17 - Encoding level</label></td>
49
		<td>
50
			<select name="f17" id="f17" size="1">
51
                <option value="1"[% IF ( f171 ) %] selected="selected"[% END %]>1 - Holdings level 1</option>
52
                <option value="2"[% IF ( f172 ) %] selected="selected"[% END %]>2 - Holdings level 2</option>
53
                <option value="3"[% IF ( f173 ) %] selected="selected"[% END %]>3 - Holdings level 3</option>
54
                <option value="4"[% IF ( f174 ) %] selected="selected"[% END %]>4 - Holdings level 4</option>
55
                <option value="5"[% IF ( f175 ) %] selected="selected"[% END %]>5 - Holdings level 4 with piece designation</option>
56
                <option value="m"[% IF ( f17m ) %] selected="selected"[% END %]>m - Mixed level</option>
57
                <option value="u"[% IF ( f17u ) %] selected="selected"[% END %]>u - Unknown</option>
58
                <option value="z"[% IF ( f17z ) %] selected="selected"[% END %]>z - Other level</option>
59
			</select>
60
		</td>
61
	</tr>
62
	<tr>
63
		<td><label for="f18">18 - Item information in record</label></td>
64
		<td>
65
			<select name="f18" id="f18" size="1">
66
                <option value="i"[% IF ( f18i ) %] selected="selected"[% END %]>i - Item information</option>
67
                <option value="n"[% IF ( f18n ) %] selected="selected"[% END %]>n - No item information</option>
68
			</select>
69
		</td>
70
	</tr>
71
	<tr>
72
		<td>19 - Undefined</td>
73
		<td></td>
74
    </tr>
75
	<tr>
76
		<td>20-24 - entry map &amp; lengths</td>
77
		<td>(auto-filled)</td>
78
	</tr>
79
80
</table>
81
<fieldset class="action"><input type="submit" value="OK" /> <a href="#" class="cancel close">Cancel</a></fieldset>
82
</form>
83
<script type="text/javascript">
84
//<![CDATA[
85
function report() {
86
            var doc   = opener.document;
87
            var field = doc.getElementById("[% index %]");
88
89
            field.value =
90
			'     '+
91
			document.f_pop.f5.value+
92
			document.f_pop.f6.value+
93
			'  '+
94
			'a'+ // MARC21 UNICODE flag - must be 'a' for Koha
95
			'22     '+
96
			document.f_pop.f17.value+
97
			document.f_pop.f18.value+
98
			' '+
99
			'4500';
100
		self.close();
101
		return false;
102
	}
103
	//]]>
104
</script>
105
[% INCLUDE 'popup-bottom.inc' %]
(-)a/koha-tmpl/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 | html %]&amp;biblionumber=[% loopro.biblionumber | html %]&amp;bi=[% loopro.biblioitemnumber | html %]#item[% loopro.object | html %]">Item [% loopro.object | html %]</a>
230
                                                        <a href="/cgi-bin/koha/catalogue/moredetail.pl?item=[% loopro.object | html %]&amp;biblionumber=[% loopro.biblionumber | html %]&amp;bi=[% loopro.biblioitemnumber | html %]#item[% loopro.object | html %]">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 | html %]" title="Display detail for this biblio">Biblio [% loopro.object | html %]</a>
232
                                                        <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% loopro.object | html %]" 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 | html %]" 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 675-680 Link Here
675
                                [% END %]
676
                                [% END %]
676
                            [% END %]
677
                            [% END %]
677
                        [% END # IF itemloop.size %]
678
                        [% END # IF itemloop.size %]
679
                        [% IF summary_holdings %]
680
                            [% FOREACH holding IN summary_holdings %]
681
                                [% UNLESS holding.suppress %]
682
                                    [% holding_details = Holdings.GetDetails(holding) %]
683
                                    [% IF holding_details.public_note || holding_details.summary || holding_details.supplements || holding_details.indexes %]
684
                                        <span class="summary-holdings">
685
                                            <br>
686
                                            <strong>Additional information for [% Holdings.GetLocation(holding, 1) | html %]</strong>
687
                                            <ul>
688
                                                [% IF holding_details.public_note %]
689
                                                    <li>Public note: [% holding_details.public_note | html %]</li>
690
                                                [% END %]
691
                                                [% IF holding_details.summary %]
692
                                                    <li>Summary: [% holding_details.summary | html %]</li>
693
                                                [% END %]
694
                                                [% IF holding_details.supplements %]
695
                                                    <li>Supplements: [% holding_details.supplements | html %]</li>
696
                                                [% END %]
697
                                                [% IF holding_details.indexes %]
698
                                                    <li>Indexes: [% holding_details.indexes | html %]</li>
699
                                                [% END %]
700
                                            </ul>
701
                                        </span>
702
                                    [% END %]
703
                                [% END %]
704
                            [% END %]
705
                        [% END %]
678
                        [% PROCESS 'shelfbrowser.inc' %]
706
                        [% PROCESS 'shelfbrowser.inc' %]
679
                        [% INCLUDE shelfbrowser tab='holdings' %]
707
                        [% INCLUDE shelfbrowser tab='holdings' %]
680
                        <br style="clear:both;" />
708
                        <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
7
Lines 398-403 Link Here
398
                                                                    [% END %]
399
                                                                    [% END %]
399
                                                                [% ELSE %]
400
                                                                [% ELSE %]
400
                                                                    <span class="unavailable">No items available:</span>
401
                                                                    <span class="unavailable">No items available:</span>
402
                                                                    [% IF ( SEARCH_RESULT.summary_holdings ) %]
403
                                                                        <span class="summary-holdings">
404
                                                                            [% FOREACH holding IN SEARCH_RESULT.summary_holdings %]
405
                                                                                [% UNLESS holding.suppress %]
406
                                                                                    [% Holdings.GetLocation(holding, 1) | html %],
407
                                                                                [% END %]
408
                                                                            [% END %]
409
                                                                        </span>
410
                                                                    [% END %]
401
                                                                [% END %]
411
                                                                [% END %]
402
                                                            [% END # / IF SEARCH_RESULT.available_items_loop.size %]
412
                                                            [% END # / IF SEARCH_RESULT.available_items_loop.size %]
403
413
(-)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 734-739 if (scalar(@itemloop) == 0 || scalar(@otheritemloop) == 0) { Link Here
734
    }
734
    }
735
}
735
}
736
736
737
# Fetch summary holdings
738
if (C4::Context->preference('SummaryHoldings')) {
739
    my $summary_holdings = C4::Holdings::GetHoldingsByBiblionumber($biblionumber);
740
    $template->param( summary_holdings => $summary_holdings );
741
}
742
743
737
## get notes and subjects from MARC record
744
## get notes and subjects from MARC record
738
if (!C4::Context->preference("OPACXSLTDetailsDisplay") ) {
745
if (!C4::Context->preference("OPACXSLTDetailsDisplay") ) {
739
    my $marcisbnsarray   = GetMarcISBN    ($record,$marcflavour);
746
    my $marcisbnsarray   = GetMarcISBN    ($record,$marcflavour);
740
- 

Return to bug 20447