[Koha-cvs] CVS: koha/admin itemtypes.pl,1.10,1.10.2.1

MJ Ray slef at users.sourceforge.net
Tue Dec 23 18:58:06 CET 2003


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

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

Index: itemtypes.pl
===================================================================
RCS file: /cvsroot/koha/koha/admin/itemtypes.pl,v
retrieving revision 1.10
retrieving revision 1.10.2.1
diff -C2 -r1.10 -r1.10.2.1
*** itemtypes.pl	18 Jul 2003 13:34:14 -0000	1.10
--- itemtypes.pl	23 Dec 2003 17:58:04 -0000	1.10.2.1
***************
*** 54,69 ****
  	my @data=split(' ',$searchstring);
  	my $count=@data;
! 	my $query="Select * from itemtypes where (description like \"$data[0]%\") order by itemtype";
! 	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);
  }
  
--- 54,66 ----
  	my @data=split(' ',$searchstring);
  	my $count=@data;
! 	my $sth=$dbh->prepare("Select * from itemtypes where (description like ?) order by itemtype");
! 	$sth->execute("$data[0]%");
  	my @results;
  	while (my $data=$sth->fetchrow_hashref){
  	push(@results,$data);
  	}
  	#  $sth->execute;
  	$sth->finish;
! 	return (scalar(@results),\@results);
  }
  
***************
*** 100,105 ****
  	if ($itemtype) {
  		my $dbh = C4::Context->dbh;
! 		my $sth=$dbh->prepare("select itemtype,description,loanlength,renewalsallowed,rentalcharge from itemtypes where itemtype='$itemtype'");
! 		$sth->execute;
  		$data=$sth->fetchrow_hashref;
  		$sth->finish;
--- 97,102 ----
  	if ($itemtype) {
  		my $dbh = C4::Context->dbh;
! 		my $sth=$dbh->prepare("select itemtype,description,loanlength,renewalsallowed,rentalcharge from itemtypes where itemtype=?");
! 		$sth->execute($itemtype);
  		$data=$sth->fetchrow_hashref;
  		$sth->finish;
***************
*** 165,171 ****
  	my $dbh = C4::Context->dbh;
  	my $itemtype=uc($input->param('itemtype'));
! 	my $query = "delete from itemtypes where itemtype='$itemtype'";
! 	my $sth=$dbh->prepare($query);
! 	$sth->execute;
  	$sth->finish;
  	print "Content-Type: text/html\n\n<META HTTP-EQUIV=Refresh CONTENT=\"0; URL=itemtypes.pl\"></html>";
--- 162,167 ----
  	my $dbh = C4::Context->dbh;
  	my $itemtype=uc($input->param('itemtype'));
! 	my $sth=$dbh->prepare("delete from itemtypes where itemtype=?");
! 	$sth->execute($itemtype);
  	$sth->finish;
  	print "Content-Type: text/html\n\n<META HTTP-EQUIV=Refresh CONTENT=\"0; URL=itemtypes.pl\"></html>";





More information about the Koha-cvs mailing list