diff --git a/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss b/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss index 923eb61c9c..2d1d36ebf9 100644 --- a/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss +++ b/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss @@ -4385,6 +4385,48 @@ div .suggestion_note { } } +.nav.nav-tabs > li > a { + align-items: center; + display: flex; + gap: 5px; + + span[class*="badge"] { + color: #000; + font-size: 85%; + font-weight: bold; + + &.text-bg-info { + background-color: #9BD6E8; + } + + &.text-bg-danger { + background-color: #FF7873; + } + + &:has( span:empty + span:empty ), /* If the element contains two empty spans */ + &:has( span:only-child:empty ) { /* If the element contains only one span and it is empty */ + background-color: transparent; + padding: 0; + } + + &:has( span + span:empty ) { /* If the element has a non-empty span followed by an empty one, reset style */ + background-color: #9BD6E8; + } + } +} + +.count-active { /* Add separator between two counts in a tab */ + & + .count-inactive { + &:empty::before { + content: ""; + } + + &::before { + content: " / "; + } + } +} + .ac-library { background-color: #EEE !important; font-weight: normal; diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-detail-tabs.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/patron-detail-tabs.inc index f272fd4e70..e60a579132 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-detail-tabs.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/patron-detail-tabs.inc @@ -5,71 +5,91 @@ [% WRAPPER tabs id= "finesholdsissues" %] [% WRAPPER tabs_nav %] [% WRAPPER tab_item tabname= "checkouts" bt_active= 1 %] - Checkouts ([% issuecount || 0 | html %]) + Checkouts + [% IF ( issuecount ) %] + [% issuecount || 0 | html %] + [% END %] [% END %] [% IF relatives_issues_count %] [% WRAPPER tab_item tabname= "relatives-issues" %] - Relatives' checkouts ([% relatives_issues_count | html %]) + Relatives' checkouts + [% IF ( relatives_issues_count ) %] + [% relatives_issues_count | html %] + [% END %] [% END %] [% END %] [% IF ( guarantees_fines ) %] [% WRAPPER tab_item tabname= "guarantees_finesandcharges" %] - Guarantees' charges ([% guarantees_fines | $Price %]) + Guarantees' charges + [% IF ( guarantees_fines ) %] + [% guarantees_fines | $Price %] + [% END %] [% END %] [% END %] [% IF ( CAN_user_circulate_circulate_remaining_permissions ) %] [% WRAPPER tab_item tabname= "holds" %] - Holds ([% holds_count || 0 | html %]) + Holds + [% IF ( holds_count ) %] + [% holds_count | html %] + [% END %] [% END %] [% IF Koha.Preference('EnableBooking') %] [% WRAPPER tab_item tabname="bookings" %] [% SET bookings_count = patron.bookings.filter_by_active.count %] [% SET expired_bookings_count = patron.bookings.count - bookings_count %] - Bookings ([% bookings_count || 0 | html %]) + Bookings + [% IF ( bookings_count ) %] + [% bookings_count || 0 | html %] + [% END %] [% END %] [% END %] [% END %] [% IF Koha.Preference('UseRecalls') %] [% WRAPPER tab_item tabname= "recalls" %] - Recalls ([% recalls.count || 0 | html %]) + Recalls + [% IF ( recalls.count ) %] + [% recalls.count | html %] + [% END %] [% END %] [% END %] [% IF Koha.Preference('ArticleRequests') %] [% SET article_requests = patron.article_requests.filter_by_current %] [% WRAPPER tab_item tabname= "article-requests" %] - Article requests ([% article_requests.count || 0 | html %]) + Article requests + [% IF ( article_requests.count ) %] + [% article_requests.count | html %] + [% END %] [% END %] [% END %] [% IF Koha.Preference('ClaimReturnedLostValue') || Koha.Preference('BundleLostValue') %] [% WRAPPER tab_item tabname= "return-claims" %] Claims - [% IF ( patron.return_claims.count ) %] - ([% IF patron.return_claims.resolved.count == 0 %] - [% patron.return_claims.resolved.count | html %] - [% ELSE %] - [% patron.return_claims.resolved.count | html %] - [% END %] - [% IF patron.return_claims.unresolved.count == 0 %] - [% patron.return_claims.unresolved.count | html %] - [% ELSE %] - [% patron.return_claims.unresolved.count | html %] - [% END %]) + [% SET warning_threshold = Koha.Preference('ClaimReturnedWarningThreshold') %] + [% IF warning_threshold != '' && ( patron.return_claims.count > warning_threshold ) %] + + [% patron.return_claims.unresolved.count | html %] + [% patron.return_claims.resolved.count | html %] + [% ELSE %] - [% no_claims = 0 %] - ([% no_claims | html %] - [% no_claims | html %]) - [% END # /IF patron.return_claims.count %] + + [% patron.return_claims.unresolved.count || "" | html %] + [% patron.return_claims.resolved.count || "" | html %] + + [% END %] [% END # /WRAPPER tab_item return-claims %] [% END %] [% WRAPPER tab_item tabname= "reldebarments" %] - Restrictions ([% patron.restrictions.count || 0 | html %]) + Restrictions + [% IF ( patron.restrictions.count ) %] + [% patron.restrictions.count | html %] + [% END %] [% END %] [% SET enrollments = patron.get_club_enrollments %] @@ -77,13 +97,19 @@ [% IF CAN_user_clubs && ( enrollable.count || enrollments.count ) %] [% WRAPPER tab_item tabname= "clubs" %] - Clubs ([% enrollments.count | html %]/[% enrollable.count | html %]) + Clubs + + [% enrollments.count || "" | html %] + [% END %] [% END %] [% IF CAN_user_tools_manage_patron_lists || patron_lists_count %] [% WRAPPER tab_item tabname="pat_lists" %] - Patron lists ([% patron_lists_count | html %]) + Patron lists + + [%~ patron_lists_count || "" | html ~%] + [% END %] [% END %] [% END # /WRAPPER tabs_nav %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/recalls.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/recalls.inc index cdc0cffa11..8915ab1f35 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/recalls.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/recalls.inc @@ -94,27 +94,25 @@
diff --git a/koha-tmpl/intranet-tmpl/prog/js/checkouts.js b/koha-tmpl/intranet-tmpl/prog/js/checkouts.js index 8f73b328d8..f06c01b00b 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/checkouts.js +++ b/koha-tmpl/intranet-tmpl/prog/js/checkouts.js @@ -1567,22 +1567,6 @@ $(document).ready(function () { url: "/cgi-bin/koha/svc/return_claims?borrowernumber=%s".format( borrowernumber ), - complete: function (json) { - let resolved = json.resolved; - let unresolved = json.unresolved; - - if (unresolved > 0) { - $("#return-claims-count-unresolved") - .text(unresolved) - .removeClass("text-bg-info") - .addClass("text-bg-warning"); - } else { - $("#return-claims-count-unresolved") - .text(unresolved) - .removeClass("text-bg-warning") - .addClass("text-bg-info"); - } - }, }, bKohaAjaxSVC: true, search: { search: "is_unresolved" },