[Koha-cvs] CVS: koha/misc bulkmarcimport.pl,1.6,1.7 fines2.pl,1.9,1.10 Install.pm,1.69,1.70

Paul POULAIN tipaul at users.sourceforge.net
Mon Dec 22 20:17:00 CET 2003


Update of /cvsroot/koha/koha/misc
In directory sc8-pr-cvs1:/tmp/cvs-serv17960/misc

Modified Files:
	bulkmarcimport.pl fines2.pl Install.pm 
Log Message:
sync'ing with rel_2_0 (mostly prepare/execute pb, bug #662)

Index: bulkmarcimport.pl
===================================================================
RCS file: /cvsroot/koha/koha/misc/bulkmarcimport.pl,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -r1.6 -r1.7
*** bulkmarcimport.pl	12 Dec 2003 10:48:20 -0000	1.6
--- bulkmarcimport.pl	22 Dec 2003 19:16:58 -0000	1.7
***************
*** 81,85 ****
  	#now, parse the record, extract the item fields, and store them in somewhere else.
  
- #	$record = MARC::File::USMARC::decode(char_decode($record->as_usmarc(),$char_encoding));
      ## create an empty record object to populate
      my $newRecord = MARC::Record->new();
--- 81,84 ----
***************
*** 99,104 ****
  	# go through each subfield code/data pair
  	foreach my $pair ( $oldField->subfields() ) { 
! 	    # upper case the data portion and store
! 	    push( @newSubfields, $pair->[0], char_decode($pair->[1],$char_encoding) );
  	}
  
--- 98,104 ----
  	# go through each subfield code/data pair
  	foreach my $pair ( $oldField->subfields() ) { 
! 		$pair->[1] =~ s/\<//g;
! 		$pair->[1] =~ s/\>//g;
! 		push( @newSubfields, $pair->[0], char_decode($pair->[1],$char_encoding) );
  	}
  

Index: fines2.pl
===================================================================
RCS file: /cvsroot/koha/koha/misc/fines2.pl,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -r1.9 -r1.10
*** fines2.pl	13 Oct 2002 10:44:59 -0000	1.9
--- fines2.pl	22 Dec 2003 19:16:58 -0000	1.10
***************
*** 110,116 ****
                                                   #
  	 my $dbh = C4::Context->dbh;
! 	 my $query="Select * from borrowers where borrowernumber='$borrower->{'guarantor'}'";
! 	 my $sth=$dbh->prepare($query);
! 	 $sth->execute;
  	 my $tdata=$sth->fetchrow_hashref;
  	 $sth->finish;
--- 110,115 ----
                                                   #
  	 my $dbh = C4::Context->dbh;
! 	 my $sth=$dbh->prepare("Select * from borrowers where borrowernumber=?");
! 	 $sth->execute($borrower->{'guarantor'});
  	 my $tdata=$sth->fetchrow_hashref;
  	 $sth->finish;
***************
*** 138,157 ****
                # this should be a separate function
                #
! 	  $item->{'title'}=~ s/\'/\\'/g;
! 	  my $query="Insert into accountlines
  	  (borrowernumber,itemnumber,accountno,date,amount,
  	  description,accounttype,amountoutstanding) values
! 	  ($data->[$i]->{'borrowernumber'},$data->[$i]->{'itemnumber'},
! 	  '$accountno',now(),'$cost','Lost item $item->{'title'} $item->{'barcode'} $due','L','$cost')";
! 	  my $sth=$dbh->prepare($query);
! 	  $sth->execute;
  	  $sth->finish;
! 	  $query="update items set itemlost=2 where itemnumber='$data->[$i]->{'itemnumber'}'";
! 	  $sth=$dbh->prepare($query);
! 	  $sth->execute;
  	  $sth->finish;
- 	} else { # FIXME
- 	         # this should be deleted
-                  #
  	}
        }
--- 137,150 ----
                # this should be a separate function
                #
! 	  my $sth=$dbh->prepare("Insert into accountlines
  	  (borrowernumber,itemnumber,accountno,date,amount,
  	  description,accounttype,amountoutstanding) values
! 	  (?,?,?,now(),?,?,'L',?)");
! 	  $sth->execute($data->[$i]->{'borrowernumber'},$data->[$i]->{'itemnumber'},
! 	  $accountno,$cost,"Lost item $item->{'title'} $item->{'barcode'} $due",$cost);
  	  $sth->finish;
! 	  $sth=$dbh->prepare("update items set itemlost=2 where itemnumber=?");
! 	  $sth->execute($data->[$i]->{'itemnumber'});
  	  $sth->finish;
  	}
        }

Index: Install.pm
===================================================================
RCS file: /cvsroot/koha/koha/misc/Install.pm,v
retrieving revision 1.69
retrieving revision 1.70
diff -C2 -r1.69 -r1.70
*** Install.pm	11 Dec 2003 12:39:05 -0000	1.69
--- Install.pm	22 Dec 2003 19:16:58 -0000	1.70
***************
*** 846,850 ****
      if (@missing > 0) {
  	my $missing='';
! 	if (POSIX::setlocale(LC_ALL) != "C") {
  		$missing.="   export LC_ALL=C\n";  
  	}
--- 846,850 ----
      if (@missing > 0) {
  	my $missing='';
! 	if (POSIX::setlocale(LC_ALL) ne "C") {
  		$missing.="   export LC_ALL=C\n";  
  	}





More information about the Koha-cvs mailing list