Bug 14945 - Add the ability to store the last patron to return an item
authorKyle M Hall <kyle@bywatersolutions.com>
Mon, 5 Nov 2012 19:35:23 +0000 (14:35 -0500)
committerBrendan Gallagher <brendan@bywatersolutions.com>
Thu, 31 Dec 2015 19:32:20 +0000 (19:32 +0000)
commitecd89d20302118202ebaa9fbe0a46aea624fe8a8
treedce94ea713c9c1c850bd6d4b8e3e560fa0d7fe6e
parente3f81857d8193245c8e8483838a9daef676ea994
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>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
C4/Circulation.pm
Koha/Item.pm
Koha/Schema/Result/ItemsLastBorrower.pm [new file with mode: 0644]
catalogue/moredetail.pl
installer/data/mysql/atomicupdate/bug_14945.sql [new file with mode: 0644]
installer/data/mysql/kohastructure.sql
installer/data/mysql/sysprefs.sql
koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref
koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-privacy.tt
t/db_dependent/Circulation/AnonymiseIssueHistory.t