[Koha-cvs] koha acqui/finishreceive.pl acqui/neworderbibli...

paul poulain paul at koha-fr.org
Thu Mar 29 15:31:01 CEST 2007


CVSROOT:	/sources/koha
Module name:	koha
Changes by:	paul poulain <tipaul>	07/03/29 13:31:01

Modified files:
	acqui          : finishreceive.pl neworderbiblio.pl 
	authorities    : authorities.pl 

Log message:
	Code cleaning :
	== Biblio.pm cleaning (useless) ==
	* some sub declaration dropped
	* removed modbiblio sub
	* removed moditem sub
	* removed newitems. It was used only in finishrecieve. Replaced by a Koha2Marc+AddItem, that is better.
	* removed MARCkoha2marcItem 
	* removed MARCdelsubfield declaration 
	* removed MARCkoha2marcBiblio
	
	== Biblio.pm cleaning (naming conventions) ==
	* MARCgettagslib renamed to GetMarcStructure
	* MARCgetitems renamed to GetMarcItem
	* MARCfind_frameworkcode renamed to GetFrameworkCode
	* MARCmarc2koha renamed to TransformMarcToKoha
	* MARChtml2marc renamed to TransformHtmlToMarc
	* MARChtml2xml renamed to TranformeHtmlToXml
	* zebraop renamed to ModZebra
	
	== MARC=OFF ==
	* removing MARC=OFF related scripts (in cataloguing directory)
	* removed checkitems (function related to MARC=off feature, that is completly broken in head. If someone want to reintroduce it, hard work coming...)
	* removed getitemsbybiblioitem (used only by MARC=OFF scripts, that is removed as well)

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/acqui/finishreceive.pl?cvsroot=koha&r1=1.22&r2=1.23
http://cvs.savannah.gnu.org/viewcvs/koha/acqui/neworderbiblio.pl?cvsroot=koha&r1=1.4&r2=1.5
http://cvs.savannah.gnu.org/viewcvs/koha/authorities/authorities.pl?cvsroot=koha&r1=1.20&r2=1.21

Patches:
Index: acqui/finishreceive.pl
===================================================================
RCS file: /sources/koha/koha/acqui/finishreceive.pl,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -b -r1.22 -r1.23
--- acqui/finishreceive.pl	9 Mar 2007 14:28:54 -0000	1.22
+++ acqui/finishreceive.pl	29 Mar 2007 13:31:01 -0000	1.23
@@ -55,14 +55,18 @@
     # create items if the user has entered barcodes
     my $barcode=$input->param('barcode');
     my @barcodes=split(/\,| |\|/,$barcode);
-    my ($error) = newitems({ biblioitemnumber => $biblioitemnumber,
-                    biblionumber     => $biblionumber,
-                    replacementprice => $replacement,
-                    price            => $cost,
-                    booksellerid     => $supplierid,
-                    homebranch       => $branch,
-                    loan             => 0 },
-                @barcodes);
+    # foreach barcode provided, build the item MARC::Record and create the item
+    foreach my $bc (@barcodes) {
+        my $itemRecord = Koha2Marc({
+                    "items.replacementprice" => $replacement,
+                    "items.price"            => $cost,
+                    "items.booksellerid"     => $supplierid,
+                    "items.homebranch"       => $branch,
+                    "items.holdingbranch"    => $branch,
+                    "items.barcode"          => $bc,
+                    "items.loan"             => 0, });
+        AddItem($itemRecord,$biblionumber);
+    }
     print $input->redirect("/cgi-bin/koha/acqui/parcel.pl?invoice=$invoiceno&supplierid=$supplierid&freight=$freight&gst=$gst&datereceived=$datereceived");
 } else {
     print $input->header;

Index: acqui/neworderbiblio.pl
===================================================================
RCS file: /sources/koha/koha/acqui/neworderbiblio.pl,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- acqui/neworderbiblio.pl	9 Mar 2007 15:34:17 -0000	1.4
+++ acqui/neworderbiblio.pl	29 Mar 2007 13:31:01 -0000	1.5
@@ -106,7 +106,7 @@
 for(my $i=0;$i<$hits;$i++) {
     my %resultsloop;
     my $marcrecord = MARC::File::USMARC::decode($marcresults->[$i]);
-    my $biblio = MARCmarc2koha(C4::Context->dbh,$marcrecord,'');
+    my $biblio = TransformMarcToKoha(C4::Context->dbh,$marcrecord,'');
 
     #build the hash for the template.
     %resultsloop=%$biblio;

Index: authorities/authorities.pl
===================================================================
RCS file: /sources/koha/koha/authorities/authorities.pl,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -b -r1.20 -r1.21
--- authorities/authorities.pl	28 Mar 2007 10:39:16 -0000	1.20
+++ authorities/authorities.pl	29 Mar 2007 13:31:01 -0000	1.21
@@ -1,6 +1,6 @@
 #!/usr/bin/perl
 
-# $Id: authorities.pl,v 1.20 2007/03/28 10:39:16 hdl Exp $
+# $Id: authorities.pl,v 1.21 2007/03/29 13:31:01 tipaul Exp $
 
 # Copyright 2000-2002 Katipo Communications
 #
@@ -385,7 +385,7 @@
 	# build indicator hash.
 	my @ind_tag = $input->param('ind_tag');
 	my @indicator = $input->param('indicator');
-	my $xml = MARChtml2xml(\@tags,\@subfields,\@values,\@indicator,\@ind_tag);
+	my $xml = TransformHtmlToXml(\@tags,\@subfields,\@values,\@indicator,\@ind_tag);
 #     warn $record->as_formatted;
 	warn $xml;
 	my $record=MARC::Record->new_from_xml($xml,'UTF-8',(C4::Context->preference("marcflavour") eq "UNIMARC"?"UNIMARCAUTH":C4::Context->preference("marcflavour")));
@@ -432,7 +432,7 @@
 	# build indicator hash.
 	my @ind_tag = $input->param('ind_tag');
 	my @indicator = $input->param('indicator');
-	my $xml = MARChtml2xml(\@tags,\@subfields,\@values,\@indicator,\@ind_tag);
+	my $xml = TransformHtmlToXml(\@tags,\@subfields,\@values,\@indicator,\@ind_tag);
 	my $record=MARC::Record->new_from_xml($xml,'UTF-8');
 	$record->encoding('UTF-8');
 	# adding an empty field





More information about the Koha-cvs mailing list