Apply patch dd134fdd181664e285e935371c92e03c9a2c065b from marc_export_custom to marc_...
[sitka/sitka-tools.git] / marc_export_custom / marc_export_custom_ms
index ac6adf0..fb9a4d5 100755 (executable)
@@ -531,14 +531,14 @@ sub add_bib_holdings {
                             if($localcfg->{$cfgparam}){
                                 # this little line is just forcing scalars into an array so we can 'use strict' with Config::Simple
                                 my @flags = ( (ref($localcfg->{$cfgparam}) eq "ARRAY") ? @{$localcfg->{$cfgparam}} : ($localcfg->{$cfgparam}));
-                                if( grep { $_ eq 'reference' } @flags && $cp->ref eq 't')
+                                if(grep( { $_ eq 'reference' } @flags) && ($cp->ref eq 't'))
                                 { skipnote($bib->id,"Flags: reference"); next COPYMAP; } 
-                                elsif( grep { $_ eq 'unholdable' } @flags && $cp->holdable eq 'f')
+                                if(grep( { $_ eq 'unholdable' } @flags) && ($cp->holdable eq 'f'))
                                 { skipnote($bib->id,"Flags: unholdable"); next COPYMAP; } 
-                                elsif( grep { $_ eq 'circulate' } @flags && $cp->circulate eq 'f')
+                                if(grep( { $_ eq 'circulate' } @flags) && ($cp->circulate eq 'f'))
                                 { skipnote($bib->id,"Flags: circulate"); next COPYMAP; } 
-                                elsif( grep { $_ eq 'hidden' } @flags && $cp->opac_visible eq 'f')
-                                { skipnote($bib->id,"Flags: hidden"); next COPYMAP; } 
+                                if(grep( { $_ eq 'hidden' } @flags) && ($cp->opac_visible eq 'f'))
+                                { skipnote($bib->id,"Flags: hidden"); next COPYMAP; }
                             }
 
                             # Excluded Circ Modifiers
@@ -546,7 +546,7 @@ sub add_bib_holdings {
                             if($localcfg->{$cfgparam}){
                                 my $circmod = $cp->circ_modifier || "";
                                 my @circmods = ( (ref($localcfg->{$cfgparam}) eq "ARRAY") ? @{$localcfg->{$cfgparam}} : ($localcfg->{$cfgparam}) );
-                                if( grep { $_ eq $circmod } @circmods && @circmods)
+                                if(grep( { $_ eq $circmod } @circmods) && @circmods)
                                 { skipnote($bib->id,$cfgparam); next COPYMAP; } 
                             }
                             # Inverse rule -- only include specified Circ Mods
@@ -554,28 +554,28 @@ sub add_bib_holdings {
                             if($localcfg->{$cfgparam}){
                                 my $circmod = $cp->circ_modifier || "";
                                 my @circmods = ( (ref($localcfg->{$cfgparam}) eq "ARRAY") ? @{$localcfg->{$cfgparam}} : ($localcfg->{$cfgparam}) );
-                                unless( grep { $_ and $_ eq $circmod } @circmods && @circmods)
+                                unless(grep( { $_ and $_ eq $circmod } @circmods) && @circmods)
                                 { skipnote($bib->id,$cfgparam); next COPYMAP; } 
                             }
                             # Excluded Copy Statuses
                             $cfgparam = 'Statuses'; 
                             if($localcfg->{$cfgparam}){
                                 my @statuses = ( (ref($localcfg->{$cfgparam}) eq "ARRAY") ? @{$localcfg->{$cfgparam}} : ($localcfg->{$cfgparam}) );
-                                if( grep { $_ eq $statuses{$cp->status}->name } @statuses && @statuses)
+                                if(grep( { $_ eq $statuses{$cp->status}->name } @statuses) && @statuses)
                                 { skipnote($bib->id,$cfgparam); next COPYMAP; } 
                             }
                             # Excluded Locations
                             $cfgparam = 'Locations'; 
                             if($localcfg->{$cfgparam}){
                                 my @locations = ( (ref($localcfg->{$cfgparam}) eq "ARRAY") ? @{$localcfg->{$cfgparam}} : ($localcfg->{$cfgparam}) );
-                                if( grep { $_ eq $shelves{$cp->location}->name } @locations && @locations)
+                                if(grep( { $_ eq $shelves{$cp->location}->name } @locations) && @locations)
                                 { skipnote($bib->id,$cfgparam); next COPYMAP; }
                             }
                             # Inverse rule - Only use the specified locations
                             $cfgparam = 'OnlyIncludeLocations'; 
                             if($localcfg->{$cfgparam}){
                                 my @locations = ( (ref($localcfg->{$cfgparam}) eq "ARRAY") ? @{$localcfg->{$cfgparam}} : ($localcfg->{'Locations'}) );
-                                unless( grep { $_ eq $shelves{$cp->location}->name } @locations && @locations)
+                                unless(grep( { $_ eq $shelves{$cp->location}->name } @locations) && @locations)
                                 { skipnote($bib->id,$cfgparam); next COPYMAP; } 
                             }
                             # exclude based on a regex match to location names
@@ -583,7 +583,7 @@ sub add_bib_holdings {
                             if($localcfg->{$cfgparam}){
                                 my @locregex = ( (ref($localcfg->{$cfgparam}) eq "ARRAY") ? @{$localcfg->{$cfgparam}} : ($localcfg->{$cfgparam}) );
                                 my $reg = $localcfg->{$cfgparam};
-                                if( grep { $shelves{$cp->location}->name =~ m/($reg)/ } @locregex && @locregex)
+                                if(grep( { $shelves{$cp->location}->name =~ m/($reg)/ } @locregex) && @locregex)
                                 { skipnote($bib->id,$cfgparam); next COPYMAP; }
                             }
                             # include based on a regex match to location names
@@ -591,7 +591,7 @@ sub add_bib_holdings {
                             if($localcfg->{$cfgparam}){
                                 my @locregex = ( (ref($localcfg->{$cfgparam}) eq "ARRAY") ? @{$localcfg->{$cfgparam}} : ($localcfg->{$cfgparam}) );
                                 my $reg = $localcfg->{$cfgparam};
-                                unless( grep { $shelves{$cp->location}->name =~ m/($reg)/ } @locregex && @locregex)
+                                unless(grep( { $shelves{$cp->location}->name =~ m/($reg)/ } @locregex) && @locregex)
                                 { skipnote($bib->id,$cfgparam); next COPYMAP; } 
                             }
                             # Exclude based on a callno regex
@@ -599,7 +599,7 @@ sub add_bib_holdings {
                             if($localcfg->{$cfgparam}){
                                 my @callnoregex = ( (ref($localcfg->{$cfgparam}) eq "ARRAY") ? @{$localcfg->{$cfgparam}} : ($localcfg->{$cfgparam}) );
                                 my $reg = $localcfg->{$cfgparam};
-                                if( grep { $cn->label =~ m/($reg)/ } @callnoregex && @callnoregex)
+                                if(grep( { $cn->label =~ m/($reg)/ } @callnoregex) && @callnoregex)
                                 { skipnote($bib->id,$cfgparam); next COPYMAP; }
                             }
                             # Include based on a callno regex
@@ -607,7 +607,7 @@ sub add_bib_holdings {
                             if($localcfg->{$cfgparam}){
                                 my @callnoregex = ( (ref($localcfg->{$cfgparam}) eq "ARRAY") ? @{$localcfg->{$cfgparam}} : ($localcfg->{$cfgparam}) );
                                 my $reg = $localcfg->{$cfgparam};
-                                unless( grep { $cn->label =~ m/($reg)/ } @callnoregex && @callnoregex)
+                                unless(grep( { $cn->label =~ m/($reg)/ } @callnoregex) && @callnoregex)
                                 { skipnote($bib->id,$cfgparam); next COPYMAP; } 
                             }