my ($exclusion_ini,$collapse_to_depth, $output_file);
my $cfg;
my $force901;
+my $onlyholdings;
GetOptions(
'help' => \$help,
'force901' => \$force901,
'exclusion_ini=s' => \$exclusion_ini,
'collapse_to_depth=i' => \$collapse_to_depth,
+ 'onlyholdings' => \$onlyholdings,
'output-file=s' => \$output_file,
);
my $r = MARC::Record->new_from_xml( $bib->marc, $encoding, $format );
if ($type eq 'biblio') {
- # Remove old 852 fields
- my @f = $r->field('852');
- $r->delete_fields(@f) if @f;
- # Add new 852 fields
- add_bib_holdings($bib, $r);
- # Check that at least one 852 was added
- @f = $r->field('852');
- # If not, we should NOT add this item to the export
- return unless @f;
+
+ if($onlyholdings){
+ # Remove old 852 fields
+ my @f = $r->field('852');
+ $r->delete_fields(@f) if @f;
+ # Add new 852 fields
+ add_bib_holdings($bib, $r);
+ # Check that at least one 852 was added
+ @f = $r->field('852');
+ # If not, we should NOT add this item to the export
+ return unless @f;
+ } else {
+ add_bib_holdings($bib, $r);
+ }
}
if($force901){