koha-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Koha-cvs] koha/cataloguing addbiblio.pl [rel_3_0]


From: Bruno Toumi
Subject: [Koha-cvs] koha/cataloguing addbiblio.pl [rel_3_0]
Date: Tue, 06 Feb 2007 15:51:56 +0000

CVSROOT:        /sources/koha
Module name:    koha
Branch:         rel_3_0
Changes by:     Bruno Toumi <btoumi>    07/02/06 15:51:56

Modified files:
        cataloguing    : addbiblio.pl 

Log message:
        add possibility to filter isbn for duplicate  field 10 

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/cataloguing/addbiblio.pl?cvsroot=koha&only_with_tag=rel_3_0&r1=1.14.2.25&r2=1.14.2.26

Patches:
Index: addbiblio.pl
===================================================================
RCS file: /sources/koha/koha/cataloguing/addbiblio.pl,v
retrieving revision 1.14.2.25
retrieving revision 1.14.2.26
diff -u -b -r1.14.2.25 -r1.14.2.26
--- addbiblio.pl        31 Jan 2007 16:22:53 -0000      1.14.2.25
+++ addbiblio.pl        6 Feb 2007 15:51:56 -0000       1.14.2.26
@@ -1,6 +1,6 @@
 #!/usr/bin/perl 
 
-# $Id: addbiblio.pl,v 1.14.2.25 2007/01/31 16:22:53 btoumi Exp $
+# $Id: addbiblio.pl,v 1.14.2.26 2007/02/06 15:51:56 btoumi Exp $
 
 # Copyright 2000-2002 Katipo Communications
 #
@@ -96,17 +96,19 @@
     $sth->execute($id);
     my ($file,$marc,$encoding) = $sth->fetchrow;
     if ($marc) {
-#         $marc =~ s/frey0103/frey50  /;
         my $record = MARC::Record->new_from_usmarc($marc);
-#         warn "REC : $marc = ".$record->as_formatted;
-       if ($record->subfield('010','a')){
-       my $f010a=$record->subfield('010','a');
-       my $f010 = $record->field('010');
-       $record->delete_field($f010);
-       my $newisbn = $f010a;
+       if ($record->field('010')){ 
+       foreach my $field ($record->field('010'))
+               {
+                       foreach my $subfield ($field->subfield('a')){
+                               my $newisbn = $field->subfield('a');
        $newisbn =~ s/-//g;
-       $f010->update('a' => $newisbn);
-       $record->insert_fields_ordered($f010);
+                               $field->update( 'a' => $newisbn );
+                               
+                                               
+                       }
+#                      $record->insert_fields_ordered($record->field('010'));
+               }               
        }
        
     if ($record->subfield(100,'a')){




reply via email to

[Prev in Thread] Current Thread [Next in Thread]