#!/usr/bin/perl
-use C4::Database;
-use CGI;
+# $Id$
+
+# Copyright 2000-2002 Katipo Communications
+#
+# This file is part of Koha.
+#
+# Koha is free software; you can redistribute it and/or modify it under the
+# terms of the GNU General Public License as published by the Free Software
+# Foundation; either version 2 of the License, or (at your option) any later
+# version.
+#
+# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+# A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along with
+# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
+# Suite 330, Boston, MA 02111-1307 USA
+
use strict;
-use C4::Acquisitions;
+use CGI;
+use C4::Context;
use C4::Biblio;
use C4::Output;
use C4::Circulation::Circ2;
my $volumeddesc=checkinp($input->param('Volume'));
if ($wthdrawn == 0 && $override ne 'yes'){
- moditem('loan',$itemnum,$bibitemnum,$barcode,$notes,$homebranch,$lost,$wthdrawn);
+ moditem( { biblionumber => $bibnum,
+ loan =>'loan',
+ itemnum => $itemnum,
+ bibitemnum => $bibitemnum,
+ barcode => $barcode,
+ notes => $notes,
+ homebranch => $homebranch,
+ lost => $lost,
+ 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;
}
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){
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 '') {
$flag=1;
}
$sth->finish;
- $dbh->disconnect;
if ($flag == 1){
my $url=$input->self_url;
$url.="&override=yes";
print "<p> <a href=$url>Cancel Anyway</a> or <a href=\"\">Back</a>";
}else {
- moditem('loan',$itemnum,$bibitemnum,$barcode,$notes,$homebranch,$lost,$wthdrawn);
+ moditem({ biblionumber => $bibnum,
+ loan => 'loan',
+ itemnum => $itemnum,
+ bibitemnum => $bibitemnum,
+ barcode => $barcode,
+ notes => $notes,
+ homebranch => $homebranch,
+ lost => $lost,
+ wthdrawn => $wthdrawn
+ });
print $input->redirect("moredetail.pl?type=intra&bib=$bibnum&bi=$bibitemnum");
}
}
}
#sub checkissue{
-