Currently if the AnonymousPatron system preference is in use, all patron data is anonymized. Some libraries would like to be able to see the last patron who returned out an item ( in case of damage ) but still keep all other patrons anonymized.
*** Bug 9011 has been marked as a duplicate of this bug. ***
Created attachment 43073 [details] [review] Bug 14945 - Add the ability to store the last patron to return an item Currently if the AnonymousPatron system preference is in use, all patron data is anonymized. Some libraries would like to be able to see the last patron who returned out an item ( in case of damage ) but still keep all other patrons anonymized. * Add the table items_last_borrower ( id, itemnumber, borrowernumber ) * Add new system preference StoreLastBorrower * If StoreLastBorrower is enabled, upon checkin have Koha insert into this table the patron who last returned this item. Replace existing row based on itemnumber if exists. * If table has a row for a given item, link to the patron from the item details page. Test plan: 1) Apply patch 2) Run updatedatabase.pl 3) Enable StoreLastBorrower 4) Issue an item to a patron and return said item 5) Issue the same item to a second patron, do not return it. 6) View moredetail.pl for the given bib, find the given item. There should be a new field in the history list 'Last returned by' with a link to the last patron to return the item. Optionally, you can also verify this works even if patron issuing history has been set to anonymize issues upon return.
Created attachment 43074 [details] [review] Bug 14945 - Add the ability to store the last patron to return an item Currently if the AnonymousPatron system preference is in use, all patron data is anonymized. Some libraries would like to be able to see the last patron who returned out an item ( in case of damage ) but still keep all other patrons anonymized. * Add the table items_last_borrower ( id, itemnumber, borrowernumber ) * Add new system preference StoreLastBorrower * If StoreLastBorrower is enabled, upon checkin have Koha insert into this table the patron who last returned this item. Replace existing row based on itemnumber if exists. * If table has a row for a given item, link to the patron from the item details page. Test plan: 1) Apply patch 2) Run updatedatabase.pl 3) Enable StoreLastBorrower 4) Issue an item to a patron and return said item 5) Issue the same item to a second patron, do not return it. 6) View moredetail.pl for the given bib, find the given item. There should be a new field in the history list 'Last returned by' with a link to the last patron to return the item. Optionally, you can also verify this works even if patron issuing history has been set to anonymize issues upon return.
Created attachment 43075 [details] [review] Bug 14945 - Add the ability to store the last patron to return an item
Created attachment 43077 [details] [review] [SIGNED OFF] Bug 14945 - Add the ability to store the last patron to return an item Currently if the AnonymousPatron system preference is in use, all patron data is anonymized. Some libraries would like to be able to see the last patron who returned out an item ( in case of damage ) but still keep all other patrons anonymized. * Add the table items_last_borrower ( id, itemnumber, borrowernumber ) * Add new system preference StoreLastBorrower * If StoreLastBorrower is enabled, upon checkin have Koha insert into this table the patron who last returned this item. Replace existing row based on itemnumber if exists. * If table has a row for a given item, link to the patron from the item details page. Test plan: 1) Apply patch 2) Run updatedatabase.pl 3) Enable StoreLastBorrower 4) Issue an item to a patron and return said item 5) Issue the same item to a second patron, do not return it. 6) View moredetail.pl for the given bib, find the given item. There should be a new field in the history list 'Last returned by' with a link to the last patron to return the item. Optionally, you can also verify this works even if patron issuing history has been set to anonymize issues upon return. Signed-off-by: Nick Clemens <nick@quecheelibrary.org>
As bug 9011 raised some discussion about this feature, I am ccing the people involved in previous bug and would like to get another signoff on this one, please.
(In reply to Jonathan Druart from comment #6) > As bug 9011 raised some discussion about this feature, I am ccing the people > involved in previous bug and would like to get another signoff on this one, > please. I agree everyone involved on bug 9011 should be aware of the new patches ( which is why I marked the bug moved ). However, you have provided no justification for requiring a second signoff on this patch. This version is the end product of all the discussion on bug 9011. This version uses a join table to track the last returner for an item. This solves the privacy issues of the first version, and the speed issues of the second version. Anyone and everyone is free to fail qa on this patch due to concerns they would like addressed, but there is nothing to be gained from requiring a second signoff.
It gains us more eyes and should not be too hard to achieve given that there is a lot of active interest in thsi feature.
Created attachment 44075 [details] [review] Bug 14954 - Remove C4::Dates from holiday related files in folder tools This patch removes C4::Dates from: Remove C4::Dates from: - tools/exceptionHolidays.pl - tools/holidays.pl - tools/newHolidays.pl - C4/Calendar.pm To test: - Go to Home > Tools > Calendar - Add, edit, delete the different types of holidays and exceptions - git grep 'C4::Calendar' and test such files - prove t/Calendar.t (Amended following comments #3 and #4 / mv) (Amended following comment #7 / 25.10.2015 / mv Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>
Comment on attachment 44075 [details] [review] Bug 14954 - Remove C4::Dates from holiday related files in folder tools Sorry, wrong bug (typo)
Small conflict in the tests
Created attachment 45147 [details] [review] Bug 14945 - Add the ability to store the last patron to return an item Currently if the AnonymousPatron system preference is in use, all patron data is anonymized. Some libraries would like to be able to see the last patron who returned out an item ( in case of damage ) but still keep all other patrons anonymized. * Add the table items_last_borrower ( id, itemnumber, borrowernumber ) * Add new system preference StoreLastBorrower * If StoreLastBorrower is enabled, upon checkin have Koha insert into this table the patron who last returned this item. Replace existing row based on itemnumber if exists. * If table has a row for a given item, link to the patron from the item details page. Test plan: 1) Apply patch 2) Run updatedatabase.pl 3) Enable StoreLastBorrower 4) Issue an item to a patron and return said item 5) Issue the same item to a second patron, do not return it. 6) View moredetail.pl for the given bib, find the given item. There should be a new field in the history list 'Last returned by' with a link to the last patron to return the item. Optionally, you can also verify this works even if patron issuing history has been set to anonymize issues upon return. Signed-off-by: Nick Clemens <nick@quecheelibrary.org>
I personally don't plan to QA this patch as long as we don't get another signoff from someone involved on the discussion of bug 9011.
I don't have the ability to test this right now. But based on the description, I think this may be a good solution. I would be interested in having a date returned timestamp as well in the table, unless it's easily queried from another table. Items can get checked out over and over again by the same patron -- it may get difficult to distinguish which time was what to provide more info to the patron, plus the less tables you have to query, the easier the reports are to write and return. What happens when the item is returned again? Does the previous entry for the same item get deleted?
Created attachment 45466 [details] [review] [SIGNED-OFF] Bug 14945 - Add the ability to store the last patron to return an item Currently if the AnonymousPatron system preference is in use, all patron data is anonymized. Some libraries would like to be able to see the last patron who returned out an item ( in case of damage ) but still keep all other patrons anonymized. * Add the table items_last_borrower ( id, itemnumber, borrowernumber ) * Add new system preference StoreLastBorrower * If StoreLastBorrower is enabled, upon checkin have Koha insert into this table the patron who last returned this item. Replace existing row based on itemnumber if exists. * If table has a row for a given item, link to the patron from the item details page. Test plan: 1) Apply patch 2) Run updatedatabase.pl 3) Enable StoreLastBorrower 4) Issue an item to a patron and return said item 5) Issue the same item to a second patron, do not return it. 6) View moredetail.pl for the given bib, find the given item. There should be a new field in the history list 'Last returned by' with a link to the last patron to return the item. Optionally, you can also verify this works even if patron issuing history has been set to anonymize issues upon return. Signed-off-by: Nick Clemens <nick@quecheelibrary.org> Signed-off-by: Jen DeMuth <JDeMuth@roseville.ca.us>
Created attachment 45510 [details] [review] Bug 14945 - Add the ability to store the last patron to return an item Currently if the AnonymousPatron system preference is in use, all patron data is anonymized. Some libraries would like to be able to see the last patron who returned out an item ( in case of damage ) but still keep all other patrons anonymized. * Add the table items_last_borrower ( id, itemnumber, borrowernumber ) * Add new system preference StoreLastBorrower * If StoreLastBorrower is enabled, upon checkin have Koha insert into this table the patron who last returned this item. Replace existing row based on itemnumber if exists. * If table has a row for a given item, link to the patron from the item details page. Test plan: 1) Apply patch 2) Run updatedatabase.pl 3) Enable StoreLastBorrower 4) Issue an item to a patron and return said item 5) Issue the same item to a second patron, do not return it. 6) View moredetail.pl for the given bib, find the given item. There should be a new field in the history list 'Last returned by' with a link to the last patron to return the item. Optionally, you can also verify this works even if patron issuing history has been set to anonymize issues upon return. Signed-off-by: Nick Clemens <nick@quecheelibrary.org> Signed-off-by: Jen DeMuth <JDeMuth@roseville.ca.us> Signed-off-by: Tom Misilo <misilot@fit.edu>
Created attachment 45511 [details] [review] Bug 14945 - Add the ability to store the last patron to return an item Currently if the AnonymousPatron system preference is in use, all patron data is anonymized. Some libraries would like to be able to see the last patron who returned out an item ( in case of damage ) but still keep all other patrons anonymized. * Add the table items_last_borrower ( id, itemnumber, borrowernumber ) * Add new system preference StoreLastBorrower * If StoreLastBorrower is enabled, upon checkin have Koha insert into this table the patron who last returned this item. Replace existing row based on itemnumber if exists. * If table has a row for a given item, link to the patron from the item details page. Test plan: 1) Apply patch 2) Run updatedatabase.pl 3) Enable StoreLastBorrower 4) Issue an item to a patron and return said item 5) Issue the same item to a second patron, do not return it. 6) View moredetail.pl for the given bib, find the given item. There should be a new field in the history list 'Last returned by' with a link to the last patron to return the item. Optionally, you can also verify this works even if patron issuing history has been set to anonymize issues upon return. Signed-off-by: Nick Clemens <nick@quecheelibrary.org> Signed-off-by: Jen DeMuth <JDeMuth@roseville.ca.us> Signed-off-by: Tom Misilo <misilot@fit.edu>
Created attachment 45522 [details] [review] Bug 14945 - Add the ability to store the last patron to return an item Currently if the AnonymousPatron system preference is in use, all patron data is anonymized. Some libraries would like to be able to see the last patron who returned out an item ( in case of damage ) but still keep all other patrons anonymized. * Add the table items_last_borrower ( id, itemnumber, borrowernumber ) * Add new system preference StoreLastBorrower * If StoreLastBorrower is enabled, upon checkin have Koha insert into this table the patron who last returned this item. Replace existing row based on itemnumber if exists. * If table has a row for a given item, link to the patron from the item details page. Test plan: 1) Apply patch 2) Run updatedatabase.pl 3) Enable StoreLastBorrower 4) Issue an item to a patron and return said item 5) Issue the same item to a second patron, do not return it. 6) View moredetail.pl for the given bib, find the given item. There should be a new field in the history list 'Last returned by' with a link to the last patron to return the item. Optionally, you can also verify this works even if patron issuing history has been set to anonymize issues upon return. Signed-off-by: Nick Clemens <nick@quecheelibrary.org> Signed-off-by: Jen DeMuth <JDeMuth@roseville.ca.us> Signed-off-by: Tom Misilo <misilot@fit.edu> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
All works fine, thanks Kyle for your tenacity :) Thanks for the additional signoffs too! I have just noticed 1 weird behavior on testing: If the last patron to return has required privacy, on the items detail page, the "Last borrower" and "Last returned by" will differ. I know that it's all the point of this patch, but the info are not obvious in this case.
Created attachment 45523 [details] [review] Bug 14945: Add 2 more tests for StoreLastBorrower Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
I was thinking about your comment Jonathan, about "the "Last borrower" and "Last returned by" will differ." Would it make sense sense to only display Last borrower, but show the new value that is stored and display with "Last returned by"? It removes the confusion that might happen after the data is anonymized?
pushed to master - thanks