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

(-)a/cataloguing/additem.pl (-16 / +17 lines)
Lines 156-169 sub generate_subfield_form { Link Here
156
	    $value = $input->param('barcode');
156
	    $value = $input->param('barcode');
157
	}
157
	}
158
158
159
        # Getting list of subfields to keep when restricted editing is enabled
160
        my $subfieldsToAllowForRestrictedEditing = C4::Context->preference('SubfieldsToAllowForRestrictedEditing');
161
        my $allowAllSubfields = (
162
            not defined $subfieldsToAllowForRestrictedEditing
163
              or $subfieldsToAllowForRestrictedEditing == q||
164
        ) ? 1 : 0;
165
        my @subfieldsToAllow = split(/ /, $subfieldsToAllowForRestrictedEditing);
166
167
        if ( $subfieldlib->{authorised_value} ) {
159
        if ( $subfieldlib->{authorised_value} ) {
168
            my @authorised_values;
160
            my @authorised_values;
169
            my %authorised_lib;
161
            my %authorised_lib;
Lines 233-245 sub generate_subfield_form { Link Here
233
                    labels   => \%authorised_lib,
225
                    labels   => \%authorised_lib,
234
                    default  => $value,
226
                    default  => $value,
235
                };
227
                };
236
                # If we're on restricted editing, and our field is not in the list of subfields to allow,
237
                # then it is read-only
238
                $subfield_data{marc_value}->{readonlyselect} = (
239
                    not $allowAllSubfields
240
                    and $restrictededition
241
                    and !grep { $tag . '$' . $subfieldtag  eq $_ } @subfieldsToAllow
242
                ) ? 1: 0;
243
            }
228
            }
244
        }
229
        }
245
            # it's a thesaurus / authority field
230
            # it's a thesaurus / authority field
Lines 325-331 sub generate_subfield_form { Link Here
325
                value       => $value,
310
                value       => $value,
326
            };
311
            };
327
        }
312
        }
328
        
313
314
        # Getting list of subfields to keep when restricted editing is enabled
315
        my $subfieldsToAllowForRestrictedEditing = C4::Context->preference('SubfieldsToAllowForRestrictedEditing');
316
        my $allowAllSubfields = (
317
            not defined $subfieldsToAllowForRestrictedEditing
318
              or $subfieldsToAllowForRestrictedEditing == q||
319
        ) ? 1 : 0;
320
        my @subfieldsToAllow = split(/ /, $subfieldsToAllowForRestrictedEditing);
321
322
        # If we're on restricted editing, and our field is not in the list of subfields to allow,
323
        # then it is read-only
324
        $subfield_data{marc_value}->{readonly} = (
325
            not $allowAllSubfields
326
            and $restrictededition
327
            and !grep { $tag . '$' . $subfieldtag  eq $_ } @subfieldsToAllow
328
        ) ? 1: 0;
329
329
        return \%subfield_data;
330
        return \%subfield_data;
330
}
331
}
331
332
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt (-13 / +28 lines)
Lines 258-264 function confirm_deletion() { Link Here
258
                [% IF ( mv.type == 'hidden' ) %]
258
                [% IF ( mv.type == 'hidden' ) %]
259
                    <input type="hidden" id="[%- mv.id -%]" name="field_value" class="input_marceditor" size="50" maxlength="[%- mv.maxlength -%]" value="[%- mv.value -%]">
259
                    <input type="hidden" id="[%- mv.id -%]" name="field_value" class="input_marceditor" size="50" maxlength="[%- mv.maxlength -%]" value="[%- mv.value -%]">
260
                [% ELSIF ( mv.type == 'select' ) %]
260
                [% ELSIF ( mv.type == 'select' ) %]
261
                    [% IF ( mv.readonlyselect ) %]
261
                    [% IF ( mv.readonly ) %]
262
                        <select name="field_value" id="[%- mv.id -%]" size="1" class="input_marceditor" readonly="readonly" disabled="disabled">
262
                        <select name="field_value" id="[%- mv.id -%]" size="1" class="input_marceditor" readonly="readonly" disabled="disabled">
263
                    [% ELSE %]
263
                    [% ELSE %]
264
                        <select name="field_value" id="[%- mv.id -%]" size="1" class="input_marceditor">
264
                        <select name="field_value" id="[%- mv.id -%]" size="1" class="input_marceditor">
Lines 272-292 function confirm_deletion() { Link Here
272
                    [% END %]
272
                    [% END %]
273
                    </select>
273
                    </select>
274
                [% ELSIF ( mv.type == 'text_auth' ) %]
274
                [% ELSIF ( mv.type == 'text_auth' ) %]
275
                    <input type="text" id="[%- mv.id -%]" name="field_value" class="input_marceditor" size="50" maxlength="[%- mv.maxlength -%]" value="[%- mv.value -%]" />
275
                    [% IF mv.readonly %]
276
                    [% SET dopop = "Dopop('/cgi-bin/koha/authorities/auth_finder.pl?authtypecode=\"${mv.authtypecode}\"&index=${mv.id}','${mv.id}')" %]
276
                        <input type="text" id="[%- mv.id -%]" name="field_value" class="input_marceditor" size="50" maxlength="[%- mv.maxlength -%]" value="[%- mv.value -%]" readonly="readonly" />
277
                    <a href="#" class="buttonDot"  onclick="[%- dopop -%]; return false;" title="Tag editor">...</a>
277
                    [% ELSE %]
278
                        <input type="text" id="[%- mv.id -%]" name="field_value" class="input_marceditor" size="50" maxlength="[%- mv.maxlength -%]" value="[%- mv.value -%]" />
279
                        [% SET dopop = "Dopop('/cgi-bin/koha/authorities/auth_finder.pl?authtypecode=\"${mv.authtypecode}\"&index=${mv.id}','${mv.id}')" %]
280
                        <a href="#" class="buttonDot"  onclick="[%- dopop -%]; return false;" title="Tag editor">...</a>
281
                    [% END %]
278
                [% ELSIF ( mv.type == 'text_plugin' ) %]
282
                [% ELSIF ( mv.type == 'text_plugin' ) %]
279
                    <input type="text" id="[%- mv.id -%]" name="field_value" class="input_marceditor" size="50" maxlength="[%- mv.maxlength -%]" value="[%- mv.value -%]" />
283
                    [% IF mv.readonly %]
280
                    [% IF ( mv.nopopup ) %]
284
                        <input type="text" id="[%- mv.id -%]" name="field_value" class="input_marceditor" size="50" maxlength="[%- mv.maxlength -%]" value="[%- mv.value -%]" readonly="readonly" />
281
                        <a href="#" id="buttonDot_[%- mv.id -%]" class="[%- mv.class -%]" title="No popup">...</a>
285
                    [% ELSE %]
282
                    [% ELSE  %]
286
                        <input type="text" id="[%- mv.id -%]" name="field_value" class="input_marceditor" size="50" maxlength="[%- mv.maxlength -%]" value="[%- mv.value -%]" />
283
                        <a href="#" id="buttonDot_[%- mv.id -%]" class="[%- mv.class -%]" title="Tag editor">...</a>
287
                        [% IF ( mv.nopopup ) %]
288
                            <a href="#" id="buttonDot_[%- mv.id -%]" class="[%- mv.class -%]" title="No popup">...</a>
289
                        [% ELSE  %]
290
                            <a href="#" id="buttonDot_[%- mv.id -%]" class="[%- mv.class -%]" title="Tag editor">...</a>
291
                        [% END %]
292
                        [%- mv.javascript -%]
284
                    [% END %]
293
                    [% END %]
285
                    [%- mv.javascript -%]
286
                [% ELSIF ( mv.type == 'text' ) %]
294
                [% ELSIF ( mv.type == 'text' ) %]
287
                    <input type="text" id="[%- mv.id -%]" name="field_value" class="input_marceditor" size="50" maxlength="[%- mv.maxlength -%]" value="[%- mv.value -%]" />
295
                    [% IF mv.readonly %]
296
                        <input type="text" id="[%- mv.id -%]" name="field_value" class="input_marceditor" size="50" maxlength="[%- mv.maxlength -%]" value="[%- mv.value -%]" readonly="readonly" />
297
                    [% ELSE %]
298
                        <input type="text" id="[%- mv.id -%]" name="field_value" class="input_marceditor" size="50" maxlength="[%- mv.maxlength -%]" value="[%- mv.value -%]" />
299
                    [% END %]
288
                [% ELSIF ( mv.type == 'textarea' ) %]
300
                [% ELSIF ( mv.type == 'textarea' ) %]
289
                    <textarea id="[%- mv.id -%]" name="field_value" class="input_marceditor" rows="5" cols="64" >[% mv.value %]</textarea>
301
                    [% IF mv.readonly %]
302
                        <textarea id="[%- mv.id -%]" name="field_value" class="input_marceditor" rows="5" cols="64" readonly="readonly" >[% mv.value %]</textarea>
303
                    [% ELSE %]
304
                        <textarea id="[%- mv.id -%]" name="field_value" class="input_marceditor" rows="5" cols="64" >[% mv.value %]</textarea>
305
                    [% END %]
290
                [% END %]
306
                [% END %]
291
307
292
                <input type="hidden" name="tag"       value="[% ite.tag %]" />
308
                <input type="hidden" name="tag"       value="[% ite.tag %]" />
293
- 

Return to bug 15173