From 64126042386e92a068e30f6c9652104340a6d846 Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Mon, 11 Feb 2008 16:21:55 -0600 Subject: [PATCH] fix XHTML validation errors in addbiblio.pl Signed-off-by: Joshua Ferraro --- cataloguing/addbiblio.pl | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/cataloguing/addbiblio.pl b/cataloguing/addbiblio.pl index 532217ecd8..6a7efe6d8d 100755 --- a/cataloguing/addbiblio.pl +++ b/cataloguing/addbiblio.pl @@ -301,9 +301,15 @@ sub create_input { $value =~ s/DD/$day/g; } my $dbh = C4::Context->dbh; + + # map '@' as "subfield" label for fixed fields + # to something that's allowed in a div id. + my $id_subfield = $subfield; + $id_subfield = "00" if $id_subfield eq "@"; + my %subfield_data = ( tag => $tag, - subfield => $subfield, + subfield => $id_subfield, marc_lib => substr( $tagslib->{$tag}->{$subfield}->{lib}, 0, 22 ), marc_lib_plain => $tagslib->{$tag}->{$subfield}->{lib}, tag_mandatory => $tagslib->{$tag}->{mandatory}, @@ -311,16 +317,10 @@ sub create_input { repeatable => $tagslib->{$tag}->{$subfield}->{repeatable}, kohafield => $tagslib->{$tag}->{$subfield}->{kohafield}, index => $index_tag, - id => "tag_".$tag."_subfield_".$subfield."_".$index_tag."_".$index_subfield, + id => "tag_".$tag."_subfield_".$id_subfield."_".$index_tag."_".$index_subfield, value => $value, random => CreateKey(), ); - # deal with a <010 tag - if($subfield eq '@'){ - $subfield_data{id} = "tag_".$tag."_subfield_00_".$index_tag."_".$index_subfield; - } else { - $subfield_data{id} = "tag_".$tag."_subfield_".$subfield."_".$index_tag."_".$index_subfield; - } if(exists $mandatory_z3950->{$tag.$subfield}){ $subfield_data{z3950_mandatory} = $mandatory_z3950->{$tag.$subfield}; @@ -353,7 +353,7 @@ sub create_input { maxlength=\"255\" \/> {$tag}->{$subfield}->{authtypecode}."&index=$subfield_data{id}','$subfield_data{id}'); return false;\" title=\"Tag Editor\">... + onclick=\"Dopop('/cgi-bin/koha/authorities/auth_finder.pl?authtypecode=".$tagslib->{$tag}->{$subfield}->{authtypecode}."&index=$subfield_data{id}','$subfield_data{id}'); return false;\" title=\"Tag Editor\">... "; # it's a plugin field } @@ -444,8 +444,6 @@ sub create_input { name=\"".$subfield_data{id}."\" class=\"input_marceditor\" tabindex=\"1\" - size=\"67\" - maxlength=\"255\" >$value "; } @@ -752,7 +750,7 @@ foreach my $thisframeworkcode ( keys %$frameworks ) { frameworktext => $frameworks->{$thisframeworkcode}->{'frameworktext'}, ); if ($frameworkcode eq $thisframeworkcode){ - $row{'selected'}="selected"; + $row{'selected'}="selected=\"selected\""; } push @frameworkcodeloop, \%row; } -- 2.39.5