From c62b9744cd870a960b5ca811a7f27e31fe815707 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 Signed-off-by: Martin Renvoize --- installer/data/mysql/atomicupdate/bug_39145.pl | 18 ++++++++++++++++++ installer/data/mysql/mandatory/sysprefs.sql | 4 ++-- .../en/modules/admin/preferences/patrons.pref | 5 +++-- 3 files changed, 23 insertions(+), 4 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 00000000000..73a19cc1026 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_39145.pl @@ -0,0 +1,18 @@ +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 7fb46c297ee..6305ec12814 100644 --- a/installer/data/mysql/mandatory/sysprefs.sql +++ b/installer/data/mysql/mandatory/sysprefs.sql @@ -394,8 +394,8 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('LinkerModule','Default','Default|FirstMatch|LastMatch','Chooses which linker module to use (see documentation).','Choice'), ('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, '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'), +('ListOwnerDesignated', NULL, NULL, 'Designated list owner at patron deletion', 'Free'), +('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 22788828bbc..eae4c9723f6 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.51.0