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

(-)a/cataloguing/additem.pl (-16 / +17 lines)
Lines 164-177 sub generate_subfield_form { Link Here
164
	    $value = $input->param('barcode');
164
	    $value = $input->param('barcode');
165
	}
165
	}
166
166
167
        # Getting list of subfields to keep when restricted editing is enabled
168
        my $subfieldsToAllowForRestrictedEditing = C4::Context->preference('SubfieldsToAllowForRestrictedEditing');
169
        my $allowAllSubfields = (
170
            not defined $subfieldsToAllowForRestrictedEditing
171
              or $subfieldsToAllowForRestrictedEditing == q||
172
        ) ? 1 : 0;
173
        my @subfieldsToAllow = split(/ /, $subfieldsToAllowForRestrictedEditing);
174
175
        if ( $subfieldlib->{authorised_value} ) {
167
        if ( $subfieldlib->{authorised_value} ) {
176
            my @authorised_values;
168
            my @authorised_values;
177
            my %authorised_lib;
169
            my %authorised_lib;
Lines 241-253 sub generate_subfield_form { Link Here
241
                    labels   => \%authorised_lib,
233
                    labels   => \%authorised_lib,
242
                    default  => $value,
234
                    default  => $value,
243
                };
235
                };
244
                # If we're on restricted editing, and our field is not in the list of subfields to allow,
245
                # then it is read-only
246
                $subfield_data{marc_value}->{readonlyselect} = (
247
                    not $allowAllSubfields
248
                    and $restrictededition
249
                    and !grep { $tag . '$' . $subfieldtag  eq $_ } @subfieldsToAllow
250
                ) ? 1: 0;
251
            }
236
            }
252
        }
237
        }
253
            # it's a thesaurus / authority field
238
            # it's a thesaurus / authority field
Lines 333-339 sub generate_subfield_form { Link Here
333
                value       => $value,
318
                value       => $value,
334
            };
319
            };
335
        }
320
        }
336
        
321
322
        # Getting list of subfields to keep when restricted editing is enabled
323
        my $subfieldsToAllowForRestrictedEditing = C4::Context->preference('SubfieldsToAllowForRestrictedEditing');
324
        my $allowAllSubfields = (
325
            not defined $subfieldsToAllowForRestrictedEditing
326
              or $subfieldsToAllowForRestrictedEditing == q||
327
        ) ? 1 : 0;
328
        my @subfieldsToAllow = split(/ /, $subfieldsToAllowForRestrictedEditing);
329
330
        # If we're on restricted editing, and our field is not in the list of subfields to allow,
331
        # then it is read-only
332
        $subfield_data{marc_value}->{readonly} = (
333
            not $allowAllSubfields
334
            and $restrictededition
335
            and !grep { $tag . '$' . $subfieldtag  eq $_ } @subfieldsToAllow
336
        ) ? 1: 0;
337
337
        return \%subfield_data;
338
        return \%subfield_data;
338
}
339
}
339
340
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt (-13 / +28 lines)
Lines 266-272 function confirm_deletion() { Link Here
266
                [% IF ( mv.type == 'hidden' ) %]
266
                [% IF ( mv.type == 'hidden' ) %]
267
                    <input type="hidden" id="[%- mv.id -%]" name="field_value" class="input_marceditor" size="50" maxlength="[%- mv.maxlength -%]" value="[%- mv.value -%]">
267
                    <input type="hidden" id="[%- mv.id -%]" name="field_value" class="input_marceditor" size="50" maxlength="[%- mv.maxlength -%]" value="[%- mv.value -%]">
268
                [% ELSIF ( mv.type == 'select' ) %]
268
                [% ELSIF ( mv.type == 'select' ) %]
269
                    [% IF ( mv.readonlyselect ) %]
269
                    [% IF ( mv.readonly ) %]
270
                        <select name="field_value" id="[%- mv.id -%]" size="1" class="input_marceditor" readonly="readonly" disabled="disabled">
270
                        <select name="field_value" id="[%- mv.id -%]" size="1" class="input_marceditor" readonly="readonly" disabled="disabled">
271
                    [% ELSE %]
271
                    [% ELSE %]
272
                        <select name="field_value" id="[%- mv.id -%]" size="1" class="input_marceditor">
272
                        <select name="field_value" id="[%- mv.id -%]" size="1" class="input_marceditor">
Lines 280-300 function confirm_deletion() { Link Here
280
                    [% END %]
280
                    [% END %]
281
                    </select>
281
                    </select>
282
                [% ELSIF ( mv.type == 'text_auth' ) %]
282
                [% ELSIF ( mv.type == 'text_auth' ) %]
283
                    <input type="text" id="[%- mv.id -%]" name="field_value" class="input_marceditor" size="50" maxlength="[%- mv.maxlength -%]" value="[%- mv.value -%]" />
283
                    [% IF mv.readonly %]
284
                    [% SET dopop = "Dopop('/cgi-bin/koha/authorities/auth_finder.pl?authtypecode=\"${mv.authtypecode}\"&index=${mv.id}','${mv.id}')" %]
284
                        <input type="text" id="[%- mv.id -%]" name="field_value" class="input_marceditor" size="50" maxlength="[%- mv.maxlength -%]" value="[%- mv.value -%]" readonly="readonly" />
285
                    <a href="#" class="buttonDot"  onclick="[%- dopop -%]; return false;" title="Tag editor">...</a>
285
                    [% ELSE %]
286
                        <input type="text" id="[%- mv.id -%]" name="field_value" class="input_marceditor" size="50" maxlength="[%- mv.maxlength -%]" value="[%- mv.value -%]" />
287
                        [% SET dopop = "Dopop('/cgi-bin/koha/authorities/auth_finder.pl?authtypecode=\"${mv.authtypecode}\"&index=${mv.id}','${mv.id}')" %]
288
                        <a href="#" class="buttonDot"  onclick="[%- dopop -%]; return false;" title="Tag editor">...</a>
289
                    [% END %]
286
                [% ELSIF ( mv.type == 'text_plugin' ) %]
290
                [% ELSIF ( mv.type == 'text_plugin' ) %]
287
                    <input type="text" id="[%- mv.id -%]" name="field_value" class="input_marceditor" size="50" maxlength="[%- mv.maxlength -%]" value="[%- mv.value -%]" />
291
                    [% IF mv.readonly %]
288
                    [% IF ( mv.nopopup ) %]
292
                        <input type="text" id="[%- mv.id -%]" name="field_value" class="input_marceditor" size="50" maxlength="[%- mv.maxlength -%]" value="[%- mv.value -%]" readonly="readonly" />
289
                        <a href="#" id="buttonDot_[%- mv.id -%]" class="[%- mv.class -%]" title="No popup">...</a>
293
                    [% ELSE %]
290
                    [% ELSE  %]
294
                        <input type="text" id="[%- mv.id -%]" name="field_value" class="input_marceditor" size="50" maxlength="[%- mv.maxlength -%]" value="[%- mv.value -%]" />
291
                        <a href="#" id="buttonDot_[%- mv.id -%]" class="[%- mv.class -%]" title="Tag editor">...</a>
295
                        [% IF ( mv.nopopup ) %]
296
                            <a href="#" id="buttonDot_[%- mv.id -%]" class="[%- mv.class -%]" title="No popup">...</a>
297
                        [% ELSE  %]
298
                            <a href="#" id="buttonDot_[%- mv.id -%]" class="[%- mv.class -%]" title="Tag editor">...</a>
299
                        [% END %]
300
                        [%- mv.javascript -%]
292
                    [% END %]
301
                    [% END %]
293
                    [%- mv.javascript -%]
294
                [% ELSIF ( mv.type == 'text' ) %]
302
                [% ELSIF ( mv.type == 'text' ) %]
295
                    <input type="text" id="[%- mv.id -%]" name="field_value" class="input_marceditor" size="50" maxlength="[%- mv.maxlength -%]" value="[%- mv.value -%]" />
303
                    [% IF mv.readonly %]
304
                        <input type="text" id="[%- mv.id -%]" name="field_value" class="input_marceditor" size="50" maxlength="[%- mv.maxlength -%]" value="[%- mv.value -%]" readonly="readonly" />
305
                    [% ELSE %]
306
                        <input type="text" id="[%- mv.id -%]" name="field_value" class="input_marceditor" size="50" maxlength="[%- mv.maxlength -%]" value="[%- mv.value -%]" />
307
                    [% END %]
296
                [% ELSIF ( mv.type == 'textarea' ) %]
308
                [% ELSIF ( mv.type == 'textarea' ) %]
297
                    <textarea id="[%- mv.id -%]" name="field_value" class="input_marceditor" rows="5" cols="64" >[% mv.value %]</textarea>
309
                    [% IF mv.readonly %]
310
                        <textarea id="[%- mv.id -%]" name="field_value" class="input_marceditor" rows="5" cols="64" readonly="readonly" >[% mv.value %]</textarea>
311
                    [% ELSE %]
312
                        <textarea id="[%- mv.id -%]" name="field_value" class="input_marceditor" rows="5" cols="64" >[% mv.value %]</textarea>
313
                    [% END %]
298
                [% END %]
314
                [% END %]
299
315
300
                <input type="hidden" name="tag"       value="[% ite.tag %]" />
316
                <input type="hidden" name="tag"       value="[% ite.tag %]" />
301
- 

Return to bug 15173