Many librarians would like a quick and easy way to know when an item was marked as lost or withdrawn.
Created attachment 15567 [details] [review] Bug 9673 - Track when items are marked as lost or withdrawn Add date fields to track when an item was marked as lost or withdrawn. Display those fields on catalogue/moredetail.pl Test Plan: 1) Apply patch 2) Run updatedatabase.pl 3) Pick a record with items, browse to the 'items' tab ( moredetail.pl ) 4) Mark an item as lost, verify the field "Lost on:" displays below the "Lost status" field with todays date. 5) Mark the item as not lost, verify the field no longer displays 6) Repeat steps 4 and 5 with the Withdrawn field.
Hi Kyle, please add the new fields also to the deleteditems table, else deleting items won't work correctly. I was also wondering if it might be useful to add this information to action_log or statistics table?
Created attachment 15890 [details] [review] Bug 9673 - Track when items are marked as lost or withdrawn Add date fields to track when an item was marked as lost or withdrawn. Display those fields on catalogue/moredetail.pl Test Plan: 1) Apply patch 2) Run updatedatabase.pl 3) Pick a record with items, browse to the 'items' tab ( moredetail.pl ) 4) Mark an item as lost, verify the field "Lost on:" displays below the "Lost status" field with todays date. 5) Mark the item as not lost, verify the field no longer displays 6) Repeat steps 4 and 5 with the Withdrawn field.
(In reply to comment #2) > Hi Kyle, > please add the new fields also to the deleteditems table, else deleting > items won't work correctly. I was also wondering if it might be useful to > add this information to action_log or statistics table? I believe this information may already be recorded in the action logs, but is not easily accessible to librarians as the format it is stored in is not exactly user friendly.
Created attachment 16002 [details] [review] Bug 9673 - Track when items are marked as lost or withdrawn Add date fields to track when an item was marked as lost or withdrawn. Display those fields on catalogue/moredetail.pl Test Plan: 1) Apply patch 2) Run updatedatabase.pl 3) Pick a record with items, browse to the 'items' tab ( moredetail.pl ) 4) Mark an item as lost, verify the field "Lost on:" displays below the "Lost status" field with todays date. 5) Mark the item as not lost, verify the field no longer displays 6) Repeat steps 4 and 5 with the Withdrawn field.
Created attachment 16003 [details] [review] Bug 9673 - Track when items are marked as lost or withdrawn Add date fields to track when an item was marked as lost or withdrawn. Display those fields on catalogue/moredetail.pl Test Plan: 1) Apply patch 2) Run updatedatabase.pl 3) Pick a record with items, browse to the 'items' tab ( moredetail.pl ) 4) Mark an item as lost, verify the field "Lost on:" displays below the "Lost status" field with todays date. 5) Mark the item as not lost, verify the field no longer displays 6) Repeat steps 4 and 5 with the Withdrawn field. Signed-off-by: Mathieu Saby <mathieu.saby@univ-rennes2.fr>
I fear did some mistakes using git bz... But I have tested and I sign off : - marking an item withdrawn - marking an item lost => date visible - mark an item previously lost or withdrawn as "non lost" and "non withdrawn" => date invisible, and no more present in database - suppressing an item marked as lost of withdrawn => item moved to deleteditem. date of loss / withdrawal stored in deleteditem M. Saby
An other interesting feature would be the ability to add comment when marking an item as lost or withdrawn. M. Saby
(In reply to comment #2) > Hi Kyle, > please add the new fields also to the deleteditems table, else deleting > items won't work correctly. I was also wondering if it might be useful to > add this information to action_log or statistics table? In kohastructure too :) Marked as Failed QA.
Created attachment 16032 [details] [review] Bug 9673 - Track when items are marked as lost or withdrawn Add date fields to track when an item was marked as lost or withdrawn. Display those fields on catalogue/moredetail.pl Test Plan: 1) Apply patch 2) Run updatedatabase.pl 3) Pick a record with items, browse to the 'items' tab ( moredetail.pl ) 4) Mark an item as lost, verify the field "Lost on:" displays below the "Lost status" field with todays date. 5) Mark the item as not lost, verify the field no longer displays 6) Repeat steps 4 and 5 with the Withdrawn field. Signed-off-by: Mathieu Saby <mathieu.saby@univ-rennes2.fr> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Created attachment 16033 [details] [review] Bug 9673 - Track when items are marked as lost or withdrawn Add date fields to track when an item was marked as lost or withdrawn. Display those fields on catalogue/moredetail.pl Test Plan: 1) Apply patch 2) Run updatedatabase.pl 3) Pick a record with items, browse to the 'items' tab ( moredetail.pl ) 4) Mark an item as lost, verify the field "Lost on:" displays below the "Lost status" field with todays date. 5) Mark the item as not lost, verify the field no longer displays 6) Repeat steps 4 and 5 with the Withdrawn field. Signed-off-by: Mathieu Saby <mathieu.saby@univ-rennes2.fr> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
QA comment: 1/ DateTime::Format::MySQL is not load in C4::Items 2/ If someone edits the item even thought it is already marked as lost, the lost on date becomes the current date. Is it really what we want? Marked as Failed QA for 1 and certainly for 2 too (except if it is wanted).
For 2) : I did not see that, but clearly, no, I don't want such a behavior... M. Saby
Created attachment 16642 [details] [review] Bug 9673 - Track when items are marked as lost or withdrawn Add date fields to track when an item was marked as lost or withdrawn. Display those fields on catalogue/moredetail.pl Test Plan: 1) Apply patch 2) Run updatedatabase.pl 3) Pick a record with items, browse to the 'items' tab ( moredetail.pl ) 4) Mark an item as lost, verify the field "Lost on:" displays below the "Lost status" field with todays date. 5) Mark the item as not lost, verify the field no longer displays 6) Repeat steps 4 and 5 with the Withdrawn field. Signed-off-by: Mathieu Saby <mathieu.saby@univ-rennes2.fr> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Created attachment 16643 [details] [review] Bug 9673 - Track when items are marked as lost or withdrawn - QA Followup
Created attachment 16644 [details] [review] Bug 9673 - Track when items are marked as lost or withdrawn Add date fields to track when an item was marked as lost or withdrawn. Display those fields on catalogue/moredetail.pl Test Plan: 1) Apply patch 2) Run updatedatabase.pl 3) Pick a record with items, browse to the 'items' tab ( moredetail.pl ) 4) Mark an item as lost, verify the field "Lost on:" displays below the "Lost status" field with todays date. 5) Mark the item as not lost, verify the field no longer displays 6) Repeat steps 4 and 5 with the Withdrawn field. Signed-off-by: Mathieu Saby <mathieu.saby@univ-rennes2.fr> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Created attachment 16645 [details] [review] Bug 9673 - Track when items are marked as lost or withdrawn - QA Followup
Created attachment 16646 [details] [review] Bug 9673 - Track when items are marked as lost or withdrawn - QA Followup
QA comment: Just looking at the code: If itemlost *and* wthdrawn are defined, we will have 2 calls to GetItem. It could be improve if a test is added before the loop. Something like: if ( $item->{itemlost} or $item->{wthdrawn} ) { my $pre_mod_item = GetItem($item->{'itemnumber'}); for my $field ( qw( itemlost wthdrawn ) ) { if ( defined( $item->{$field} ) ) { Marked as Failed QA.
Created attachment 18031 [details] [review] Bug 9673 - Track when items are marked as lost or withdrawn Add date fields to track when an item was marked as lost or withdrawn. Display those fields on catalogue/moredetail.pl Test Plan: 1) Apply patch 2) Run updatedatabase.pl 3) Pick a record with items, browse to the 'items' tab ( moredetail.pl ) 4) Mark an item as lost, verify the field "Lost on:" displays below the "Lost status" field with todays date. 5) Mark the item as not lost, verify the field no longer displays 6) Repeat steps 4 and 5 with the Withdrawn field. Signed-off-by: Mathieu Saby <mathieu.saby@univ-rennes2.fr> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Created attachment 18032 [details] [review] Bug 9673 - Track when items are marked as lost or withdrawn - QA Followup
Created attachment 18033 [details] [review] Bug 9673 - Track when items are marked as lost or withdrawn - QA Followup 2 * Reduces the possible cass to GetItem from 2 to 1 * Uses dt_from_string to get the DateTime object, so the time zone is correct
Created attachment 18034 [details] [review] Bug 9673 - Track when items are marked as lost or withdrawn - QA Followup 2 * Reduces the possible cass to GetItem from 2 to 1 * Uses dt_from_string to get the DateTime object, so the time zone is correct
Kyle, shouldn't we unset the withdrawn date if an item is restored?
ping Kyle
Created attachment 19013 [details] [review] Bug 9673 - Track when items are marked as lost or withdrawn - QA Followup 3 - Clear 'on' fields when clearing statuses
Created attachment 19014 [details] [review] Bug 9673 - Track when items are marked as lost or withdrawn - QA Followup 3 - Clear 'on' fields when clearing statuses
Kyle, The last patch does not work. Try to : 1/ Mark as lost 2/ Mark as withdrawn => I got in DB: itemlost: 1 itemlost_on: NULL wthdrawn: 1 wthdrawn_on: 2013-06-14 16:18:12
Created attachment 19079 [details] [review] Bug 9673 - Track when items are marked as lost or withdrawn - QA Followup 3 - Clear 'on' fields when clearing statuses
Created attachment 19080 [details] [review] Bug 9673 - Track when items are marked as lost or withdrawn - QA Followup
Kyle, Sorry but the last patch needs a signoff. Early qa: maybe the 3 conditional tests if, unless and if + for my $field (@fields) { + if ( defined( $item->{$field} ) ) { + unless ( $pre_mod_item->{$field} ) { + if ( $item->{$field} ) { could be group into a simple condition (gain of visibility and indentation level) if( defined( $item->{$field} ) and not pre_mod_item->{$field} and $item->{$field} ) It's a minor thing. Switch back to Needs SignOff
Created attachment 19120 [details] [review] Bug 9673 - Track when items are marked as lost or withdrawn Add date fields to track when an item was marked as lost or withdrawn. Display those fields on catalogue/moredetail.pl Test Plan: 1) Apply patch 2) Run updatedatabase.pl 3) Pick a record with items, browse to the 'items' tab ( moredetail.pl ) 4) Mark an item as lost, verify the field "Lost on:" displays below the "Lost status" field with todays date. 5) Mark the item as not lost, verify the field no longer displays 6) Repeat steps 4 and 5 with the Withdrawn field. Signed-off-by: Mathieu Saby <mathieu.saby@univ-rennes2.fr> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Created attachment 19121 [details] [review] Bug 9673 - Track when items are marked as lost or withdrawn - QA Followup
Should we carry the existing typo to another column? wthdrawn -> wthdrawn_on?
(In reply to Katrin Fischer from comment #34) > Should we carry the existing typo to another column? wthdrawn -> wthdrawn_on? Yes, absolutely! I think it would be far more confusing to have one field named correctly and one not. At least this way we have consistency. And, when I or someone else get around to renaming the wthdrawn column, we can rename both at once.
(In reply to Kyle M Hall from comment #35) > (In reply to Katrin Fischer from comment #34) > > Should we carry the existing typo to another column? wthdrawn -> wthdrawn_on? > > Yes, absolutely! I think it would be far more confusing to have one field > named correctly and one not. At least this way we have consistency. And, > when I or someone else get around to renaming the wthdrawn column, we can > rename both at once. I can't say I'm keen on a patch that intentionally adds a typo, even for the sake of consistency.
Ok, I'll file a bug to rename wthdrawn, update this patch, and make it depend on the new bug. That should resolve all the issues at once.
Created attachment 19483 [details] [review] Bug 9673 - Track when items are marked as lost or withdrawn Add date fields to track when an item was marked as lost or withdrawn. Display those fields on catalogue/moredetail.pl Test Plan: 1) Apply patch 2) Run updatedatabase.pl 3) Pick a record with items, browse to the 'items' tab ( moredetail.pl ) 4) Mark an item as lost, verify the field "Lost on:" displays below the "Lost status" field with todays date. 5) Mark the item as not lost, verify the field no longer displays 6) Repeat steps 4 and 5 with the Withdrawn field. Signed-off-by: Mathieu Saby <mathieu.saby@univ-rennes2.fr> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Created attachment 19484 [details] [review] Bug 9673 - Track when items are marked as lost or withdrawn - QA Followup
Created attachment 19485 [details] [review] Bug 9673 - Track when items are marked as lost or withdrawn - QA Followup 2 - Change wthdrawn_on to withdrawn_on
Created attachment 19486 [details] [review] Bug 9673 - Track when items are marked as lost or withdrawn Add date fields to track when an item was marked as lost or withdrawn. Display those fields on catalogue/moredetail.pl Test Plan: 1) Apply patch 2) Run updatedatabase.pl 3) Pick a record with items, browse to the 'items' tab ( moredetail.pl ) 4) Mark an item as lost, verify the field "Lost on:" displays below the "Lost status" field with todays date. 5) Mark the item as not lost, verify the field no longer displays 6) Repeat steps 4 and 5 with the Withdrawn field. Signed-off-by: Mathieu Saby <mathieu.saby@univ-rennes2.fr> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Created attachment 19487 [details] [review] Bug 9673 - Track when items are marked as lost or withdrawn - QA Followup
Created attachment 19488 [details] [review] Bug 9673 - Track when items are marked as lost or withdrawn - QA Followup 2 - Change wthdrawn_on to withdrawn_on
Created attachment 19489 [details] [review] [SIGNED-OFF] Bug 9673 - Track when items are marked as lost or withdrawn Add date fields to track when an item was marked as lost or withdrawn. Display those fields on catalogue/moredetail.pl Test Plan: 1) Apply patch 2) Run updatedatabase.pl 3) Pick a record with items, browse to the 'items' tab ( moredetail.pl ) 4) Mark an item as lost, verify the field "Lost on:" displays below the "Lost status" field with todays date. 5) Mark the item as not lost, verify the field no longer displays 6) Repeat steps 4 and 5 with the Withdrawn field. Signed-off-by: Mathieu Saby <mathieu.saby@univ-rennes2.fr> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Created attachment 19490 [details] [review] Bug 9673 - Track when items are marked as lost or withdrawn - QA Followup
Created attachment 19492 [details] [review] Bug 9673 - Track when items are marked as lost or withdrawn - QA Followup
Should we also be nice and update saved reports using wthdrawn?
Applying: Bug 9673 - Track when items are marked as lost or withdrawn Repository lacks necessary blobs to fall back on 3-way merge. Cannot fall back to three-way merge. Patch failed at 0001 Bug 9673 - Track when items are marked as lost or withdrawn The copy of the patch that failed is found in: /home/christopher/git/koha/.git/rebase-apply/patch When you have resolved this problem, run "git am --continue". If you prefer to skip this patch, run "git am --skip" instead. To restore the original branch and stop patching, run "git am --abort".
Created attachment 21730 [details] [review] Bug 9673 - Track when items are marked as lost or withdrawn Add date fields to track when an item was marked as lost or withdrawn. Display those fields on catalogue/moredetail.pl Test Plan: 1) Apply patch 2) Run updatedatabase.pl 3) Pick a record with items, browse to the 'items' tab ( moredetail.pl ) 4) Mark an item as lost, verify the field "Lost on:" displays below the "Lost status" field with todays date. 5) Mark the item as not lost, verify the field no longer displays 6) Repeat steps 4 and 5 with the Withdrawn field. Signed-off-by: Mathieu Saby <mathieu.saby@univ-rennes2.fr> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Created attachment 21731 [details] [review] Bug 9673 - Track when items are marked as lost or withdrawn - QA Followup
QA comment: Works as described. There is a typo in updatedb (wthdrawn vs withdrawn). The itemlost date (itemlost_on value) should be display only if the itemlost value is set (!= ""). I will submit a followup. Marked as Passed QA.
Created attachment 22690 [details] [review] Bug 9673 - Track when items are marked as lost or withdrawn Add date fields to track when an item was marked as lost or withdrawn. Display those fields on catalogue/moredetail.pl Test Plan: 1) Apply patch 2) Run updatedatabase.pl 3) Pick a record with items, browse to the 'items' tab ( moredetail.pl ) 4) Mark an item as lost, verify the field "Lost on:" displays below the "Lost status" field with todays date. 5) Mark the item as not lost, verify the field no longer displays 6) Repeat steps 4 and 5 with the Withdrawn field. Signed-off-by: Mathieu Saby <mathieu.saby@univ-rennes2.fr> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Created attachment 22691 [details] [review] Bug 9673: QA followup This followup fixes the wthdrawn typo exist in updatedatabase.pl and does not display the lostitem date if the lostitem value is not set (!= ""). Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
I forgot to mention: I squashed the 2 patches (second patch fixed the typo and was not useful for the history).
Pushed to master. Thanks, Kyle!