[Koha-cvs] koha/acqui.simple addbiblio.pl [rel_2_2]

Joshua Ferraro jmf at kados.org
Thu Apr 13 07:50:25 CEST 2006


CVSROOT:	/sources/koha
Module name:	koha
Branch: 	rel_2_2
Changes by:	Joshua Ferraro <kados at savannah.gnu.org>	06/04/13 05:50:25

Modified files:
	acqui.simple   : addbiblio.pl 

Log message:
	partial fix for encoding probs in MARC editor

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/koha/acqui.simple/addbiblio.pl.diff?only_with_tag=rel_2_2&tr1=1.52.2.37&tr2=1.52.2.38&r1=text&r2=text

Patches:
Index: koha/acqui.simple/addbiblio.pl
diff -u koha/acqui.simple/addbiblio.pl:1.52.2.37 koha/acqui.simple/addbiblio.pl:1.52.2.38
--- koha/acqui.simple/addbiblio.pl:1.52.2.37	Fri Apr  7 11:45:58 2006
+++ koha/acqui.simple/addbiblio.pl	Thu Apr 13 05:50:25 2006
@@ -1,6 +1,6 @@
 #!/usr/bin/perl
 
-# $Id: addbiblio.pl,v 1.52.2.37 2006/04/07 11:45:58 tipaul Exp $
+# $Id: addbiblio.pl,v 1.52.2.38 2006/04/13 05:50:25 kados Exp $
 
 # Copyright 2000-2002 Katipo Communications
 #
@@ -32,7 +32,9 @@
 use HTML::Template;
 use MARC::File::USMARC;
 use MARC::File::XML;
-  
+if (C4::Context->preference('marcflavour') eq 'UNIMARC') {
+	MARC::File::XML->default_record_format( 'UNIMARC' );
+}
 use vars qw( $tagslib);
 use vars qw( $authorised_values_sth);
 use vars qw( $is_a_modif );
@@ -447,7 +449,10 @@
 	my @ind_tag = $input->param('ind_tag');
 	my @indicator = $input->param('indicator');
 	my $xml = MARChtml2xml(\@tags,\@subfields,\@values,\@indicator,\@ind_tag);
-    my $record=MARC::Record::new_from_xml($xml, 'UTF-8');
+	#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";
 	# 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');
@@ -494,7 +499,7 @@
 	my @ind_tag = $input->param('ind_tag');
 	my @indicator = $input->param('indicator');
 	my $xml = MARChtml2xml(\@tags,\@subfields,\@values,\@indicator,\@ind_tag);
-	my $record=MARC::Record::new_from_xml($xml, 'UTF-8');
+	my $record=MARC::Record->new_from_xml($xml, C4::Context->preference('TemplateEncoding'),C4::Context->preference('marcflavour'));
 	# adding an empty field
 	my $field = MARC::Field->new("$addedfield",'','','$tagaddfield_subfield' => "");
 	$record->append_fields($field);





More information about the Koha-cvs mailing list