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 <andrewfh@dubcolib.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Pedro Amorim 2023-08-11 13:35:55 +00:00 committed by Tomas Cohen Arazi
parent 0e0929c169
commit 9fabc2f0b8
Signed by: tomascohen
GPG key ID: 0A272EA1B2F3C15F
4 changed files with 14 additions and 25 deletions

View file

@ -528,13 +528,6 @@ $(document).ready(function() {
+ __("No renewal before %s").format(oObj.can_renew_date)
+ "</span>";
span_style = "display: none";
span_class = "renewals-allowed";
} else if ( oObj.can_renew_error == "auto_too_soon" ) {
msg += "<span class='renewals-disabled'>"
+ __("Scheduled for automatic renewal")
+ "</span>";
span_style = "display: none";
span_class = "renewals-allowed";
} else if ( oObj.can_renew_error == "auto_too_late" ) {
@ -556,13 +549,6 @@ $(document).ready(function() {
+ __("Automatic renewal failed, account expired")
+ "</span>";
span_style = "display: none";
span_class = "renewals-allowed";
} else if ( oObj.can_renew_error == "auto_renew" ) {
msg += "<span class='renewals-disabled'>"
+ __("Scheduled for automatic renewal")
+ "</span>";
span_style = "display: none";
span_class = "renewals-allowed";
} else if ( oObj.can_renew_error == "onsite_checkout" ) {
@ -610,6 +596,11 @@ $(document).ready(function() {
}
content += ")</span>";
}
if(oObj.auto_renew){
content += "<span class='renewals-info'>(";
content += __("Scheduled for automatic renewal");
content += ")</span>";
}
return content;
}

View file

@ -495,17 +495,12 @@
/ [% ISSUE.unseenleft | html %] of [% ISSUE.unseenallowed | html %] renewals left before the item must be seen by the library
[% END %]
)</span>
[% ELSIF ( ISSUE.auto_renew || ISSUE.auto_too_soon ) %]
<span class="usr-msg automatic-renewal">Automatic renewal</span>
<span class="renewals">(
[% 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 %]
)</span>
[% ELSIF ( ISSUE.item_denied_renewal ) %]
Renewal not allowed
[% END %]
[% IF ( ISSUE.auto_renew || ISSUE.auto_too_soon ) %]
<br><span class="usr-msg automatic-renewal">This item is scheduled for auto renewal.</span>
[% END %]
</td>
[% END %]
[% IF ( OPACFinesTab ) %]

View file

@ -363,9 +363,7 @@
<input type="submit" value="Renew item" class="btn btn-primary btn-sm 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' %]
[% IF ISSUE.renew_error == 'onsite_checkout' %]
<span>This is a on-site checkout, it cannot be renewed.</span>
[% ELSIF ISSUE.renew_error == 'too_unseen' %]
<span>You have renewed this item the maximum number of consecutive times without it being seen by the library.</span>
@ -380,6 +378,9 @@
<input type="hidden" name="confirmed" value="" />
[% END %]
[% END %]
[% IF ISSUE.auto_renew %]
<br><span>This item is scheduled for automatic renewal</span>
[% END %]
</form>
</td>
[% UNLESS ( nofines ) %]

View file

@ -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,