From 864d70e59a44ccd135d72f8d601b8df126328fee 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 Content-Type: text/plain; charset=utf-8 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 | 18 ++++++++++++++++++ installer/data/mysql/mandatory/sysprefs.sql | 6 +++--- .../en/modules/admin/preferences/patrons.pref | 5 +++-- 3 files changed, 24 insertions(+), 5 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..73a19cc102 --- /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 76954d2022..6ec01e40b3 100644 --- a/installer/data/mysql/mandatory/sysprefs.sql +++ b/installer/data/mysql/mandatory/sysprefs.sql @@ -391,8 +391,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'), @@ -889,4 +889,4 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('z3950AuthorAuthFields','701,702,700',NULL,'Define the MARC biblio fields for Personal Name Authorities to fill biblio.author','free'), ('z3950NormalizeAuthor','0','','If ON, Personal Name Authorities will replace authors in biblio.author','YesNo'), ('z3950Status','','','This syspref allows to define custom YAML based rules for marking items unavailable in z3950 results.','Textarea') -; \ No newline at end of file +; 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 5a84a24557..eef20a4939 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