[Koha-cvs] CVS: koha/admin aqbudget.pl,1.15,1.16 authorised_values.pl,1.11,1.12 checkmarc.pl,1.5,1.6 systempreferences.pl,1.15,1.16 thesaurus.pl,1.9,1.10

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


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

Modified Files:
	aqbudget.pl authorised_values.pl checkmarc.pl 
	systempreferences.pl thesaurus.pl 
Log Message:
sync'ing with rel_2_0 (mostly prepare/execute pb, bug #662)

Index: aqbudget.pl
===================================================================
RCS file: /cvsroot/koha/koha/admin/aqbudget.pl,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -r1.15 -r1.16
*** aqbudget.pl	13 Jun 2003 13:46:03 -0000	1.15
--- aqbudget.pl	22 Dec 2003 19:16:58 -0000	1.16
***************
*** 54,60 ****
  	my @data=split(' ',$searchstring);
  	my $count=@data;
! 	my $query="Select aqbudgetid,bookfundid,startdate,enddate,budgetamount from aqbudget where (bookfundid like \"$data[0]%\") order by bookfundid,aqbudgetid";
! 	my $sth=$dbh->prepare($query);
! 	$sth->execute;
  	my @results;
  	my $cnt=0;
--- 54,59 ----
  	my @data=split(' ',$searchstring);
  	my $count=@data;
! 	my $sth=$dbh->prepare("Select aqbudgetid,bookfundid,startdate,enddate,budgetamount from aqbudget where (bookfundid like ?) order by bookfundid,aqbudgetid");
! 	$sth->execute("$data[0]%");
  	my @results;
  	my $cnt=0;
***************
*** 104,111 ****
  	if ($aqbudgetid) {
  		my $dbh = C4::Context->dbh;
! 	        my $query="select aqbudgetid,bookfundname,aqbookfund.bookfundid,startdate,enddate,budgetamount from aqbudget,aqbookfund where aqbudgetid='$aqbudgetid' and aqbudget.bookfundid=aqbookfund.bookfundid";
! #	        print $query;
! 		my $sth=$dbh->prepare($query);
! 		$sth->execute;
  		$dataaqbudget=$sth->fetchrow_hashref;
  		$sth->finish;
--- 103,108 ----
  	if ($aqbudgetid) {
  		my $dbh = C4::Context->dbh;
! 		my $sth=$dbh->prepare("select aqbudgetid,bookfundname,aqbookfund.bookfundid,startdate,enddate,budgetamount from aqbudget,aqbookfund where aqbudgetid=? and aqbudget.bookfundid=aqbookfund.bookfundid");
! 		$sth->execute($aqbudgetid);
  		$dataaqbudget=$sth->fetchrow_hashref;
  		$sth->finish;
***************
*** 137,142 ****
  } elsif ($op eq 'add_validate') {
  	my $dbh = C4::Context->dbh;
! 	my $query = "replace aqbudget (aqbudgetid,bookfundid,startdate,enddate,budgetamount) values (?,?,?,?,?)";
! 	my $sth=$dbh->prepare($query);
  	$sth->execute($input->param('aqbudgetid'),$input->param('bookfundid'),
  						format_date_in_iso($input->param('startdate')),
--- 134,138 ----
  } elsif ($op eq 'add_validate') {
  	my $dbh = C4::Context->dbh;
! 	my $sth=$dbh->prepare("replace aqbudget (aqbudgetid,bookfundid,startdate,enddate,budgetamount) values (?,?,?,?,?)");
  	$sth->execute($input->param('aqbudgetid'),$input->param('bookfundid'),
  						format_date_in_iso($input->param('startdate')),
***************
*** 152,157 ****
  } elsif ($op eq 'delete_confirm') {
  	my $dbh = C4::Context->dbh;
! 	my $sth=$dbh->prepare("select aqbudgetid,bookfundid,startdate,enddate,budgetamount from aqbudget where aqbudgetid='$aqbudgetid'");
! 	$sth->execute;
  	my $data=$sth->fetchrow_hashref;
  	$sth->finish;
--- 148,153 ----
  } elsif ($op eq 'delete_confirm') {
  	my $dbh = C4::Context->dbh;
! 	my $sth=$dbh->prepare("select aqbudgetid,bookfundid,startdate,enddate,budgetamount from aqbudget where aqbudgetid=?");
! 	$sth->execute($aqbudgetid);
  	my $data=$sth->fetchrow_hashref;
  	$sth->finish;
***************
*** 167,173 ****
  	my $dbh = C4::Context->dbh;
  	my $aqbudgetid=uc($input->param('aqbudgetid'));
! 	my $query = "delete from aqbudget where aqbudgetid='$aqbudgetid'";
! 	my $sth=$dbh->prepare($query);
! 	$sth->execute;
  	$sth->finish;
  	 print $input->redirect("aqbookfund.pl");
--- 163,168 ----
  	my $dbh = C4::Context->dbh;
  	my $aqbudgetid=uc($input->param('aqbudgetid'));
! 	my $sth=$dbh->prepare("delete from aqbudget where aqbudgetid=?");
! 	$sth->execute($aqbudgetid);
  	$sth->finish;
  	 print $input->redirect("aqbookfund.pl");
***************
*** 190,196 ****
  	        my $dataaqbookfund;
  	        my $dbh = C4::Context->dbh;
! 	        my $query="select bookfundid,bookfundname from aqbookfund where bookfundid=?";
! #	        print $query;
! 		my $sth=$dbh->prepare($query);
  		$sth->execute($results->[$i]{'bookfundid'});
  		$dataaqbookfund=$sth->fetchrow_hashref;
--- 185,189 ----
  	        my $dataaqbookfund;
  	        my $dbh = C4::Context->dbh;
! 		my $sth=$dbh->prepare("select bookfundid,bookfundname from aqbookfund where bookfundid=?");
  		$sth->execute($results->[$i]{'bookfundid'});
  		$dataaqbookfund=$sth->fetchrow_hashref;

Index: authorised_values.pl
===================================================================
RCS file: /cvsroot/koha/koha/admin/authorised_values.pl,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -r1.11 -r1.12
*** authorised_values.pl	21 Oct 2003 15:47:07 -0000	1.11
--- authorised_values.pl	22 Dec 2003 19:16:58 -0000	1.12
***************
*** 35,41 ****
  	my @data=split(' ',$searchstring);
  	my $count=@data;
! 	my $query="Select id,category,authorised_value,lib from authorised_values where (category like \"$data[0]%\") order by category,authorised_value";
! 	my $sth=$dbh->prepare($query);
! 	$sth->execute;
  	my @results;
  	my $cnt=0;
--- 35,40 ----
  	my @data=split(' ',$searchstring);
  	my $count=@data;
! 	my $sth=$dbh->prepare("Select id,category,authorised_value,lib from authorised_values where (category like ?) order by category,authorised_value");
! 	$sth->execute("$data[0]%");
  	my @results;
  	my $cnt=0;
***************
*** 52,57 ****
  $searchfield=~ s/\,//g;
  my $id = $input->param('id');
- my $reqsel="select category,authorised_value,lib from authorised_values where id='$id'";
- my $reqdel="delete from authorised_values where id='$id'";
  my $offset=$input->param('offset');
  my $script_name="/cgi-bin/koha/admin/authorised_values.pl";
--- 51,54 ----
***************
*** 82,87 ****
  	if ($id) {
  		my $dbh = C4::Context->dbh;
! 		my $sth=$dbh->prepare("select id,category,authorised_value,lib from authorised_values where id='$id'");
! 		$sth->execute;
  		$data=$sth->fetchrow_hashref;
  		$sth->finish;
--- 79,84 ----
  	if ($id) {
  		my $dbh = C4::Context->dbh;
! 		my $sth=$dbh->prepare("select id,category,authorised_value,lib from authorised_values where id=?");
! 		$sth->execute($id);
  		$data=$sth->fetchrow_hashref;
  		$sth->finish;
***************
*** 122,127 ****
  } elsif ($op eq 'delete_confirm') {
  	my $dbh = C4::Context->dbh;
! 	my $sth=$dbh->prepare($reqsel);
! 	$sth->execute;
  	my $data=$sth->fetchrow_hashref;
  	$sth->finish;
--- 119,124 ----
  } elsif ($op eq 'delete_confirm') {
  	my $dbh = C4::Context->dbh;
! 	my $sth=$dbh->prepare("select category,authorised_value,lib from authorised_values where id=?");
! 	$sth->execute($id);
  	my $data=$sth->fetchrow_hashref;
  	$sth->finish;
***************
*** 136,141 ****
  } elsif ($op eq 'delete_confirmed') {
  	my $dbh = C4::Context->dbh;
! 	my $sth=$dbh->prepare($reqdel);
! 	$sth->execute;
  	$sth->finish;
  	print "Content-Type: text/html\n\n<META HTTP-EQUIV=Refresh CONTENT=\"0; URL=authorised_values.pl?searchfield=$searchfield\"></html>";
--- 133,138 ----
  } elsif ($op eq 'delete_confirmed') {
  	my $dbh = C4::Context->dbh;
! 	my $sth=$dbh->prepare("delete from authorised_values where id=?");
! 	$sth->execute($id);
  	$sth->finish;
  	print "Content-Type: text/html\n\n<META HTTP-EQUIV=Refresh CONTENT=\"0; URL=authorised_values.pl?searchfield=$searchfield\"></html>";

Index: checkmarc.pl
===================================================================
RCS file: /cvsroot/koha/koha/admin/checkmarc.pl,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -r1.5 -r1.6
*** checkmarc.pl	4 Sep 2003 15:03:00 -0000	1.5
--- checkmarc.pl	22 Dec 2003 19:16:58 -0000	1.6
***************
*** 83,88 ****
  	}
  }
! $sth = $dbh->prepare("select kohafield from marc_subfield_structure where tagfield=$tagfield");
! $sth->execute;
  while (($res2) = $sth->fetchrow) {
  	if (!$res2 || $res2 =~ /^items/) {
--- 83,88 ----
  	}
  }
! $sth = $dbh->prepare("select kohafield from marc_subfield_structure where tagfield=?");
! $sth->execute($tagfield);
  while (($res2) = $sth->fetchrow) {
  	if (!$res2 || $res2 =~ /^items/) {

Index: systempreferences.pl
===================================================================
RCS file: /cvsroot/koha/koha/admin/systempreferences.pl,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -r1.15 -r1.16
*** systempreferences.pl	1 Aug 2003 14:24:47 -0000	1.15
--- systempreferences.pl	22 Dec 2003 19:16:58 -0000	1.16
***************
*** 55,61 ****
  	my @data=split(' ',$searchstring);
  	my $count=@data;
! 	my $query="Select variable,value,explanation,type,options from systempreferences where (variable like \"$data[0]%\") order by variable";
! 	my $sth=$dbh->prepare($query);
! 	$sth->execute;
  	my @results;
  	my $cnt=0;
--- 55,60 ----
  	my @data=split(' ',$searchstring);
  	my $count=@data;
! 	my $sth=$dbh->prepare("Select variable,value,explanation,type,options from systempreferences where (variable like ?) order by variable");
! 	$sth->execute("$data[0]%");
  	my @results;
  	my $cnt=0;
***************
*** 70,76 ****
  my $input = new CGI;
  my $searchfield=$input->param('searchfield');
- my $pkfield="variable";
- my $reqsel="select variable,value,explanation,type,options from systempreferences where $pkfield='$searchfield'";
- my $reqdel="delete from systempreferences where $pkfield='$searchfield'";
  my $offset=$input->param('offset');
  my $script_name="/cgi-bin/koha/admin/systempreferences.pl";
--- 69,72 ----
***************
*** 136,141 ****
  	if ($sth->rows) {
  		unless (C4::Context->config('demo') eq 1) {
! 			my $query = "update systempreferences set value=?,explanation=? where variable=?";
! 			my $sth=$dbh->prepare($query);
  			$sth->execute($value, $input->param('explanation'), $input->param('variable'));
  			$sth->finish;
--- 132,136 ----
  	if ($sth->rows) {
  		unless (C4::Context->config('demo') eq 1) {
! 			my $sth=$dbh->prepare("update systempreferences set value=?,explanation=? where variable=?");
  			$sth->execute($value, $input->param('explanation'), $input->param('variable'));
  			$sth->finish;
***************
*** 143,148 ****
      } else {
  		unless (C4::Context->config('demo') eq 1) {
! 			my $query = "insert into systempreferences (variable,value,explanation) values (?,?,?)";
! 			my $sth=$dbh->prepare($query);
  			$sth->execute($input->param('variable'), $input->param('value'), $input->param('explanation'));
  			$sth->finish;
--- 138,142 ----
      } else {
  		unless (C4::Context->config('demo') eq 1) {
! 			my $sth=$dbh->prepare("insert into systempreferences (variable,value,explanation) values (?,?,?)");
  			$sth->execute($input->param('variable'), $input->param('value'), $input->param('explanation'));
  			$sth->finish;
***************
*** 161,166 ****
  	if ($searchfield) {
  		my $dbh = C4::Context->dbh;
! 		my $sth=$dbh->prepare("select variable,value,explanation,type,options from systempreferences where variable='$searchfield'");
! 		$sth->execute;
  		$data=$sth->fetchrow_hashref;
  		$sth->finish;
--- 155,160 ----
  	if ($searchfield) {
  		my $dbh = C4::Context->dbh;
! 		my $sth=$dbh->prepare("select variable,value,explanation,type,options from systempreferences where variable=?");
! 		$sth->execute($searchfield);
  		$data=$sth->fetchrow_hashref;
  		$sth->finish;
***************
*** 237,247 ****
  } elsif ($op eq 'add_validate') {
  	my $dbh = C4::Context->dbh;
! 	my $query="select * from systempreferences where variable=?";
! 	my $sth=$dbh->prepare($query);
  	$sth->execute($input->param('variable'));
  	if ($sth->rows) {
  		unless (C4::Context->config('demo') eq 1) {
! 			my $query = "update systempreferences set value=?,explanation=? where variable=?";
! 			my $sth=$dbh->prepare($query);
  			$sth->execute($input->param('value'), $input->param('explanation'), $input->param('variable'));
  			$sth->finish;
--- 231,239 ----
  } elsif ($op eq 'add_validate') {
  	my $dbh = C4::Context->dbh;
! 	my $sth=$dbh->prepare("select * from systempreferences where variable=?");
  	$sth->execute($input->param('variable'));
  	if ($sth->rows) {
  		unless (C4::Context->config('demo') eq 1) {
! 			my $sth=$dbh->prepare("update systempreferences set value=?,explanation=? where variable=?");
  			$sth->execute($input->param('value'), $input->param('explanation'), $input->param('variable'));
  			$sth->finish;
***************
*** 249,254 ****
  	} else {
  		unless (C4::Context->config('demo') eq 1) {
! 			my $query = "insert into systempreferences (variable,value,explanation) values (?,?,?)";
! 			my $sth=$dbh->prepare($query);
  			$sth->execute($input->param('variable'), $input->param('value'), $input->param('explanation'));
  			$sth->finish;
--- 241,245 ----
  	} else {
  		unless (C4::Context->config('demo') eq 1) {
! 			my $sth=$dbh->prepare("insert into systempreferences (variable,value,explanation) values (?,?,?)");
  			$sth->execute($input->param('variable'), $input->param('value'), $input->param('explanation'));
  			$sth->finish;
***************
*** 260,265 ****
  } elsif ($op eq 'delete_confirm') {
  	my $dbh = C4::Context->dbh;
! 	my $sth=$dbh->prepare($reqsel);
! 	$sth->execute;
  	my $data=$sth->fetchrow_hashref;
  	$sth->finish;
--- 251,256 ----
  } elsif ($op eq 'delete_confirm') {
  	my $dbh = C4::Context->dbh;
! 	my $sth=$dbh->prepare("select variable,value,explanation,type,options from systempreferences where variable=?");
! 	$sth->execute($searchfield);
  	my $data=$sth->fetchrow_hashref;
  	$sth->finish;
***************
*** 273,278 ****
  } elsif ($op eq 'delete_confirmed') {
  	my $dbh = C4::Context->dbh;
! 	my $sth=$dbh->prepare($reqdel);
! 	$sth->execute;
  	$sth->finish;
  													# END $OP eq DELETE_CONFIRMED
--- 264,269 ----
  } elsif ($op eq 'delete_confirmed') {
  	my $dbh = C4::Context->dbh;
! 	my $sth=$dbh->prepare("delete from systempreferences where variable=?");
! 	$sth->execute($searchfield);
  	$sth->finish;
  													# END $OP eq DELETE_CONFIRMED

Index: thesaurus.pl
===================================================================
RCS file: /cvsroot/koha/koha/admin/thesaurus.pl,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -r1.9 -r1.10
*** thesaurus.pl	10 Jul 2003 14:11:46 -0000	1.9
--- thesaurus.pl	22 Dec 2003 19:16:58 -0000	1.10
***************
*** 39,43 ****
  my $father=$input->param('father');
  
! my $reqsel="select category,stdlib,freelib from bibliothesaurus where id='$id'";
  my $reqdel="delete from bibliothesaurus where id='$id'";
  my $script_name="/cgi-bin/koha/admin/thesaurus.pl";
--- 39,43 ----
  my $father=$input->param('father');
  
! my $reqsel="";
  my $reqdel="delete from bibliothesaurus where id='$id'";
  my $script_name="/cgi-bin/koha/admin/thesaurus.pl";
***************
*** 74,79 ****
  	if ($id) {
  		my $dbh = C4::Context->dbh;
! 		my $sth=$dbh->prepare("select id,category,freelib,stdlib from bibliothesaurus where id='$id'");
! 		$sth->execute;
  		$data=$sth->fetchrow_hashref;
  		$sth->finish;
--- 74,79 ----
  	if ($id) {
  		my $dbh = C4::Context->dbh;
! 		my $sth=$dbh->prepare("select id,category,freelib,stdlib from bibliothesaurus where id=?");
! 		$sth->execute($id);
  		$data=$sth->fetchrow_hashref;
  		$sth->finish;
***************
*** 124,129 ****
  } elsif ($op eq 'delete_confirm') {
  	my $dbh = C4::Context->dbh;
! 	my $sth=$dbh->prepare($reqsel);
! 	$sth->execute;
  	my $data=$sth->fetchrow_hashref;
  	$sth->finish;
--- 124,129 ----
  } elsif ($op eq 'delete_confirm') {
  	my $dbh = C4::Context->dbh;
! 	my $sth=$dbh->prepare("select category,stdlib,freelib from bibliothesaurus where id=?");
! 	$sth->execute($id);
  	my $data=$sth->fetchrow_hashref;
  	$sth->finish;





More information about the Koha-cvs mailing list