X-Git-Url: http://koha-dev.rot13.org:8081/gitweb/?a=blobdiff_plain;f=updateitem.pl;h=c280b1356b425176c0f7ab750b0f751ad4f53846;hb=98d746e42e467166609de4c0f3f86993764371dd;hp=8c5b2e27120c773164b7a9d9ce73f19c00ca5809;hpb=5daa17742269ff96577ec513a0d9722c32c7f380;p=koha_gimpoz diff --git a/updateitem.pl b/updateitem.pl index 8c5b2e2712..c280b1356b 100755 --- a/updateitem.pl +++ b/updateitem.pl @@ -1,5 +1,6 @@ #!/usr/bin/perl +# $Id$ # Copyright 2000-2002 Katipo Communications # @@ -18,9 +19,9 @@ # Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place, # Suite 330, Boston, MA 02111-1307 USA -use C4::Database; -use CGI; use strict; +use CGI; +use C4::Context; use C4::Acquisitions; use C4::Biblio; use C4::Output; @@ -87,7 +88,7 @@ if ($wthdrawn == 0 && $override ne 'yes'){ wthdranw => $wthdrawn }); if ($lost ==1){ - my $dbh=C4Connect; + my $dbh = C4::Context->dbh; my $sth=$dbh->prepare("Select * from issues where (itemnumber='$itemnum') and (returndate is null)"); $sth->execute; my $data=$sth->fetchrow_hashref; @@ -111,11 +112,11 @@ if ($wthdrawn == 0 && $override ne 'yes'){ } print $input->redirect("moredetail.pl?type=intra&bib=$bibnum&bi=$bibitemnum"); } else { - + # print "marking cancelled"; #need to check if it is on reserve or issued - my $dbh=C4Connect; - my $flag=0; + my $dbh = C4::Context->dbh; + my $flag=0; my ($resbor,$resrec)=C4::Circulation::Circ2::checkreserve($env,$dbh,$itemnum); # print $resbor; if ($resbor){ @@ -123,7 +124,7 @@ if ($wthdrawn == 0 && $override ne 'yes'){ print "The biblio or biblioitem this item belongs to has a reserve on it"; $flag=1; } - my $sth=$dbh->prepare("Select * from issues where (itemnumber='$itemnum') and (returndate is null)"); + my $sth=$dbh->prepare("Select * from issues where (itemnumber='$itemnum') and (returndate is null)"); $sth->execute; my $data=$sth->fetchrow_hashref; if ($data->{'borrowernumber'} ne '') { @@ -132,7 +133,6 @@ if ($wthdrawn == 0 && $override ne 'yes'){ $flag=1; } $sth->finish; - $dbh->disconnect; if ($flag == 1){ my $url=$input->self_url; $url.="&override=yes"; @@ -161,4 +161,3 @@ sub checkinp{ } #sub checkissue{ -