# Getting list of subfields to keep when restricted edition is enabled
my $subfieldsToAllowForRestrictedEdition = C4::Context->preference('SubfieldsToAllowForRestrictedEdition');
+ my $allowAllSubfields = (
+ not defined $subfieldsToAllowForRestrictedEdition
+ or $subfieldsToAllowForRestrictedEdition == q||
+ ) ? 1 : 0;
my @subfieldsToAllow = split(/ /, $subfieldsToAllowForRestrictedEdition);
# If we're on restricted edition, and our field is not in the list of subfields to allow,
# then it is read-only
$attributes_no_value .= 'readonly="readonly" '
if (
- $restrictededition
+ not $allowAllSubfields
+ and $restrictededition
and !grep { $tag . '$' . $subfieldtag eq $_ } @subfieldsToAllow
);
# then it is read-only
push @scrparam, (-readonly => "readonly"), (-disabled => "disabled")
if (
- $restrictededition
+ not $allowAllSubfields
+ and $restrictededition
and !grep { $tag . '$' . $subfieldtag eq $_ } @subfieldsToAllow
);
$subfield_data{marc_value} =CGI::scrolling_list(@scrparam);
- 'UNIMARC: "995$f 995$h 995$j"'
- 'MARC21: "952$a 952$b 952$c"'
- Note that the FA framework is excluded from the permission.
+ - If the pref is empty, no fields are restricted.
-
- Define a list of subfields for which edition is authorized when items_batchmod_restricted permission is enabled, separated by spaces.
- pref: SubfieldsToAllowForRestrictedBatchmod
- 'UNIMARC: "995$f 995$h 995$j"'
- 'MARC21: "952$a 952$b 952$c"'
- Note that the FA framework is excluded from the permission.
+ - If the pref is empty, no fields are restricted.
Display:
-
- 'Separate multiple displayed authors, series or subjects with '
# Getting list of subfields to keep when restricted batchmod edit is enabled
my $subfieldsToAllowForBatchmod = C4::Context->preference('SubfieldsToAllowForRestrictedBatchmod');
+my $allowAllSubfields = (
+ not defined $subfieldsToAllowForBatchmod
+ or $subfieldsToAllowForBatchmod == q||
+) ? 1 : 0;
my @subfieldsToAllow = split(/ /, $subfieldsToAllowForBatchmod);
foreach my $tag (sort keys %{$tagslib}) {
# loop through each subfield
foreach my $subfield (sort keys %{$tagslib->{$tag}}) {
next if subfield_is_koha_internal_p($subfield);
- next if ($restrictededition && !grep { $tag . '$' . $subfield eq $_ } @subfieldsToAllow );
+ next if (not $allowAllSubfields and $restrictededition && !grep { $tag . '$' . $subfield eq $_ } @subfieldsToAllow );
next if ($tagslib->{$tag}->{$subfield}->{'tab'} ne "10");
# barcode and stocknumber are not meant to be batch-modified
next if $tagslib->{$tag}->{$subfield}->{'kohafield'} eq 'items.barcode';