fix for bug 1101: Renew All for the OPAC

This adds a Renew All form to the OPAC, and updates opac-renew.pl to take multiple item= parameters.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
This commit is contained in:
Jesse Weaver 2008-08-21 11:52:11 -05:00 committed by Galen Charlton
parent 225e115a85
commit a4ee974e04
2 changed files with 16 additions and 14 deletions

View file

@ -209,7 +209,7 @@ $.tablesorter.addParser({
</tr>
<!-- /TMPL_LOOP --></tbody>
</table>
<!-- FIXME: See bug 1101 <!--TMPL_IF Name="OpacRenewalAllowed"-->
<!-- TMPL_IF name="OpacRenewalAllowed" -->
<form action="/cgi-bin/koha/opac-renew.pl" method="post">
<input type="hidden" name="from" value="opac_user" />
<input type="hidden" name="borrowernumber" value="<!-- TMPL_VAR NAME="borrowernumber" -->" />
@ -218,7 +218,7 @@ $.tablesorter.addParser({
<!-- /TMPL_LOOP -->
<input type="submit" value="Renew All" />
</form>
<!--/TMPL_IF--> -->
<!-- /TMPL_IF -->
<!-- TMPL_ELSE -->
<table>
<tr><td>You have nothing checked out</td></tr>

View file

@ -20,13 +20,15 @@ my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
debug => 1,
}
);
my $itemnumber = $query->param('item');
my @items = $query->param('item');
my $borrowernumber = $query->param('borrowernumber') || $query->param('bornum');
for my $itemnumber ( @items ) {
my ($status,$error) = CanBookBeRenewed( $borrowernumber, $itemnumber );
if ( $status == 1 ) {
AddRenewal( $borrowernumber, $itemnumber );
}
}
# FIXME: else return ERROR to user!!
if ( $query->param('from') eq 'opac_user' ) {