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

(-)a/authorities/authorities.pl (-77 / +59 lines)
Lines 118-135 sub build_authorized_values_list { Link Here
118
            $authorised_lib{$value} = $lib;
118
            $authorised_lib{$value} = $lib;
119
        }
119
        }
120
    }
120
    }
121
    return CGI::scrolling_list(
121
    return {
122
        -name     => "tag_".$tag."_subfield_".$subfield."_".$index_tag."_".$index_subfield,
122
        type     => 'select',
123
        -values   => \@authorised_values,
123
        id       => "tag_".$tag."_subfield_".$subfield."_".$index_tag."_".$index_subfield,
124
        -default  => $value,
124
        name     => "tag_".$tag."_subfield_".$subfield."_".$index_tag."_".$index_subfield,
125
        -labels   => \%authorised_lib,
125
        values   => \@authorised_values,
126
        -override => 1,
126
        labels   => \%authorised_lib,
127
        -size     => 1,
127
        default  => $value,
128
        -multiple => 0,
128
    };
129
        -tabindex => 1,
130
        -id       => "tag_".$tag."_subfield_".$subfield."_".$index_tag."_".$index_subfield,
131
        -class    => "input_marceditor",
132
    );
133
}
129
}
134
130
135
131
Lines 209-224 sub create_input { Link Here
209
    # it's a thesaurus / authority field
205
    # it's a thesaurus / authority field
210
    }
206
    }
211
    elsif ( $tagslib->{$tag}->{$subfield}->{authtypecode} ) {
207
    elsif ( $tagslib->{$tag}->{$subfield}->{authtypecode} ) {
212
        $subfield_data{marc_value} =
208
        $subfield_data{marc_value} = {
213
    "<input type=\"text\"
209
            type         => 'text1',
214
            id=\"".$subfield_data{id}."\"
210
            id           => $subfield_data{id},
215
            name=\"".$subfield_data{id}."\"
211
            name         => $subfield_data{id},
216
            value=\"$value\"
212
            value        => $value,
217
            class=\"input_marceditor\"
213
            authtypecode => $tagslib->{$tag}->{$subfield}->{authtypecode},
218
            tabindex=\"1\" \/>
214
        };
219
        <a href=\"#\" class=\"buttonDot\"
220
        onclick=\"openAuth(this.parentNode.getElementsByTagName('input')[1].id,'".$tagslib->{$tag}->{$subfield}->{authtypecode}."','auth'); return false;\" tabindex=\"1\" title=\"Tag Editor\">...</a>
221
    ";
222
    # it's a plugin field
215
    # it's a plugin field
223
    }
216
    }
224
    elsif ( $tagslib->{$tag}->{$subfield}->{'value_builder'} ) {
217
    elsif ( $tagslib->{$tag}->{$subfield}->{'value_builder'} ) {
Lines 238-280 sub create_input { Link Here
238
        my ( $function_name, $javascript ) = plugin_javascript( $dbh, $rec, $tagslib, $subfield_data{id}, $tabloop );
231
        my ( $function_name, $javascript ) = plugin_javascript( $dbh, $rec, $tagslib, $subfield_data{id}, $tabloop );
239
#         my ( $function_name, $javascript,$extended_param );
232
#         my ( $function_name, $javascript,$extended_param );
240
        
233
        
241
        $subfield_data{marc_value} =
234
        $subfield_data{marc_value} = {
242
            "<input tabindex=\"1\"
235
            type       => 'text2',
243
                    type=\"text\"
236
            id         => $subfield_data{id},
244
                    id=\"".$subfield_data{id}."\"
237
            name       => $subfield_data{id},
245
                    size=\"67\"
238
            value      => $value,
246
                    maxlength=\"$max_length\"
239
            maxlength  => $max_length,
247
                    name=\"".$subfield_data{id}."\"
240
            function   => $function_name,
248
                    value=\"$value\"
241
            index_tag  => $index_tag,
249
                    class=\"input_marceditor\"
242
            javascript => $javascript,
250
                    onfocus=\"Focus$function_name($index_tag)\"
243
        };
251
                    onblur=\"Blur$function_name($index_tag); \" \/>
252
                    <a href=\"#\" class=\"buttonDot\" onclick=\"Clic$function_name('$subfield_data{id}'); return false;\" title=\"Tag Editor\">...</a>
253
                    $javascript";
254
        # it's an hidden field
244
        # it's an hidden field
255
    }
245
    }
256
    elsif ( $tag eq '' ) {
246
    elsif ( $tag eq '' ) {
257
        $subfield_data{marc_value} =
247
        $subfield_data{marc_value} = {
258
            "<input tabindex=\"1\"
248
            type      => 'hidden',
259
                    type=\"hidden\"
249
            id        => $subfield_data{id},
260
                    id=\"".$subfield_data{id}."\"
250
            name      => $subfield_data{id},
261
                    name=\"".$subfield_data{id}."\"
251
            value     => $value,
262
                    size=\"67\"
252
            maxlength => $max_length,
263
                    maxlength=\"$max_length\"
253
        }
264
                    value=\"$value\" \/>
265
            ";
266
    }
254
    }
267
    elsif ( $tagslib->{$tag}->{$subfield}->{'hidden'} ) {
255
    elsif ( $tagslib->{$tag}->{$subfield}->{'hidden'} ) {
268
        $subfield_data{marc_value} =
256
        $subfield_data{marc_value} = {
269
            "<input type=\"text\"
257
            type => 'text',
270
                    id=\"".$subfield_data{id}."\"
258
            id        => $subfield_data{id},
271
                    name=\"".$subfield_data{id}."\"
259
            name      => $subfield_data{id},
272
                    class=\"input_marceditor\"
260
            value     => $value,
273
                    tabindex=\"1\"
261
            maxlength => $max_length,
274
                    size=\"67\"
262
        };
275
                    maxlength=\"$max_length\"
276
                    value=\"$value\"
277
            \/>";
278
263
279
        # it's a standard field
264
        # it's a standard field
280
    }
265
    }
Lines 289-318 sub create_input { Link Here
289
                && C4::Context->preference("marcflavour") eq "MARC21" )
274
                && C4::Context->preference("marcflavour") eq "MARC21" )
290
        )
275
        )
291
        {
276
        {
292
            $subfield_data{marc_value} =
277
            $subfield_data{marc_value} = {
293
                "<textarea cols=\"70\"
278
                type => 'textarea',
294
                        rows=\"4\"
279
                id        => $subfield_data{id},
295
                        id=\"".$subfield_data{id}."\"
280
                name      => $subfield_data{id},
296
                        name=\"".$subfield_data{id}."\"
281
                value     => $value,
297
                        class=\"input_marceditor\"
282
                maxlength => $max_length,
298
                        tabindex=\"1\"
283
            };
299
                        size=\"67\"
284
300
                        maxlength=\"$max_length\"
301
                        >$value</textarea>
302
                ";
303
        }
285
        }
304
        else {
286
        else {
305
            $subfield_data{marc_value} =
287
            $subfield_data{marc_value} = {
306
                "<input type=\"text\"
288
                type => 'text',
307
                        id=\"".$subfield_data{id}."\"
289
                id        => $subfield_data{id},
308
                        name=\"".$subfield_data{id}."\"
290
                name      => $subfield_data{id},
309
                        value=\"$value\"
291
                value     => $value,
310
                        tabindex=\"1\"
292
                maxlength => $max_length,
311
                        size=\"67\"
293
            };
312
                        maxlength=\"$max_length\"
294
313
                        class=\"input_marceditor\"
314
                \/>
315
                ";
316
        }
295
        }
317
    }
296
    }
318
    $subfield_data{'index_subfield'} = $index_subfield;
297
    $subfield_data{'index_subfield'} = $index_subfield;
Lines 538-544 sub build_hidden_data { Link Here
538
            $subfield_data{marc_lib}=$tagslib->{$tag}->{$subfield}->{lib};
517
            $subfield_data{marc_lib}=$tagslib->{$tag}->{$subfield}->{lib};
539
            $subfield_data{marc_mandatory}=$tagslib->{$tag}->{$subfield}->{mandatory};
518
            $subfield_data{marc_mandatory}=$tagslib->{$tag}->{$subfield}->{mandatory};
540
            $subfield_data{marc_repeatable}=$tagslib->{$tag}->{$subfield}->{repeatable};
519
            $subfield_data{marc_repeatable}=$tagslib->{$tag}->{$subfield}->{repeatable};
541
            $subfield_data{marc_value}="<input type=\"hidden\" name=\"field_value[]\">";
520
            $subfield_data{marc_value} = {
521
                type => 'hidden_simple',
522
                name => 'field_value[]',
523
            };
542
            push(@loop_data, \%subfield_data);
524
            push(@loop_data, \%subfield_data);
543
            $i++
525
            $i++
544
        }
526
        }
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/authorities.tt (-2 / +27 lines)
Lines 311-317 function confirmnotdup(redirect){ Link Here
311
                    </label>
311
                    </label>
312
                [% END %]
312
                [% END %]
313
                
313
                
314
                [% subfield_loo.marc_value %]
314
                [% SET mv = subfield_loo.marc_value %]
315
                [% IF ( mv.type == 'select' ) %]
316
                     <select name="[%- mv.name -%]" tabindex="1" size="1" class="input_marceditor" id="[%- mv.id -%]">
317
                     [% FOREACH aval IN mv.values %]
318
                         [% IF aval == mv.default %]
319
                         <option value="[%- aval -%]" selected="selected">[%- mv.labels.$aval -%]</option>
320
                         [% ELSE %]
321
                         <option value="[%- aval -%]">[%- mv.labels.$aval -%]</option>
322
                         [% END %]
323
                     [% END %]
324
                     </select>
325
                [% ELSIF ( mv.type == 'text1' ) %]
326
                    <input type="text" id="[%- mv.id -%]" name="[%- mv.id -%]" value="[%- mv.value -%]" class="input_marceditor" tabindex="1" />
327
                    <a href="#" class="buttonDot" onclick="openAuth(this.parentNode.getElementsByTagName('input')[1].id,'[%- mv.authtypecode -%]','auth'); return false;" tabindex="1" title="Tag editor">...</a>
328
                [% ELSIF ( mv.type == 'text2' ) %]
329
                    <input tabindex="1" type="text" id="[%- mv.id -%]" size="67" maxlength="[%- mv.maxlength -%]" name="[%- mv.id -%]" value="[%- mv.value -%]" class="input_marceditor" onfocus="Focus[%- mv.function -%]([%- mv.index_tag -%])" onblur="Blur[%- mv.function -%]([%- mv.index_tag -%]);" />
330
                    <a href="#" class="buttonDot" onclick="Clic[%- mv.function -%]('[%- mv.id -%]'); return false;" title="Tag editor">...</a>
331
                    [% mv.javascript %]
332
                [% ELSIF ( mv.type == 'text' ) %]
333
                    <input type="text" id="[%- mv.id -%]" name="[%- mv.name -%]" value="[%- mv.value -%]" class="input_marceditor" tabindex="1" size="67" maxlength="[%- mv.maxlength -%]" />
334
                [% ELSIF ( mv.type == 'textarea' ) %]
335
                    <textarea cols="70" rows="4" id="[%- mv.id -%]" name="[%- mv.name -%]" class="input_marceditor" tabindex="1" size="67" maxlength="[%- mv.maxlength -%]">[%- mv.value -%]</textarea>
336
                [% ELSIF ( mv.type == 'hidden' ) %]
337
                    <input tabindex="1" type="hidden" id="[%- mv.id -%]" name="[%- mv.name -%]" size="67" maxlength="[%- mv.maxlength -%]" value="[%- mv.value -%]" />
338
                [% ELSIF ( mv.type == 'hidden_simple' ) %]
339
                    <input type="hidden" name="[%- mv.name -%]" />
340
                [% END %]
315
341
316
                <span class="subfield_controls">
342
                <span class="subfield_controls">
317
                [% IF ( subfield_loo.repeatable ) %]
343
                [% IF ( subfield_loo.repeatable ) %]
318
- 

Return to bug 12177