From 78291ad5d9585bbcbe56d2b1a211858b7f19d4a9 Mon Sep 17 00:00:00 2001 From: Alex Buckley Date: Mon, 4 Apr 2022 07:52:06 +0000 Subject: [PATCH] Bug 23538: Database changes Sponsored-by: Catalyst IT --- ...lAddressForPatronRegistrations_sysprefs.pl | 29 +++++++++++++++++++ .../mysql/en/mandatory/sample_notices.yml | 25 ++++++++++++++++ installer/data/mysql/mandatory/sysprefs.sql | 2 ++ .../en/modules/admin/preferences/opac.pref | 13 +++++++++ 4 files changed, 69 insertions(+) create mode 100755 installer/data/mysql/atomicupdate/bug23538-add_EmailPatronRegistrations_and_EmailAddressForPatronRegistrations_sysprefs.pl diff --git a/installer/data/mysql/atomicupdate/bug23538-add_EmailPatronRegistrations_and_EmailAddressForPatronRegistrations_sysprefs.pl b/installer/data/mysql/atomicupdate/bug23538-add_EmailPatronRegistrations_and_EmailAddressForPatronRegistrations_sysprefs.pl new file mode 100755 index 0000000000..61ee73395e --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug23538-add_EmailPatronRegistrations_and_EmailAddressForPatronRegistrations_sysprefs.pl @@ -0,0 +1,29 @@ +use Modern::Perl; + +return { + bug_number => "23538", + description => "Add new system preferences EmailPatronRegistrations and EmailAddressForPatronRegistrations and new OPAC_REG letter", + up => sub { + my ($args) = @_; + my ($dbh, $out) = @$args{qw(dbh out)}; + + $dbh->do(q{INSERT IGNORE INTO systempreferences (variable,value,options,explanation,type) VALUES ('EmailPatronRegistrations', '0', '0|EmailAddressForPatronRegistrations|BranchEmailAddress|KohaAdminEmailAddress', 'Choose email address that new patron registrations will be sent to: ', 'Choice'), ('EmailAddressForPatronRegistrations', '', '', ' If you choose EmailAddressForPatronRegistrations you have to enter a valid email address: ', 'free') }); + + $dbh->do(q{INSERT IGNORE INTO letter (`module`, `code`, `branchcode`, `name`, `is_html`, `title`, `content`, `message_transport_type`, `lang`) VALUES ( 'members', 'OPAC_REG', '', 'New OPAC self-registration submitted', 1, 'New OPAC self-registration', + '

New OPAC self-registration

+

Self-registration made by

+ +

', 'email', 'default') }); + }, +}; diff --git a/installer/data/mysql/en/mandatory/sample_notices.yml b/installer/data/mysql/en/mandatory/sample_notices.yml index 34ffab80df..fcd76b85f8 100644 --- a/installer/data/mysql/en/mandatory/sample_notices.yml +++ b/installer/data/mysql/en/mandatory/sample_notices.yml @@ -1698,3 +1698,28 @@ tables: - "

This is to confirm that someone enabled two factor authentication on your account.

" - "

If you did not do this, someone else may be using your account. Please contact technical support.

" - "

Your library

" + + - module: members + code: OPAC_REG + branchcode: "" + name: "New OPAC self-registration submitted" + is_html: 1 + title: "New OPAC self-registration" + message_transport_type: email + lang: default + content: + - "

New OPAC self-registration

" + - "

Self-registration made by

" + - "" + - "

" diff --git a/installer/data/mysql/mandatory/sysprefs.sql b/installer/data/mysql/mandatory/sysprefs.sql index 242de0d463..6ca4166507 100644 --- a/installer/data/mysql/mandatory/sysprefs.sql +++ b/installer/data/mysql/mandatory/sysprefs.sql @@ -200,9 +200,11 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('ElasticsearchIndexStatus_biblios', '0', 'Biblios index status', NULL, NULL), ('ElasticsearchMARCFormat', 'ISO2709', 'ISO2709|ARRAY', 'Elasticsearch MARC format. ISO2709 format is recommended as it is faster and takes less space, whereas array is searchable.', 'Choice'), ('ElasticsearchCrossFields', '1', '', 'Enable "cross_fields" option for searches using Elastic search.', 'YesNo'), +('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'), ('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'), ('EmailPurchaseSuggestions','0','0|EmailAddressForSuggestions|BranchEmailAddress|KohaAdminEmailAddress','Choose email address that new purchase suggestions will be sent to: ','Choice'), ('EnableAdvancedCatalogingEditor','0','','Enable the Rancor advanced cataloging editor','YesNo'), ('EnableBorrowerFiles','0',NULL,'If enabled, allows librarians to upload and attach arbitrary files to a borrower record.','YesNo'), diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref index 555febc918..bedfb44083 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref @@ -856,6 +856,19 @@ OPAC: 1: Allow 0: "Don't allow" - patrons to notify the library of changes to their contact information from the OPAC. + - + - "Choose email address that new patron self-registrations will be sent to: " + - pref: EmailPatronRegistrations + default: 0 + choices: + 0: none + EmailAddressForPatronRegistrations: EmailAddressForPatronRegistrations + BranchEmailAddress: email address of branch + KohaAdminEmailAddress: KohaAdminEmailAddress + - 'If you chooose EmailAddressForPatronRegistrations you have to enter a valid email address: ' + - + - pref: EmailAddressForPatronRegistrations + class: email Advanced search options: - -- 2.20.1