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

Joshua Ferraro jmf at kados.org
Wed Mar 1 18:25:11 CET 2006


CVSROOT:	/sources/koha
Module name:	koha
Branch: 	rel_2_2
Changes by:	Joshua Ferraro <kados at savannah.gnu.org>	06/03/01 17:25:11

Modified files:
	acqui.simple   : additem.pl 

Log message:
	Add support for new MARChtml2xml routine.

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

Patches:
Index: koha/acqui.simple/additem.pl
diff -u koha/acqui.simple/additem.pl:1.27.2.12 koha/acqui.simple/additem.pl:1.27.2.13
--- koha/acqui.simple/additem.pl:1.27.2.12	Sun Feb  5 21:59:21 2006
+++ koha/acqui.simple/additem.pl	Wed Mar  1 17:25:11 2006
@@ -1,6 +1,6 @@
 #!/usr/bin/perl
 
-# $Id: additem.pl,v 1.27.2.12 2006/02/05 21:59:21 kados Exp $
+# $Id: additem.pl,v 1.27.2.13 2006/03/01 17:25:11 kados Exp $
 
 # Copyright 2000-2002 Katipo Communications
 #
@@ -75,11 +75,13 @@
 	# build indicator hash.
 	my @ind_tag = $input->param('ind_tag');
 	my @indicator = $input->param('indicator');
-	my %indicators;
-	for (my $i=0;$i<=$#ind_tag;$i++) {
-		$indicators{$ind_tag[$i]} = $indicator[$i];
-	}
-	my $record = MARChtml2marc($dbh,\@tags,\@subfields,\@values,%indicators);
+	#my %indicators;
+	#for (my $i=0;$i<=$#ind_tag;$i++) {
+	#	$indicators{$ind_tag[$i]} = $indicator[$i];
+	#}
+	my $xml = MARChtml2xml(\@tags,\@subfields,\@values,\@indicator,\@ind_tag);
+        my $record=MARC::Record::new_from_xml($xml);
+	#my $record = MARChtml2marc($dbh,\@tags,\@subfields,\@values,%indicators);
 	# if autoBarcode is ON, calculate barcode...
 	if (C4::Context->preference('autoBarcode')) {
 		my ($tagfield,$tagsubfield) = &MARCfind_marc_from_kohafield($dbh,"items.barcode");
@@ -131,11 +133,13 @@
 	my @ind_tag = $input->param('ind_tag');
 	my @indicator = $input->param('indicator');
 #	my $itemnum = $input->param('itemnum');
-	my %indicators;
-	for (my $i=0;$i<=$#ind_tag;$i++) {
-		$indicators{$ind_tag[$i]} = $indicator[$i];
-	}
-	my $record = MARChtml2marc($dbh,\@tags,\@subfields,\@values,%indicators);
+	#my %indicators;
+	#for (my $i=0;$i<=$#ind_tag;$i++) {
+	#	$indicators{$ind_tag[$i]} = $indicator[$i];
+	#}
+	my $xml = MARChtml2xml(\@tags,\@subfields,\@values,\@indicator,\@ind_tag);
+        my $record=MARC::Record::new_from_xml($xml);
+	#my $record = MARChtml2marc($dbh,\@tags,\@subfields,\@values,%indicators);
 # MARC::Record builded => now, record in DB
 # warn "R: ".$record->as_formatted;
 	my ($oldbiblionumber,$oldbibnum,$oldbibitemnum) = NEWmoditem($dbh,$record,$bibid,$itemnum,0);





More information about the Koha-cvs mailing list