Bug 12363

Summary: Marking an item as lost in koha always returns it, but longoverdue.pl may not
Product: Koha Reporter: Kyle M Hall <kyle>
Component: Architecture, internals, and plumbingAssignee: Jonathan Druart <jonathan.druart>
Status: CLOSED FIXED QA Contact: Kyle M Hall <kyle>
Severity: major    
Priority: P5 - low CC: fridolin.somers, jdemuth, jonathan.druart, katrin.fischer, marjorie.barry-vila, martin.renvoize, nengard, patrick.robitaille, sandboxes, severine.queune
Version: master   
Hardware: All   
OS: All   
See Also: http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8506
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12812
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10748
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19287
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Attachments: Bug 12363: Add new pref MarkLostItemsAsReturned
Bug 12363: Add a switch to mark|do not mark items as returned when lost
Bug 12363: Add new pref MarkLostItemsAsReturned
Bug 12363: Add a switch to mark|do not mark items as returned when lost
Bug 12363: Add new pref MarkLostItemsAsReturned
Bug 12363: Add a switch to mark|do not mark items as returned when lost

Description Kyle M Hall 2014-06-04 17:52:12 UTC
The cronjob script longoverdue.pl has a switch --mark-returned which controls if an item is returned when marked as lost. As such, by default items are *not* returned when lost by longoverdue.pl, and at the same time, *are* returned when marked as lost from the staff intranet.

In the past, marking an item as lost from additem.pl would not return the item, but doing so from moredetail.pl, so librarians had at least some control over having and item returned when lost. An update to additem.pl now causes all ways to mark an item as lost from the staff intranet.

This behavior makes little sense. The flag behavior should be moved to a system preference.

An upgrade path is problematic though. We could have longoverdue.pl set the system preference value based on the --marked-returned flag on each run. That would allow upgrades to work without intervention.
Comment 1 Katrin Fischer 2016-11-10 10:20:23 UTC
Hm, I am not sure we want to match the staff client behaviour to the script in all cases. I think a workflow for the library could be: don't automatically remove lost items from the account, but use a special lost value and let the staff check them, beore marking them lost and removing them from the account.
It might be good to still allow to control them independently.
Comment 2 Jonathan Druart 2017-10-17 14:00:50 UTC
Created attachment 68212 [details] [review]
Bug 12363: Add new pref MarkLostItemsAsReturned
Comment 3 Jonathan Druart 2017-10-17 14:00:55 UTC
Created attachment 68213 [details] [review]
Bug 12363: Add a switch to mark|do not mark items as returned when lost

There are several ways to mark an item an lost:
- item list view (catalogue/moredetail.pl, "Items" tab)
- cataloguing (cataloguing/additem.pl)
- Batch item modification tools (tools/batchMod.pl)
- The long overdue cronjob (misc/cronjobs/longoverdue.pl)

So far only the cronjob is configurable, the others mark the item as
returned (does the checkin).

This behaviour should be controlable using a syspref, to let libraries
choose what fit best for them.

Test plan:
Use the 2 options of the pref, mark checked out items as lost using the
different possibilities, and confirm that the behaviours make sense to
you
Comment 4 Séverine Queune 2017-10-18 14:07:00 UTC
Return is correctly done or blocked depending on the syspref.
I tried to mark lost items using the pages (catalogue/moredetail.pl, "Items" tab) / (cataloguing/additem.pl) / (tools/batchMod.pl) but lost status is never saved.
I don't know how to try with long overdue cronjob.

I used Biblibre's sandbox#2.
I set parameters by myself because there where no authorized value for the 'LOST' list and the field 995$2 was hidden and not linked to this list.
Maybe I did something wrong...
Comment 5 Séverine Queune 2017-10-18 14:35:50 UTC
My bad, I forgot when I set the authorized values that only numbers were allowed and I used letters. Sorry.

Behaviour is correct.
Comment 6 Biblibre Sandboxes 2017-10-18 14:37:11 UTC
Patch tested with a sandbox, by Séverine QUEUNE <severine.queune@bulac.fr>
Comment 7 Biblibre Sandboxes 2017-10-18 14:37:42 UTC
Created attachment 68256 [details] [review]
Bug 12363: Add new pref MarkLostItemsAsReturned

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Comment 8 Biblibre Sandboxes 2017-10-18 14:37:45 UTC
Created attachment 68257 [details] [review]
Bug 12363: Add a switch to mark|do not mark items as returned when lost

There are several ways to mark an item an lost:
- item list view (catalogue/moredetail.pl, "Items" tab)
- cataloguing (cataloguing/additem.pl)
- Batch item modification tools (tools/batchMod.pl)
- The long overdue cronjob (misc/cronjobs/longoverdue.pl)

So far only the cronjob is configurable, the others mark the item as
returned (does the checkin).

This behaviour should be controlable using a syspref, to let libraries
choose what fit best for them.

Test plan:
Use the 2 options of the pref, mark checked out items as lost using the
different possibilities, and confirm that the behaviours make sense to
you

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Comment 9 Kyle M Hall 2017-10-27 12:33:37 UTC
Created attachment 68684 [details] [review]
Bug 12363: Add new pref MarkLostItemsAsReturned

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 10 Kyle M Hall 2017-10-27 12:33:45 UTC
Created attachment 68685 [details] [review]
Bug 12363: Add a switch to mark|do not mark items as returned when lost

There are several ways to mark an item an lost:
- item list view (catalogue/moredetail.pl, "Items" tab)
- cataloguing (cataloguing/additem.pl)
- Batch item modification tools (tools/batchMod.pl)
- The long overdue cronjob (misc/cronjobs/longoverdue.pl)

So far only the cronjob is configurable, the others mark the item as
returned (does the checkin).

This behaviour should be controlable using a syspref, to let libraries
choose what fit best for them.

Test plan:
Use the 2 options of the pref, mark checked out items as lost using the
different possibilities, and confirm that the behaviours make sense to
you

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 11 Jonathan Druart 2017-10-27 17:12:26 UTC
Pushed to master for 17.11, thanks to everybody involved!
Comment 12 Jonathan Druart 2017-12-12 16:06:54 UTC
*** Bug 13589 has been marked as a duplicate of this bug. ***
Comment 13 Fridolin Somers 2018-04-10 07:36:31 UTC
I choose not to backport to 17.05.x since its getting old.