Bug 39046 - Use Bootstrap badge to indicate late transfers
Summary: Use Bootstrap badge to indicate late transfers
Status: Passed QA
Alias: None
Product: Koha
Classification: Unclassified
Component: Templates (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Owen Leonard
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-02-05 19:50 UTC by Owen Leonard
Modified: 2025-04-11 14:22 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Screenshot showing the proposed updated page (75.42 KB, image/png)
2025-02-05 19:50 UTC, Owen Leonard
Details
Bug 39046: Use Bootstrap badge to indicate late transfers (2.81 KB, patch)
2025-02-06 15:49 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 39046: Use Bootstrap badge to indicate late transfers (3.30 KB, patch)
2025-02-12 17:02 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 39046: Use Bootstrap badge to indicate late transfers (3.45 KB, patch)
2025-02-21 11:33 UTC, Biblibre Sandboxes
Details | Diff | Splinter Review
Bug 39046: Use Bootstrap badge to indicate late transfers (3.51 KB, patch)
2025-04-11 14:21 UTC, Baptiste Wojtkowski (bwoj)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Owen Leonard 2025-02-05 19:50:18 UTC
Created attachment 177552 [details]
Screenshot showing the proposed updated page

On the transfers to receive page we color the whole row red if the transfer is late. I think it would be more user-friendly to style the date-late information with a Bootstrap badge instead.
Comment 1 Owen Leonard 2025-02-06 15:49:54 UTC
Created attachment 177585 [details] [review]
Bug 39046: Use Bootstrap badge to indicate late transfers

This patch removes the error class from the table of late transfers.
Instead, the days late status is shown as a Bootstrap badge. The patch
also adds pluralization to the string so that it adapts based on the
number of late transfers.

To test you would ideally have multiple pending transfers to your
library, some late and some not. This will presumably require manually
updated your database to change the date of pending transfers.

- Make at least one transfer multiple days late by changing the
   `datesent` value to a date late enough to exceed the number of days
   defined in the TransfersMaxDaysWarning system preference.
- Make at least one transfer only one day late.
- When you go to Circulation -> Transfers to receive you should see
  badge-style labels on the transfers which are late.
  - The text of the labels should be correct according to the number: "1
    day late" or "XX days late"

Sponsored-by: Athens County Public Libraries
Comment 2 Owen Leonard 2025-02-12 17:02:59 UTC
Created attachment 177949 [details] [review]
Bug 39046: Use Bootstrap badge to indicate late transfers

This patch removes the error class from the table of late transfers.
Instead, the days late status is shown as a Bootstrap badge. The patch
also adds pluralization to the string so that it adapts based on the
number of late transfers.

To test you would ideally have multiple pending transfers to your
library, some late and some not. This will presumably require manually
updated your database to change the date of pending transfers.

- Make at least one transfer multiple days late by changing the
   `datesent` value to a date late enough to exceed the number of days
   defined in the TransfersMaxDaysWarning system preference.
- Make at least one transfer only one day late.
- When you go to Circulation -> Transfers to receive you should see
  badge-style labels on the transfers which are late.
  - The text of the labels should be correct according to the number: "1
    day late" or "XX days late"

Sponsored-by: Athens County Public Libraries
Comment 3 Victor Grousset/tuxayo 2025-02-17 04:44:17 UTC
Is it directly related to bug 38664? (or it's dependencies that did cleanup)

Or is the "Depends on 38664" just because it's a patch that can only directly be applied on top of 38664? (as likely most new patches)
Comment 4 Owen Leonard 2025-02-18 12:03:05 UTC
(In reply to Victor Grousset/tuxayo from comment #3)

> Or is the "Depends on 38664" just because it's a patch that can only
> directly be applied on top of 38664?

I was working on this patch before 38664 was pushed, so the dependency was necessary at the time. Now it's not relevant.
Comment 5 Biblibre Sandboxes 2025-02-21 11:33:11 UTC
Created attachment 178479 [details] [review]
Bug 39046: Use Bootstrap badge to indicate late transfers

This patch removes the error class from the table of late transfers.
Instead, the days late status is shown as a Bootstrap badge. The patch
also adds pluralization to the string so that it adapts based on the
number of late transfers.

To test you would ideally have multiple pending transfers to your
library, some late and some not. This will presumably require manually
updated your database to change the date of pending transfers.

- Make at least one transfer multiple days late by changing the
   `datesent` value to a date late enough to exceed the number of days
   defined in the TransfersMaxDaysWarning system preference.
- Make at least one transfer only one day late.
- When you go to Circulation -> Transfers to receive you should see
  badge-style labels on the transfers which are late.
  - The text of the labels should be correct according to the number: "1
    day late" or "XX days late"

Sponsored-by: Athens County Public Libraries
Signed-off-by: Anneli Österman <anneli.osterman@koha-suomi.fi>
Comment 6 Anneli Österman 2025-02-21 11:40:25 UTC
A small notice: Above the table of transfers is the info text that says "Transfers are considered late after x days.". In this sentence the words "considered late" are red which implies that something is colored red underneath, which no longer applies after this change. I think this is not a show stopper but could be fixed sometimes.
Comment 7 Baptiste Wojtkowski (bwoj) 2025-04-11 14:21:03 UTC
Created attachment 180849 [details] [review]
Bug 39046: Use Bootstrap badge to indicate late transfers

This patch removes the error class from the table of late transfers.
Instead, the days late status is shown as a Bootstrap badge. The patch
also adds pluralization to the string so that it adapts based on the
number of late transfers.

To test you would ideally have multiple pending transfers to your
library, some late and some not. This will presumably require manually
updated your database to change the date of pending transfers.

- Make at least one transfer multiple days late by changing the
   `datesent` value to a date late enough to exceed the number of days
   defined in the TransfersMaxDaysWarning system preference.
- Make at least one transfer only one day late.
- When you go to Circulation -> Transfers to receive you should see
  badge-style labels on the transfers which are late.
  - The text of the labels should be correct according to the number: "1
    day late" or "XX days late"

Sponsored-by: Athens County Public Libraries
Signed-off-by: Anneli Österman <anneli.osterman@koha-suomi.fi>
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
Comment 8 Baptiste Wojtkowski (bwoj) 2025-04-11 14:22:44 UTC
I love these QoL patches :)
Passes QA, very small and clean