remove a SQL limit & the items table stuff
authorPaul POULAIN <paul@koha-fr.org>
Mon, 19 Nov 2007 17:55:25 +0000 (18:55 +0100)
committerJoshua Ferraro <jmf@liblime.com>
Tue, 20 Nov 2007 22:22:55 +0000 (16:22 -0600)
The authoritative data for the items is the items table, not the MARC data.

Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
misc/rebuildnonmarc.pl

index 21063d2..176e490 100755 (executable)
@@ -67,16 +67,8 @@ while (my ($biblionumber)= $sth->fetchrow) {
         $nbitems++;
     }
 #     print "$biblionumber\n";
-    # now, create biblio and items with NEWnewXX call.
     my $frameworkcode = GetFrameworkCode($biblionumber);
     localNEWmodbiblio($dbh,$record,$biblionumber,$frameworkcode) unless $test_parameter;
-#     warn 'B=>'.$record->as_formatted;
-#     print "biblio done\n";
-    for (my $i=0;$i<=$#items;$i++) {
-        my $tmp = TransformMarcToKoha($dbh,$items[$i],$frameworkcode) unless $test_parameter; # finds the itemnumber
-        localNEWmoditem($dbh,$items[$i],$biblionumber,$tmp->{itemnumber},0) unless $test_parameter;
-#         print "1 item done\n";
-    }
 }
 # $dbh->do("unlock tables");
 my $timeneeded = time() - $starttime;
@@ -93,17 +85,3 @@ sub localNEWmodbiblio {
     return 1;
 }
 
-sub localNEWmoditem {
-    my ( $dbh, $record, $biblionumber, $itemnumber, $delete ) = @_;
-#     warn "NEWmoditem $biblionumber / $itemnumber / $delete ".$record->as_formatted;
-    my $frameworkcode=GetFrameworkCode($biblionumber);
-    my $olditem = TransformMarcToKoha( $dbh, $record, $frameworkcode, 'items' );
-#     warn "OLDITEM : ".Data::Dumper::Dumper( $olditem );
-    my $sth =  $dbh->prepare("SELECT biblioitemnumber FROM biblioitems WHERE biblionumber=?");
-    $sth->execute($biblionumber);
-    my ($biblioitemnumber) = $sth->fetchrow;
-    $sth->finish(); 
-    $olditem->{'biblioitemnumber'} = $biblioitemnumber;
-    C4::Biblio::_koha_modify_item( $dbh, $olditem );
-#     die;
-}