From 211399668a945487d618ca1513b1d464431531cd Mon Sep 17 00:00:00 2001 From: Chris Cormack Date: Thu, 20 Jan 2011 12:16:43 -0500 Subject: [PATCH] Bug 5618: Multiple renewals in the opac Enables logged-in OPAC patrons to renew multiple items at once using checkboxes. Errors are now handled better (for example, when item is on reserve) Sponsored by Los Gatos Public Library Squashed commit of the following: commit 020d9904ddb22af238c8a90c1f7447ead5a6d0e7 Author: Chris Cormack Date: Thu Jan 20 08:57:01 2011 +1300 Bug 5618: typo fix commit 147cfd91dbe88fd58c5d404db9bf06a21310e2ef Author: Chris Cormack Date: Thu Jan 20 08:47:39 2011 +1300 Bug 5618: Adding better error handling for reserves, and always redirecting instead of exploding commit 2dfb6c687d0d38c240e22d41f2aef6e3a9e53f02 Author: Chris Cormack Date: Fri Jan 14 15:39:20 2011 +1300 Bug 5618: Is mostly working now, needs some prettying up commit f8d260a4dcde144c9ed487521a79ee687ff8feb3 Author: Chris Cormack Date: Fri Jan 14 15:03:45 2011 +1300 bug 5618: Initial commit to set up checkboxes for choosing multiple items Signed-off-by: Ian Walls Signed-off-by: Chris Cormack --- .../opac-tmpl/prog/en/modules/opac-user.tmpl | 11 ++++++- opac/opac-renew.pl | 30 +++++++++++++++---- 2 files changed, 34 insertions(+), 7 deletions(-) diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tmpl b/koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tmpl index 001d947855..68013505c6 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tmpl +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tmpl @@ -192,6 +192,9 @@ $.tablesorter.addParser({
+
+ "> + @@ -246,7 +249,7 @@ $.tablesorter.addParser({ - @@ -258,7 +261,13 @@ $.tablesorter.addParser({
Items Checked Out
&borrowernumber=">Renew ( of renewals remaining) + "/>&borrowernumber=">Renew ( of renewals remaining) Not renewable ( of renewals remaining) (On hold)
+ + + +
+ +
" /> diff --git a/opac/opac-renew.pl b/opac/opac-renew.pl index 205f48a227..a84be259ed 100755 --- a/opac/opac-renew.pl +++ b/opac/opac-renew.pl @@ -2,7 +2,24 @@ #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 +# script to renew items from the web +# Parts Copyright 2010 Catalyst IT + +# 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 warnings; @@ -27,15 +44,16 @@ my @items = $query->param('item'); $borrowernumber = $query->param('borrowernumber') || $query->param('bornum'); my $opacrenew = C4::Context->preference("OpacRenewalAllowed"); +my $errorstring=''; for my $itemnumber ( @items ) { my ($status,$error) = CanBookBeRenewed( $borrowernumber, $itemnumber ); if ( $status == 1 && $opacrenew == 1 ) { AddRenewal( $borrowernumber, $itemnumber ); } + else { + $errorstring .= $error ."|"; + } } -# FIXME: else return ERROR to user!! -if ( $query->param('from') eq 'opac_user' ) { - print $query->redirect("/cgi-bin/koha/opac-user.pl"); -} -# FIXME: ELSE WHAT? No response at all. Not very robust. +print $query->redirect("/cgi-bin/koha/opac-user.pl?renew_error=$errorstring"); + -- 2.39.5