Koha/opac/opac-renew.pl
Chris Cormack ef6b767117 Changing CanBookBeRenewed to pass back the reason a renewal cannot proceed
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-01-08 16:13:20 -06:00

33 lines
853 B
Perl
Executable file

#!/usr/bin/perl
#written 18/1/2000 by chris@katipo.co.nz
# adapted for use in the hlt opac by finlay@katipo.co.nz 29/11/2002
#script to renew items from the web
use CGI;
use C4::Circulation;
use C4::Auth;
my $query = new CGI;
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
{
template_name => "opac-user.tmpl",
query => $query,
type => "opac",
authnotrequired => 0,
flagsrequired => { borrow => 1 },
debug => 1,
}
);
my $itemnumber = $query->param('item');
my $borrowernumber = $query->param("borrowernumber");
my ($status,$error) = CanBookBeRenewed( $borrowernumber, $itemnumber );
if ( $status == 1 ) {
AddRenewal( $borrowernumber, $itemnumber );
}
if ( $query->param('from') eq 'opac_user' ) {
print $query->redirect("/cgi-bin/koha/opac-user.pl");
}