} elsif ($op eq 'add_validate') {
$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'));
+ my $sth=$dbh->prepare("replace categories (categorycode,description,enrolmentperiod,upperagelimit,dateofbirthrequired,enrolmentfee,reservefee,overduenoticerequired) values (?,?,?,?,?,?,?,?)");
+ $sth->execute(map { $input->param($_) } ('categorycode','description','enrolmentperiod','upperagelimit','dateofbirthrequired','enrolmentfee','reservefee','overduenoticerequired'));
$sth->finish;
# END $OP eq ADD_VALIDATE
################## DELETE_CONFIRM ##################################
my $cat = $3; # item type
my $data=$input->param($key);
my ($issuelength,$maxissueqty)=split(',',$data);
- if ($maxissueqty >0) {
+# if ($maxissueqty >0) {
$sth_search->execute($br,$bor,$cat);
my $res = $sth_search->fetchrow_hashref();
if ($res->{total}) {
} else {
$sth_Iinsert->execute($br,$bor,$cat,$maxissueqty,$issuelength);
}
- } else {
- $sth_Idelete->execute($br,$bor,$cat);
- }
+# } else {
+# $sth_Idelete->execute($br,$bor,$cat);
+# }
}
# FINES
if ($key =~ /F-(.*)-(.*)\.(.*)/) {
my $cat = $3; # item type
my $data=$input->param($key);
my ($fine,$firstremind,$chargeperiod)=split(',',$data);
- if ($fine >0) {
+# if ($fine >0) {
$sth_search->execute($br,$bor,$cat);
my $res = $sth_search->fetchrow_hashref();
if ($res->{total}) {
} else {
$sth_Finsert->execute($br,$bor,$cat,$fine,$firstremind,$chargeperiod);
}
- } else {
- $sth_Fdelete->execute($br,$bor,$cat);
- }
+# } else {
+# $sth_Fdelete->execute($br,$bor,$cat);
+# }
}
}
my $maxissueqty = $dat->{'maxissueqty'}+0;
my $issuelength = $dat->{'issuelength'}+0;
my $finesvalue;
- $finesvalue= "$fine,$dat->{'firstremind'},$dat->{'chargeperiod'}" if $fine>0;
+ $finesvalue= "$fine,$dat->{'firstremind'},$dat->{'chargeperiod'}" if $fine+$dat->{'firstremind'}+$dat->{'chargeperiod'}>0;
my $issuingvalue;
- if ($maxissueqty>0) {
- $issuingvalue = "$issuelength,$maxissueqty" ;
- }
- else {
- $issuingvalue = "$issuelength, 5";
- $maxissueqty = 5;
- }
+# if ($maxissueqty>0) {
+ $issuingvalue = "$issuelength,$maxissueqty" if $issuelength+$maxissueqty>0;
+# }
+# else {
+# $issuingvalue = "$issuelength, 5";
+# $maxissueqty = 5;
+# }
my %row = (finesname=> "F-$branch-$trow3[$i].$$data->{'itemtype'}",
finesvalue => $finesvalue,
issuingname => "I-$branch-$trow3[$i].$$data->{itemtype}",
my $data;
if ($itemtype) {
my $dbh = C4::Context->dbh;
- my $sth=$dbh->prepare("select itemtype,description,loanlength,renewalsallowed,rentalcharge,notforloan from itemtypes where itemtype=?");
+ my $sth=$dbh->prepare("select itemtype,description,renewalsallowed,rentalcharge,notforloan from itemtypes where itemtype=?");
$sth->execute($itemtype);
$data=$sth->fetchrow_hashref;
$sth->finish;
}
$template->param(itemtype => $itemtype,
description => $data->{'description'},
- loanlength => $data->{'loanlength'},
renewalsallowed => $data->{'renewalsallowed'},
rentalcharge => $data->{'rentalcharge'},
notforloan => $data->{'notforloan'}
# called by add_form, used to insert/modify data in DB
} elsif ($op eq 'add_validate') {
my $dbh = C4::Context->dbh;
- my $query = "replace itemtypes (itemtype,description,loanlength,renewalsallowed,rentalcharge,notforloan) values (";
+ my $query = "replace itemtypes (itemtype,description,renewalsallowed,rentalcharge,notforloan) values (";
$query.= $dbh->quote($input->param('itemtype')).",";
$query.= $dbh->quote($input->param('description')).",";
- $query.= $dbh->quote($input->param('loanlength')).",";
if ($input->param('renewalsallowed') ne 1) {
$query.= "0,";
} else {
$sth->finish;
}
- my $sth=$dbh->prepare("select itemtype,description,loanlength,renewalsallowed,rentalcharge from itemtypes where itemtype=?");
+ my $sth=$dbh->prepare("select itemtype,description,renewalsallowed,rentalcharge from itemtypes where itemtype=?");
$sth->execute($itemtype);
my $data=$sth->fetchrow_hashref;
$sth->finish;
$template->param(itemtype => $itemtype,
description => $data->{'description'},
- loanlength => $data->{'loanlength'},
renewalsallowed => $data->{'renewalsallowed'},
rentalcharge => $data->{'rentalcharge'},
total => $total);
}
$row_data{itemtype} = $results->[$i]{'itemtype'};
$row_data{description} = $results->[$i]{'description'};
- $row_data{loanlength} = $results->[$i]{'loanlength'};
$row_data{renewalsallowed} = $results->[$i]{'renewalsallowed'};
$row_data{rentalcharge} = $results->[$i]{'rentalcharge'};
push(@loop_data, \%row_data);
-size=>1,
-multiple=>0,
);
- warn "ATTENTION ---+--- $data->{'link'}";
$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'});
use CGI;
use C4::Auth;
use C4::Context;
+use C4::Koha;
use C4::Output;
use C4::Interface::CGI::Output;
use C4::Search;