From 1e85f93c52e2b1c800a8910d48df515f24211c70 Mon Sep 17 00:00:00 2001 From: Pedro Amorim Date: Fri, 11 Aug 2023 13:35:55 +0000 Subject: [PATCH] Bug 25393: UI adjustments This updates the information messages that are displayed in Staff, OPAC and SCO regarding renewals and if the item is up for automatic renewal or not. Add issues.auto_renew to svc/checkouts endpoint response Signed-off-by: Andrew Fuerste-Henry --- koha-tmpl/intranet-tmpl/prog/js/checkouts.js | 19 +++++-------------- .../bootstrap/en/modules/opac-user.tt | 11 +++-------- .../bootstrap/en/modules/sco/sco-main.tt | 7 ++++--- svc/checkouts | 2 ++ 4 files changed, 14 insertions(+), 25 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/js/checkouts.js b/koha-tmpl/intranet-tmpl/prog/js/checkouts.js index 9836a960d0b..95063d2fc7a 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/checkouts.js +++ b/koha-tmpl/intranet-tmpl/prog/js/checkouts.js @@ -522,13 +522,6 @@ $(document).ready(function() { + __("No renewal before %s").format(oObj.can_renew_date) + ""; - span_style = "display: none"; - span_class = "renewals-allowed"; - } else if ( oObj.can_renew_error == "auto_too_soon" ) { - msg += "" - + __("Scheduled for automatic renewal") - + ""; - span_style = "display: none"; span_class = "renewals-allowed"; } else if ( oObj.can_renew_error == "auto_too_late" ) { @@ -550,13 +543,6 @@ $(document).ready(function() { + __("Automatic renewal failed, account expired") + ""; - span_style = "display: none"; - span_class = "renewals-allowed"; - } else if ( oObj.can_renew_error == "auto_renew" ) { - msg += "" - + __("Scheduled for automatic renewal") - + ""; - span_style = "display: none"; span_class = "renewals-allowed"; } else if ( oObj.can_renew_error == "onsite_checkout" ) { @@ -604,6 +590,11 @@ $(document).ready(function() { } content += ")"; } + if(oObj.auto_renew){ + content += "("; + content += __("Scheduled for automatic renewal"); + content += ")"; + } return content; } 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 2a82506693a..0352f497dc3 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt @@ -500,17 +500,12 @@ / [% ISSUE.unseenleft | html %] of [% ISSUE.unseenallowed | html %] renewals left before the item must be seen by the library [% END %] ) - [% ELSIF ( ISSUE.auto_renew || ISSUE.auto_too_soon ) %] - Automatic renewal - ( - [% ISSUE.renewsleft | html %] of [% ISSUE.renewsallowed | html %] renewals remaining - [% IF Koha.Preference('UnseenRenewals') && ISSUE.unseenallowed %] - / [% ISSUE.unseenleft | html %] of [% ISSUE.unseenallowed | html %] renewals left before the item must be seen by the library - [% END %] - ) [% ELSIF ( ISSUE.item_denied_renewal ) %] Renewal not allowed [% END %] + [% IF ( ISSUE.auto_renew || ISSUE.auto_too_soon ) %] +
This item is scheduled for auto renewal. + [% END %] [% END %] [% IF ( OPACFinesTab ) %] 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 003c792402f..2852e316f87 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 @@ -356,9 +356,7 @@ [% END %] [% ELSE %] - [% IF ISSUE.renew_error == 'auto_renew' OR ISSUE.renew_error == 'auto_too_soon' %] - This item has been scheduled for automatic renewal and cannot be renewed - [% ELSIF ISSUE.renew_error == 'onsite_checkout' %] + [% IF ISSUE.renew_error == 'onsite_checkout' %] This is a on-site checkout, it cannot be renewed. [% ELSIF ISSUE.renew_error == 'too_unseen' %] You have renewed this item the maximum number of consecutive times without it being seen by the library. @@ -373,6 +371,9 @@ [% END %] [% END %] + [% IF ISSUE.auto_renew %] +
This item is scheduled for automatic renewal + [% END %] [% UNLESS ( nofines ) %] diff --git a/svc/checkouts b/svc/checkouts index 20b1a344609..e45582d85cf 100755 --- a/svc/checkouts +++ b/svc/checkouts @@ -72,6 +72,7 @@ my $sql = ' issues.date_due, issues.date_due < now() as date_due_overdue, issues.timestamp, + issues.auto_renew, issues.onsite_checkout, @@ -272,6 +273,7 @@ while ( my $c = $sth->fetchrow_hashref() ) { date_due => $c->{date_due}, date_due_overdue => $c->{date_due_overdue} ? JSON::true : JSON::false, timestamp => $c->{timestamp}, + auto_renew => $c->{auto_renew}, onsite_checkout => $c->{onsite_checkout}, enumchron => $c->{enumchron}, renewals_count => $renewals_count, -- 2.30.2