From 9035991112fb3ef7613bfcc095a103182d742b7d Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Tue, 8 Jul 2008 09:33:35 -0500 Subject: [PATCH] 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 --- authorities/authorities.pl | 18 +++++++++++++----- cataloguing/addbiblio.pl | 24 ++++++++++++++++-------- 2 files changed, 29 insertions(+), 13 deletions(-) diff --git a/authorities/authorities.pl b/authorities/authorities.pl index 1cb8f8cb60..518f9464d5 100755 --- a/authorities/authorities.pl +++ b/authorities/authorities.pl @@ -120,6 +120,14 @@ sub create_input { $value =~ s/"/"/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 "; } @@ -269,7 +277,7 @@ sub create_input { value=\"$value\" tabindex=\"1\" size=\"67\" - maxlength=\"255\" + maxlength=\"$max_length\" class=\"input_marceditor\" \/> "; diff --git a/cataloguing/addbiblio.pl b/cataloguing/addbiblio.pl index ca07b26966..b27b6fa96b 100755 --- a/cataloguing/addbiblio.pl +++ b/cataloguing/addbiblio.pl @@ -288,6 +288,14 @@ sub create_input { $value =~ s/"/"/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\" \/> {$tag}->{$subfield}->{authtypecode}."&index=$subfield_data{id}','$subfield_data{id}'); return false;\" title=\"Tag Editor\">... @@ -384,7 +392,7 @@ sub create_input { class=\"input_marceditor\" tabindex=\"1\" size=\"67\" - maxlength=\"255\" + maxlength=\"$max_length\" readonly=\"readonly\" \/> ... $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\" \/> "; -- 2.39.5