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

(-)a/C4/Items.pm (-7 / +8 lines)
Lines 2412-2417 sub PrepareItemrecordDisplay { Link Here
2412
                    $defaultvalue =~ s/"/"/g;
2412
                    $defaultvalue =~ s/"/"/g;
2413
                }
2413
                }
2414
2414
2415
                my $maxlength = $tagslib->{$tag}->{$subfield}->{maxlength};
2416
2415
                # search for itemcallnumber if applicable
2417
                # search for itemcallnumber if applicable
2416
                if ( $tagslib->{$tag}->{$subfield}->{kohafield} eq 'items.itemcallnumber'
2418
                if ( $tagslib->{$tag}->{$subfield}->{kohafield} eq 'items.itemcallnumber'
2417
                    && C4::Context->preference('itemcallnumber') ) {
2419
                    && C4::Context->preference('itemcallnumber') ) {
Lines 2549-2565 sub PrepareItemrecordDisplay { Link Here
2549
                        my $tab= $plugin->noclick? '-1': '';
2551
                        my $tab= $plugin->noclick? '-1': '';
2550
                        my $class= $plugin->noclick? ' disabled': '';
2552
                        my $class= $plugin->noclick? ' disabled': '';
2551
                        my $title= $plugin->noclick? 'No popup': 'Tag editor';
2553
                        my $title= $plugin->noclick? 'No popup': 'Tag editor';
2552
                        $subfield_data{marc_value} = qq[<input type="text" id="$subfield_data{id}" name="field_value" class="input_marceditor" size="50" maxlength="255" value="$defaultvalue" /><a href="#" id="buttonDot_$subfield_data{id}" tabindex="$tab" class="buttonDot $class" title="$title">...</a>\n].$plugin->javascript;
2554
                        $subfield_data{marc_value} = qq[<input type="text" id="$subfield_data{id}" name="field_value" class="input_marceditor" size="50" maxlength="$maxlength" value="$defaultvalue" /><a href="#" id="buttonDot_$subfield_data{id}" tabindex="$tab" class="buttonDot $class" title="$title">...</a>\n].$plugin->javascript;
2553
                    } else {
2555
                    } else {
2554
                        warn $plugin->errstr;
2556
                        warn $plugin->errstr;
2555
                        $subfield_data{marc_value} = qq(<input type="text" id="$subfield_data{id}" name="field_value" class="input_marceditor" size="50" maxlength="255" value="$defaultvalue" />); # supply default input form
2557
                        $subfield_data{marc_value} = qq(<input type="text" id="$subfield_data{id}" name="field_value" class="input_marceditor" size="50" maxlength="$maxlength" value="$defaultvalue" />); # supply default input form
2556
                    }
2558
                    }
2557
                }
2559
                }
2558
                elsif ( $tag eq '' ) {       # it's an hidden field
2560
                elsif ( $tag eq '' ) {       # it's an hidden field
2559
                    $subfield_data{marc_value} = qq(<input type="hidden" tabindex="1" id="$subfield_data{id}" name="field_value" class="input_marceditor" size="50" maxlength="255" value="$defaultvalue" />);
2561
                    $subfield_data{marc_value} = qq(<input type="hidden" tabindex="1" id="$subfield_data{id}" name="field_value" class="input_marceditor" size="50" maxlength="$maxlength" value="$defaultvalue" />);
2560
                }
2562
                }
2561
                elsif ( $tagslib->{$tag}->{$subfield}->{'hidden'} ) {   # FIXME: shouldn't input type be "hidden" ?
2563
                elsif ( $tagslib->{$tag}->{$subfield}->{'hidden'} ) {   # FIXME: shouldn't input type be "hidden" ?
2562
                    $subfield_data{marc_value} = qq(<input type="text" tabindex="1" id="$subfield_data{id}" name="field_value" class="input_marceditor" size="50" maxlength="255" value="$defaultvalue" />);
2564
                    $subfield_data{marc_value} = qq(<input type="text" tabindex="1" id="$subfield_data{id}" name="field_value" class="input_marceditor" size="50" maxlength="$maxlength" value="$defaultvalue" />);
2563
                }
2565
                }
2564
                elsif ( length($defaultvalue) > 100
2566
                elsif ( length($defaultvalue) > 100
2565
                            or (C4::Context->preference("marcflavour") eq "UNIMARC" and
2567
                            or (C4::Context->preference("marcflavour") eq "UNIMARC" and
Lines 2568-2576 sub PrepareItemrecordDisplay { Link Here
2568
                                  500 <= $tag && $tag < 600                     )
2570
                                  500 <= $tag && $tag < 600                     )
2569
                          ) {
2571
                          ) {
2570
                    # oversize field (textarea)
2572
                    # oversize field (textarea)
2571
                    $subfield_data{marc_value} = qq(<textarea tabindex="1" id="$subfield_data{id}" name="field_value" class="input_marceditor" size="50" maxlength="255">$defaultvalue</textarea>\n");
2573
                    $subfield_data{marc_value} = qq(<textarea tabindex="1" id="$subfield_data{id}" name="field_value" class="input_marceditor" size="50" maxlength="$maxlength">$defaultvalue</textarea>\n");
2572
                } else {
2574
                } else {
2573
                    $subfield_data{marc_value} = "<input type=\"text\" name=\"field_value\" value=\"$defaultvalue\" size=\"50\" maxlength=\"255\" />";
2575
                    $subfield_data{marc_value} = "<input type=\"text\" name=\"field_value\" value=\"$defaultvalue\" size=\"50\" maxlength=\"$maxlength\" />";
2574
                }
2576
                }
2575
                push( @loop_data, \%subfield_data );
2577
                push( @loop_data, \%subfield_data );
2576
            }
2578
            }
2577
- 

Return to bug 13735