Bugzilla – Attachment 71136 Details for
Bug 15494
Block renewals by arbitrary item values
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 15494 - Update display of renewal errors
Bug-15494---Update-display-of-renewal-errors.patch (text/plain), 7.23 KB, created by
Marcel de Rooy
on 2018-02-02 09:05:35 UTC
(
hide
)
Description:
Bug 15494 - Update display of renewal errors
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2018-02-02 09:05:35 UTC
Size:
7.23 KB
patch
obsolete
>From 641ed97949a10b73f596ab81bd44c7735d2d4e1f Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Wed, 24 May 2017 09:31:59 -0400 >Subject: [PATCH] Bug 15494 - Update display of renewal errors >Content-Type: text/plain; charset=utf-8 > >To test: >1 - Define a rule to deny renewal >2 - Checkout an item meeting this rule >3 - Attempt renew an item via the OPAC >4 - Attempt renewal via SIP >5 - Attempt renewal via staff client >6 - Verify errors are reasonable > >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > C4/SIP/ILS/Transaction/Renew.pm | 1 + > koha-tmpl/intranet-tmpl/prog/en/includes/strings.inc | 1 + > koha-tmpl/intranet-tmpl/prog/en/modules/circ/renew.tt | 4 ++++ > koha-tmpl/intranet-tmpl/prog/js/checkouts.js | 7 +++++++ > koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt | 4 ++++ > misc/cronjobs/automatic_renewals.pl | 3 ++- > opac/opac-user.pl | 1 + > 7 files changed, 20 insertions(+), 1 deletion(-) > >diff --git a/C4/SIP/ILS/Transaction/Renew.pm b/C4/SIP/ILS/Transaction/Renew.pm >index 7e1e9b7..af96f93 100644 >--- a/C4/SIP/ILS/Transaction/Renew.pm >+++ b/C4/SIP/ILS/Transaction/Renew.pm >@@ -51,6 +51,7 @@ sub do_renew_for { > } else { > $renewerror=~s/on_reserve/Item unavailable due to outstanding holds/; > $renewerror=~s/too_many/Item has reached maximum renewals/; >+ $renewerror=~s/item_denied_renewal/Item renewal is not allowed/; > $self->screen_msg($renewerror); > $self->renewal_ok(0); > } >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/strings.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/strings.inc >index e116204..fa57579 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/strings.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/strings.inc >@@ -21,6 +21,7 @@ > var NOT_RENEWABLE_AUTO_TOO_MUCH_OWEING = _("Automatic renewal failed, patron has unpaid fines"); > var NOT_RENEWABLE_AUTO_ACCOUNT_EXPIRED = _("Automatic renewal failed, account expired"); > var NOT_RENEWABLE_AUTO_RENEW = _("Scheduled for automatic renewal"); >+ var NOT_RENEWABLE_DENIED = _("Renewal denied by syspref"); > var RENEWALS_REMAINING = _("%s of %s renewals remaining"); > var HOLD_IS_SUSPENDED = _("Hold is <strong>suspended</strong>"); > var UNTIL = _("until %s"); >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/renew.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/renew.tt >index d4397e0..f7ab658 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/renew.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/renew.tt >@@ -117,6 +117,10 @@ > > <p>[% borrower.firstname %] [% borrower.surname %] ( <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrower.borrowernumber %]"> [% borrower.cardnumber %] </a> ) is currently restricted.</p> > >+ [% ELSIF error == "item_denied_renewal" %] >+ >+ <p>Item is not allowed renewal.</p> >+ > [% ELSE %] > > [% error %] >diff --git a/koha-tmpl/intranet-tmpl/prog/js/checkouts.js b/koha-tmpl/intranet-tmpl/prog/js/checkouts.js >index 1d16823..7b0d387 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/checkouts.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/checkouts.js >@@ -399,6 +399,13 @@ $(document).ready(function() { > span_class = "renewals-allowed"; > } else if ( oObj.can_renew_error == "onsite_checkout" ) { > // Don't display something if it's an onsite checkout >+ } else if ( oObj.can_renew_error == "item_denied_renewal" ) { >+ content += "<span class='renewals-disabled'>" >+ + NOT_RENEWABLE_DENIED >+ + "</span>"; >+ >+ span_style = "display: none"; >+ span_class = "renewals-allowed"; > } else { > content += "<span class='renewals-disabled'>" > + oObj.can_renew_error >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 1c26a4f..46442d0 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt >@@ -92,6 +92,8 @@ Using this account is not recommended because some parts of Koha will not functi > <li>It is too soon after the checkout date for this item to be renewed.</li> > [% ELSIF error == 'on_reserve' %] > <li>This item is on hold for another borrower.</li> >+ [% ELSIF error == 'item_denied_renewal' %] >+ <li>Item renewal is not allowed.</li> > [% END %] > [% END %] > </ul> >@@ -306,6 +308,8 @@ Using this account is not recommended because some parts of Koha will not functi > [% ELSIF ( ISSUE.too_soon ) %] > No renewal before [% ISSUE.soonestrenewdate %] > <span class="renewals">([% ISSUE.renewsleft %] of [% ISSUE.renewsallowed %] renewals remaining)</span> >+ [% ELSIF ( ISSUE.item_denied_renewal ) %] >+ Renewal not allowed > [% END %] > </td> > [% END %] >diff --git a/misc/cronjobs/automatic_renewals.pl b/misc/cronjobs/automatic_renewals.pl >index 6a170ca..b50a6d5 100755 >--- a/misc/cronjobs/automatic_renewals.pl >+++ b/misc/cronjobs/automatic_renewals.pl >@@ -88,7 +88,8 @@ while ( my $auto_renew = $auto_renews->next ) { > or $error eq 'auto_account_expired' > or $error eq 'auto_too_late' > or $error eq 'auto_too_much_oweing' >- or $error eq 'auto_too_soon' ) { >+ or $error eq 'auto_too_soon' >+ or $error eq 'item_denied_renewal' ) { > if ( not $auto_renew->auto_renew_error or $error ne $auto_renew->auto_renew_error ) { > $auto_renew->auto_renew_error($error)->store; > push @{ $report{ $auto_renew->borrowernumber } }, $auto_renew >diff --git a/opac/opac-user.pl b/opac/opac-user.pl >index 55c04a3..d776d02 100755 >--- a/opac/opac-user.pl >+++ b/opac/opac-user.pl >@@ -224,6 +224,7 @@ if ($issues){ > $issue->{'auto_too_soon'} = 1 if $renewerror eq 'auto_too_soon'; > $issue->{'auto_too_late'} = 1 if $renewerror eq 'auto_too_late'; > $issue->{'auto_too_much_oweing'} = 1 if $renewerror eq 'auto_too_much_oweing'; >+ $issue->{'item_denied_renewal'} = 1 if $renewerror eq 'item_denied_renewal'; > > if ( $renewerror eq 'too_soon' ) { > $issue->{'too_soon'} = 1; >-- >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 15494
:
63700
|
63701
|
63702
|
63703
|
67886
|
67887
|
67888
|
67889
|
68146
|
68147
|
68148
|
68149
|
70295
|
70629
|
70630
|
70631
|
70632
|
71129
|
71130
|
71131
|
71132
|
71133
|
71134
|
71135
|
71136
|
71137
|
71138
|
79249
|
79250
|
79251
|
79252
|
79253
|
79254
|
79293
|
80327
|
80328
|
80329
|
80330
|
80331
|
80332
|
80333
|
81411
|
81412
|
81413
|
81414
|
81415
|
81416
|
81417