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

Paul POULAIN tipaul at users.sourceforge.net
Mon Jan 12 20:20:35 CET 2004


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

Modified Files:
      Tag: rel_2_0
	itemtypes.pl 
Log Message:
adding notforloan field management

Index: itemtypes.pl
===================================================================
RCS file: /cvsroot/koha/koha/admin/itemtypes.pl,v
retrieving revision 1.10.2.1
retrieving revision 1.10.2.2
diff -C2 -r1.10.2.1 -r1.10.2.2
*** itemtypes.pl	23 Dec 2003 17:58:04 -0000	1.10.2.1
--- itemtypes.pl	12 Jan 2004 19:20:33 -0000	1.10.2.2
***************
*** 97,101 ****
  	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;
--- 97,101 ----
  	if ($itemtype) {
  		my $dbh = C4::Context->dbh;
! 		my $sth=$dbh->prepare("select itemtype,description,loanlength,renewalsallowed,rentalcharge,notforloan from itemtypes where itemtype=?");
  		$sth->execute($itemtype);
  		$data=$sth->fetchrow_hashref;
***************
*** 106,110 ****
  							loanlength => $data->{'loanlength'},
  							renewalsallowed => $data->{'renewalsallowed'},
! 							rentalcharge => $data->{'rentalcharge'});
  ;
  													# END $OP eq ADD_FORM
--- 106,112 ----
  							loanlength => $data->{'loanlength'},
  							renewalsallowed => $data->{'renewalsallowed'},
! 							rentalcharge => $data->{'rentalcharge'},
! 							notforloan => $data->{'notforloan'}
! 							);
  ;
  													# END $OP eq ADD_FORM
***************
*** 113,117 ****
  } elsif ($op eq 'add_validate') {
  	my $dbh = C4::Context->dbh;
! 	my $query = "replace itemtypes (itemtype,description,loanlength,renewalsallowed,rentalcharge) values (";
  	$query.= $dbh->quote($input->param('itemtype')).",";
  	$query.= $dbh->quote($input->param('description')).",";
--- 115,119 ----
  } elsif ($op eq 'add_validate') {
  	my $dbh = C4::Context->dbh;
! 	my $query = "replace itemtypes (itemtype,description,loanlength,renewalsallowed,rentalcharge,notforloan) values (";
  	$query.= $dbh->quote($input->param('itemtype')).",";
  	$query.= $dbh->quote($input->param('description')).",";
***************
*** 122,126 ****
  		$query.= "1,";
  	}
! 	$query.= $dbh->quote($input->param('rentalcharge')).")";
  	my $sth=$dbh->prepare($query);
  	$sth->execute;
--- 124,133 ----
  		$query.= "1,";
  	}
! 	$query.= $dbh->quote($input->param('rentalcharge')).",";
! 	if ($input->param('notforloan') ne 1) {
! 		$query.= "0)";
! 	} else {
! 		$query.= "1)";
! 	}
  	my $sth=$dbh->prepare($query);
  	$sth->execute;





More information about the Koha-cvs mailing list