From 30fe9614c072e7ceb71e3dde549abd70626e812b Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Tue, 19 Dec 2023 17:08:27 +0000 Subject: [PATCH] Bug 12802: Update system preference Allow the EmailFieldPrimary preference to accept multiple selections --- installer/data/mysql/atomicupdate/bug_12802.pl | 14 ++++++++++++++ installer/data/mysql/mandatory/sysprefs.sql | 2 +- .../prog/en/modules/admin/preferences/patrons.pref | 2 +- 3 files changed, 16 insertions(+), 2 deletions(-) create mode 100755 installer/data/mysql/atomicupdate/bug_12802.pl diff --git a/installer/data/mysql/atomicupdate/bug_12802.pl b/installer/data/mysql/atomicupdate/bug_12802.pl new file mode 100755 index 00000000000..55def6be3fb --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_12802.pl @@ -0,0 +1,14 @@ +use Modern::Perl; + +return { + bug_number => '12802', + description => 'Change type of system preference EmailFieldPrimary to multiple', + up => sub { + my ($args) = @_; + my ( $dbh, $out ) = @$args{qw(dbh out)}; + + $dbh->do("UPDATE systempreferences SET type='multiple' WHERE variable='EmailFieldPrimary'"); + + say $out "Updated system preference 'EmailFieldPrimary' to have type 'multiple'"; + }, +}; diff --git a/installer/data/mysql/mandatory/sysprefs.sql b/installer/data/mysql/mandatory/sysprefs.sql index b58114d802e..2ad55fbd2f2 100644 --- a/installer/data/mysql/mandatory/sysprefs.sql +++ b/installer/data/mysql/mandatory/sysprefs.sql @@ -225,7 +225,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('EmailAddressForPatronRegistrations', '', '', ' If you choose EmailAddressForPatronRegistrations you have to enter a valid email address: ', 'free'), ('EmailAddressForSuggestions','','',' If you choose EmailAddressForSuggestions you have to enter a valid email address: ','free'), ('EmailFieldPrecedence','email|emailpro|B_email','','Ordered list of patron email fields to use when AutoEmailPrimaryAddress is set to first valid','multiple'), -('EmailFieldPrimary','OFF','email|emailpro|B_email|cardnumber|OFF','Defines the default email address field where patron email notices are sent.','Choice'), +('EmailFieldPrimary','OFF','email|emailpro|B_email|cardnumber|OFF','Defines the default email address field where patron email notices are sent.','multiple'), ('emailLibrarianWhenHoldIsPlaced','0',NULL,'If ON, emails the librarian whenever a hold is placed','YesNo'), ('EmailOverduesNoEmail','1',NULL,'Send send overdues of patrons without email address to staff','YesNo'), ('EmailPatronRegistrations', '0', '0|EmailAddressForPatronRegistrations|BranchEmailAddress|KohaAdminEmailAddress', 'Choose email address that new patron registrations will be sent to: ', 'Choice'), 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 c2043b85dd3..e93074a3ef4 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 @@ -194,7 +194,7 @@ Patrons: - "Use the patron's" - pref: EmailFieldPrimary default: "OFF" - choices: + multiple: email: primary email emailpro: secondary email B_email: alternate email -- 2.43.0