Bug 11889: Disown a list upon deletion of owner
authorAleisha Amohia <aleishaamohia@hotmail.com>
Tue, 14 Feb 2017 22:56:31 +0000 (22:56 +0000)
committerTomas Cohen Arazi <tomascohen@theke.io>
Tue, 19 Jul 2022 14:00:10 +0000 (11:00 -0300)
commit6ff09b16f1620840fc2f9353e17a718e7e98f8c7
treed3817c0e8635ae4fa2502a6d537f7ea26646e89a
parentfc919fc796df42c29e73cd527d3c425377fcc27a
Bug 11889: Disown a list upon deletion of owner

This patch adds a syspref 'ListOwnershipUponPatronDeletion' which
decides if all the owner's lists (public and private) are deleted
when the owner is deleted, or if the ownership of their public and
shared lists are transfered to the user who deleted the owner (private
lists that are not shared are always deleted).

To test:
1) Apply patch and update database
2) Set the ListOwnershipUponPatronDeletion syspref to 'Transfer...'
3) Set up a superlibrarian user
4) Log in as this superlibrarian user and set up three lists, a public
list (maybe named 'public'), and two private lists (named 'private' and
'shared')
5) Log in as this user to the opac (if you haven't already) and share
the 'shared' list with someone
6) View the virtualshelves table in mysql to see the three lists you
just created under your new user
7) Also view the virtualshelfshares table in mysql to see the 'shared'
list
8) Log into the staff client with your regular user (a different user to
the one you just created)
9) Search for the user you just created and delete them
10) Go to your lists
11) You should see the 'shared' list under your private lists, and their
'public' list under your public lists, both with you as the owner
12) if you view both the virtualshelves table and the virtualshelfshares
table in mysql again, youll see you are now the owner and the 'private'
list will no longer exist.
13) Set the ListOwnershipUponPatronDeletion syspref back to 'Delete...'
14) Repeat steps 3 - 10 again (it may help to delete the 'shared' and
'public' lists before you re-create them)
15) You should not see any of the lists you just made under private or
public lists this time. To confirm, check the virtualshelves table in
mysql and make sure that all three lists have been deleted.

Sponsored-by: Catalyst IT
Signed-off-by: Cédric Vita <cedric.vita@dracenie.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
2022-06-08 Removed old atomic update. See new follow-up.
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Koha/Patron.pm
koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref