From d971d592307bfeabc1f9642b8858aa6f5d518437 Mon Sep 17 00:00:00 2001 From: tipaul Date: Fri, 2 Jun 2006 15:32:52 +0000 Subject: [PATCH] - moving active color to grey instead of yellow - ******** IMPORTANT ********* if TemplateEncoding system preference is set to iso8859-1, there are a lot of encoding problems : MARC::File::XML don't like it, as MARC::Record is supposed to work in MARC8 or UNICODE. Thus, it seems that all accents are transformed in the process html => xml => marc. Thus, i've reintroduced the html => marc behaviour if the TemplateEncoding is set to iso8859-1 (i've fixed the html2marc as joshua proposed previously, fixing a remaining bug) This solution is a workaround : we will have to find a correct solution for Koha 3.0, to move every Koha to UNICODE and UNICODE only. But for instance, I tried some things but failed. Thust this solution, that works correctly for french libraries and should change nothing for unicode ones. --- acqui.simple/addbiblio.pl | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/acqui.simple/addbiblio.pl b/acqui.simple/addbiblio.pl index d42d34f922..d01583e8b8 100755 --- a/acqui.simple/addbiblio.pl +++ b/acqui.simple/addbiblio.pl @@ -177,7 +177,6 @@ sub build_authorized_values_list ($$$$$) { push @authorised_values, $itemtype; $authorised_lib{$itemtype}=$description; } - $value=$itemtype unless ($value); #---- "true" authorised value } else { @@ -212,7 +211,7 @@ sub create_input () { my %subfield_data; $subfield_data{tag}=$tag; $subfield_data{subfield}=$subfield; - $subfield_data{marc_lib}="".$tagslib->{$tag}->{$subfield}->{lib}.""; + $subfield_data{marc_lib}=$tagslib->{$tag}->{$subfield}->{lib}; $subfield_data{marc_lib_plain}=$tagslib->{$tag}->{$subfield}->{lib}; $subfield_data{tag_mandatory}=$tagslib->{$tag}->{mandatory}; $subfield_data{mandatory}=$tagslib->{$tag}->{$subfield}->{mandatory}; @@ -225,7 +224,7 @@ sub create_input () { $subfield_data{marc_value}= build_authorized_values_list($tag, $subfield, $value, $dbh,$authorised_values_sth); # it's a thesaurus / authority field } elsif ($tagslib->{$tag}->{$subfield}->{authtypecode}) { - $subfield_data{marc_value}=" {$tag}->{$subfield}->{authtypecode}','subfield$tag$i')\">..."; + $subfield_data{marc_value}=" {$tag}->{$subfield}->{authtypecode}','subfield$tag$i')\">..."; # it's a plugin field } elsif ($tagslib->{$tag}->{$subfield}->{'value_builder'}) { # opening plugin. Just check wether we are on a developper computer on a production one @@ -241,15 +240,15 @@ sub create_input () { $subfield_data{marc_value}=" ... $javascript"; # it's an hidden field } elsif ($tag eq '') { - $subfield_data{marc_value}=""; + $subfield_data{marc_value}=""; } elsif ($tagslib->{$tag}->{$subfield}->{'hidden'}) { - $subfield_data{marc_value}=""; + $subfield_data{marc_value}=""; # it's a standard field } else { if (length($value) >100) { $subfield_data{marc_value}=""; } else { - $subfield_data{marc_value}=""; #" + $subfield_data{marc_value}=""; #" } } return \%subfield_data; @@ -486,11 +485,13 @@ if ($op eq "addbiblio") { # build indicator hash. my @ind_tag = $input->param('ind_tag'); my @indicator = $input->param('indicator'); - my $xml = MARChtml2xml(\@tags,\@subfields,\@values,\@indicator,\@ind_tag); - #warn $xml; - my $record=MARC::Record->new_from_xml($xml,C4::Context->preference('TemplateEncoding'),C4::Context->preference('marcflavour')); - #warn $record->as_formatted; - #warn "IN ADDBIB"; + my $record; + if (C4::Context->preference('TemplateEncoding') eq "iso-8859-1") { + $record = MARChtml2marc($dbh,\@tags,\@subfields,\@values,\@indicator,\@ind_tag); + } else { + my $xml = MARChtml2xml(\@tags,\@subfields,\@values,\@indicator,\@ind_tag); + $record=MARC::Record->new_from_xml($xml,C4::Context->preference('TemplateEncoding'),C4::Context->preference('marcflavour')); + } # check for a duplicate my ($duplicatebiblionumber,$duplicatebibid,$duplicatetitle) = FindDuplicate($record) if ($op eq "addbiblio") && (!$is_a_modif); my $confirm_not_duplicate = $input->param('confirm_not_duplicate'); -- 2.39.5