$opts{'timeout'} = 0;
$opts{'config'} = '@sysconfdir@/opensrf_core.xml';
$opts{'store'} = 'reporter';
+ $opts{'852b'} = 'both';
GetOptions(\%opts,
'help',
'items',
+ '852b=s',
'exclude-hidden',
'mfhd',
'all',
Additional options for type = 'BIBLIO':
--items or -i Include items (holdings) in the output
+ --852b Accepts 'owning_lib', 'circ_lib', or 'both' to
+ control whether the 852$b in exported embedded
+ holdings has the owning library, the circulation
+ library, or both in separate repeats of the $b.
+ If not supplied, defaults to 'both', which is the
+ legacy behavior.
--money Currency symbol to use in item price field [\$]
--mfhd Export serial MFHD records for associated bib records
Not compatible with --format=BRE
}
}
+ if ($opts{'852b'} ne 'circ_lib' &&
+ $opts{'852b'} ne 'owning_lib' &&
+ $opts{'852b'} ne 'both') {
+ die "Invalid value '" . $opts{'852b'} . "' for --852b; must be 'circ_lib', 'owning_lib', or 'both'";
+ }
+
$opts{store} = lc($opts{store});
if (none {$_ eq $opts{store}} (STORES)) {
die "Please select a supported store. ".
. shift;
warn($message);
};
+
+ my @sfb = ();
+ my $f852b_option = $Marque::config->option_value('852b');
+ if ($f852b_option eq 'owning_lib') {
+ @sfb = (
+ b => Encode::decode_utf8($acp->call_number()->owning_lib()->shortname()),
+ );
+ } elsif ($f852b_option eq 'circ_lib') {
+ @sfb = (
+ b => Encode::decode_utf8($acp->circ_lib()->shortname()),
+ );
+ } else {
+ @sfb = (
+ b => Encode::decode_utf8($acp->call_number()->owning_lib()->shortname()),
+ b => Encode::decode_utf8($acp->circ_lib()->shortname()),
+ );
+ }
+
$marc->insert_grouped_field(
MARC::Field->new(
'852', '4', ' ',
($location ? ('a' => $location) : ()),
- b => Encode::decode_utf8($acp->call_number()->owning_lib()->shortname()),
- b => Encode::decode_utf8($acp->circ_lib()->shortname()),
+ @sfb,
c => Encode::decode_utf8($acp->location()->name()),
($prefix ? (k => Encode::decode_utf8($prefix)) : ()),
j => Encode::decode_utf8($acp->call_number()->label()),
--- /dev/null
+== --852 option for marc_export ==
+
+The new `--852b` switch (when used in conjunction with `--items`)
+takes the following values:
+
+ * circ_lib - emit the item circulation library in 852$b
+ * owning_lib - emit the owning library in 852$b
+ * both - emit owning lib and circ lib as separate repeats
+ of $b. This is both the default and legacy behavior.
+
+[source]
+--------
+ --852b Accepts 'owning_lib', 'circ_lib', or 'both' to
+ control whether the 852 in exported embedded
+ holdings has the owning library, the circulation
+ library, or both in separate repeats of the .
+ If not supplied, defaults to 'both', which is the
+ legacy behavior.
+--------