Signed-off-by: Robin H. Johnson <rjohnson@sitka.bclibraries.ca>
my $cfg;
my $force901;
my $onlyholdings;
my $cfg;
my $force901;
my $onlyholdings;
+my $field852_4b_type = 'collapsed';
GetOptions(
'help' => \$help,
GetOptions(
'help' => \$help,
'onlyholdings' => \$onlyholdings,
'output-file=s' => \$output_file,
'quiet' => \$quiet,
'onlyholdings' => \$onlyholdings,
'output-file=s' => \$output_file,
'quiet' => \$quiet,
+ 'field-852-4b-type=s' => \$field852_4b_type,
);
if ($exclusion_ini) {
die "exclusion ini file does not exist" unless (-r $exclusion_ini and -s $exclusion_ini);
$cfg = new Config::Simple($exclusion_ini)
}
);
if ($exclusion_ini) {
die "exclusion ini file does not exist" unless (-r $exclusion_ini and -s $exclusion_ini);
$cfg = new Config::Simple($exclusion_ini)
}
+unless($field852_4b_type =~ /^(collapsed?|circ|owning)/) {
+ die sprintf("Invalid argument '%s' to --field-852-4b-type", $field852_4b_type);
+}
if ($help) {
print <<"HELP";
if ($help) {
print <<"HELP";
will be collapsed up to the parent org unit at the set depth
--onlyholdings Clean out 852s before adding new ones, and only export items that
successfully recieved an 852 field
will be collapsed up to the parent org unit at the set depth
--onlyholdings Clean out 852s before adding new ones, and only export items that
successfully recieved an 852 field
+ --field-852-4b-type TYPE TYPE IN 'circ', 'owning', 'collapsed' (default)
+ What library should be displayed in field 852 4\$b?
+ my $field_852_4b = undef;
+ if($field852_4b_type =~ /collapsed?/) {
+ $field_852_4b = $orgs{$printlib}->shortname;
+ } elsif($field852_4b_type == 'circ') {
+ $field_852_4b = $orgs{$circlib}->shortname;
+ } elsif($field852_4b_type == 'owning') {
+ $field_852_4b = $orgs{$owninglib}->shortname;
+ } else {
+ die "Should not have reached here, invalid \$field852_4b_type=${field852_4b_type}";
+ }
+
$r->append_fields(
MARC::Field->new(
852, '4', '',
a => $location,
$r->append_fields(
MARC::Field->new(
852, '4', '',
a => $location,
- b => $orgs{$printlib}->shortname,
- #b => $orgs{$owninglib}->shortname,
- #b => $orgs{$circlib}->shortname,
c => $shelves{$cp->location}->name,
j => $cn->label,
($cp->circ_modifier ? ( g => $cp->circ_modifier ) : ()),
c => $shelves{$cp->location}->name,
j => $cn->label,
($cp->circ_modifier ? ( g => $cp->circ_modifier ) : ()),