3 #written 18/1/2000 by chris@katipo.co.nz
4 # adapted for use in the hlt opac by finlay@katipo.co.nz 29/11/2002
5 #script to renew items from the web
16 my ( $template, $borrowernumber, $cookie ) = get_template_and_user
(
18 template_name
=> "opac-user.tmpl",
22 flagsrequired
=> { borrow
=> 1 },
26 my @items = $query->param('item');
27 $borrowernumber = $query->param('borrowernumber') || $query->param('bornum');
28 my $opacrenew = C4
::Context
->preference("OpacRenewalAllowed");
30 for my $itemnumber ( @items ) {
31 my ($status,$error) = CanBookBeRenewed
( $borrowernumber, $itemnumber );
32 if ( $status == 1 && $opacrenew == 1 ) {
33 AddRenewal
( $borrowernumber, $itemnumber );
36 # FIXME: else return ERROR to user!!
38 if ( $query->param('from') eq 'opac_user' ) {
39 print $query->redirect("/cgi-bin/koha/opac-user.pl");
41 # FIXME: ELSE WHAT? No response at all. Not very robust.