From 53b8a238abe87aef99d8c90e598709c026344587 Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Mon, 17 Feb 2025 10:25:18 +0000 Subject: [PATCH] Bug 39145: Add option to transfer only public lists to preference Test plan: Run updatedatabase.pl Check ListOwnershipUponPatronDeletion on Patron preferences tab. Signed-off-by: Marcel de Rooy Signed-off-by: David Nind --- installer/data/mysql/atomicupdate/bug_39145.pl | 16 ++++++++++++++++ installer/data/mysql/mandatory/sysprefs.sql | 2 +- .../en/modules/admin/preferences/patrons.pref | 5 +++-- 3 files changed, 20 insertions(+), 3 deletions(-) create mode 100755 installer/data/mysql/atomicupdate/bug_39145.pl diff --git a/installer/data/mysql/atomicupdate/bug_39145.pl b/installer/data/mysql/atomicupdate/bug_39145.pl new file mode 100755 index 0000000000..943636a1b0 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_39145.pl @@ -0,0 +1,16 @@ +use Modern::Perl; +use Koha::Installer::Output qw(say_warning say_success say_info); + +return { + bug_number => "39145", + description => "Adjust preference ListOwnershipUponPatronDeletion", + up => sub { + my ($args) = @_; + my ( $dbh, $out ) = @$args{qw(dbh out)}; + + $dbh->do(q{ + UPDATE systempreferences SET options='delete|transfer|transfer_public' WHERE variable = 'ListOwnershipUponPatronDeletion' + }); + say $out "Updated system preference 'ListOwnershipUponPatronDeletion'"; + }, +}; diff --git a/installer/data/mysql/mandatory/sysprefs.sql b/installer/data/mysql/mandatory/sysprefs.sql index 09b8afd6fd..28eb5f9295 100644 --- a/installer/data/mysql/mandatory/sysprefs.sql +++ b/installer/data/mysql/mandatory/sysprefs.sql @@ -391,7 +391,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('LinkerOptions','','','A pipe-separated list of options for the linker.','free'), ('LinkerRelink','1',NULL,'If ON the authority linker will relink headings that have previously been linked every time it runs.','YesNo'), ('ListOwnerDesignated', NULL, NULL, 'Designated list owner at patron deletion', 'Free'), -('ListOwnershipUponPatronDeletion', 'delete', 'delete|transfer', 'Defines the action on their public or shared lists when patron is deleted', 'Choice'), +('ListOwnershipUponPatronDeletion', 'delete', 'delete|transfer|transfer_public', 'Defines the action on their public or shared lists when patron is deleted', 'Choice'), ('LoadCheckoutsTableDelay','0','','Delay before auto-loading checkouts table on checkouts screen','Integer'), ('LoadSearchHistoryToTheFirstLoggedUser', '1', NULL, 'If ON, the next user will automatically get the last searches in their history', 'YesNo'), ('LocalCoverImages','0','1','Display local cover images on intranet details pages.','YesNo'), diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref index 90e041b218..939161534f 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref @@ -37,8 +37,9 @@ Patrons: - "When deleting a patron who owns public or shared lists," - pref: ListOwnershipUponPatronDeletion choices: - delete: "delete these lists." - transfer: "change owner of these lists." + delete: "delete these lists." + transfer: "change owner of these lists." + transfer_public: "change owner of public lists, delete shared lists." - All public or shared lists of this patron are either deleted or transferred to a new owner according to your choice; other private lists (not shared) are deleted. - "
When changing owner at patron deletion, use borrowernumber " - pref: ListOwnerDesignated -- 2.39.5