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

(-)a/cataloguing/additem.pl (-10 / +3 lines)
Lines 155-161 sub generate_subfield_form { Link Here
155
	    $value = $input->param('barcode');
155
	    $value = $input->param('barcode');
156
	}
156
	}
157
        my $attributes_no_value = qq(id="$subfield_data{id}" name="field_value" class="input_marceditor" size="50" maxlength="$subfield_data{maxlength}" );
157
        my $attributes_no_value = qq(id="$subfield_data{id}" name="field_value" class="input_marceditor" size="50" maxlength="$subfield_data{maxlength}" );
158
        my $attributes_no_value_textarea = qq(id="$subfield_data{id}" name="field_value" class="input_marceditor" rows="5" cols="64" );
159
158
160
        # Getting list of subfields to keep when restricted editing is enabled
159
        # Getting list of subfields to keep when restricted editing is enabled
161
        my $subfieldsToAllowForRestrictedEditing = C4::Context->preference('SubfieldsToAllowForRestrictedEditing');
160
        my $subfieldsToAllowForRestrictedEditing = C4::Context->preference('SubfieldsToAllowForRestrictedEditing');
Lines 236-242 sub generate_subfield_form { Link Here
236
                    id          => $subfield_data{id},
235
                    id          => $subfield_data{id},
237
                    maxlength   => $subfield_data{max_length},
236
                    maxlength   => $subfield_data{max_length},
238
                    value       => $value,
237
                    value       => $value,
239
                    avalue      => $authorised_lib{$value},
240
                };
238
                };
241
            }
239
            }
242
            else {
240
            else {
Lines 249-262 sub generate_subfield_form { Link Here
249
                };
247
                };
250
                # If we're on restricted editing, and our field is not in the list of subfields to allow,
248
                # If we're on restricted editing, and our field is not in the list of subfields to allow,
251
                # then it is read-only
249
                # then it is read-only
252
                if (
250
                $subfield_data{marc_value}->{readonlyselect} = (
253
                    not $allowAllSubfields
251
                    not $allowAllSubfields
254
                    and $restrictededition
252
                    and $restrictededition
255
                    and !grep { $tag . '$' . $subfieldtag  eq $_ } @subfieldsToAllow
253
                    and !grep { $tag . '$' . $subfieldtag  eq $_ } @subfieldsToAllow
256
                ) {
254
                ) ? 1: 0;
257
                    $subfield_data{marc_value}->{readonly} ='readonly="readonly"',
258
                    $subfield_data{marc_value}->{disabled} ='disabled="disabled"',
259
                }
260
            }
255
            }
261
        }
256
        }
262
            # it's a thesaurus / authority field
257
            # it's a thesaurus / authority field
Lines 280-295 sub generate_subfield_form { Link Here
280
                id => $subfield_data{id}, tabloop => $loop_data };
275
                id => $subfield_data{id}, tabloop => $loop_data };
281
            $plugin->build( $pars );
276
            $plugin->build( $pars );
282
            if( !$plugin->errstr ) {
277
            if( !$plugin->errstr ) {
283
                #TODO Report 12176 will make this even better !
284
                my $class= 'buttonDot'. ( $plugin->noclick? ' disabled': '' );
278
                my $class= 'buttonDot'. ( $plugin->noclick? ' disabled': '' );
285
                my $title= $plugin->noclick? 'No popup': 'Tag editor';
286
                $subfield_data{marc_value} = {
279
                $subfield_data{marc_value} = {
287
                    type        => 'text_plugin',
280
                    type        => 'text_plugin',
288
                    id          => $subfield_data{id},
281
                    id          => $subfield_data{id},
289
                    maxlength   => $subfield_data{max_length},
282
                    maxlength   => $subfield_data{max_length},
290
                    value       => $value,
283
                    value       => $value,
291
                    class       => $class,
284
                    class       => $class,
292
                    title       => $title,
285
                    nopopup     => $plugin->noclick,
293
                    javascript  => $plugin->javascript,
286
                    javascript  => $plugin->javascript,
294
                };
287
                };
295
            } else {
288
            } else {
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt (-7 / +11 lines)
Lines 228-236 $(document).ready(function() { Link Here
228
228
229
                [% SET mv = ite.marc_value %]
229
                [% SET mv = ite.marc_value %]
230
                [% IF ( mv.type == 'hidden' ) %]
230
                [% IF ( mv.type == 'hidden' ) %]
231
                    <input type="hidden" id="[%- mv.id -%]" name="field_value" class="input_marceditor" size="50" maxlength="[%- mv.maxlength -%]" value="[%- mv.value -%]" />[% mv.avalue %].hidden
231
                    <input type="hidden" id="[%- mv.id -%]" name="field_value" class="input_marceditor" size="50" maxlength="[%- mv.maxlength -%]" value="[%- mv.value -%]">
232
                [% ELSIF ( mv.type == 'select' ) %]
232
                [% ELSIF ( mv.type == 'select' ) %]
233
                    <select name="[%- mv.name -%]" id="[%- mv.id -%]" size="1" class="input_marceditor" [% mv.readonly %] [% mv.disabled %]>
233
                    [% IF ( mv.readonlyselect ) %]
234
                        <select name="[%- mv.name -%]" id="[%- mv.id -%]" size="1" class="input_marceditor" readonly="readonly" disabled="disabled">
235
                    [% ELSE %]
236
                        <select name="[%- mv.name -%]" id="[%- mv.id -%]" size="1" class="input_marceditor">
237
                    [% END %]
234
                    [% FOREACH aval IN mv.values %]
238
                    [% FOREACH aval IN mv.values %]
235
                        [% IF aval == mv.default %]
239
                        [% IF aval == mv.default %]
236
                        <option value="[%- aval -%]" selected="selected">[%- mv.labels.$aval -%]</option>
240
                        <option value="[%- aval -%]" selected="selected">[%- mv.labels.$aval -%]</option>
Lines 245-255 $(document).ready(function() { Link Here
245
                    <a href="#" class="buttonDot"  onclick="[%- dopop -%]; return false;" title="Tag Editor">...</a>
249
                    <a href="#" class="buttonDot"  onclick="[%- dopop -%]; return false;" title="Tag Editor">...</a>
246
                [% ELSIF ( mv.type == 'text_plugin' ) %]
250
                [% ELSIF ( mv.type == 'text_plugin' ) %]
247
                    <input type="text" id="[%- mv.id -%]" name="field_value" class="input_marceditor" size="50" maxlength="[%- mv.maxlength -%]" value="[%- mv.value -%]" />
251
                    <input type="text" id="[%- mv.id -%]" name="field_value" class="input_marceditor" size="50" maxlength="[%- mv.maxlength -%]" value="[%- mv.value -%]" />
248
                    [% IF ( mv.title == 'Tag editor' ) %]
252
                    [% IF ( mv.nopopup ) %]
249
                    <a href="#" id="buttonDot_[%- mv.id -%]" class="[%- mv.class -%]" title="Tag editor">...</a>[%- mv.javascript -%]
253
                        <a href="#" id="buttonDot_[%- mv.id -%]" class="[%- mv.class -%]" title="No popup">...</a>
250
                    [% ELSIF ( mv.title == 'No popup' ) %]
254
                    [% ELSE  %]
251
                    <a href="#" id="buttonDot_[%- mv.id -%]" class="[%- mv.class -%]" title="No popup">...</a>[%- mv.javascript -%]
255
                        <a href="#" id="buttonDot_[%- mv.id -%]" class="[%- mv.class -%]" title="Tag editor">...</a>
252
                    [% END %]
256
                    [% END %]
257
                    [%- mv.javascript -%]
253
                [% ELSIF ( mv.type == 'text' ) %]
258
                [% ELSIF ( mv.type == 'text' ) %]
254
                    <input type="text" id="[%- mv.id -%]" name="field_value" class="input_marceditor" size="50" maxlength="[%- mv.maxlength -%]" value="[%- mv.value -%]" />
259
                    <input type="text" id="[%- mv.id -%]" name="field_value" class="input_marceditor" size="50" maxlength="[%- mv.maxlength -%]" value="[%- mv.value -%]" />
255
                [% ELSIF ( mv.type == 'textarea' ) %]
260
                [% ELSIF ( mv.type == 'textarea' ) %]
256
- 

Return to bug 12176