[Koha-cvs] koha/misc bulkupdate.pl

Antoine Farnault antoine at koha-fr.org
Tue Jun 19 17:58:23 CEST 2007


CVSROOT:	/sources/koha
Module name:	koha
Changes by:	Antoine Farnault <toins>	07/06/19 15:58:23

Modified files:
	misc           : bulkupdate.pl 

Log message:
	oups... It can be more than one ISBN.... fixed now.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/misc/bulkupdate.pl?cvsroot=koha&r1=1.1&r2=1.2

Patches:
Index: bulkupdate.pl
===================================================================
RCS file: /sources/koha/koha/misc/bulkupdate.pl,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- bulkupdate.pl	18 Jun 2007 13:29:38 -0000	1.1
+++ bulkupdate.pl	19 Jun 2007 15:58:23 -0000	1.2
@@ -15,7 +15,7 @@
 # Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
 # Suite 330, Boston, MA  02111-1307 USA
 
-# $Id: bulkupdate.pl,v 1.1 2007/06/18 13:29:38 toins Exp $
+# $Id: bulkupdate.pl,v 1.2 2007/06/19 15:58:23 toins Exp $
 
 
 =head1 bulkupdate.pl 
@@ -110,18 +110,19 @@
         
         eval{
             my $record = MARC::Record->new_from_xml($marcxml,'UTF-8');
-            my $field = $record->field('010');
+            my @field = $record->field('010');
+	    foreach my $field (@field){
             my $subfield = $field->subfield('a');
             if($subfield){
                 my $isbn = $subfield;
                 $isbn =~ s/\-//g;
                 $field->update('a' => $isbn);
+		    }
+	    }
                 $marcxml = $record->as_xml('UTF-8');
-                
                 # Update
                 my $sth = $dbh->prepare($update_marcxml);
                 $sth->execute($marcxml,$biblioitemnumber);
-            }
         };
         if($@){
             print "\n /!\\ pb getting $biblioitemnumber : $@";





More information about the Koha-cvs mailing list