# Modified 2008 by BibLibre for Koha
# Modified 2011 by Catalyst
# Modified 2011 by Equinox Software, Inc.
+# Modified 2016 by Universidad de El Salvador
#
# This file is part of Koha.
#
use List::MoreUtils qw/uniq/;
use vars qw(@ISA @EXPORT);
-use C4::Biblio qw(GetMarcSubfieldStructureFromKohaField);
use Koha::SimpleMARC qw(read_field);
## of the leader of a MARC record, the values are the RIS types
## that might appropriately represent these types.
my %ustypehash = (
- "a" => "BOOK",
- "c" => "MUSIC",
- "d" => "MUSIC",
- "e" => "MAP",
- "f" => "MAP",
- "g" => "ADVS",
- "i" => "SOUND",
- "j" => "SOUND",
- "k" => "ART",
- "m" => "DATA",
- "o" => "GEN",
- "p" => "GEN",
- "r" => "ART",
- "t" => "GEN",
- );
-
+ "a" => "BOOK",
+ "c" => "MUSIC",
+ "d" => "MUSIC",
+ "e" => "MAP",
+ "f" => "MAP",
+ "g" => "ADVS",
+ "i" => "SOUND",
+ "j" => "SOUND",
+ "k" => "ART",
+ "m" => "DATA",
+ "o" => "GEN",
+ "p" => "GEN",
+ "r" => "ART",
+ "t" => "MANSCPT",
+ );
+
my %unitypehash = (
- "a" => "BOOK",
- "b" => "BOOK",
- "c" => "MUSIC",
- "d" => "MUSIC",
- "e" => "MAP",
- "f" => "MAP",
- "g" => "ADVS",
- "i" => "SOUND",
- "j" => "SOUND",
- "k" => "ART",
- "l" => "ELEC",
- "m" => "ADVS",
- "r" => "ART",
- );
-
+ "a" => "BOOK",
+ "b" => "MANSCPT",
+ "c" => "MUSIC",
+ "d" => "MUSIC",
+ "e" => "MAP",
+ "f" => "MAP",
+ "g" => "ADVS",
+ "i" => "SOUND",
+ "j" => "SOUND",
+ "k" => "ART",
+ "l" => "ELEC",
+ "m" => "GEN",
+ "r" => "ART",
+ );
+
## The type of a MARC record is found at position 06 of the leader
my $typeofrecord = defined($leader) && length $leader >=6 ?
substr($leader, 6, 1): undef;
+ ## Pos 07 == Bibliographic level
+ my $biblevel = defined($leader) && length $leader >=7 ?
+ substr($leader, 7, 1): '';
- ## ToDo: for books, field 008 positions 24-27 might have a few more
+ ## TODO: for books, field 008 positions 24-27 might have a few more
## hints
my %typehash;
}
if (!defined $typeofrecord || !exists $typehash{$typeofrecord}) {
- print "TY - BOOK\r\n"; ## most reasonable default
- warn ("no type found - assume BOOK") if $marcprint;
- }
- else {
- print "TY - $typehash{$typeofrecord}\r\n";
+ print "TY - GEN\r\n"; ## most reasonable default
+ warn ("no type found - assume GEN") if $marcprint;
+ } elsif ( $typeofrecord =~ "a" ) {
+ if ( $biblevel eq 'a' ) {
+ print "TY - GEN\r\n"; ## monographic component part
+ } elsif ( $biblevel eq 'b' || $biblevel eq 's' ) {
+ print "TY - SER\r\n"; ## serial or serial component part
+ } elsif ( $biblevel eq 'm' ) {
+ print "TY - $typehash{$typeofrecord}\r\n"; ## book
+ } elsif ( $biblevel eq 'c' || $biblevel eq 'd' ) {
+ print "TY - GEN\r\n"; ## collections, part of collections or made-up collections
+ } elsif ( $biblevel eq 'i' ) {
+ print "TY - DATA\r\n"; ## updating loose-leafe as Dataset
+ }
+ } else {
+ print "TY - $typehash{$typeofrecord}\r\n";
}
## use $typeofrecord as the return value, just in case
## be written and designated. The field is free-form and resistant
## to all parsing efforts, so this information is lost on me
}
+ return;
}
##********************************************************************
}
}
}
+ return;
}
##********************************************************************