@@ -, +, @@ --- C4/UsageStats.pm | 2 +- installer/data/mysql/atomicupdate/bug_30237.pl | 7 ++++++- installer/data/mysql/mandatory/sysprefs.sql | 2 +- .../prog/en/modules/admin/preferences/patrons.pref | 4 ++-- members/memberentry.pl | 4 ++-- opac/opac-memberentry.pl | 4 ++-- opac/opac-registration-verify.pl | 4 ++-- t/db_dependent/Context.t | 6 +++--- 8 files changed, 19 insertions(+), 14 deletions(-) --- a/C4/UsageStats.pm +++ a/C4/UsageStats.pm @@ -324,7 +324,7 @@ sub _shared_preferences { TrackClicks PatronSelfRegistration OPACShelfBrowser - AutoEmailOpacUser + AutoEmailNewUser AutoEmailPrimaryAddress autoMemberNum BorrowerRenewalPeriodBase --- a/installer/data/mysql/atomicupdate/bug_30237.pl +++ a/installer/data/mysql/atomicupdate/bug_30237.pl @@ -8,6 +8,11 @@ return { my ($dbh, $out) = @$args{qw(dbh out)}; # Add WELCOME notice $dbh->do( q{ - INSERT IGNORE INTO letter (module, code, name, is_html, title, content, message_transport_type) VALUES ('members', 'WELCOME', 'Welcome notice', 1, '[% USE Koha %]Welcome to [% Koha.Preference('LibraryName') %]', "[% USE Koha %]\r\nHello [% borrower.title %] [% borrower.firstname %] [% borrower.surname %].\r\n\r\nThankyou for joining [% Koha.Preference('LibraryName') %]\r\n\r\nThe library's catalog can be found here.\r\n\r\nYour library card number is [% borrower.cardnumber %]\r\n\r\nIf you have any problems or questions regarding your account, please contact your Koha Administrator.", 'email');}); + INSERT IGNORE INTO letter (module, code, name, is_html, title, content, message_transport_type) VALUES ('members', 'WELCOME', 'Welcome notice', 1, "[% USE Koha %]Welcome to [% Koha.Preference('LibraryName') %]", "[% USE Koha %]\r\nHello [% borrower.title %] [% borrower.firstname %] [% borrower.surname %].\r\n\r\nThankyou for joining [% Koha.Preference('LibraryName') %]\r\n\r\nThe library's catalog can be found here.\r\n\r\nYour library card number is [% borrower.cardnumber %]\r\n\r\nIf you have any problems or questions regarding your account, please contact your Koha Administrator.", 'email');}); + + # Update system preference + $dbh->do( q{ + UPDATE systempreferences SET variable = 'AutoEmailNewUser', explanation = 'Send an email to newly created patrons.' WHERE variable = 'AutoEmailOpacUser' + }); }, }; --- a/installer/data/mysql/mandatory/sysprefs.sql +++ a/installer/data/mysql/mandatory/sysprefs.sql @@ -74,7 +74,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('autoBarcode','OFF','incremental|annual|hbyymmincr|EAN13|OFF','Used to autogenerate a barcode: incremental will be of the form 1, 2, 3; annual of the form 2007-0001, 2007-0002; hbyymmincr of the form HB08010001 where HB=Home Branch','Choice'), ('AutoCreateAuthorities','0',NULL,'Automatically create authorities that do not exist when cataloging records.','YesNo'), ('AutoCreditNumber', '', '', 'Automatically generate a number for account credits', 'Choice'), -('AutoEmailOpacUser','0',NULL,'Sends notification emails containing new account details to patrons - when account is created.','YesNo'), +('AutoEmailNewUser','0',NULL,'Send an email to newly created patrons.','YesNo'), ('AutoEmailPrimaryAddress','OFF','email|emailpro|B_email|cardnumber|OFF','Defines the default email address where \'Account Details\' emails are sent.','Choice'), ('AutoShareWithMana','subscription','','defines datas automatically shared with mana','multiple'), ('AutoLocation','0',NULL,'If ON, IP authentication is enabled, blocking access to the staff interface from unauthorized IP addresses','YesNo'), --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref @@ -143,11 +143,11 @@ Patrons: - "patron messaging setting on the OPAC." - '
NOTE: EnhancedMessagingPreferences must be enabled.' - - - pref: AutoEmailOpacUser + - pref: AutoEmailNewUser choices: 1: Send 0: "Don't send" - - an email to newly created patrons with their account details. + - an email to newly created patrons. - - pref: UseEmailReceipts choices: --- a/members/memberentry.pl +++ a/members/memberentry.pl @@ -459,8 +459,8 @@ if ((!$nok) and $nodouble and ($op eq 'insert' or $op eq 'save')){ delete $newdata{password}; } - # If 'AutoEmailOpacUser' syspref is on, email user their account details from the 'notice' that matches the user's branchcode. - if ( C4::Context->preference("AutoEmailOpacUser") ) { + # If 'AutoEmailNewUser' syspref is on, email user their account details from the 'notice' that matches the user's branchcode. + if ( C4::Context->preference("AutoEmailNewUser") ) { #look for defined primary email address, if blank - attempt to use borr.email and borr.emailpro instead my $emailaddr = $patron->notice_email_address; # if we manage to find a valid email address, send notice --- a/opac/opac-memberentry.pl +++ a/opac/opac-memberentry.pl @@ -244,8 +244,8 @@ if ( $action eq 'create' ) { $template->param( password_cleartext => $patron->plain_text_password ); $template->param( borrower => $patron->unblessed ); - # If 'AutoEmailOpacUser' syspref is on, email user their account details from the 'notice' that matches the user's branchcode. - if ( C4::Context->preference("AutoEmailOpacUser") ) { + # If 'AutoEmailNewUser' syspref is on, email user their account details from the 'notice' that matches the user's branchcode. + if ( C4::Context->preference("AutoEmailNewUser") ) { #look for defined primary email address, if blank - attempt to use borr.email and borr.emailpro instead my $emailaddr = $patron->notice_email_address; # if we manage to find a valid email address, send notice --- a/opac/opac-registration-verify.pl +++ a/opac/opac-registration-verify.pl @@ -85,8 +85,8 @@ if ( $template->param( password_cleartext => $patron->plain_text_password ); $template->param( borrower => $patron ); - # If 'AutoEmailOpacUser' syspref is on, email user their account details from the 'notice' that matches the user's branchcode. - if ( C4::Context->preference("AutoEmailOpacUser") ) { + # If 'AutoEmailNewUser' syspref is on, email user their account details from the 'notice' that matches the user's branchcode. + if ( C4::Context->preference("AutoEmailNewUser") ) { # Look up correct email address taking AutoEmailPrimaryAddress into account my $emailaddr = $patron->notice_email_address; # if we manage to find a valid email address, send notice --- a/t/db_dependent/Context.t +++ a/t/db_dependent/Context.t @@ -126,9 +126,9 @@ is($oConnection->option('async'), 1, "ZOOM connection is asynchronous"); $silly_preference->delete(); -# AutoEmailOpacUser should be a YesNo pref -C4::Context->set_preference('AutoEmailOpacUser', ''); -my $yesno_pref = Koha::Config::SysPrefs->find('AutoEmailOpacUser'); +# AutoEmailNewUser should be a YesNo pref +C4::Context->set_preference('AutoEmailNewUser', ''); +my $yesno_pref = Koha::Config::SysPrefs->find('AutoEmailNewUser'); is( $yesno_pref->value(), 0, 'set_preference should have set the value to 0, instead of an empty string' ); done_testing(); --