Bugzilla – Attachment 56678 Details for
Bug 16873
Renewal error message not specific enough on self check.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[SIGNED-OFF] Bug 16873: Improve renewal error messages on self check
SIGNED-OFF-Bug-16873-Improve-renewal-error-message.patch (text/plain), 6.05 KB, created by
Josef Moravec
on 2016-10-19 21:09:46 UTC
(
hide
)
Description:
[SIGNED-OFF] Bug 16873: Improve renewal error messages on self check
Filename:
MIME Type:
Creator:
Josef Moravec
Created:
2016-10-19 21:09:46 UTC
Size:
6.05 KB
patch
obsolete
>From 00c8b878a8899939ccbd092631ad284b8a42aa7a Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Fri, 19 Aug 2016 12:01:32 +0100 >Subject: [PATCH] [SIGNED-OFF] Bug 16873: Improve renewal error messages on > self check > >When a patron is not allowed to renew from the self check module, the >only message displayed is "No renewals allowed". >It would be nicer to let him/her know that the renewal is not allowed >because it's a on-site checkout or automatic renewal. > >To do so we can call CanBookBeRenewed instead of CanBookBeIssued and get >the renewal error. > >Test plan: >0/ Switch off AllowSelfCheckReturns >1/ check out an item and tick "auto renewal" >2/ Go on the self check module >=> auto renewal message is displayed >3/ check out an item and tick "on-site checkout" >4/ Go on the self check module >=> on-site checkout message is displayed >5/ check out an item without ticking any checkboxes (regular checkout) >Renew it to reach the max renew allowed >6/ Go on the self check module >=> regular checkout message is displayed >7/ Switch on AllowSelfCheckReturns and repeat previous steps >=> "Return this item" button is displayed in addition of the renewal >error message > >Signed-off-by: Josef Moravec <josef.moravec@gmail.com> >--- > .../opac-tmpl/bootstrap/en/modules/sco/sco-main.tt | 23 +++++++++++++--------- > opac/sco/sco-main.pl | 12 +++++------ > 2 files changed, 19 insertions(+), 16 deletions(-) > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/sco/sco-main.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/sco/sco-main.tt >index 3e5d7f4..d97c5f1 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/sco/sco-main.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/sco/sco-main.tt >@@ -250,15 +250,7 @@ > <form action="/cgi-bin/koha/sco/sco-main.pl" method="post"> > <input type="hidden" name="patronid" value="[% patronid %]" /> > <input type="hidden" name="barcode" value="[% ISSUE.barcode %]" /> >- [% IF ( ISSUE.norenew ) %] >- [% IF ( AllowSelfCheckReturns ) %] >- <input type="submit" value="Check in item" name="confirm" class="btn return" /> >- <input type="hidden" name="op" value="returnbook" /> >- <input type="hidden" name="confirmed" value="" /> >- [% ELSE %] >- <span>No renewals allowed</span> >- [% END %] >- [% ELSE %] >+ [% IF ISSUE.can_be_renewed %] > <input type="hidden" name="op" value="checkout" /> > <input type="hidden" name="confirmed" value="1" /> > [% UNLESS ( ISSUE.renew ) %] >@@ -266,6 +258,19 @@ > [% ELSE %] > <input type="submit" value="Renew item" class="btn renew" /> > [% END %] >+ [% ELSE %] >+ [% IF ISSUE.renew_error == 'auto_renew' OR ISSUE.renew_error == 'auto_too_soon' %] >+ <span>This item has been scheduled for automatic renewal and cannot be renewed</span> >+ [% ELSIF ISSUE.renew_error == 'onsite_checkout' %] >+ <span>This is a on-site checkout, it cannot be renewed.</span> >+ [% ELSE %] >+ <span>No renewals allowed</span> >+ [% END %] >+ [% IF AllowSelfCheckReturns %] >+ <input type="submit" value="Check in item" name="confirm" class="btn return" /> >+ <input type="hidden" name="op" value="returnbook" /> >+ <input type="hidden" name="confirmed" value="" /> >+ [% END %] > [% END %] > </form> > </td> >diff --git a/opac/sco/sco-main.pl b/opac/sco/sco-main.pl >index 0a59d3b..f0b91f4 100755 >--- a/opac/sco/sco-main.pl >+++ b/opac/sco/sco-main.pl >@@ -227,14 +227,12 @@ if ($borrower->{cardnumber}) { > my @issues; > my ($issueslist) = GetPendingIssues( $borrower->{'borrowernumber'} ); > foreach my $it (@$issueslist) { >- my ($renewokay, $renewerror) = CanBookBeIssued( >- $borrower, >- $it->{'barcode'}, >- undef, >- 0, >- C4::Context->preference("AllowItemsOnHoldCheckout") >+ my ($can_be_renewed, $renew_error) = CanBookBeRenewed( >+ $borrower->{borrowernumber}, >+ $it->{itemnumber}, > ); >- $it->{'norenew'} = 1 if $renewokay->{'NO_MORE_RENEWALS'}; >+ $it->{can_be_renewed} = $can_be_renewed; >+ $it->{renew_error} = $renew_error; > $it->{date_due} = $it->{date_due_sql}; > push @issues, $it; > } >-- >2.1.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 16873
:
54626
|
55503
|
56678
|
57238
|
57670