[Koha-cvs] koha/import breeding.pl [dev_week]

Ryan Higgins rch at liblime.com
Thu Mar 29 11:44:11 CEST 2007


CVSROOT:	/sources/koha
Module name:	koha
Branch:		dev_week
Changes by:	Ryan Higgins <rych>	07/03/29 09:44:11

Modified files:
	import         : breeding.pl 

Log message:
	fixed tabs, add chomp for files w/ newline chars

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/import/breeding.pl?cvsroot=koha&only_with_tag=dev_week&r1=1.2.4.5&r2=1.2.4.5.2.1

Patches:
Index: breeding.pl
===================================================================
RCS file: /sources/koha/koha/import/Attic/breeding.pl,v
retrieving revision 1.2.4.5
retrieving revision 1.2.4.5.2.1
diff -u -b -r1.2.4.5 -r1.2.4.5.2.1
--- breeding.pl	10 Feb 2006 01:36:17 -0000	1.2.4.5
+++ breeding.pl	29 Mar 2007 09:44:11 -0000	1.2.4.5.2.1
@@ -1,6 +1,6 @@
 #!/usr/bin/perl
 
-# $Id: breeding.pl,v 1.2.4.5 2006/02/10 01:36:17 kados Exp $
+# $Id: breeding.pl,v 1.2.4.5.2.1 2007/03/29 09:44:11 rych Exp $
 
 # Script for handling import of MARC data into Koha db
 #   and Z39.50 lookups
@@ -45,12 +45,6 @@
 use C4::Auth;
 use C4::Breeding;
 
-#------------------
-# Constants
-
-my $includes = C4::Context->config('includes') ||
-	"/usr/local/www/hdl/htdocs/includes";
-
 # HTML colors for alternating lines
 my $lc1='#dddddd';
 my $lc2='#ddaaaa';
@@ -77,16 +71,18 @@
 					debug => 1,
 					});
 
-$template->param(SCRIPT_NAME => $ENV{'SCRIPT_NAME'},
+$template->param(       SCRIPT_NAME => $ENV{'SCRIPT_NAME'},
 						uploadmarc => $uploadmarc);
 if ($uploadmarc && length($uploadmarc)>0) {
-	my $marcrecord='';
+    my $marcdata='';
 	while (<$uploadmarc>) {
-		$marcrecord.=$_;
+    	# in case the file has each record on a new line
+    	chomp($_);
+        $marcdata.=$_;
 	}
-	my ($notmarcrecord,$alreadyindb,$alreadyinfarm,$imported) = ImportBreeding($marcrecord,$overwrite_biblio,$filename,$syntax,int(rand(99999)));
+    my ($notmarcrecord,$alreadyindb,$alreadyinfarm,$imported) = ImportBreeding($marcdata,$overwrite_biblio,$filename,$syntax,int(rand(99999)));
 
-	$template->param(imported => $imported,
+    $template->param(       imported => $imported,
 							alreadyindb => $alreadyindb,
 							alreadyinfarm => $alreadyinfarm,
 							notmarcrecord => $notmarcrecord,
@@ -106,6 +102,9 @@
 #---------------
 # log cleared, as marcimport is (almost) rewritten from scratch.
 # $Log: breeding.pl,v $
+# Revision 1.2.4.5.2.1  2007/03/29 09:44:11  rych
+# fixed tabs, add chomp for files w/ newline chars
+#
 # Revision 1.2.4.5  2006/02/10 01:36:17  kados
 # Fixes a bug I experienced with missing qw(:standard) from CGI declaration
 #





More information about the Koha-cvs mailing list