[Koha-cvs] CVS: koha/C4 Biblio.pm,1.37,1.38 Catalogue.pm,1.29,1.30 Search.pm,1.57,1.58

Paul POULAIN tipaul at users.sourceforge.net
Thu Feb 27 17:52:06 CET 2003


Update of /cvsroot/koha/koha/C4
In directory sc8-pr-cvs1:/tmp/cvs-serv2685/C4

Modified Files:
	Biblio.pm Catalogue.pm Search.pm 
Log Message:
* moving prepare / execute to ? form.
* some # cleaning
* little bugfix.
* road to 1.9.2 => acquisition and cataloguing merging

Index: Biblio.pm
===================================================================
RCS file: /cvsroot/koha/koha/C4/Biblio.pm,v
retrieving revision 1.37
retrieving revision 1.38
diff -C2 -r1.37 -r1.38
*** Biblio.pm	12 Feb 2003 11:03:03 -0000	1.37
--- Biblio.pm	27 Feb 2003 16:51:59 -0000	1.38
***************
*** 2,5 ****
--- 2,11 ----
  # $Id$
  # $Log$
+ # Revision 1.38  2003/02/27 16:51:59  tipaul
+ # * moving prepare / execute to ? form.
+ # * some # cleaning
+ # * little bugfix.
+ # * road to 1.9.2 => acquisition and cataloguing merging
+ #
  # Revision 1.37  2003/02/12 11:03:03  tipaul
  # Support for 000 -> 010 fields.
***************
*** 1522,1533 ****
  							$item->{'price'},$item->{'replacementprice'},
  							$item->{'itemnotes'},$item->{'loan'});
- 
- 	$sth->execute;
  	if (defined $sth->errstr) {
  		$error .= $sth->errstr;
  	}
  	$sth->finish;
- 	#  $itemnumber++;
- 	#  $dbh->disconnect;
  	return($itemnumber,$error);
  }
--- 1528,1535 ----

Index: Catalogue.pm
===================================================================
RCS file: /cvsroot/koha/koha/C4/Catalogue.pm,v
retrieving revision 1.29
retrieving revision 1.30
diff -C2 -r1.29 -r1.30
*** Catalogue.pm	10 Feb 2003 13:37:08 -0000	1.29
--- Catalogue.pm	27 Feb 2003 16:52:01 -0000	1.30
***************
*** 272,283 ****
    ordernumber=$ordnum and biblionumber=$bibnum";
    my $sth=$dbh->prepare($query);
- #  print $query;
    $sth->execute;
    $sth->finish;
!   $query="update aqorderbreakdown set bookfundid=$bookfund where
!   ordernumber=$ordnum";
    $sth=$dbh->prepare($query);
! #  print $query;
!   $sth->execute;
    $sth->finish;
  }
--- 272,281 ----
    ordernumber=$ordnum and biblionumber=$bibnum";
    my $sth=$dbh->prepare($query);
    $sth->execute;
    $sth->finish;
!   $query="update aqorderbreakdown set bookfundid=? where
!   ordernumber=?";
    $sth=$dbh->prepare($query);
!   $sth->execute($bookfund,$ordnum);
    $sth->finish;
  }
***************
*** 325,342 ****
    my ($biblio,$ordnum,$quantrec,$user,$cost,$invoiceno,$bibitemno,$freight,$bookfund,$rrp)=@_;
    my $dbh = C4::Context->dbh;
!   my $query="update aqorders set quantityreceived='$quantrec',
!   datereceived=now(),booksellerinvoicenumber='$invoiceno',
!   biblioitemnumber=$bibitemno,unitprice='$cost',freight='$freight',
!   rrp='$rrp'
!   where biblionumber=$biblio and ordernumber=$ordnum
!   ";
! #  print $query;
    my $sth=$dbh->prepare($query);
!   $sth->execute;
    $sth->finish;
    $query="update aqorderbreakdown set bookfundid=? where
    ordernumber=?";
    $sth=$dbh->prepare($query);
- #  print $query;
    $sth->execute($bookfund,$ordnum);
    $sth->finish;
--- 323,335 ----
    my ($biblio,$ordnum,$quantrec,$user,$cost,$invoiceno,$bibitemno,$freight,$bookfund,$rrp)=@_;
    my $dbh = C4::Context->dbh;
!   my $query="update aqorders set quantityreceived=?,datereceived=now(),booksellerinvoicenumber=?,
!   										biblioitemnumber=?,unitprice=?,freight=?,rrp=?
!   						where biblionumber=? and ordernumber=?";
    my $sth=$dbh->prepare($query);
!   $sth->execute($quantrec,$invoiceno,$bibitemno,$cost,$freight,$rrp,$biblio,$ordnum);
    $sth->finish;
    $query="update aqorderbreakdown set bookfundid=? where
    ordernumber=?";
    $sth=$dbh->prepare($query);
    $sth->execute($bookfund,$ordnum);
    $sth->finish;
***************
*** 598,647 ****
  #'
  sub ordersearch {
!   my ($search,$biblio,$catview) = @_;
!   my $dbh   = C4::Context->dbh;
!   my $query = "Select *,biblio.title from aqorders,biblioitems,biblio
! where aqorders.biblioitemnumber = biblioitems.biblioitemnumber
! and biblio.biblionumber=aqorders.biblionumber
! and ((datecancellationprinted is NULL)
! or (datecancellationprinted = '0000-00-00'))
! and ((";
!   my @data  = split(' ',$search);
!   my $count = @data;
!   for (my $i = 0; $i < $count; $i++) {
!     $query .= "(biblio.title like '$data[$i]%' or biblio.title like '% $data[$i]%') and ";
!   }
!   $query=~ s/ and $//;
! 		# FIXME - Redo this properly instead of hacking off the
! 		# trailing 'and'.
!   $query.=" ) or biblioitems.isbn='$search'
!   or (aqorders.ordernumber='$search' and aqorders.biblionumber='$biblio')) ";
!   if ($catview ne 'yes'){
!     $query.=" and (quantityreceived < quantity or quantityreceived is NULL)";
!   }
!   $query.=" group by aqorders.ordernumber";
!   my $sth=$dbh->prepare($query);
!   $sth->execute;
!   my $i=0;
!   my @results;
!   while (my $data=$sth->fetchrow_hashref){
!      my $sth2=$dbh->prepare("Select * from biblio where
!      biblionumber='$data->{'biblionumber'}'");
!      $sth2->execute;
!      my $data2=$sth2->fetchrow_hashref;
!      $sth2->finish;
!      $data->{'author'}=$data2->{'author'};
!      $data->{'seriestitle'}=$data2->{'seriestitle'};
!      $sth2=$dbh->prepare("Select * from aqorderbreakdown where
!     ordernumber=$data->{'ordernumber'}");
!     $sth2->execute;
!     $data2=$sth2->fetchrow_hashref;
!     $sth2->finish;
!     $data->{'branchcode'}=$data2->{'branchcode'};
!     $data->{'bookfundid'}=$data2->{'bookfundid'};
!     $results[$i]=$data;
!     $i++;
!   }
!   $sth->finish;
!   return($i, at results);
  }
  
--- 591,637 ----
  #'
  sub ordersearch {
! 	my ($search,$biblio,$catview) = @_;
! 	my $dbh   = C4::Context->dbh;
! 	my $query = "Select *,biblio.title from aqorders,biblioitems,biblio
! 							where aqorders.biblioitemnumber = biblioitems.biblioitemnumber
! 									and biblio.biblionumber=aqorders.biblionumber
! 									and ((datecancellationprinted is NULL)
! 									or (datecancellationprinted = '0000-00-00'))
! 									and ((";
! 	my @data  = split(' ',$search);
! 	my $count = @data;
! 	for (my $i = 0; $i < $count; $i++) {
! 		$query .= "(biblio.title like '$data[$i]%' or biblio.title like '% $data[$i]%') and ";
! 	}
! 	$query=~ s/ and $//;
! 			# FIXME - Redo this properly instead of hacking off the
! 			# trailing 'and'.
! 	$query.=" ) or biblioitems.isbn='$search' or (aqorders.ordernumber='$search' and aqorders.biblionumber='$biblio')) ";
! 	if ($catview ne 'yes'){
! 		$query.=" and (quantityreceived < quantity or quantityreceived is NULL)";
! 	}
! 	$query.=" group by aqorders.ordernumber";
! 	my $sth=$dbh->prepare($query);
! 	$sth->execute;
! 	my $i=0;
! 	my @results;
! 	while (my $data=$sth->fetchrow_hashref){
! 		my $sth2=$dbh->prepare("Select * from biblio where biblionumber=?");
! 		$sth2->execute($data->{'biblionumber'});
! 		my $data2=$sth2->fetchrow_hashref;
! 		$sth2->finish;
! 		$data->{'author'}=$data2->{'author'};
! 		$data->{'seriestitle'}=$data2->{'seriestitle'};
! 		$sth2=$dbh->prepare("Select * from aqorderbreakdown where ordernumber=?");
! 		$sth2->execute($data->{'ordernumber'});
! 		$data2=$sth2->fetchrow_hashref;
! 		$sth2->finish;
! 		$data->{'branchcode'}=$data2->{'branchcode'};
! 		$data->{'bookfundid'}=$data2->{'bookfundid'};
! 		$results[$i]=$data;
! 		$i++;
! 	}
! 	$sth->finish;
! 	return($i, at results);
  }
  

Index: Search.pm
===================================================================
RCS file: /cvsroot/koha/koha/C4/Search.pm,v
retrieving revision 1.57
retrieving revision 1.58
diff -C2 -r1.57 -r1.58
*** Search.pm	21 Feb 2003 02:25:03 -0000	1.57
--- Search.pm	27 Feb 2003 16:52:02 -0000	1.58
***************
*** 1106,1110 ****
  			$query.= " and (publishercode like '%$search->{'publisher'}%')";
  		}
- 		warn $query;
  		my $sti=$dbh->prepare($query);
  		$sti->execute;
--- 1106,1109 ----





More information about the Koha-cvs mailing list