Bugzilla – Attachment 192171 Details for
Bug 41518
"Scheduled for automatic renewal" displays even if patron does not allow automatic renewals
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 41518: Only show autorenewal text if autorenewal allowed
1d86baa.patch (text/plain), 4.20 KB, created by
David Nind
on 2026-01-29 17:23:26 UTC
(
hide
)
Description:
Bug 41518: Only show autorenewal text if autorenewal allowed
Filename:
MIME Type:
Creator:
David Nind
Created:
2026-01-29 17:23:26 UTC
Size:
4.20 KB
patch
obsolete
>From 1d86baa4f40a9a6a1d03accfce0b52d4a914a523 Mon Sep 17 00:00:00 2001 >From: David Cook <dcook@prosentient.com.au> >Date: Mon, 5 Jan 2026 04:10:15 +0000 >Subject: [PATCH] Bug 41518: Only show autorenewal text if autorenewal allowed > >This change makes the "Scheduled for automatic renewal" text appear >in the staff interface and OPAC only if both the issue has auto_renew >and the borrower has autorenew_checkouts set. These are the criteria that >automatic_renewals.pl uses for processing automatic renewals. > >Test plan: >0. Apply the patch >1. koha-plack --restart kohadev >2. Checkout an item as an automatic renewal >(ie either set it as Automatic renewal using the checkout option or have > the circ and fines rules set to use Automatic renewals) >3. View the checkout in both the staff interface and the OPAC >4. Note that they both show "Scheduled for automatic renewal" or >"This item is scheduled for auto renewal" for the OPAC >5. In the patron record change "Allow auto-renewal of items" from >"Yes" to "No" >6. Note that the text talking about the item being scheduled >for automatic renewal no longer displays > >Bonus points: >1. Run 'perl ./misc/cronjobs/automatic_renewals.pl -v' >2. Note that the automatic renewal doesn't show when "Allow auto-renewal >of items" is set to "No" but it does show when it's set to "Yes" > >Signed-off-by: David Nind <david@davidnind.com> >--- > koha-tmpl/intranet-tmpl/prog/js/checkouts.js | 2 +- > koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt | 2 +- > svc/checkouts | 2 ++ > 3 files changed, 4 insertions(+), 2 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/js/checkouts.js b/koha-tmpl/intranet-tmpl/prog/js/checkouts.js >index ecf8409c02..9d4676a39c 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/checkouts.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/checkouts.js >@@ -575,7 +575,7 @@ function LoadIssuesTable() { > } > content += ")</span>"; > } >- if (oObj.auto_renew) { >+ if (oObj.auto_renew && oObj.auto_renew_patron) { > content += "<span class='renewals-info'>("; > content += __("Scheduled for automatic renewal"); > content += ")</span>"; >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 5c8edacfe2..9402ec6698 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt >@@ -481,7 +481,7 @@ > [% ELSIF ( ISSUE.item_denied_renewal ) %] > Renewal not allowed > [% END %] >- [% IF ( ISSUE.auto_renew || ISSUE.auto_too_soon ) %] >+ [% IF ( ( ISSUE.auto_renew || ISSUE.auto_too_soon ) && borrower.autorenew_checkouts ) %] > <br /><span class="usr-msg automatic-renewal">This item is scheduled for auto renewal.</span> > [% END %] > </td> >diff --git a/svc/checkouts b/svc/checkouts >index 9b45a03fbf..3d568e357d 100755 >--- a/svc/checkouts >+++ b/svc/checkouts >@@ -107,6 +107,7 @@ my $sql = ' > borrowers.surname, > borrowers.firstname, > borrowers.cardnumber, >+ borrowers.autorenew_checkouts, > > items.itemlost, > items.damaged, >@@ -277,6 +278,7 @@ while ( my $c = $sth->fetchrow_hashref() ) { > date_due_today => $c->{date_due_today} ? JSON::true : JSON::false, > timestamp => $c->{timestamp}, > auto_renew => $c->{auto_renew}, >+ auto_renew_patron => $c->{autorenew_checkouts}, > onsite_checkout => $c->{onsite_checkout}, > enumchron => $c->{enumchron}, > renewals_count => $renewals_count, >-- >2.39.5 >
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 41518
:
190883
| 192171