View | Details | Raw Unified | Return to bug 7673
Collapse All | Expand All

(-)a/cataloguing/additem.pl (-2 / +8 lines)
Lines 160-172 sub generate_subfield_form { Link Here
160
160
161
        # Getting list of subfields to keep when restricted edition is enabled
161
        # Getting list of subfields to keep when restricted edition is enabled
162
        my $subfieldsToAllowForRestrictedEdition = C4::Context->preference('SubfieldsToAllowForRestrictedEdition');
162
        my $subfieldsToAllowForRestrictedEdition = C4::Context->preference('SubfieldsToAllowForRestrictedEdition');
163
        my $allowAllSubfields = (
164
            not defined $subfieldsToAllowForRestrictedEdition
165
              or $subfieldsToAllowForRestrictedEdition == q||
166
        ) ? 1 : 0;
163
        my @subfieldsToAllow = split(/ /, $subfieldsToAllowForRestrictedEdition);
167
        my @subfieldsToAllow = split(/ /, $subfieldsToAllowForRestrictedEdition);
164
168
165
        # If we're on restricted edition, and our field is not in the list of subfields to allow,
169
        # If we're on restricted edition, and our field is not in the list of subfields to allow,
166
        # then it is read-only
170
        # then it is read-only
167
        $attributes_no_value .= 'readonly="readonly" '
171
        $attributes_no_value .= 'readonly="readonly" '
168
            if (
172
            if (
169
                $restrictededition
173
                not $allowAllSubfields
174
                and $restrictededition
170
                and !grep { $tag . '$' . $subfieldtag  eq $_ } @subfieldsToAllow
175
                and !grep { $tag . '$' . $subfieldtag  eq $_ } @subfieldsToAllow
171
            );
176
            );
172
177
Lines 246-252 sub generate_subfield_form { Link Here
246
                # then it is read-only
251
                # then it is read-only
247
                push @scrparam, (-readonly => "readonly"), (-disabled => "disabled")
252
                push @scrparam, (-readonly => "readonly"), (-disabled => "disabled")
248
                    if (
253
                    if (
249
                        $restrictededition
254
                        not $allowAllSubfields
255
                        and $restrictededition
250
                        and !grep { $tag . '$' . $subfieldtag  eq $_ } @subfieldsToAllow
256
                        and !grep { $tag . '$' . $subfieldtag  eq $_ } @subfieldsToAllow
251
                    );
257
                    );
252
                $subfield_data{marc_value} =CGI::scrolling_list(@scrparam);
258
                $subfield_data{marc_value} =CGI::scrolling_list(@scrparam);
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref (+2 lines)
Lines 116-121 Cataloging: Link Here
116
            - 'UNIMARC: "995$f 995$h 995$j"'
116
            - 'UNIMARC: "995$f 995$h 995$j"'
117
            - 'MARC21: "952$a 952$b 952$c"'
117
            - 'MARC21: "952$a 952$b 952$c"'
118
            - Note that the FA framework is excluded from the permission.
118
            - Note that the FA framework is excluded from the permission.
119
            - If the pref is empty, no fields are restricted.
119
        -
120
        -
120
            - Define a list of subfields for which edition is authorized when items_batchmod_restricted permission is enabled, separated by spaces.
121
            - Define a list of subfields for which edition is authorized when items_batchmod_restricted permission is enabled, separated by spaces.
121
            - pref: SubfieldsToAllowForRestrictedBatchmod
122
            - pref: SubfieldsToAllowForRestrictedBatchmod
Lines 123-128 Cataloging: Link Here
123
            - 'UNIMARC: "995$f 995$h 995$j"'
124
            - 'UNIMARC: "995$f 995$h 995$j"'
124
            - 'MARC21: "952$a 952$b 952$c"'
125
            - 'MARC21: "952$a 952$b 952$c"'
125
            - Note that the FA framework is excluded from the permission.
126
            - Note that the FA framework is excluded from the permission.
127
            - If the pref is empty, no fields are restricted.
126
    Display:
128
    Display:
127
        -
129
        -
128
            - 'Separate multiple displayed authors, series or subjects with '
130
            - 'Separate multiple displayed authors, series or subjects with '
(-)a/tools/batchMod.pl (-2 / +5 lines)
Lines 301-313 my $pref_itemcallnumber = C4::Context->preference('itemcallnumber'); Link Here
301
301
302
# Getting list of subfields to keep when restricted batchmod edit is enabled
302
# Getting list of subfields to keep when restricted batchmod edit is enabled
303
my $subfieldsToAllowForBatchmod = C4::Context->preference('SubfieldsToAllowForRestrictedBatchmod');
303
my $subfieldsToAllowForBatchmod = C4::Context->preference('SubfieldsToAllowForRestrictedBatchmod');
304
my $allowAllSubfields = (
305
    not defined $subfieldsToAllowForBatchmod
306
      or $subfieldsToAllowForBatchmod == q||
307
) ? 1 : 0;
304
my @subfieldsToAllow = split(/ /, $subfieldsToAllowForBatchmod);
308
my @subfieldsToAllow = split(/ /, $subfieldsToAllowForBatchmod);
305
309
306
foreach my $tag (sort keys %{$tagslib}) {
310
foreach my $tag (sort keys %{$tagslib}) {
307
    # loop through each subfield
311
    # loop through each subfield
308
    foreach my $subfield (sort keys %{$tagslib->{$tag}}) {
312
    foreach my $subfield (sort keys %{$tagslib->{$tag}}) {
309
     	next if subfield_is_koha_internal_p($subfield);
313
     	next if subfield_is_koha_internal_p($subfield);
310
        next if ($restrictededition && !grep { $tag . '$' . $subfield eq $_ } @subfieldsToAllow );
314
        next if (not $allowAllSubfields and $restrictededition && !grep { $tag . '$' . $subfield eq $_ } @subfieldsToAllow );
311
    	next if ($tagslib->{$tag}->{$subfield}->{'tab'} ne "10");
315
    	next if ($tagslib->{$tag}->{$subfield}->{'tab'} ne "10");
312
        # barcode and stocknumber are not meant to be batch-modified
316
        # barcode and stocknumber are not meant to be batch-modified
313
    	next if $tagslib->{$tag}->{$subfield}->{'kohafield'} eq 'items.barcode';
317
    	next if $tagslib->{$tag}->{$subfield}->{'kohafield'} eq 'items.barcode';
314
- 

Return to bug 7673