Bug 41170: Highlight previously edited item on add items page

Some libraries find it useful to have the item that was just
edited/saved visible in the items list

To test:
0 - Apply patch
1 - Edit an item, confirm the itme is highlighted yellow with title
    'Currently editing' (Hover to see the title)
2 - Save the item
3 - Confirm item is now highlighted light blue with title 'Previously
    edited'
4 - Sign off

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit a6819d4985)
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>
This commit is contained in:
Nick Clemens 2025-11-03 13:20:19 +00:00 committed by Jacob O'Mara
parent e07fcbeacd
commit 3e7dd4e4e9
No known key found for this signature in database
2 changed files with 15 additions and 8 deletions

View File

@ -308,6 +308,9 @@ tbody tr.active:nth-child( 2n+1 ) td,
tbody tr.active td {
background-color: #FFFFCC;
}
tbody tr.previous td {
background-color: #CCFFFF;
}
#loading {
background-color: #FFF;

View File

@ -119,17 +119,21 @@
<tbody>
[% FOREACH item IN items %]
[% SET can_be_edited = ! ( Koha.Preference('IndependentBranches') && ! logged_in_user.is_superlibrarian && item.homebranch != Branches.GetLoggedInBranchname() ) %]
[% SET tr_class = '' %]
[% IF item.itemnumber == itemnumber AND op == 'cud-saveitem' %]
[% UNLESS can_be_edited %]
[% SET tr_class='active' %]
[% SET tr_class = [] %]
[% SET tr_title = "" %]
[% IF item.itemnumber == itemnumber %]
[% IF op == 'cud-saveitem' %]
[% tr_class.push('active') %]
[% tr_title = t("Currently editing") %]
[% ELSE %]
[% SET tr_class='active editable' %]
[% tr_class.push('previous') %]
[% tr_title = t("Previously edited") %]
[% END %]
[% ELSIF can_be_edited %]
[% SET tr_class='editable' %]
[% END %]
<tr id="row[% item.itemnumber | html %]" class="[% tr_class | html %]">
[% IF can_be_edited %]
[% tr_class.push = 'editable' %]
[% END %]
<tr id="row[% item.itemnumber | html %]" class="[% tr_class.join(' ') | html %]" title="[% tr_title | html %]">
[% UNLESS can_be_edited %]
<td>&nbsp;</td>
[% ELSE %]