|
Lines 3712-3722
sub BatchModField {
Link Here
|
| 3712 |
return 1; |
3712 |
return 1; |
| 3713 |
} else { |
3713 |
} else { |
| 3714 |
my $done=0; |
3714 |
my $done=0; |
|
|
3715 |
if ($field eq '000') { |
| 3716 |
my $value=$record->leader(); |
| 3717 |
if ($value=~ s/$condition/$repval/){ |
| 3718 |
$record->leader($repval); |
| 3719 |
$done=1; |
| 3720 |
} |
| 3721 |
if ( $nocond eq 'true'){ |
| 3722 |
$record->leader($repval); |
| 3723 |
$done=1; |
| 3724 |
} |
| 3725 |
} |
| 3715 |
for my $rfield ($record->field($field)) { |
3726 |
for my $rfield ($record->field($field)) { |
| 3716 |
if ($subfield && $subfield ne "@"){ |
3727 |
if ($subfield && $subfield ne "@"){ |
| 3717 |
my @subfields = $rfield->subfields(); |
3728 |
my @subfields = $rfield->subfields(); |
| 3718 |
my @subfields_to_add; |
3729 |
my @subfields_to_add; |
| 3719 |
foreach my $subf (@subfields) { |
3730 |
foreach my $subf (@subfields) { |
| 3720 |
if ($subf->[0] eq $subfield){ |
3731 |
if ($subf->[0] eq $subfield){ |
| 3721 |
$subf->[1]=NormalizeString($subf->[1]); |
3732 |
$subf->[1]=NormalizeString($subf->[1]); |
| 3722 |
if ( $action eq "mod" ) { |
3733 |
if ( $action eq "mod" ) { |
|
Lines 3726-3733
sub BatchModField {
Link Here
|
| 3726 |
if ($nocond eq "true"){ |
3737 |
if ($nocond eq "true"){ |
| 3727 |
$subf->[1] = $repval; |
3738 |
$subf->[1] = $repval; |
| 3728 |
$done=1; |
3739 |
$done=1; |
| 3729 |
} |
3740 |
} |
| 3730 |
} elsif ( $action eq "del" ) { |
3741 |
} elsif ( $action eq "del" ) { |
| 3731 |
if ( $subf->[1] =~ m/$condition/ || $nocond eq "true" ) { |
3742 |
if ( $subf->[1] =~ m/$condition/ || $nocond eq "true" ) { |
| 3732 |
$done=1; |
3743 |
$done=1; |
| 3733 |
next; |
3744 |
next; |
|
Lines 3735-3745
sub BatchModField {
Link Here
|
| 3735 |
} |
3746 |
} |
| 3736 |
} |
3747 |
} |
| 3737 |
push @subfields_to_add,@$subf; |
3748 |
push @subfields_to_add,@$subf; |
| 3738 |
} |
3749 |
} |
| 3739 |
if ($done){ |
3750 |
if ($done){ |
| 3740 |
if (@subfields_to_add){ |
3751 |
if (@subfields_to_add){ |
| 3741 |
$rfield->replace_with(MARC::Field->new($rfield->tag,$rfield->indicator(1),$rfield->indicator(2),@subfields_to_add)); |
3752 |
$rfield->replace_with(MARC::Field->new($rfield->tag,$rfield->indicator(1),$rfield->indicator(2),@subfields_to_add)); |
| 3742 |
} |
3753 |
} |
| 3743 |
else { |
3754 |
else { |
| 3744 |
my $count= $record->delete_field($rfield); |
3755 |
my $count= $record->delete_field($rfield); |
| 3745 |
} |
3756 |
} |
|
Lines 3754-3761
sub BatchModField {
Link Here
|
| 3754 |
if ($field < 10){ |
3765 |
if ($field < 10){ |
| 3755 |
my $value=$record->field($field)->data(); |
3766 |
my $value=$record->field($field)->data(); |
| 3756 |
if ($value=~ s/$condition/$repval/){ |
3767 |
if ($value=~ s/$condition/$repval/){ |
| 3757 |
$record->field($field)->update($value); |
3768 |
$record->field($field)->update($value); |
| 3758 |
$done=1; |
3769 |
$done=1; |
| 3759 |
|
3770 |
|
| 3760 |
} |
3771 |
} |
| 3761 |
if ( $nocond eq 'true'){ |
3772 |
if ( $nocond eq 'true'){ |
| 3762 |
- |
|
|