From 726c0565e89ff1a8c812e4c51ecdd7684cbec918 Mon Sep 17 00:00:00 2001 From: tipaul Date: Wed, 18 Aug 2004 16:05:14 +0000 Subject: [PATCH] various bugfixes --- admin/categorie.pl | 4 ++-- admin/issuingrules.pl | 32 +++++++++++++++---------------- admin/itemtypes.pl | 10 +++------- admin/marc_subfields_structure.pl | 1 - admin/systempreferences.pl | 1 + 5 files changed, 22 insertions(+), 26 deletions(-) diff --git a/admin/categorie.pl b/admin/categorie.pl index b491fde00f..5a8d4e519a 100755 --- a/admin/categorie.pl +++ b/admin/categorie.pl @@ -112,8 +112,8 @@ if ($op eq 'add_form') { } 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 ################################## diff --git a/admin/issuingrules.pl b/admin/issuingrules.pl index 0e27bf58e5..74fcdfedbd 100755 --- a/admin/issuingrules.pl +++ b/admin/issuingrules.pl @@ -66,7 +66,7 @@ if ($op eq 'save') { 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}) { @@ -74,9 +74,9 @@ if ($op eq 'save') { } 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-(.*)-(.*)\.(.*)/) { @@ -85,7 +85,7 @@ if ($op eq 'save') { 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}) { @@ -93,9 +93,9 @@ if ($op eq 'save') { } else { $sth_Finsert->execute($br,$bor,$cat,$fine,$firstremind,$chargeperiod); } - } else { - $sth_Fdelete->execute($br,$bor,$cat); - } +# } else { +# $sth_Fdelete->execute($br,$bor,$cat); +# } } } @@ -159,15 +159,15 @@ foreach my $data (@itemtypes) { 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}", diff --git a/admin/itemtypes.pl b/admin/itemtypes.pl index 44286d537b..cd24949b11 100755 --- a/admin/itemtypes.pl +++ b/admin/itemtypes.pl @@ -96,14 +96,13 @@ if ($op eq 'add_form') { 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'} @@ -114,10 +113,9 @@ if ($op eq 'add_form') { # 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 { @@ -150,14 +148,13 @@ if ($op eq 'add_form') { $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); @@ -189,7 +186,6 @@ if ($op eq 'add_form') { } $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); diff --git a/admin/marc_subfields_structure.pl b/admin/marc_subfields_structure.pl index 42c2bef198..c758b0188a 100755 --- a/admin/marc_subfields_structure.pl +++ b/admin/marc_subfields_structure.pl @@ -164,7 +164,6 @@ if ($op eq 'add_form') { -size=>1, -multiple=>0, ); - warn "ATTENTION ---+--- $data->{'link'}"; $row_data{tagsubfield} =$data->{'tagsubfield'}.""; $row_data{liblibrarian} = CGI::escapeHTML($data->{'liblibrarian'}); $row_data{libopac} = CGI::escapeHTML($data->{'libopac'}); diff --git a/admin/systempreferences.pl b/admin/systempreferences.pl index c9d2b6a428..0aa0ba5701 100755 --- a/admin/systempreferences.pl +++ b/admin/systempreferences.pl @@ -41,6 +41,7 @@ use strict; use CGI; use C4::Auth; use C4::Context; +use C4::Koha; use C4::Output; use C4::Interface::CGI::Output; use C4::Search; -- 2.39.5