[Koha-cvs] CVS: koha/admin systempreferences.pl,1.1,1.2

Paul POULAIN tipaul at users.sourceforge.net
Wed May 15 14:17:37 CEST 2002


Update of /cvsroot/koha/koha/admin
In directory usw-pr-cvs1:/tmp/cvs-serv23167/admin

Modified Files:
	systempreferences.pl 
Log Message:
Update of systempreferences table structure and admin script. Contains now a "help" fields that shows what param is supposed to do what. The params will be in the sample-DB. I've dumped the 3 I know. If there are others, let me know :

INSERT INTO systempreferences VALUES ('template', 'french', 'Template default name. Not used for instance');
INSERT INTO systempreferences VALUES ('autoBarcode', '', '1 or else. If 1, Barcode is auto-calculated');
INSERT INTO systempreferences VALUES ('acquisitions', 'normal', 'normal or simple : will use acquisition system found in directory acqui.simple or acquisition');






Index: systempreferences.pl
===================================================================
RCS file: /cvsroot/koha/koha/admin/systempreferences.pl,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** systempreferences.pl	5 Mar 2002 20:48:42 -0000	1.1
--- systempreferences.pl	15 May 2002 12:17:35 -0000	1.2
***************
*** 32,36 ****
  	my @data=split(' ',$searchstring);
  	my $count=@data;
! 	my $query="Select variable,value from systempreferences where (variable like \"$data[0]%\") order by variable";
  	my $sth=$dbh->prepare($query);
  	$sth->execute;
--- 32,36 ----
  	my @data=split(' ',$searchstring);
  	my $count=@data;
! 	my $query="Select variable,value,explanation from systempreferences where (variable like \"$data[0]%\") order by variable";
  	my $sth=$dbh->prepare($query);
  	$sth->execute;
***************
*** 50,54 ****
  my $searchfield=$input->param('searchfield');
  my $pkfield="variable";
! my $reqsel="select variable,value from systempreferences where $pkfield='$searchfield'";
  my $reqdel="delete from systempreferences where $pkfield='$searchfield'";
  my $offset=$input->param('offset');
--- 50,54 ----
  my $searchfield=$input->param('searchfield');
  my $pkfield="variable";
! my $reqsel="select variable,value,explanation from systempreferences where $pkfield='$searchfield'";
  my $reqdel="delete from systempreferences where $pkfield='$searchfield'";
  my $offset=$input->param('offset');
***************
*** 71,75 ****
  	if ($searchfield) {
  		my $dbh = &C4Connect;
! 		my $sth=$dbh->prepare("select variable,value from systempreferences where variable='$searchfield'");
  		$sth->execute;
  		$data=$sth->fetchrow_hashref;
--- 71,75 ----
  	if ($searchfield) {
  		my $dbh = &C4Connect;
! 		my $sth=$dbh->prepare("select variable,value,explanation from systempreferences where variable='$searchfield'");
  		$sth->execute;
  		$data=$sth->fetchrow_hashref;
***************
*** 139,142 ****
--- 139,143 ----
  	print "<form action='$script_name' name=Aform method=post>";
  	print "<input type=hidden name=op value='add_validate'>";
+ 	print "<input type=hidden name=explanation value='".$data->{'explanation'}."'>";
  	print "<table>";
  	if ($searchfield) {
***************
*** 155,161 ****
  } elsif ($op eq 'add_validate') {
  	my $dbh=C4Connect;
! 	my $query = "replace systempreferences (variable,value) values (";
  	$query.= $dbh->quote($input->param('variable')).",";
! 	$query.= $dbh->quote($input->param('value')).")";
  	my $sth=$dbh->prepare($query);
  	$sth->execute;
--- 156,163 ----
  } elsif ($op eq 'add_validate') {
  	my $dbh=C4Connect;
! 	my $query = "replace systempreferences (variable,value,explanation) values (";
  	$query.= $dbh->quote($input->param('variable')).",";
! 	$query.= $dbh->quote($input->param('value')).",";
! 	$query.= $dbh->quote($input->param('explanation')).")";
  	my $sth=$dbh->prepare($query);
  	$sth->execute;
***************
*** 201,209 ****
  	print mkformnotable("$script_name", at inputs);
  	print <<printend
- <b>Hints :</b>
- 2 variables are useful in this table :
- <li><i>acquisitions</i>, which value may be "simple" or "normal"</li>
- <li><i>autoMemberNum</i> which may be 1 or 0</li>
- <br><br>
  printend
  	;
--- 203,206 ----
***************
*** 212,216 ****
  	}
  	print mktablehdr;
! 	print mktablerow(4,'#99cc33',bold('Variable'),bold('Value'),
  	'&nbsp;','&nbsp;','/images/background-mem.gif');
  	my $env;
--- 209,213 ----
  	}
  	print mktablehdr;
! 	print mktablerow(5,'#99cc33',bold('Variable'),bold('Value'),bold('Explanation'),
  	'&nbsp;','&nbsp;','/images/background-mem.gif');
  	my $env;
***************
*** 223,227 ****
  	    		$toggle="white";
  	  	}
! 		print mktablerow(4,$toggle,$results->[$i]{'variable'},$results->[$i]{'value'},
  		mklink("$script_name?op=add_form&searchfield=".$results->[$i]{'variable'},'Edit'),
  		mklink("$script_name?op=delete_confirm&searchfield=".$results->[$i]{'variable'},'Delete',''));
--- 220,224 ----
  	    		$toggle="white";
  	  	}
! 		print mktablerow(5,$toggle,$results->[$i]{'variable'},$results->[$i]{'value'},$results->[$i]{'explanation'},
  		mklink("$script_name?op=add_form&searchfield=".$results->[$i]{'variable'},'Edit'),
  		mklink("$script_name?op=delete_confirm&searchfield=".$results->[$i]{'variable'},'Delete',''));





More information about the Koha-cvs mailing list