From 0aa5820916fc4795c623b777fc9b640ae56d07ab Mon Sep 17 00:00:00 2001 From: Emily Lamancusa Date: Thu, 24 Jul 2025 10:30:14 -0400 Subject: [PATCH] Bug 40492: Improvements to offline circ actions table Update the pending offline circulation actions page to link each item barcode directly to the item details, rather than the biblio record, and open the links in a new tab. Add a column to show the last seen date of the items being processed, with a warning if the item's last seen date is more recent than the offline circulation action date. To test: 1. Upload a Koha Offline Circulation (koc) file (the file attached to this bug can be used if you are using a sandbox or KTD with the standard sample data) i. Go to Circulation > Upload offline circulation file ii. Upload the file iii. Click "Add to offline circulation queue" 2. Go to Circulation > Pending offline circulation actions 3. Click on the item barcodes in the table --> Note that each barcode links to the biblio record, and navigates away from the page within the same tab. 4. Apply patch and restart_all 5. Return to (or refresh) the pending offline circulation actions page and click on the item barcodes again --> The barcodes now open the item details page in a new tab --> There is a new column for the item last seen date 6. Without processing the offline circulation actions, check in one of the items listed in the table 7. Return to the Pending offline circulation actions page --> Confirm that the last seen date of the item you just checked in is highlighted in red with a warning icon, since its last seen date is newer than the offline transaction date 8. Hover over the warning icon --> Confirm that a tooltip appears with an explanation of why the date is in red Signed-off-by: David Nind Signed-off-by: Lucas Gass Signed-off-by: Pedro Amorim --- .../prog/en/modules/offline_circ/list.tt | 27 +++++++++++++++++-- offline_circ/list.pl | 8 ++++++ 2 files changed, 33 insertions(+), 2 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/offline_circ/list.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/offline_circ/list.tt index 3340f272c5..27d630e47c 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/offline_circ/list.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/offline_circ/list.tt @@ -46,6 +46,7 @@   Date + Item last seen date Action Barcode Card number or username @@ -59,6 +60,23 @@ + + [% UNLESS operation.outdated %] + [% operation.datelastseen | $KohaDates with_hours=1 %] + [% ELSE %] + + [% operation.datelastseen | $KohaDates with_hours=1 %] + [% END %] + [% SWITCH ( operation.action ) -%] [% CASE "issue" -%] @@ -72,8 +90,13 @@ [% END -%] - [% IF ( operation.biblionumber ) %] - [% operation.barcode | html %] + [% IF ( operation.itemnumber ) %] + [% operation.barcode | html %] [% ELSE %] [% operation.barcode | html %] [% END %] diff --git a/offline_circ/list.pl b/offline_circ/list.pl index 76e70d981d..478733ba66 100755 --- a/offline_circ/list.pl +++ b/offline_circ/list.pl @@ -27,6 +27,8 @@ use C4::Context; use C4::Circulation qw( GetOfflineOperations GetOfflineOperation ); use C4::Members; use Koha::Patrons; +use Koha::DateUtils qw( dt_from_string ); +use DateTime; use Koha::Items; @@ -49,6 +51,12 @@ for (@$operations) { my $biblio = $item->biblio; $_->{'bibliotitle'} = $biblio->title; $_->{'biblionumber'} = $biblio->biblionumber; + $_->{'itemnumber'} = $item->itemnumber; + $_->{'datelastseen'} = $item->datelastseen; + $_->{'outdated'} = + DateTime->compare( dt_from_string( $item->datelastseen ), dt_from_string( $_->{'timestamp'} ) ) == 1 + ? 1 + : 0; } my $patron =