Lines 41-46
package C4::Ris;
Link Here
|
41 |
# Modified 2008 by BibLibre for Koha |
41 |
# Modified 2008 by BibLibre for Koha |
42 |
# Modified 2011 by Catalyst |
42 |
# Modified 2011 by Catalyst |
43 |
# Modified 2011 by Equinox Software, Inc. |
43 |
# Modified 2011 by Equinox Software, Inc. |
|
|
44 |
# Modified 2016 by Universidad de El Salvador |
44 |
# |
45 |
# |
45 |
# This file is part of Koha. |
46 |
# This file is part of Koha. |
46 |
# |
47 |
# |
Lines 349-389
sub print_typetag {
Link Here
|
349 |
## of the leader of a MARC record, the values are the RIS types |
350 |
## of the leader of a MARC record, the values are the RIS types |
350 |
## that might appropriately represent these types. |
351 |
## that might appropriately represent these types. |
351 |
my %ustypehash = ( |
352 |
my %ustypehash = ( |
352 |
"a" => "BOOK", |
353 |
"a" => "BOOK", |
353 |
"c" => "MUSIC", |
354 |
"c" => "MUSIC", |
354 |
"d" => "MUSIC", |
355 |
"d" => "MUSIC", |
355 |
"e" => "MAP", |
356 |
"e" => "MAP", |
356 |
"f" => "MAP", |
357 |
"f" => "MAP", |
357 |
"g" => "ADVS", |
358 |
"g" => "ADVS", |
358 |
"i" => "SOUND", |
359 |
"i" => "SOUND", |
359 |
"j" => "SOUND", |
360 |
"j" => "SOUND", |
360 |
"k" => "ART", |
361 |
"k" => "ART", |
361 |
"m" => "DATA", |
362 |
"m" => "DATA", |
362 |
"o" => "GEN", |
363 |
"o" => "GEN", |
363 |
"p" => "GEN", |
364 |
"p" => "GEN", |
364 |
"r" => "ART", |
365 |
"r" => "ART", |
365 |
"t" => "GEN", |
366 |
"t" => "MANSCPT", |
366 |
); |
367 |
); |
367 |
|
368 |
|
368 |
my %unitypehash = ( |
369 |
my %unitypehash = ( |
369 |
"a" => "BOOK", |
370 |
"a" => "BOOK", |
370 |
"b" => "BOOK", |
371 |
"b" => "MANSCPT", |
371 |
"c" => "MUSIC", |
372 |
"c" => "MUSIC", |
372 |
"d" => "MUSIC", |
373 |
"d" => "MUSIC", |
373 |
"e" => "MAP", |
374 |
"e" => "MAP", |
374 |
"f" => "MAP", |
375 |
"f" => "MAP", |
375 |
"g" => "ADVS", |
376 |
"g" => "ADVS", |
376 |
"i" => "SOUND", |
377 |
"i" => "SOUND", |
377 |
"j" => "SOUND", |
378 |
"j" => "SOUND", |
378 |
"k" => "ART", |
379 |
"k" => "ART", |
379 |
"l" => "ELEC", |
380 |
"l" => "ELEC", |
380 |
"m" => "ADVS", |
381 |
"m" => "GEN", |
381 |
"r" => "ART", |
382 |
"r" => "ART", |
382 |
); |
383 |
); |
383 |
|
384 |
|
384 |
## The type of a MARC record is found at position 06 of the leader |
385 |
## The type of a MARC record is found at position 06 of the leader |
385 |
my $typeofrecord = defined($leader) && length $leader >=6 ? |
386 |
my $typeofrecord = defined($leader) && length $leader >=6 ? |
386 |
substr($leader, 6, 1): undef; |
387 |
substr($leader, 6, 1): undef; |
|
|
388 |
my $typeofrecord2 = defined($leader) && length $leader >=6 ? |
389 |
substr($leader, 7, 1): undef; |
387 |
|
390 |
|
388 |
## ToDo: for books, field 008 positions 24-27 might have a few more |
391 |
## ToDo: for books, field 008 positions 24-27 might have a few more |
389 |
## hints |
392 |
## hints |
Lines 399-409
sub print_typetag {
Link Here
|
399 |
} |
402 |
} |
400 |
|
403 |
|
401 |
if (!defined $typeofrecord || !exists $typehash{$typeofrecord}) { |
404 |
if (!defined $typeofrecord || !exists $typehash{$typeofrecord}) { |
402 |
print "TY - BOOK\r\n"; ## most reasonable default |
405 |
print "TY - GEN\r\n"; ## most reasonable default |
403 |
warn ("no type found - assume BOOK") if $marcprint; |
406 |
warn ("no type found - assume GEN") if $marcprint; |
404 |
} |
407 |
} elsif ( $typeofrecord =~ "a" ) { |
405 |
else { |
408 |
if ( $typeofrecord2 =~ "a" ) { |
406 |
print "TY - $typehash{$typeofrecord}\r\n"; |
409 |
print "TY - GEN\r\n"; ## monographic component part |
|
|
410 |
} elsif ( $typeofrecord2 =~ "b" || $typeofrecord2 =~ "s" ) { |
411 |
print "TY - SER\r\n"; ## serial or serial component part |
412 |
} elsif ( $typeofrecord2 =~ "m" ) { |
413 |
print "TY - $typehash{$typeofrecord}\r\n"; ## book |
414 |
} elsif ( $typeofrecord2 =~ "c" || $typeofrecord2 =~ "d" ) { |
415 |
print "TY - GEN\r\n"; ## collections, part of collections or made-up collections |
416 |
} elsif ( $typeofrecord2 =~ "i" ) { |
417 |
print "TY - DATA\r\n"; ## updating loose-leafe as Dataset |
418 |
} |
419 |
} else { |
420 |
print "TY - $typehash{$typeofrecord}\r\n"; |
407 |
} |
421 |
} |
408 |
|
422 |
|
409 |
## use $typeofrecord as the return value, just in case |
423 |
## use $typeofrecord as the return value, just in case |
410 |
- |
|
|