From 49271317fa87d2a439999147193e09d893d2b5b2 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 Signed-off-by: Brendan Gallagher Signed-off-by: Axelle Clarisse Signed-off-by: Mathieu Saby Signed-off-by: Aleisha Amohia Signed-off-by: Martin Renvoize Signed-off-by: Katrin Fischer --- 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 0000000000..55def6be3f --- /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 3a10bafffa..8ea05a46ff 100644 --- a/installer/data/mysql/mandatory/sysprefs.sql +++ b/installer/data/mysql/mandatory/sysprefs.sql @@ -229,7 +229,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 968f81dc8b..4b3103dcbd 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.39.5