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 <david@davidnind.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
This commit is contained in:
Emily Lamancusa 2025-07-24 10:30:14 -04:00 committed by Pedro Amorim
parent 7cda9f0648
commit 0aa5820916
No known key found for this signature in database
GPG Key ID: 06B75BA7F3894D55
2 changed files with 33 additions and 2 deletions

View File

@ -46,6 +46,7 @@
<tr> <tr>
<th>&nbsp;</th> <th>&nbsp;</th>
<th>Date</th> <th>Date</th>
<th>Item last seen date</th>
<th>Action</th> <th>Action</th>
<th>Barcode</th> <th>Barcode</th>
<th>Card number or username</th> <th>Card number or username</th>
@ -59,6 +60,23 @@
<td> <td>
<label for="operationid[% operation.operationid | html %]">[% operation.timestamp | $KohaDates with_hours=1 %]</label> <label for="operationid[% operation.operationid | html %]">[% operation.timestamp | $KohaDates with_hours=1 %]</label>
</td> </td>
<td>
[% UNLESS operation.outdated %]
[% operation.datelastseen | $KohaDates with_hours=1 %]
[% ELSE %]
<span class="error"
><i
data-bs-toggle="tooltip"
title="This item has been updated since the offline circulation action was taken. Use caution when processing this action."
data-bs-placement="right"
class="fa fa-exclamation-triangle"
style="color:gold"
tabindex="0"
></i>
[% operation.datelastseen | $KohaDates with_hours=1 %]</span
>
[% END %]
</td>
<td> <td>
[% SWITCH ( operation.action ) -%] [% SWITCH ( operation.action ) -%]
[% CASE "issue" -%] [% CASE "issue" -%]
@ -72,8 +90,13 @@
[% END -%] [% END -%]
</td> </td>
<td> <td>
[% IF ( operation.biblionumber ) %] [% IF ( operation.itemnumber ) %]
<a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% operation.biblionumber | uri %]" title="[% operation.bibliotitle | html %]">[% operation.barcode | html %]</a> <a
href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% operation.biblionumber | uri %]&itemnumber=[% operation.itemnumber | uri %]#item[% operation.itemnumber | uri %]"
target="_blank"
title="[% operation.bibliotitle | html %]"
>[% operation.barcode | html %]</a
>
[% ELSE %] [% ELSE %]
<span class="error">[% operation.barcode | html %]</span> <span class="error">[% operation.barcode | html %]</span>
[% END %] [% END %]

View File

@ -27,6 +27,8 @@ use C4::Context;
use C4::Circulation qw( GetOfflineOperations GetOfflineOperation ); use C4::Circulation qw( GetOfflineOperations GetOfflineOperation );
use C4::Members; use C4::Members;
use Koha::Patrons; use Koha::Patrons;
use Koha::DateUtils qw( dt_from_string );
use DateTime;
use Koha::Items; use Koha::Items;
@ -49,6 +51,12 @@ for (@$operations) {
my $biblio = $item->biblio; my $biblio = $item->biblio;
$_->{'bibliotitle'} = $biblio->title; $_->{'bibliotitle'} = $biblio->title;
$_->{'biblionumber'} = $biblio->biblionumber; $_->{'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 = my $patron =