[Koha-cvs] CVS: koha/admin aqbookfund.pl,1.15,1.15.2.1

MJ Ray slef at users.sourceforge.net
Tue Dec 23 19:02:47 CET 2003


Update of /cvsroot/koha/koha/admin
In directory sc8-pr-cvs1:/tmp/cvs-serv23916/admin

Modified Files:
      Tag: rel_2_0
	aqbookfund.pl 
Log Message:
DBI call fix for bug 662

Index: aqbookfund.pl
===================================================================
RCS file: /cvsroot/koha/koha/admin/aqbookfund.pl,v
retrieving revision 1.15
retrieving revision 1.15.2.1
diff -C2 -r1.15 -r1.15.2.1
*** aqbookfund.pl	6 Jun 2003 14:50:36 -0000	1.15
--- aqbookfund.pl	23 Dec 2003 18:02:43 -0000	1.15.2.1
***************
*** 53,68 ****
  	my @data=split(' ',$searchstring);
  	my $count=@data;
! 	my $query="select bookfundid,bookfundname,bookfundgroup from aqbookfund where (bookfundname like \"%$data[0]%\") order by bookfundid";
! 	my $sth=$dbh->prepare($query);
! 	$sth->execute;
  	my @results;
- 	my $cnt=0;
  	while (my $data=$sth->fetchrow_hashref){
  		push(@results,$data);
- 		$cnt ++;
  	}
  	#  $sth->execute;
  	$sth->finish;
! 	return ($cnt,\@results);
  }
  
--- 53,65 ----
  	my @data=split(' ',$searchstring);
  	my $count=@data;
! 	my $sth=$dbh->prepare("select bookfundid,bookfundname,bookfundgroup from aqbookfund where (bookfundname like ?) order by bookfundid");
! 	$sth->execute("%$data[0]%");
  	my @results;
  	while (my $data=$sth->fetchrow_hashref){
  		push(@results,$data);
  	}
  	#  $sth->execute;
  	$sth->finish;
! 	return (scalar(@results),\@results);
  }
  
***************
*** 103,108 ****
  	if ($bookfundid) {
  		my $dbh = C4::Context->dbh;
! 		my $sth=$dbh->prepare("select bookfundid,bookfundname,bookfundgroup from aqbookfund where bookfundid='$bookfundid'");
! 		$sth->execute;
  		$data=$sth->fetchrow_hashref;
  		$sth->finish;
--- 100,105 ----
  	if ($bookfundid) {
  		my $dbh = C4::Context->dbh;
! 		my $sth=$dbh->prepare("select bookfundid,bookfundname,bookfundgroup from aqbookfund where bookfundid=?");
! 		$sth->execute($bookfundid);
  		$data=$sth->fetchrow_hashref;
  		$sth->finish;
***************
*** 128,140 ****
          my $dbh = C4::Context->dbh;
  	my $bookfundid=uc($input->param('bookfundid'));
! 	my $query = "delete from aqbookfund where bookfundid ='$bookfundid'";
! 	my $sth=$dbh->prepare($query);
! 	$sth->execute;
  	$sth->finish;
! 	$query = "replace aqbookfund (bookfundid,bookfundname) values (";
! 	$query.= $dbh->quote($input->param('bookfundid')).",";
! 	$query.= $dbh->quote($input->param('bookfundname')).")";
! 	my $sth=$dbh->prepare($query);
! 	$sth->execute;
  	$sth->finish;
  													# END $OP eq ADD_VALIDATE
--- 125,133 ----
          my $dbh = C4::Context->dbh;
  	my $bookfundid=uc($input->param('bookfundid'));
! 	my $sth=$dbh->prepare("delete from aqbookfund where bookfundid =?");
! 	$sth->execute($bookfundid);
  	$sth->finish;
! 	my $sth=$dbh->prepare("replace aqbookfund (bookfundid,bookfundname) values (?,?)");
! 	$sth->execute($input->param('bookfundid'),$input->param('bookfundname'));
  	$sth->finish;
  													# END $OP eq ADD_VALIDATE
***************
*** 147,152 ****
  #	my $total = $sth->fetchrow_hashref;
  #	$sth->finish;
! 	my $sth=$dbh->prepare("select bookfundid,bookfundname,bookfundgroup from aqbookfund where bookfundid='$bookfundid'");
! 	$sth->execute;
  	my $data=$sth->fetchrow_hashref;
  	$sth->finish;
--- 140,145 ----
  #	my $total = $sth->fetchrow_hashref;
  #	$sth->finish;
! 	my $sth=$dbh->prepare("select bookfundid,bookfundname,bookfundgroup from aqbookfund where bookfundid=?");
! 	$sth->execute($bookfundid);
  	my $data=$sth->fetchrow_hashref;
  	$sth->finish;
***************
*** 159,166 ****
  	my $dbh = C4::Context->dbh;
  	my $bookfundid=uc($input->param('bookfundid'));
! 	my $query = "delete from aqbookfund where bookfundid='$bookfundid'";
! 	my $sth=$dbh->prepare($query);
! 	$sth->execute;
! 	$dbh->do("delete from aqbudget where bookfundid='$bookfundid'");
  	$sth->finish;
  													# END $OP eq DELETE_CONFIRMED
--- 152,160 ----
  	my $dbh = C4::Context->dbh;
  	my $bookfundid=uc($input->param('bookfundid'));
! 	my $sth=$dbh->prepare("delete from aqbookfund where bookfundid=?");
! 	$sth->execute($bookfundid);
! 	$sth->finish;
! 	$sth=$dbh->prepare("delete from aqbudget where bookfundid=?");
! 	$sth->execute($bookfundid);
  	$sth->finish;
  													# END $OP eq DELETE_CONFIRMED





More information about the Koha-cvs mailing list