From ae81b7c47345948f13c26508aaa07b53bd139ac0 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Mon, 14 Jul 2014 08:34:40 -0400 Subject: [PATCH] Bug 12568 - Improve visibility of successful renewal via opac Currently, when a patron renews an item via the opac, the only feedback the patron receives when a renewal is successful is an updated value for the due date of the item. This subtle indication of success may go unnoticed by some patrons. We should add a more prominent way to indicate an item was renewed successfully. Test Plan: 1) Apply this patch 2) From the OPAC, renew some items 3) Note the "Renewed!" message in the "Renew" column of the checkouts table Signed-off-by: Cathi Wiggins Signed-off-by: Katrin Fischer Passes tests and QA script. Makes successful renewals more visible to the user in the OPAC. Signed-off-by: Chris Cormack Signed-off-by: Tomas Cohen Arazi --- koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt | 1 + opac/opac-renew.pl | 11 ++++++++--- opac/opac-user.pl | 4 ++++ 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt index ec3de30c15..7b7f023971 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt @@ -222,6 +222,7 @@ [% IF ( OpacRenewalAllowed && !( borrower.is_expired && borrower.BlockExpiredPatronOpacActions ) ) %] + [% IF ISSUE.renewed %]Renewed![% END %] [% IF ( ISSUE.status ) %] [% IF ( canrenew ) %] Renew diff --git a/opac/opac-renew.pl b/opac/opac-renew.pl index 34b7527da6..7b59f4752b 100755 --- a/opac/opac-renew.pl +++ b/opac/opac-renew.pl @@ -43,11 +43,13 @@ my ( $template, $borrowernumber, $cookie ) = get_template_and_user( debug => 1, } ); -my @items = $query->param('item'); +my @items = $query->param('item'); my $opacrenew = C4::Context->preference("OpacRenewalAllowed"); -my $errorstring=''; +my $errorstring = q{}; +my $renewed = q{}; + my $member_details = GetMemberDetails($borrowernumber); if ( $member_details->{'BlockExpiredPatronOpacActions'} @@ -56,6 +58,7 @@ if ( $member_details->{'BlockExpiredPatronOpacActions'} $errorstring = 'card_expired'; } else { + my @renewed; for my $itemnumber (@items) { my ( $status, $error ) = CanBookBeRenewed( $borrowernumber, $itemnumber ); @@ -81,12 +84,14 @@ else { $branchcode = 'OPACRenew'; } AddRenewal( $borrowernumber, $itemnumber, $branchcode ); + push( @renewed, $itemnumber ); } else { $errorstring .= $error . "|"; } } + $renewed = join( '|', @renewed ); } -print $query->redirect("/cgi-bin/koha/opac-user.pl?renew_error=$errorstring"); +print $query->redirect("/cgi-bin/koha/opac-user.pl?renew_error=$errorstring&renewed=$renewed"); diff --git a/opac/opac-user.pl b/opac/opac-user.pl index 3284b3a339..fdf4054b36 100755 --- a/opac/opac-user.pl +++ b/opac/opac-user.pl @@ -64,6 +64,8 @@ my ( $template, $borrowernumber, $cookie ) = get_template_and_user( } ); +my %renewed = map { $_ => 1 } split( '|', $query->param('renewed') ); + my $show_priority; for ( C4::Context->preference("OPACShowHoldQueueDetails") ) { m/priority/ and $show_priority = 1; @@ -189,6 +191,8 @@ if ($issues){ $issue->{'status'} = $status; } + $issue->{'renewed'} = $renewed{ $issue->{'itemnumber'} }; + if ($renewerror) { $issue->{'too_many'} = 1 if $renewerror eq 'too_many'; $issue->{'on_reserve'} = 1 if $renewerror eq 'on_reserve'; -- 2.39.5