Bug 38331 - Add date acquired, item lost on, damaged on, withdrawn on, and date last seen columns to the item search results
Summary: Add date acquired, item lost on, damaged on, withdrawn on, and date last seen...
Status: Signed Off
Alias: None
Product: Koha
Classification: Unclassified
Component: Searching (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Eric Garcia
QA Contact:
URL:
Keywords:
: 13965 38671 (view as bug list)
Depends on: 37238
Blocks:
  Show dependency treegraph
 
Reported: 2024-11-01 20:21 UTC by Lucas Gass (lukeg)
Modified: 2025-06-15 23:15 UTC (History)
10 users (show)

See Also:
GIT URL:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
This enhancement adds additional columns to the item search results table (they are hidden by default): - dateaccessioned (Date acquired) - itemlost_on (Date lost)* - damaged_on (Date damaged)* - withdrawn_on (Date withdrawn)* - datelastseen (Date last seen) * These dates are added or updated when the respective status is changed for an item.
Version(s) released in:
Circulation function:


Attachments
Bug 38331: Add date accessioned column to item search results (7.86 KB, patch)
2024-11-01 20:54 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 38331: Add date accessioned column to item search results (7.91 KB, patch)
2024-11-04 14:12 UTC, Biblibre Sandboxes
Details | Diff | Splinter Review
Bug 38331: add dateaccessioned, itemlost_on, damaged_on, withdrawn_on, datelastseen as options in item search results (9.25 KB, patch)
2024-12-12 17:37 UTC, Andrew Fuerste-Henry
Details | Diff | Splinter Review
Bug 38331: add dateaccessioned, itemlost_on, damaged_on, withdrawn_on, datelastseen as options in item search results (9.28 KB, patch)
2024-12-12 18:58 UTC, Jason Robb
Details | Diff | Splinter Review
Bug 38331: add dateaccessioned, itemlost_on, damaged_on, withdrawn_on, datelastseen as options in item search results (9.30 KB, patch)
2025-02-12 13:15 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 38331: Add dateaccessioned, itemlost_on, damaged_on, withdrawn_on, datelasteen to itemsearch results (9.96 KB, patch)
2025-03-10 13:58 UTC, Andrew Fuerste-Henry
Details | Diff | Splinter Review
Bug 38331: Add dateaccessioned, itemlost_on, damaged_on, withdrawn_on, datelasteen to itemsearch results (10.25 KB, patch)
2025-06-10 18:17 UTC, Eric Garcia
Details | Diff | Splinter Review
Bug 38331: Add dateaccessioned, itemlost_on, damaged_on, withdrawn_on, datelasteen to itemsearch results (10.30 KB, patch)
2025-06-15 23:03 UTC, David Nind
Details | Diff | Splinter Review
Bug 38331: (follow-up) Rename item search results column headings (5.81 KB, patch)
2025-06-15 23:03 UTC, David Nind
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Lucas Gass (lukeg) 2024-11-01 20:21:37 UTC
Now that Bug 37238 is moving we can add some new columns to the itemsearch display that are hidden by default. One that has been requested is  date accessioned.
Comment 1 Lucas Gass (lukeg) 2024-11-01 20:54:40 UTC
Created attachment 173892 [details] [review]
Bug 38331: Add date accessioned column to item search results

To test:
1. APPLY PATCH, restart_all
2. Do an item search, you should not see a 'Date aquired' column.
3. Go to Administration > Table settings.
4. Under catalog find the dateaccessioned column. BY default it should be hidden.
5. Uncheck it to make that column show.
6. Do step 2 again, this time you should see the date accessioned column.
7. Make sure the data in the column is correct.
8. From the top navbar click 'Export all results to', making sure the 'Date aquaied' column is in the CSV.

Note about exporting. With Bug 37238 we now have two ways of exporting files like CSV. Do we want to keep both? The dataTables one is nice because it will only export columns you have exposed.
Comment 2 Biblibre Sandboxes 2024-11-04 14:12:45 UTC
Created attachment 173921 [details] [review]
Bug 38331: Add date accessioned column to item search results

To test:
1. APPLY PATCH, restart_all
2. Do an item search, you should not see a 'Date aquired' column.
3. Go to Administration > Table settings.
4. Under catalog find the dateaccessioned column. BY default it should be hidden.
5. Uncheck it to make that column show.
6. Do step 2 again, this time you should see the date accessioned column.
7. Make sure the data in the column is correct.
8. From the top navbar click 'Export all results to', making sure the 'Date aquaied' column is in the CSV.

Note about exporting. With Bug 37238 we now have two ways of exporting files like CSV. Do we want to keep both? The dataTables one is nice because it will only export columns you have exposed.

Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Comment 3 Katrin Fischer 2024-11-11 17:36:55 UTC
This was pushed back by bug 37238. Extending deadline to Wednesday.
Comment 4 Katrin Fischer 2024-11-14 14:34:03 UTC
Not going to be in 24.11.00.
Comment 5 Andrew Fuerste-Henry 2024-12-12 14:57:48 UTC
This patch no longer applies. While we're at it, I'm rolling bug 38671 into this one: Let's add dateaccessioned, itemlost_on, damaged_on, and withdrawn_on to the available results columns in item search.
Comment 6 Andrew Fuerste-Henry 2024-12-12 14:58:21 UTC
*** Bug 38671 has been marked as a duplicate of this bug. ***
Comment 7 hebah 2024-12-12 15:15:29 UTC
Heck, let's add datelastseen while we're here!
Comment 8 Andrew Fuerste-Henry 2024-12-12 17:37:51 UTC
Created attachment 175415 [details] [review]
Bug 38331: add dateaccessioned, itemlost_on, damaged_on, withdrawn_on, datelastseen as options in item search results

to test:
1 - have items with values in dateaccessioned, itemlost_on, damaged_on, withdrawn_on, datelastseen
2 - perform an item search that returns those items
3 - observe these values are not available
4 - apply patch, restart_all
5 - repeat item search, those values still don't show
6 - go to table settings, see dateaccessioned, itemlost_on, damaged_on, withdrawn_on, datelastseen are now available to be displayed, but are hidden by default
7 - adjust table settings to show all new fields
8 - repeat search, now you see values!
9 - export results in available formats, confirm new values are in export
Comment 9 Andrew Fuerste-Henry 2024-12-12 17:48:16 UTC
Be aware, filtering on date columns gets confusing if you're using a date format other than YYYY-MM-DD. That issue predates this patch: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38692
Comment 10 Jason Robb 2024-12-12 18:58:00 UTC
Created attachment 175418 [details] [review]
Bug 38331: add dateaccessioned, itemlost_on, damaged_on, withdrawn_on, datelastseen as options in item search results

to test:
1 - have items with values in dateaccessioned, itemlost_on, damaged_on, withdrawn_on, datelastseen
2 - perform an item search that returns those items
3 - observe these values are not available
4 - apply patch, restart_all
5 - repeat item search, those values still don't show
6 - go to table settings, see dateaccessioned, itemlost_on, damaged_on, withdrawn_on, datelastseen are now available to be displayed, but are hidden by default
7 - adjust table settings to show all new fields
8 - repeat search, now you see values!
9 - export results in available formats, confirm new values are in export

Signed-off-by: Jason Robb <jrobb@sekls.org>
Comment 11 Jonathan Druart 2025-02-12 13:15:00 UTC
Created attachment 177855 [details] [review]
Bug 38331: add dateaccessioned, itemlost_on, damaged_on, withdrawn_on, datelastseen as options in item search results

to test:
1 - have items with values in dateaccessioned, itemlost_on, damaged_on, withdrawn_on, datelastseen
2 - perform an item search that returns those items
3 - observe these values are not available
4 - apply patch, restart_all
5 - repeat item search, those values still don't show
6 - go to table settings, see dateaccessioned, itemlost_on, damaged_on, withdrawn_on, datelastseen are now available to be displayed, but are hidden by default
7 - adjust table settings to show all new fields
8 - repeat search, now you see values!
9 - export results in available formats, confirm new values are in export

Signed-off-by: Jason Robb <jrobb@sekls.org>
Comment 12 Jonathan Druart 2025-02-12 13:15:10 UTC
Patch rebased using the auto-rebase script.
Comment 13 Victor Grousset/tuxayo 2025-02-24 21:54:02 UTC
Comment on attachment 177855 [details] [review]
Bug 38331: add dateaccessioned, itemlost_on, damaged_on, withdrawn_on, datelastseen as options in item search results

Review of attachment 177855 [details] [review]:
-----------------------------------------------------------------

::: koha-tmpl/intranet-tmpl/prog/en/includes/catalogue/itemsearch_item.csv.inc
@@ +50,5 @@
> +"[% item.dateaccessioned | $KohaDates | $raw %]"
> +[%- delimiter | $raw -%]
> +"[% item.itemlost_on | $KohaDates | $raw %]"
> +[%- delimiter | $raw -%]
> +"[% item.damged_on | $KohaDates | $raw %]"

Typo and patch doesn't apply.
Comment 14 Andrew Fuerste-Henry 2025-03-10 13:58:20 UTC
Created attachment 179116 [details] [review]
Bug 38331: Add dateaccessioned, itemlost_on, damaged_on, withdrawn_on, datelasteen to itemsearch results

to test:
1 - have items with values in dateaccessioned, itemlost_on, damaged_on, withdrawn_on, datelastseen
2 - perform an item search that returns those items
3 - observe these values are not available
4 - apply patch, restart_all
5 - repeat item search, those values still don't show
6 - go to table settings, see dateaccessioned, itemlost_on, damaged_on, withdrawn_on, datelastseen are now available to be displayed, but are hidden by default
7 - adjust table settings to show all new fields
8 - repeat search, now you see values!
9 - export results in available formats, confirm new values are in export
Comment 15 Jonathan Druart 2025-05-13 13:24:20 UTC
Not sure why but I am seeing the damaged_on column, I am expecting it to be hidden by default.
Comment 16 Lucas Gass (lukeg) 2025-06-10 16:46:09 UTC
*** Bug 13965 has been marked as a duplicate of this bug. ***
Comment 17 Eric Garcia 2025-06-10 18:17:50 UTC
Created attachment 183146 [details] [review]
Bug 38331: Add dateaccessioned, itemlost_on, damaged_on, withdrawn_on, datelasteen to itemsearch results

Fixed typo in columns_setting.yml
damaged_on should now be hidden by default.

to test:
1 - have items with values in dateaccessioned, itemlost_on, damaged_on, withdrawn_on, datelastseen
2 - perform an item search that returns those items
3 - observe these values are not available
4 - apply patch, restart_all
5 - repeat item search, those values still don't show
6 - go to table settings, see dateaccessioned, itemlost_on, damaged_on, withdrawn_on, datelastseen are now available to be displayed, but are hidden by default
7 - adjust table settings to show all new fields
8 - repeat search, now you see values!
9 - export results in available formats, confirm new values are in export
Comment 18 Lucas Gass (lukeg) 2025-06-10 20:07:36 UTC
Doesn't apply now
Comment 19 Lucas Gass (lukeg) 2025-06-10 20:09:53 UTC
Ah, I see. We should obsolete the first patch.
Comment 20 Lucas Gass (lukeg) 2025-06-10 20:11:25 UTC
Actually, if I obsolete the first Andrew will not get credit for his work. I will obsolete Eric's patch. 

Eric, thanks for the help. Can you provide your patch as a follow-up to Andrew's so he can get credit for the first patch?
Comment 21 David Nind 2025-06-15 23:03:51 UTC
Created attachment 183264 [details] [review]
Bug 38331: Add dateaccessioned, itemlost_on, damaged_on, withdrawn_on, datelasteen to itemsearch results

Fixed typo in columns_setting.yml
damaged_on should now be hidden by default.

to test:
1 - have items with values in dateaccessioned, itemlost_on, damaged_on, withdrawn_on, datelastseen
2 - perform an item search that returns those items
3 - observe these values are not available
4 - apply patch, restart_all
5 - repeat item search, those values still don't show
6 - go to table settings, see dateaccessioned, itemlost_on, damaged_on, withdrawn_on, datelastseen are now available to be displayed, but are hidden by default
7 - adjust table settings to show all new fields
8 - repeat search, now you see values!
9 - export results in available formats, confirm new values are in export

Signed-off-by: David Nind <david@davidnind.com>
Comment 22 David Nind 2025-06-15 23:03:55 UTC
Created attachment 183265 [details] [review]
Bug 38331: (follow-up) Rename item search results column headings

Rename the item search results column headings so that they are
shorter and more succinct:
- Date accessioned -> Date acquired (to match up with the
  input field name)
- Item lost on date -> Date lost
- Item damaged on date > Date damaged
- Withdrawn on date -> Date withdrawn
- Date last seen -> no change

Signed-off-by: David Nind <david@davidnind.com>
Comment 23 David Nind 2025-06-15 23:11:51 UTC
I've added a follow-up patch to rename the item search results columns:
- Date accessioned -> Date acquired (to match up with the input field name - 952$d (d - Date acquired))
- Item lost on date -> Date lost
- Item damaged on date > Date damaged
- Withdrawn on date -> Date withdrawn
- Date last seen -> no change

Reasons: 
- this is an item search, so including 'item' in the column title is unnecessary 
- shorter and more succinct

An alternative to my follow-up would be lost date, damaged date, withdrawn date, acquired date.

Additional suggestion: Show the date fields after the appropriate column for the setting. For example, put damaged_on after damaged status.

Testing notes (using KTD):
1. For step 1, edit some items for records:
   - Date acquired (dateaccessioned): most items already have a date accessioned, but you can add in 952$d (d - Date acquired)
   - Dates for the various statuses - add a status value for these fields, the date the status is changed is used for these fields:
     . itemlost_on: mark an items as lost, choose a lost staus for 952$1 (1 - Lost status)
     . damaged_on: mark an item as damaged, choose a damage status for 952$4 (4 - Damaged status)
     . withdrawn_on: mark an item as withdrawn, choose a withdrawn status for 952$0 (0 - Withdrawn status)
  - Date last seen (datelastseen): check some items out to a patron