HPM config
authorMarijana Glavica <mglavica@ffzg.hr>
Thu, 24 Jul 2014 15:59:20 +0000 (17:59 +0200)
committerMarijana Glavica <mglavica@ffzg.hr>
Thu, 24 Jul 2014 15:59:20 +0000 (17:59 +0200)
conf/hpm/knjige.pl

index f4d88ee..78f2fe2 100644 (file)
@@ -371,7 +371,7 @@ marc_compose('245',
        'b', suffix(
                ( rec('200','e') && rec('200','f') ) ? ' /' : 
                ( rec('200','e') && rec('200','h') && ! rec('200','f') ) ? '.'  : 
-                       '.',
+                       '',
                        rec('200','e'),
        ),
        'b', suffix(
@@ -736,30 +736,39 @@ marc('942','b',
        'LIB'
 );
 
-if ( rec('245') =~ m/Elektronička građa/ ) {
+my $keyword = dump( rec('610') );
+my $itype;
+
+if ( rec('200','a') =~ m/Elektroni/ ) {
        marc('942','c',
                'CD'
        );
-} elsif ( rec('610') =~ m/disertacija/ ) {
+       $itype = 'CD';
+} elsif ( $keyword =~ m/disertacija/ ) {
        marc('942','c',
                'DIS'
        );
-} elsif ( rec('610') =~ m/magistarski/ ) {
+       $itype = 'DIS';
+} elsif ( $keyword =~ m/magistarski/ ) {
        marc('942','c',
                'MAG'
        );
+       $itype = 'MAG';
 } elsif ( rec('990') =~ m/(separat|posebni)/ ) {
        marc('942','c',
                'SEP'
        );
+       $itype = 'SEP';
 } elsif ( rec('990') =~ m/starih/ ) {
        marc('942','c',
                'OLD'
        );
+       $itype = 'OLD';
 } else {
        marc('942','c',
                'BOOK'
        );
+       $itype = 'BOOK';
 }
 
 # HPM local
@@ -777,11 +786,68 @@ marc('993','a',
 
 # Items
 
-marc('952','e',
-       rec('991','a')
-);
-marc('952','t',
-       rec('991','b')
-);
+#marc('952','a',
+#      'HPM'
+#);
+#marc('952','b',
+#      'HPM'
+#);
+#marc('952','e',
+#      rec('991','a')
+#);
+#marc('952','o',
+#      rec('990')
+#);
+#marc('952','t',
+#      rec('991','b')
+#);
+
+my $copynumber = rec('991','b') ;
+my $callnumber = rec('990') ;
+
+my $location = rec('992');
+my $location_konv = {
+       'ZB, Min. odjel i Geol. odjel, HPrM' => 'ZB',
+       'ZB, Min. odjel i Geol. odjel, HPM' => 'ZB',
+       'ZB i Min. odjel, HPrM' => 'ZB',
+       'ZB i Min. odjel, HPM' => 'ZB',
+       'ZB i Geol. odjel, HPrM' => 'ZB',
+       'ZB i Geol. odjel, HPM' => 'ZB',
+       'ZB, HRrM' => 'ZB',
+       'ZB, HrPM' => 'ZB',
+       'ZB, HPrM' => 'ZB',
+       'ZB, HPM' => 'ZB',
+       'ZB, Geol. odjel i Min. odjel, HPM' => 'ZB',
+       'Min. odjel i ZB, HPM' => 'ZB',
+       'Min. odjel i Geol. odjel, HPrM' => 'MP',
+       'Min. odjel i Geol. odjel, HPM' => 'MP',
+       'Min. odjel, HPrM' => 'MP',
+       'Min. odjel, HPM' => 'MP',
+       'Min. odjel' => 'MP',
+       'Institut Makarska' => 'ZB',
+       'Geol. odjel i ZB, HPM' => 'ZB',
+       'Geol. odjel i Min. odjel, HPM' => 'MP',
+       'Geol. odjel, HPrM' => 'GP',
+       'Geol. odjel, HPM' => 'GP'
+};
+
+#dump ( $itype );
+
+if ( rec('991','a') ) {
+       foreach my $repeat ( rec_array('991') ) {
+               my $sf_a = $repeat->{a} || die "991 doesn't have a ", dump( $repeat );
+               if ( my $sf_b = $repeat->{b} ) {
+                       $sf_b || die "no inv";
+                       marc_compose('952',
+                               'a' => 'HPM',
+                               'b' => 'HPM',
+                               'c' => $location_konv->{$location},
+                               't' => $sf_b,
+                               'o' => $callnumber,
+                               'y' => $itype
+                       );
+               }
+       }
+}
 
-} # polje 200a
+} # polje 201a