[Koha-cvs] CVS: koha/admin aqbookfund.pl,1.15,1.16 branches.pl,1.23,1.24 categorie.pl,1.13,1.14 categoryitem.pl,1.7,1.8 charges.pl,1.1,1.2 currency.pl,1.9,1.10 itemtypes.pl,1.10,1.11 koha2marclinks.pl,1.9,1.10 marc_subfields_structure.pl,1.17,1.18 marctagstructure.pl,1.18,1.19 printers.pl,1.9,1.10 stopwords.pl,1.10,1.11 z3950servers.pl,1.8,1.9

Paul POULAIN tipaul at users.sourceforge.net
Mon Jan 12 17:55:08 CET 2004


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

Modified Files:
	aqbookfund.pl branches.pl categorie.pl categoryitem.pl 
	charges.pl currency.pl itemtypes.pl koha2marclinks.pl 
	marc_subfields_structure.pl marctagstructure.pl printers.pl 
	stopwords.pl z3950servers.pl 
Log Message:
synch'ing with rel_2_0 version

Index: aqbookfund.pl
===================================================================
RCS file: /cvsroot/koha/koha/admin/aqbookfund.pl,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -r1.15 -r1.16
*** aqbookfund.pl	6 Jun 2003 14:50:36 -0000	1.15
--- aqbookfund.pl	12 Jan 2004 16:55:05 -0000	1.16
***************
*** 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

Index: branches.pl
===================================================================
RCS file: /cvsroot/koha/koha/admin/branches.pl,v
retrieving revision 1.23
retrieving revision 1.24
diff -C2 -r1.23 -r1.24
*** branches.pl	30 Dec 2003 19:59:02 -0000	1.23
--- branches.pl	12 Jan 2004 16:55:05 -0000	1.24
***************
*** 354,371 ****
      my ($branchcode) = @_;
      my $dbh = C4::Context->dbh;
!     my ($query, @query_args);
      if ($branchcode) {
! 	$query = "Select * from branches where branchcode = ?";
! 	@query_args = ($branchcode);
      } else {
! 	$query = "Select * from branches";
      }
-     $query.=" order by branchcode";
-     my $sth = $dbh->prepare($query);
-     $sth->execute(@query_args);
      my @results;
      while (my $data = $sth->fetchrow_hashref) {
! 	$query = "select categorycode from branchrelations where branchcode = ?";
! 	my $nsth = $dbh->prepare($query);
  	$nsth->execute($data->{'branchcode'});;
  	my @cats = ();
--- 354,368 ----
      my ($branchcode) = @_;
      my $dbh = C4::Context->dbh;
!     my $sth;
      if ($branchcode) {
! 		$sth = $dbh->prepare("Select * from branches where branchcode = ? order by branchcode");
! 		$sth->execute($branchcode);
      } else {
! 		$sth = $dbh->prepare("Select * from branches order by branchcode");
! 		$sth->execute();
      }
      my @results;
      while (my $data = $sth->fetchrow_hashref) {
! 	my $nsth = $dbh->prepare("select categorycode from branchrelations where branchcode = ?");
  	$nsth->execute($data->{'branchcode'});;
  	my @cats = ();
***************
*** 386,400 ****
  	my ($catcode) = @_;
  	my $dbh = C4::Context->dbh;
! 	my ($query, @query_args);
  	#    print DEBUG "getcategoryinfo: entry: catcode=".cvs($catcode)."\n";
  	if ($catcode) {
! 		$query = "select * from branchcategories where categorycode = ?";
! 		@query_args = ($catcode);
  	} else {
! 		$query = "Select * from branchcategories";
  	}
- 	#    print DEBUG "getcategoryinfo: query=".cvs($query)."\n";
- 	my $sth = $dbh->prepare($query);
- 	$sth->execute(@query_args);
  	my @results;
  	while (my $data = $sth->fetchrow_hashref) {
--- 383,395 ----
  	my ($catcode) = @_;
  	my $dbh = C4::Context->dbh;
! 	my $sth;
  	#    print DEBUG "getcategoryinfo: entry: catcode=".cvs($catcode)."\n";
  	if ($catcode) {
! 		$sth = $dbh->prepare("select * from branchcategories where categorycode = ?");
! 		$sth->execute($catcode);
  	} else {
! 		$sth = $dbh->prepare("Select * from branchcategories");
! 		$sth->execute();
  	}
  	my @results;
  	while (my $data = $sth->fetchrow_hashref) {
***************
*** 411,416 ****
  	my ($data) = @_;
  	my $dbh = C4::Context->dbh;
! 	my $query = "replace branches (branchcode,branchname,branchaddress1,branchaddress2,branchaddress3,branchphone,branchfax,branchemail) values (?,?,?,?,?,?,?,?)";
! 	my $sth=$dbh->prepare($query);
  	$sth->execute(uc($data->{'branchcode'}), $data->{'branchname'},
  		$data->{'branchaddress1'}, $data->{'branchaddress2'},
--- 406,410 ----
  	my ($data) = @_;
  	my $dbh = C4::Context->dbh;
! 	my $sth=$dbh->prepare("replace branches (branchcode,branchname,branchaddress1,branchaddress2,branchaddress3,branchphone,branchfax,branchemail) values (?,?,?,?,?,?,?,?)");
  	$sth->execute(uc($data->{'branchcode'}), $data->{'branchname'},
  		$data->{'branchaddress1'}, $data->{'branchaddress2'},
***************
*** 444,458 ****
  		}
  	}
- 	# FIXME - There's already a $dbh in this scope.
- 	my $dbh = C4::Context->dbh;
  	foreach my $cat (@addcats) {
! 		my $query = "insert into branchrelations (branchcode, categorycode) values(?, ?)";
! 		my $sth = $dbh->prepare($query);
  		$sth->execute($branchcode, $cat);
  		$sth->finish;
  	}
  	foreach my $cat (@removecats) {
! 		my $query = "delete from branchrelations where branchcode=? and categorycode=?";
! 		my $sth = $dbh->prepare($query);
  		$sth->execute($branchcode, $cat);
  		$sth->finish;
--- 438,448 ----
  		}
  	}
  	foreach my $cat (@addcats) {
! 		my $sth = $dbh->prepare("insert into branchrelations (branchcode, categorycode) values(?, ?)");
  		$sth->execute($branchcode, $cat);
  		$sth->finish;
  	}
  	foreach my $cat (@removecats) {
! 		my $sth = $dbh->prepare("delete from branchrelations where branchcode=? and categorycode=?");
  		$sth->execute($branchcode, $cat);
  		$sth->finish;
***************
*** 463,469 ****
  # delete branch...
      my ($branchcode) = @_;
-     my $query = "delete from branches where branchcode = ?";
      my $dbh = C4::Context->dbh;
!     my $sth=$dbh->prepare($query);
      $sth->execute($branchcode);
      $sth->finish;
--- 453,458 ----
  # delete branch...
      my ($branchcode) = @_;
      my $dbh = C4::Context->dbh;
!     my $sth=$dbh->prepare("delete from branches where branchcode = ?");
      $sth->execute($branchcode);
      $sth->finish;
***************
*** 474,479 ****
  	my ($data) = @_;
  	my $dbh = C4::Context->dbh;
! 	my $query = "replace branchcategories (categorycode,categoryname,codedescription) values (?,?,?)";
! 	my $sth=$dbh->prepare($query);
  	$sth->execute(uc($data->{'categorycode'}), $data->{'categoryname'},$data->{'codedescription'});
  
--- 463,467 ----
  	my ($data) = @_;
  	my $dbh = C4::Context->dbh;
! 	my $sth=$dbh->prepare("replace branchcategories (categorycode,categoryname,codedescription) values (?,?,?)");
  	$sth->execute(uc($data->{'categorycode'}), $data->{'categoryname'},$data->{'codedescription'});
  
***************
*** 483,489 ****
  # delete branch...
      my ($categorycode) = @_;
-     my $query = "delete from branchcategories where categorycode = ?";
      my $dbh = C4::Context->dbh;
!     my $sth=$dbh->prepare($query);
      $sth->execute($categorycode);
      $sth->finish;
--- 471,476 ----
  # delete branch...
      my ($categorycode) = @_;
      my $dbh = C4::Context->dbh;
!     my $sth=$dbh->prepare("delete from branchcategories where categorycode = ?");
      $sth->execute($categorycode);
      $sth->finish;

Index: categorie.pl
===================================================================
RCS file: /cvsroot/koha/koha/admin/categorie.pl,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -r1.13 -r1.14
*** categorie.pl	13 Jun 2003 14:41:34 -0000	1.13
--- categorie.pl	12 Jan 2004 16:55:05 -0000	1.14
***************
*** 52,67 ****
  	my @data=split(' ',$searchstring);
  	my $count=@data;
! 	my $query="Select * from categories where (description like \"$data[0]%\")";
! 	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);
  }
  
--- 52,64 ----
  	my @data=split(' ',$searchstring);
  	my $count=@data;
! 	my $sth=$dbh->prepare("Select * from categories where (description like ?)");
! 	$sth->execute("$data[0]%");
  	my @results;
  	while (my $data=$sth->fetchrow_hashref){
  	push(@results,$data);
  	}
  	#  $sth->execute;
  	$sth->finish;
! 	return (scalar(@results),\@results);
  }
  
***************
*** 71,75 ****
  my $categorycode=$input->param('categorycode');
  my $op = $input->param('op');
- $searchfield=~ s/\,//g;
  
  my ($template, $loggedinuser, $cookie)
--- 68,71 ----
***************
*** 97,102 ****
  	if ($categorycode) {
  		my $dbh = C4::Context->dbh;
! 		my $sth=$dbh->prepare("select categorycode,description,enrolmentperiod,upperagelimit,dateofbirthrequired,enrolmentfee,issuelimit,reservefee,overduenoticerequired from categories where categorycode='$categorycode'");
! 		$sth->execute;
  		$data=$sth->fetchrow_hashref;
  		$sth->finish;
--- 93,98 ----
  	if ($categorycode) {
  		my $dbh = C4::Context->dbh;
! 		my $sth=$dbh->prepare("select categorycode,description,enrolmentperiod,upperagelimit,dateofbirthrequired,enrolmentfee,issuelimit,reservefee,overduenoticerequired from categories where categorycode=?");
! 		$sth->execute($categorycode);
  		$data=$sth->fetchrow_hashref;
  		$sth->finish;
***************
*** 117,132 ****
  	$template->param(add_validate => 1);
  	my $dbh = C4::Context->dbh;
! 	my $query = "replace categories (categorycode,description,enrolmentperiod,upperagelimit,dateofbirthrequired,enrolmentfee,issuelimit,reservefee,overduenoticerequired) values (";
! 	$query.= $dbh->quote($input->param('categorycode')).",";
! 	$query.= $dbh->quote($input->param('description')).",";
! 	$query.= $dbh->quote($input->param('enrolmentperiod')).",";
! 	$query.= $dbh->quote($input->param('upperagelimit')).",";
! 	$query.= $dbh->quote($input->param('dateofbirthrequired')).",";
! 	$query.= $dbh->quote($input->param('enrolmentfee')).",";
! 	$query.= $dbh->quote($input->param('issuelimit')).",";
! 	$query.= $dbh->quote($input->param('reservefee')).",";
! 	$query.= $dbh->quote($input->param('overduenoticerequired')).")";
! 	my $sth=$dbh->prepare($query);
! 	$sth->execute;
  	$sth->finish;
  													# END $OP eq ADD_VALIDATE
--- 113,118 ----
  	$template->param(add_validate => 1);
  	my $dbh = C4::Context->dbh;
! 	my $sth=$dbh->prepare("replace categories (categorycode,description,enrolmentperiod,upperagelimit,dateofbirthrequired,enrolmentfee,issuelimit,reservefee,overduenoticerequired) values (?,?,?,?,?,?,?,?,?)");
! 	$sth->execute(map { $input->param($_) } ('categorycode','description','enrolmentperiod','upperagelimit','dateofbirthrequired','enrolmentfee','issuelimit','reservefee','overduenoticerequired'));
  	$sth->finish;
  													# END $OP eq ADD_VALIDATE
***************
*** 137,148 ****
  
  	my $dbh = C4::Context->dbh;
! 	my $sth=$dbh->prepare("select count(*) as total from categoryitem where categorycode='$categorycode'");
! 	$sth->execute;
  	my $total = $sth->fetchrow_hashref;
  	$sth->finish;
  	$template->param(total => $total->{'total'});
  	
! 	my $sth2=$dbh->prepare("select categorycode,description,enrolmentperiod,upperagelimit,dateofbirthrequired,enrolmentfee,issuelimit,reservefee,overduenoticerequired from categories where categorycode='$categorycode'");
! 	$sth2->execute;
  	my $data=$sth2->fetchrow_hashref;
  	$sth2->finish;
--- 123,134 ----
  
  	my $dbh = C4::Context->dbh;
! 	my $sth=$dbh->prepare("select count(*) as total from categoryitem where categorycode=?");
! 	$sth->execute($categorycode);
  	my $total = $sth->fetchrow_hashref;
  	$sth->finish;
  	$template->param(total => $total->{'total'});
  	
! 	my $sth2=$dbh->prepare("select categorycode,description,enrolmentperiod,upperagelimit,dateofbirthrequired,enrolmentfee,issuelimit,reservefee,overduenoticerequired from categories where categorycode=?");
! 	$sth2->execute($categorycode);
  	my $data=$sth2->fetchrow_hashref;
  	$sth2->finish;
***************
*** 168,174 ****
  	my $dbh = C4::Context->dbh;
  	my $categorycode=uc($input->param('categorycode'));
! 	my $query = "delete from categories where categorycode='$categorycode'";
! 	my $sth=$dbh->prepare($query);
! 	$sth->execute;
  	$sth->finish;
  													# END $OP eq DELETE_CONFIRMED
--- 154,159 ----
  	my $dbh = C4::Context->dbh;
  	my $categorycode=uc($input->param('categorycode'));
! 	my $sth=$dbh->prepare("delete from categories where categorycode=?");
! 	$sth->execute($categorycode);
  	$sth->finish;
  													# END $OP eq DELETE_CONFIRMED

Index: categoryitem.pl
===================================================================
RCS file: /cvsroot/koha/koha/admin/categoryitem.pl,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -r1.7 -r1.8
*** categoryitem.pl	5 Apr 2003 03:35:09 -0000	1.7
--- categoryitem.pl	12 Jan 2004 16:55:05 -0000	1.8
***************
*** 53,68 ****
  	my @data=split(' ',$searchstring);
  	my $count=@data;
! 	my $query="Select * from categories where (description like \"$data[0]%\")";
! 	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 * from categories where (description like ?)");
! 	$sth->execute("$data[0]%");
  	my @results;
  	while (my $data=$sth->fetchrow_hashref){
  	push(@results,$data);
  	}
  	#  $sth->execute;
  	$sth->finish;
! 	return (scalar(@results),\@results);
  }
  
***************
*** 96,101 ****
  	if ($categorycode) {
  		my $dbh = C4::Context->dbh;
! 		my $sth=$dbh->prepare("select categorycode,description,enrolmentperiod,upperagelimit,dateofbirthrequired,finetype,bulk,enrolmentfee,issuelimit,reservefee,overduenoticerequired from categories where categorycode='$categorycode'");
! 		$sth->execute;
  		$data=$sth->fetchrow_hashref;
  		$sth->finish;
--- 93,98 ----
  	if ($categorycode) {
  		my $dbh = C4::Context->dbh;
! 		my $sth=$dbh->prepare("select categorycode,description,enrolmentperiod,upperagelimit,dateofbirthrequired,finetype,bulk,enrolmentfee,issuelimit,reservefee,overduenoticerequired from categories where categorycode=?");
! 		$sth->execute($categorycode);
  		$data=$sth->fetchrow_hashref;
  		$sth->finish;
***************
*** 121,138 ****
  	$template->param(add_validate => 1);
  	my $dbh = C4::Context->dbh;
! 	my $query = "replace categories (categorycode,description,enrolmentperiod,upperagelimit,dateofbirthrequired,finetype,bulk,enrolmentfee,issuelimit,reservefee,overduenoticerequired) values (";
! 	$query.= $dbh->quote($input->param('categorycode')).",";
! 	$query.= $dbh->quote($input->param('description')).",";
! 	$query.= $dbh->quote($input->param('enrolmentperiod')).",";
! 	$query.= $dbh->quote($input->param('upperagelimit')).",";
! 	$query.= $dbh->quote($input->param('dateofbirthrequired')).",";
! 	$query.= $dbh->quote($input->param('finetype')).",";
! 	$query.= $dbh->quote($input->param('bulk')).",";
! 	$query.= $dbh->quote($input->param('enrolmentfee')).",";
! 	$query.= $dbh->quote($input->param('issuelimit')).",";
! 	$query.= $dbh->quote($input->param('reservefee')).",";
! 	$query.= $dbh->quote($input->param('overduenoticerequired')).")";
! 	my $sth=$dbh->prepare($query);
! 	$sth->execute;
  	$sth->finish;
  	print "data recorded";
--- 118,123 ----
  	$template->param(add_validate => 1);
  	my $dbh = C4::Context->dbh;
! 	my $sth=$dbh->prepare("replace categories (categorycode,description,enrolmentperiod,upperagelimit,dateofbirthrequired,finetype,bulk,enrolmentfee,issuelimit,reservefee,overduenoticerequired) values (?,?,?,?,?,?,?,?,?,?,?)");
! 	$sth->execute(map {$input->param($_)} ('categorycode','description','enrolmentperiod','upperagelimit','dateofbirthrequired','finetype','bulk','enrolmentfee','issuelimit','reservefee','overduenoticerequired'));
  	$sth->finish;
  	print "data recorded";
***************
*** 146,156 ****
  	$template->param(delete_confirm => 1);
  	my $dbh = C4::Context->dbh;
! 	my $sth=$dbh->prepare("select count(*) as total from categoryitem where categorycode='$categorycode'");
! 	$sth->execute;
  	my $total = $sth->fetchrow_hashref;
  	print "TOTAL : $categorycode : $total->{'total'}<br>";
  	$sth->finish;
! 	my $sth2=$dbh->prepare("select categorycode,description,enrolmentperiod,upperagelimit,dateofbirthrequired,finetype,bulk,enrolmentfee,issuelimit,reservefee,overduenoticerequired from categories where categorycode='$categorycode'");
! 	$sth2->execute;
  	my $data=$sth2->fetchrow_hashref;
  	$sth2->finish;
--- 131,141 ----
  	$template->param(delete_confirm => 1);
  	my $dbh = C4::Context->dbh;
! 	my $sth=$dbh->prepare("select count(*) as total from categoryitem where categorycode=?");
! 	$sth->execute($categorycode);
  	my $total = $sth->fetchrow_hashref;
  	print "TOTAL : $categorycode : $total->{'total'}<br>";
  	$sth->finish;
! 	my $sth2=$dbh->prepare("select categorycode,description,enrolmentperiod,upperagelimit,dateofbirthrequired,finetype,bulk,enrolmentfee,issuelimit,reservefee,overduenoticerequired from categories where categorycode=?");
! 	$sth2->execute($categorycode);
  	my $data=$sth2->fetchrow_hashref;
  	$sth2->finish;
***************
*** 174,180 ****
  	my $dbh = C4::Context->dbh;
  	my $categorycode=uc($input->param('categorycode'));
! 	my $query = "delete from categories where categorycode='$categorycode'";
! 	my $sth=$dbh->prepare($query);
! 	$sth->execute;
  	$sth->finish;
  													# END $OP eq DELETE_CONFIRMED
--- 159,164 ----
  	my $dbh = C4::Context->dbh;
  	my $categorycode=uc($input->param('categorycode'));
! 	my $sth=$dbh->prepare("delete from categories where categorycode=?");
! 	$sth->execute($categorycode);
  	$sth->finish;
  													# END $OP eq DELETE_CONFIRMED
***************
*** 197,201 ****
                                  issuelimit => $results->[$i]{'issuelimit'},
                                  reservefee => $results->[$i]{'reservefee'},
! 				toggle = $toggle );
                  push @loop, \%row;
                  if ( $toggle eq 'white' )
--- 181,185 ----
                                  issuelimit => $results->[$i]{'issuelimit'},
                                  reservefee => $results->[$i]{'reservefee'},
! 				toggle => $toggle );
                  push @loop, \%row;
                  if ( $toggle eq 'white' )

Index: charges.pl
===================================================================
RCS file: /cvsroot/koha/koha/admin/charges.pl,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** charges.pl	6 Oct 2003 13:40:49 -0000	1.1
--- charges.pl	12 Jan 2004 16:55:05 -0000	1.2
***************
*** 44,49 ****
  
  my $dbh = C4::Context->dbh;
! my $query="Select description,categorycode from categories";
! my $sth=$dbh->prepare($query);
  $sth->execute;
   my @trow3;
--- 44,48 ----
  
  my $dbh = C4::Context->dbh;
! my $sth=$dbh->prepare("Select description,categorycode from categories");
  $sth->execute;
   my @trow3;
***************
*** 57,62 ****
  }
  $sth->finish;
! $query="Select description,itemtype from itemtypes";
! $sth=$dbh->prepare($query);
  $sth->execute;
  $i=0;
--- 56,60 ----
  }
  $sth->finish;
! $sth=$dbh->prepare("Select description,itemtype from itemtypes");
  $sth->execute;
  $i=0;
***************
*** 72,77 ****
  	}
  	for ($i=0;$i<9;$i++){
! 		$query="select * from categoryitem where categorycode=? and itemtype=?";
! 		my $sth2=$dbh->prepare($query);
  		$sth2->execute($trow3[$i],$data->{'itemtype'});
  		my $dat=$sth2->fetchrow_hashref;
--- 70,74 ----
  	}
  	for ($i=0;$i<9;$i++){
! 		my $sth2=$dbh->prepare("select * from categoryitem where categorycode=? and itemtype=?");
  		$sth2->execute($trow3[$i],$data->{'itemtype'});
  		my $dat=$sth2->fetchrow_hashref;

Index: currency.pl
===================================================================
RCS file: /cvsroot/koha/koha/admin/currency.pl,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -r1.9 -r1.10
*** currency.pl	6 May 2003 14:55:39 -0000	1.9
--- currency.pl	12 Jan 2004 16:55:05 -0000	1.10
***************
*** 69,75 ****
  my $input = new CGI;
  my $searchfield=$input->param('searchfield');
- my $pkfield="currency";
- my $reqsel="select currency,rate from currency where $pkfield='$searchfield'";
- my $reqdel="delete from currency where $pkfield='$searchfield'";
  #my $branchcode=$input->param('branchcode');
  my $offset=$input->param('offset');
--- 69,72 ----
***************
*** 101,106 ****
  	if ($searchfield) {
  		my $dbh = C4::Context->dbh;
! 		my $sth=$dbh->prepare("select currency,rate from currency where currency='$searchfield'");
! 		$sth->execute;
  		$data=$sth->fetchrow_hashref;
  		$sth->finish;
--- 98,103 ----
  	if ($searchfield) {
  		my $dbh = C4::Context->dbh;
! 		my $sth=$dbh->prepare("select currency,rate from currency where currency=?");
! 		$sth->execute($searchfield);
  		$data=$sth->fetchrow_hashref;
  		$sth->finish;
***************
*** 138,147 ****
  	$template->param(delete_confirm => 1);
  	my $dbh = C4::Context->dbh;
! 	my $sth=$dbh->prepare("select count(*) as total from aqbooksellers where currency='$searchfield'");
! 	$sth->execute;
  	my $total = $sth->fetchrow_hashref;
  	$sth->finish;
! 	my $sth2=$dbh->prepare($reqsel);
! 	$sth2->execute;
  	my $data=$sth2->fetchrow_hashref;
  	$sth2->finish;
--- 135,144 ----
  	$template->param(delete_confirm => 1);
  	my $dbh = C4::Context->dbh;
! 	my $sth=$dbh->prepare("select count(*) as total from aqbooksellers where currency=?");
! 	$sth->execute($searchfield);
  	my $total = $sth->fetchrow_hashref;
  	$sth->finish;
! 	my $sth2=$dbh->prepare("select currency,rate from currency where currency=?");
! 	$sth2->execute($searchfield);
  	my $data=$sth2->fetchrow_hashref;
  	$sth2->finish;
***************
*** 159,164 ****
  	$template->param(delete_confirmed => 1);
  	my $dbh = C4::Context->dbh;
! 	my $sth=$dbh->prepare($reqdel);
! 	$sth->execute;
  	$sth->finish;
  													# END $OP eq DELETE_CONFIRMED
--- 156,161 ----
  	$template->param(delete_confirmed => 1);
  	my $dbh = C4::Context->dbh;
! 	my $sth=$dbh->prepare("delete from currency where currency=?");
! 	$sth->execute($searchfield);
  	$sth->finish;
  													# END $OP eq DELETE_CONFIRMED

Index: itemtypes.pl
===================================================================
RCS file: /cvsroot/koha/koha/admin/itemtypes.pl,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -r1.10 -r1.11
*** itemtypes.pl	18 Jul 2003 13:34:14 -0000	1.10
--- itemtypes.pl	12 Jan 2004 16:55:05 -0000	1.11
***************
*** 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>";

Index: koha2marclinks.pl
===================================================================
RCS file: /cvsroot/koha/koha/admin/koha2marclinks.pl,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -r1.9 -r1.10
*** koha2marclinks.pl	30 Dec 2003 17:47:10 -0000	1.9
--- koha2marclinks.pl	12 Jan 2004 16:55:05 -0000	1.10
***************
*** 64,69 ****
  
  	for (my $i=0;$i<=9;$i++) {
! 		my $sth2=$dbh->prepare("select tagfield,tagsubfield,liblibrarian as lib,tab from marc_subfield_structure where tagfield like '$i%'");
! 		$sth2->execute;
  		my @marcarray;
  		push @marcarray," ";
--- 64,69 ----
  
  	for (my $i=0;$i<=9;$i++) {
! 		my $sth2=$dbh->prepare("select tagfield,tagsubfield,liblibrarian as lib,tab from marc_subfield_structure where tagfield like ?");
! 		$sth2->execute("$i%");
  		my @marcarray;
  		push @marcarray," ";
***************
*** 106,111 ****
  		$fields{$kohafield}->{liblibrarian} = $liblibrarian;
  	}
! 	my $sth2=$dbh->prepare("SHOW COLUMNS from $tablename");
! 	$sth2->execute;
  
  	my $toggle="white";
--- 106,112 ----
  		$fields{$kohafield}->{liblibrarian} = $liblibrarian;
  	}
! 	#XXX: This might not work. Maybe should use a DBI call instead of SHOW COLUMNS
! 	my $sth2=$dbh->prepare("SHOW COLUMNS from ?");
! 	$sth2->execute($tablename);
  
  	my $toggle="white";

Index: marc_subfields_structure.pl
===================================================================
RCS file: /cvsroot/koha/koha/admin/marc_subfields_structure.pl,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -r1.17 -r1.18
*** marc_subfields_structure.pl	30 Dec 2003 16:45:52 -0000	1.17
--- marc_subfields_structure.pl	12 Jan 2004 16:55:05 -0000	1.18
***************
*** 34,40 ****
  	my @data=split(' ',$searchstring);
  	my $count=@data;
! 	my $query="Select tagfield,tagsubfield,liblibrarian,libopac,repeatable,mandatory,kohafield,tab,authorised_value,thesaurus_category,value_builder from marc_subfield_structure where (tagfield like \"$searchstring%\") order by tagfield";
! 	my $sth=$dbh->prepare($query);
! 	$sth->execute;
  	my @results;
  	my $cnt=0;
--- 34,39 ----
  	my @data=split(' ',$searchstring);
  	my $count=@data;
! 	my $sth=$dbh->prepare("Select tagfield,tagsubfield,liblibrarian,libopac,repeatable,mandatory,kohafield,tab,authorised_value,thesaurus_category,value_builder from marc_subfield_structure where (tagfield like ?) order by tagfield");
! 	$sth->execute("$searchstring%");
  	my @results;
  	my $cnt=0;
***************
*** 53,58 ****
  my $tagsubfield=$input->param('tagsubfield');
  my $pkfield="tagfield";
- my $reqsel="select tagfield,tagsubfield,liblibrarian,libopac,repeatable,mandatory,kohafield,tab,authorised_value,thesaurus_category,value_builder from marc_subfield_structure where tagfield='$tagfield' and tagsubfield='$tagsubfield'";
- my $reqdel="delete from marc_subfield_structure where tagfield='$tagfield' and tagsubfield='$tagsubfield'";
  my $offset=$input->param('offset');
  my $script_name="/cgi-bin/koha/admin/marc_subfields_structure.pl";
--- 52,55 ----
***************
*** 141,146 ****
  
  	# build values list
! 	my $sth=$dbh->prepare("select tagfield,tagsubfield,liblibrarian,libopac,repeatable,mandatory,kohafield,tab,authorised_value,thesaurus_category,value_builder from marc_subfield_structure where tagfield='$tagfield'"); # and tagsubfield='$tagsubfield'");
! 	$sth->execute;
  	my @loop_data = ();
  	my $toggle="white";
--- 138,143 ----
  
  	# build values list
! 	my $sth=$dbh->prepare("select tagfield,tagsubfield,liblibrarian,libopac,repeatable,mandatory,kohafield,tab,authorised_value,thesaurus_category,value_builder from marc_subfield_structure where tagfield=?"); # and tagsubfield='$tagsubfield'");
! 	$sth->execute($tagfield);
  	my @loop_data = ();
  	my $toggle="white";
***************
*** 164,168 ****
  					-multiple=>0,
  					);
! 		$row_data{tagsubfield} =$data->{'tagsubfield'}."<input type=\"hidden\" name=\"tagsubfield\" value=\"".$data->{'tagsubfield'}."\" />";
  		$row_data{liblibrarian} = CGI::escapeHTML($data->{'liblibrarian'});
  		$row_data{libopac} = CGI::escapeHTML($data->{'libopac'});
--- 161,165 ----
  					-multiple=>0,
  					);
! 		$row_data{tagsubfield} =$data->{'tagsubfield'}."<input type='hidden' name='tagsubfield' value='".$data->{'tagsubfield'}."'>";
  		$row_data{liblibrarian} = CGI::escapeHTML($data->{'liblibrarian'});
  		$row_data{libopac} = CGI::escapeHTML($data->{'libopac'});
***************
*** 212,216 ****
  					-multiple=>0,
  					);
! 		$row_data{tagsubfield} = "<input type=\"text\" name=\"tagsubfield\" value=\"".$data->{'tagsubfield'}."\" size=\"3\" maxlength=\"1\" />";
  		$row_data{liblibrarian} = "";
  		$row_data{libopac} = "";
--- 209,213 ----
  					-multiple=>0,
  					);
! 		$row_data{tagsubfield} = "<input type=\"text\" name=\"tagsubfield\" value=\"".$data->{'tagsubfield'}."\" size=\"3\" maxlength=\"1\">";
  		$row_data{liblibrarian} = "";
  		$row_data{libopac} = "";
***************
*** 237,241 ****
  	}
  	$template->param(action => "Edit subfields",
! 							tagfield => "<input type=\"hidden\" name=\"tagfield\" value=\"$tagfield\" />$tagfield",
  							loop => \@loop_data,
  							more_subfields => $more_subfields,
--- 234,238 ----
  	}
  	$template->param(action => "Edit subfields",
! 							tagfield => "<input type=\"hidden\" name=\"tagfield\" value=\"$tagfield\">$tagfield",
  							loop => \@loop_data,
  							more_subfields => $more_subfields,
***************
*** 296,301 ****
  } elsif ($op eq 'delete_confirm') {
  	my $dbh = C4::Context->dbh;
! 	my $sth=$dbh->prepare($reqsel);
! 	$sth->execute;
  	my $data=$sth->fetchrow_hashref;
  	$sth->finish;
--- 293,298 ----
  } elsif ($op eq 'delete_confirm') {
  	my $dbh = C4::Context->dbh;
! 	my $sth=$dbh->prepare("select tagfield,tagsubfield,liblibrarian,libopac,repeatable,mandatory,kohafield,tab,authorised_value,thesaurus_category,value_builder from marc_subfield_structure where tagfield=? and tagsubfield=?");
! 	$sth->execute($tagfield,$tagsubfield);
  	my $data=$sth->fetchrow_hashref;
  	$sth->finish;
***************
*** 312,317 ****
  	my $dbh = C4::Context->dbh;
  	unless (C4::Context->config('demo') eq 1) {
! 		my $sth=$dbh->prepare($reqdel);
! 		$sth->execute;
  		$sth->finish;
  	}
--- 309,314 ----
  	my $dbh = C4::Context->dbh;
  	unless (C4::Context->config('demo') eq 1) {
! 		my $sth=$dbh->prepare("delete from marc_subfield_structure where tagfield=? and tagsubfield=?");
! 		$sth->execute($tagfield,$tagsubfield);
  		$sth->finish;
  	}
***************
*** 348,352 ****
  	}
  	$template->param(loop => \@loop_data);
! 	$template->param(edit => "<a href='$script_name?op=add_form&tagfield=$tagfield'>");
  	if ($offset>0) {
  		my $prevpage = $offset-$pagesize;
--- 345,349 ----
  	}
  	$template->param(loop => \@loop_data);
! 	$template->param(edit => "<a href=\"$script_name?op=add_form&amp;tagfield=$tagfield\">");
  	if ($offset>0) {
  		my $prevpage = $offset-$pagesize;

Index: marctagstructure.pl
===================================================================
RCS file: /cvsroot/koha/koha/admin/marctagstructure.pl,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -r1.18 -r1.19
*** marctagstructure.pl	30 Dec 2003 16:16:26 -0000	1.18
--- marctagstructure.pl	12 Jan 2004 16:55:06 -0000	1.19
***************
*** 35,50 ****
  	my @data=split(' ',$searchstring);
  	my $count=@data;
! 	my $query="Select tagfield,liblibrarian,libopac,repeatable,mandatory,authorised_value from marc_tag_structure where (tagfield >= $data[0]) order by tagfield";
! 	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);
  }
  
--- 35,47 ----
  	my @data=split(' ',$searchstring);
  	my $count=@data;
! 	my $sth=$dbh->prepare("Select tagfield,liblibrarian,libopac,repeatable,mandatory,authorised_value from marc_tag_structure where (tagfield >= ?) order by tagfield");
! 	$sth->execute($data[0]);
  	my @results;
  	while (my $data=$sth->fetchrow_hashref){
  	push(@results,$data);
  	}
  	#  $sth->execute;
  	$sth->finish;
! 	return (scalar(@results),\@results);
  }
  
***************
*** 52,57 ****
  my $searchfield=$input->param('searchfield');
  $searchfield=0 unless $searchfield;
- my $pkfield="tagfield";
- my $reqsel="select tagfield,liblibrarian,libopac,repeatable,mandatory,authorised_value from marc_tag_structure where $pkfield='$searchfield'";
  my $offset=$input->param('offset');
  my $script_name="/cgi-bin/koha/admin/marctagstructure.pl";
--- 49,52 ----
***************
*** 85,90 ****
  	my $data;
  	if ($searchfield) {
! 		my $sth=$dbh->prepare("select tagfield,liblibrarian,libopac,repeatable,mandatory,authorised_value from marc_tag_structure where $pkfield='$searchfield'");
! 		$sth->execute;
  		$data=$sth->fetchrow_hashref;
  		$sth->finish;
--- 80,85 ----
  	my $data;
  	if ($searchfield) {
! 		my $sth=$dbh->prepare("select tagfield,liblibrarian,libopac,repeatable,mandatory,authorised_value from marc_tag_structure where tagfield=?");
! 		$sth->execute($searchfield);
  		$data=$sth->fetchrow_hashref;
  		$sth->finish;
***************
*** 146,151 ****
  } elsif ($op eq 'delete_confirm') {
  	my $dbh = C4::Context->dbh;
! 	my $sth=$dbh->prepare($reqsel);
! 	$sth->execute;
  	my $data=$sth->fetchrow_hashref;
  	$sth->finish;
--- 141,146 ----
  } elsif ($op eq 'delete_confirm') {
  	my $dbh = C4::Context->dbh;
! 	my $sth=$dbh->prepare("select tagfield,liblibrarian,libopac,repeatable,mandatory,authorised_value from marc_tag_structure where tagfield=?");
! 	$sth->execute($searchfield);
  	my $data=$sth->fetchrow_hashref;
  	$sth->finish;
***************
*** 159,163 ****
  	my $dbh = C4::Context->dbh;
  	unless (C4::Context->config('demo') eq 1) {
! 		$dbh->do("delete from marc_tag_structure where $pkfield='$searchfield'");
  		$dbh->do("delete from marc_subfield_structure where tagfield='$searchfield'");
  	}
--- 154,158 ----
  	my $dbh = C4::Context->dbh;
  	unless (C4::Context->config('demo') eq 1) {
! 		$dbh->do("delete from marc_tag_structure where tagfield='$searchfield'");
  		$dbh->do("delete from marc_subfield_structure where tagfield='$searchfield'");
  	}

Index: printers.pl
===================================================================
RCS file: /cvsroot/koha/koha/admin/printers.pl,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -r1.9 -r1.10
*** printers.pl	6 May 2003 14:55:39 -0000	1.9
--- printers.pl	12 Jan 2004 16:55:06 -0000	1.10
***************
*** 53,59 ****
  	my @data=split(' ',$searchstring);
  	my $count=@data;
! 	my $query="Select printername,printqueue,printtype from printers where (printername like \"$data[0]%\") order by printername";
! 	my $sth=$dbh->prepare($query);
! 	$sth->execute;
  	my @results;
  	my $cnt=0;
--- 53,59 ----
  	my @data=split(' ',$searchstring);
  	my $count=@data;
! 	my $query="";
! 	my $sth=$dbh->prepare("Select printername,printqueue,printtype from printers where (printername like ?) order by printername");
! 	$sth->execute("$data[0]%");
  	my @results;
  	my $cnt=0;
***************
*** 69,75 ****
  my $input = new CGI;
  my $searchfield=$input->param('searchfield');
! my $pkfield="printername";
! my $reqsel="select printername,printqueue,printtype from printers where $pkfield='$searchfield'";
! my $reqdel="delete from printers where $pkfield='$searchfield'";
  #my $branchcode=$input->param('branchcode');
  my $offset=$input->param('offset');
--- 69,75 ----
  my $input = new CGI;
  my $searchfield=$input->param('searchfield');
! my $pkfield="";
! my $reqsel="";
! my $reqdel="";
  #my $branchcode=$input->param('branchcode');
  my $offset=$input->param('offset');
***************
*** 103,108 ****
  	if ($searchfield) {
  		my $dbh = C4::Context->dbh;
! 		my $sth=$dbh->prepare("select printername,printqueue,printtype from printers where printername='$searchfield'");
! 		$sth->execute;
  		$data=$sth->fetchrow_hashref;
  		$sth->finish;
--- 103,108 ----
  	if ($searchfield) {
  		my $dbh = C4::Context->dbh;
! 		my $sth=$dbh->prepare("select printername,printqueue,printtype from printers where printername=?");
! 		$sth->execute($searchfield);
  		$data=$sth->fetchrow_hashref;
  		$sth->finish;
***************
*** 117,126 ****
  	$template->param(add_validate => 1);
  	my $dbh = C4::Context->dbh;
! 	my $query = "replace printers (printername,printqueue,printtype) values (";
! 	$query.= $dbh->quote($input->param('printername')).",";
! 	$query.= $dbh->quote($input->param('printqueue')).",";
! 	$query.= $dbh->quote($input->param('printtype')).")";
! 	my $sth=$dbh->prepare($query);
! 	$sth->execute;
  	$sth->finish;
  													# END $OP eq ADD_VALIDATE
--- 117,122 ----
  	$template->param(add_validate => 1);
  	my $dbh = C4::Context->dbh;
! 	my $sth=$dbh->prepare("replace printers (printername,printqueue,printtype) values (?,?,?)");
! 	$sth->execute($input->param('printername'),$input->param('printqueue'),$input->param('printtype'));
  	$sth->finish;
  													# END $OP eq ADD_VALIDATE
***************
*** 130,135 ****
  	$template->param(delete_confirm => 1);
  	my $dbh = C4::Context->dbh;
! 	my $sth=$dbh->prepare($reqsel);
! 	$sth->execute;
  	my $data=$sth->fetchrow_hashref;
  	$sth->finish;
--- 126,131 ----
  	$template->param(delete_confirm => 1);
  	my $dbh = C4::Context->dbh;
! 	my $sth=$dbh->prepare("select printername,printqueue,printtype from printers where printername=");
! 	$sth->execute($searchfield);
  	my $data=$sth->fetchrow_hashref;
  	$sth->finish;
***************
*** 144,149 ****
  
  	my $dbh = C4::Context->dbh;
! 	my $sth=$dbh->prepare($reqdel);
! 	$sth->execute;
  	$sth->finish;
  													# END $OP eq DELETE_CONFIRMED
--- 140,145 ----
  
  	my $dbh = C4::Context->dbh;
! 	my $sth=$dbh->prepare("delete from printers where printername=?");
! 	$sth->execute($searchfield);
  	$sth->finish;
  													# END $OP eq DELETE_CONFIRMED

Index: stopwords.pl
===================================================================
RCS file: /cvsroot/koha/koha/admin/stopwords.pl,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -r1.10 -r1.11
*** stopwords.pl	6 May 2003 14:55:39 -0000	1.10
--- stopwords.pl	12 Jan 2004 16:55:06 -0000	1.11
***************
*** 53,59 ****
  	my @data=split(' ',$searchstring);
  	my $count=@data;
! 	my $query="Select word from stopwords where (word like \"$data[0]%\") order by word";
! 	my $sth=$dbh->prepare($query);
! 	$sth->execute;
  	my @results;
  	my $cnt=0;
--- 53,59 ----
  	my @data=split(' ',$searchstring);
  	my $count=@data;
! 	my $query="";
! 	my $sth=$dbh->prepare("Select word from stopwords where (word like ?) order by word");
! 	$sth->execute("$data[0]%");
  	my @results;
  	my $cnt=0;
***************
*** 69,75 ****
  my $input = new CGI;
  my $searchfield=$input->param('searchfield');
- my $pkfield="word";
- my $reqsel="select word from stopwords where $pkfield='$searchfield'";
- my $reqdel="delete from stopwords where $pkfield='$searchfield'";
  my $offset=$input->param('offset');
  my $script_name="/cgi-bin/koha/admin/stopwords.pl";
--- 69,72 ----
***************
*** 100,105 ****
  	if ($searchfield) {
  		my $dbh = C4::Context->dbh;
! 		my $sth=$dbh->prepare("select word from stopwords where word='$searchfield'");
! 		$sth->execute;
  		$data=$sth->fetchrow_hashref;
  		$sth->finish;
--- 97,102 ----
  	if ($searchfield) {
  		my $dbh = C4::Context->dbh;
! 		my $sth=$dbh->prepare("select word from stopwords where word=?");
! 		$sth->execute($searchfield);
  		$data=$sth->fetchrow_hashref;
  		$sth->finish;
***************
*** 124,129 ****
  	$template->param(delete_confirm => 1);
  	my $dbh = C4::Context->dbh;
! 	my $sth=$dbh->prepare($reqsel);
! 	$sth->execute;
  	my $data=$sth->fetchrow_hashref;
  	$sth->finish;
--- 121,126 ----
  	$template->param(delete_confirm => 1);
  	my $dbh = C4::Context->dbh;
! 	my $sth=$dbh->prepare("select word from stopwords where word=?");
! 	$sth->execute($searchfield);
  	my $data=$sth->fetchrow_hashref;
  	$sth->finish;
***************
*** 134,139 ****
  	$template->param(delete_confirmed => 1);
  	my $dbh = C4::Context->dbh;
! 	my $sth=$dbh->prepare($reqdel);
! 	$sth->execute;
  	$sth->finish;
  													# END $OP eq DELETE_CONFIRMED
--- 131,136 ----
  	$template->param(delete_confirmed => 1);
  	my $dbh = C4::Context->dbh;
! 	my $sth=$dbh->prepare("delete from stopwords where word=?");
! 	$sth->execute($searchfield);
  	$sth->finish;
  													# END $OP eq DELETE_CONFIRMED

Index: z3950servers.pl
===================================================================
RCS file: /cvsroot/koha/koha/admin/z3950servers.pl,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -r1.8 -r1.9
*** z3950servers.pl	6 May 2003 14:55:41 -0000	1.8
--- z3950servers.pl	12 Jan 2004 16:55:06 -0000	1.9
***************
*** 36,58 ****
  	my @data=split(' ',$searchstring);
  	my $count=@data;
! 	my $query="Select host,port,db,userid,password,name,id,checked,rank,syntax from z3950servers where (name like \"$data[0]\%\") order by rank,name";
! 	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;
  	$dbh->disconnect;
! 	return ($cnt,\@results);
  }
  
  my $input = new CGI;
  my $searchfield=$input->param('searchfield');
- my $reqsel="select host,port,db,userid,password,name,id,checked,rank,syntax from z3950servers where (name = '$searchfield') order by rank,name";
- my $reqdel="delete from z3950servers where name='$searchfield'";
  my $offset=$input->param('offset');
  my $script_name="/cgi-bin/koha/admin/z3950servers.pl";
--- 36,53 ----
  	my @data=split(' ',$searchstring);
  	my $count=@data;
! 	my $sth=$dbh->prepare("Select host,port,db,userid,password,name,id,checked,rank,syntax from z3950servers where (name like ?) order by rank,name");
! 	$sth->execute("$data[0]\%");
  	my @results;
  	while (my $data=$sth->fetchrow_hashref) {
  	    push(@results,$data);
  	}
  	#  $sth->execute;
  	$sth->finish;
  	$dbh->disconnect;
! 	return (scalar(@results),\@results);
  }
  
  my $input = new CGI;
  my $searchfield=$input->param('searchfield');
  my $offset=$input->param('offset');
  my $script_name="/cgi-bin/koha/admin/z3950servers.pl";
***************
*** 84,89 ****
  	if ($searchfield) {
  		my $dbh = C4::Context->dbh;
! 		my $sth=$dbh->prepare("select host,port,db,userid,password,name,id,checked,rank,syntax from z3950servers where (name = '$searchfield') order by rank,name");
! 		$sth->execute;
  		$data=$sth->fetchrow_hashref;
  		$sth->finish;
--- 79,84 ----
  	if ($searchfield) {
  		my $dbh = C4::Context->dbh;
! 		my $sth=$dbh->prepare("select host,port,db,userid,password,name,id,checked,rank,syntax from z3950servers where (name = ?) order by rank,name");
! 		$sth->execute($searchfield);
  		$data=$sth->fetchrow_hashref;
  		$sth->finish;
***************
*** 139,144 ****
  	my $dbh = C4::Context->dbh;
  
! 	my $sth2=$dbh->prepare($reqsel);
! 	$sth2->execute;
  	my $data=$sth2->fetchrow_hashref;
  	$sth2->finish;
--- 134,139 ----
  	my $dbh = C4::Context->dbh;
  
! 	my $sth2=$dbh->prepare("select host,port,db,userid,password,name,id,checked,rank,syntax from z3950servers where (name = ?) order by rank,name");
! 	$sth2->execute($searchfield);
  	my $data=$sth2->fetchrow_hashref;
  	$sth2->finish;
***************
*** 158,163 ****
  	$template->param(delete_confirmed => 1);
  	my $dbh=C4::Context->dbh;
! 	my $sth=$dbh->prepare($reqdel);
! 	$sth->execute;
  	$sth->finish;
  													# END $OP eq DELETE_CONFIRMED
--- 153,158 ----
  	$template->param(delete_confirmed => 1);
  	my $dbh=C4::Context->dbh;
! 	my $sth=$dbh->prepare("delete from z3950servers where name=?");
! 	$sth->execute($searchfield);
  	$sth->finish;
  													# END $OP eq DELETE_CONFIRMED





More information about the Koha-cvs mailing list