bug 2203 [1/2]: increase input maxlength in MARC editor

The maximum length allowed for input into a subfield in
the MARC editor has been increased to 9999 charaacters
(from 255), permitting data entry of a field that meets
the maximum MARC field limit of 9999 octets.

Also set the maximum length for the leader form input
to 24 characters and the length for the MARC21 008
to 40 characters.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
This commit is contained in:
Galen Charlton 2008-07-08 09:33:35 -05:00 committed by Joshua Ferraro
parent 386b4b15a1
commit 9035991112
2 changed files with 29 additions and 13 deletions

View file

@ -120,6 +120,14 @@ sub create_input {
$value =~ s/"/&quot;/g;
# determine maximum length; 9999 bytes per ISO 2709 except for leader and MARC21 008
my $max_length = 9999;
if ($tag eq '000') {
$max_length = 24;
} elsif ($tag eq '008' and C4::Context->preference('marcflavour') eq 'MARC21') {
$max_length = 40;
}
# if there is no value provided but a default value in parameters, get it
unless ($value) {
$value = $tagslib->{$tag}->{$subfield}->{defaultvalue};
@ -203,7 +211,7 @@ sub create_input {
type=\"text\"
id=\"".$subfield_data{id}."\"
size=\"67\"
maxlength=\"255\"
maxlength=\"$max_length\"
name=\"".$subfield_data{id}."\"
value=\"$value\"
class=\"input_marceditor\"
@ -220,7 +228,7 @@ sub create_input {
id=\"".$subfield_data{id}."\"
name=\"".$subfield_data{id}."\"
size=\"67\"
maxlength=\"255\"
maxlength=\"$max_length\"
value=\"$value\" \/>
";
}
@ -232,7 +240,7 @@ sub create_input {
class=\"input_marceditor\"
tabindex=\"1\"
size=\"67\"
maxlength=\"255\"
maxlength=\"$max_length\"
value=\"$value\"
\/>";
@ -257,7 +265,7 @@ sub create_input {
class=\"input_marceditor\"
tabindex=\"1\"
size=\"67\"
maxlength=\"255\"
maxlength=\"$max_length\"
>$value</textarea>
";
}
@ -269,7 +277,7 @@ sub create_input {
value=\"$value\"
tabindex=\"1\"
size=\"67\"
maxlength=\"255\"
maxlength=\"$max_length\"
class=\"input_marceditor\"
\/>
";

View file

@ -288,6 +288,14 @@ sub create_input {
$value =~ s/"/&quot;/g;
# determine maximum length; 9999 bytes per ISO 2709 except for leader and MARC21 008
my $max_length = 9999;
if ($tag eq '000') {
$max_length = 24;
} elsif ($tag eq '008' and C4::Context->preference('marcflavour') eq 'MARC21') {
$max_length = 40;
}
# if there is no value provided but a default value in parameters, get it
unless ($value) {
$value = $tagslib->{$tag}->{$subfield}->{defaultvalue};
@ -354,7 +362,7 @@ sub create_input {
class=\"input_marceditor\"
tabindex=\"1\"
size=\"5\"
maxlength=\"255\"
maxlength=\"$max_length\"
readonly=\"readonly\"
\/>";
@ -370,7 +378,7 @@ sub create_input {
class=\"input_marceditor\"
tabindex=\"1\"
size=\"67\"
maxlength=\"255\"
maxlength=\"$max_length\"
\/>
<a href=\"#\" class=\"buttonDot\"
onclick=\"Dopop('/cgi-bin/koha/authorities/auth_finder.pl?authtypecode=".$tagslib->{$tag}->{$subfield}->{authtypecode}."&amp;index=$subfield_data{id}','$subfield_data{id}'); return false;\" title=\"Tag Editor\">...</a>
@ -384,7 +392,7 @@ sub create_input {
class=\"input_marceditor\"
tabindex=\"1\"
size=\"67\"
maxlength=\"255\"
maxlength=\"$max_length\"
readonly=\"readonly\"
\/>
<a href=\"#\" class=\"buttonDot\"
@ -416,7 +424,7 @@ sub create_input {
class=\"input_marceditor\"
onfocus=\"Focus$function_name($index_tag)\"
size=\"67\"
maxlength=\"255\"
maxlength=\"$max_length\"
onblur=\"Blur$function_name($index_tag); \" \/>
<a href=\"#\" class=\"buttonDot\" onclick=\"Clic$function_name('$subfield_data{id}'); return false;\" title=\"Tag Editor\">...</a>
$javascript";
@ -430,7 +438,7 @@ sub create_input {
value=\"$value\"
tabindex=\"1\"
size=\"67\"
maxlength=\"255\"
maxlength=\"$max_length\"
class=\"input_marceditor\"
\/>
";
@ -444,7 +452,7 @@ sub create_input {
id=\"".$subfield_data{id}."\"
name=\"".$subfield_data{id}."\"
size=\"67\"
maxlength=\"255\"
maxlength=\"$max_length\"
value=\"$value\" \/>
";
}
@ -456,7 +464,7 @@ sub create_input {
class=\"input_marceditor\"
tabindex=\"1\"
size=\"67\"
maxlength=\"255\"
maxlength=\"$max_length\"
value=\"$value\"
\/>";
@ -491,7 +499,7 @@ sub create_input {
value=\"$value\"
tabindex=\"1\"
size=\"67\"
maxlength=\"255\"
maxlength=\"$max_length\"
class=\"input_marceditor\"
\/>
";