View | Details | Raw Unified | Return to bug 30237
Collapse All | Expand All

(-)a/C4/UsageStats.pm (-1 / +1 lines)
Lines 324-330 sub _shared_preferences { Link Here
324
        TrackClicks
324
        TrackClicks
325
        PatronSelfRegistration
325
        PatronSelfRegistration
326
        OPACShelfBrowser
326
        OPACShelfBrowser
327
        AutoEmailOpacUser
327
        AutoEmailNewUser
328
        AutoEmailPrimaryAddress
328
        AutoEmailPrimaryAddress
329
        autoMemberNum
329
        autoMemberNum
330
        BorrowerRenewalPeriodBase
330
        BorrowerRenewalPeriodBase
(-)a/installer/data/mysql/atomicupdate/bug_30237.pl (-1 / +6 lines)
Lines 8-13 return { Link Here
8
        my ($dbh, $out) = @$args{qw(dbh out)};
8
        my ($dbh, $out) = @$args{qw(dbh out)};
9
        # Add WELCOME notice
9
        # Add WELCOME notice
10
        $dbh->do( q{
10
        $dbh->do( q{
11
            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 <a href='[% Koha.Preference('OPACBaseURL') %]'>here</a>.\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');});
11
            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 <a href='[% Koha.Preference('OPACBaseURL') %]'>here</a>.\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');});
12
13
        # Update system preference
14
        $dbh->do( q{
15
            UPDATE systempreferences SET variable = 'AutoEmailNewUser', explanation = 'Send an email to newly created patrons.' WHERE variable = 'AutoEmailOpacUser'
16
        });
12
    },
17
    },
13
};
18
};
(-)a/installer/data/mysql/mandatory/sysprefs.sql (-1 / +1 lines)
Lines 73-79 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
73
('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'),
73
('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'),
74
('AutoCreateAuthorities','0',NULL,'Automatically create authorities that do not exist when cataloging records.','YesNo'),
74
('AutoCreateAuthorities','0',NULL,'Automatically create authorities that do not exist when cataloging records.','YesNo'),
75
('AutoCreditNumber', '', '', 'Automatically generate a number for account credits', 'Choice'),
75
('AutoCreditNumber', '', '', 'Automatically generate a number for account credits', 'Choice'),
76
('AutoEmailOpacUser','0',NULL,'Sends notification emails containing new account details to patrons - when account is created.','YesNo'),
76
('AutoEmailNewUser','0',NULL,'Send an email to newly created patrons.','YesNo'),
77
('AutoEmailPrimaryAddress','OFF','email|emailpro|B_email|cardnumber|OFF','Defines the default email address where \'Account Details\' emails are sent.','Choice'),
77
('AutoEmailPrimaryAddress','OFF','email|emailpro|B_email|cardnumber|OFF','Defines the default email address where \'Account Details\' emails are sent.','Choice'),
78
('AutoShareWithMana','subscription','','defines datas automatically shared with mana','multiple'),
78
('AutoShareWithMana','subscription','','defines datas automatically shared with mana','multiple'),
79
('AutoLocation','0',NULL,'If ON, IP authentication is enabled, blocking access to the staff interface from unauthorized IP addresses','YesNo'),
79
('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 (-2 / +2 lines)
Lines 143-153 Patrons: Link Here
143
         - "patron messaging setting on the OPAC."
143
         - "patron messaging setting on the OPAC."
144
         - '<br><strong>NOTE:</strong> <a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=EnhancedMessagingPreferences">EnhancedMessagingPreferences</a> must be enabled.'
144
         - '<br><strong>NOTE:</strong> <a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=EnhancedMessagingPreferences">EnhancedMessagingPreferences</a> must be enabled.'
145
     -
145
     -
146
         - pref: AutoEmailOpacUser
146
         - pref: AutoEmailNewUser
147
           choices:
147
           choices:
148
               1: Send
148
               1: Send
149
               0: "Don't send"
149
               0: "Don't send"
150
         - an email to newly created patrons with their account details.
150
         - an email to newly created patrons.
151
     -
151
     -
152
         - pref: UseEmailReceipts
152
         - pref: UseEmailReceipts
153
           choices:
153
           choices:
(-)a/members/memberentry.pl (-2 / +2 lines)
Lines 459-466 if ((!$nok) and $nodouble and ($op eq 'insert' or $op eq 'save')){ Link Here
459
            delete $newdata{password};
459
            delete $newdata{password};
460
        }
460
        }
461
461
462
        # If 'AutoEmailOpacUser' syspref is on, email user their account details from the 'notice' that matches the user's branchcode.
462
        # If 'AutoEmailNewUser' syspref is on, email user their account details from the 'notice' that matches the user's branchcode.
463
        if ( C4::Context->preference("AutoEmailOpacUser") ) {
463
        if ( C4::Context->preference("AutoEmailNewUser") ) {
464
            #look for defined primary email address, if blank - attempt to use borr.email and borr.emailpro instead
464
            #look for defined primary email address, if blank - attempt to use borr.email and borr.emailpro instead
465
            my $emailaddr = $patron->notice_email_address;
465
            my $emailaddr = $patron->notice_email_address;
466
            # if we manage to find a valid email address, send notice 
466
            # if we manage to find a valid email address, send notice 
(-)a/opac/opac-memberentry.pl (-2 / +2 lines)
Lines 243-250 if ( $action eq 'create' ) { Link Here
243
                $template->param( password_cleartext => $patron->plain_text_password );
243
                $template->param( password_cleartext => $patron->plain_text_password );
244
                $template->param( borrower => $patron->unblessed );
244
                $template->param( borrower => $patron->unblessed );
245
245
246
                # If 'AutoEmailOpacUser' syspref is on, email user their account details from the 'notice' that matches the user's branchcode.
246
                # If 'AutoEmailNewUser' syspref is on, email user their account details from the 'notice' that matches the user's branchcode.
247
                if ( C4::Context->preference("AutoEmailOpacUser") ) {
247
                if ( C4::Context->preference("AutoEmailNewUser") ) {
248
                    #look for defined primary email address, if blank - attempt to use borr.email and borr.emailpro instead
248
                    #look for defined primary email address, if blank - attempt to use borr.email and borr.emailpro instead
249
                    my $emailaddr = $patron->notice_email_address;
249
                    my $emailaddr = $patron->notice_email_address;
250
                    # if we manage to find a valid email address, send notice
250
                    # if we manage to find a valid email address, send notice
(-)a/opac/opac-registration-verify.pl (-2 / +2 lines)
Lines 78-85 if ( Link Here
78
        $template->param( password_cleartext => $patron->plain_text_password );
78
        $template->param( password_cleartext => $patron->plain_text_password );
79
        $template->param( borrower => $patron );
79
        $template->param( borrower => $patron );
80
80
81
        # If 'AutoEmailOpacUser' syspref is on, email user their account details from the 'notice' that matches the user's branchcode.
81
        # If 'AutoEmailNewUser' syspref is on, email user their account details from the 'notice' that matches the user's branchcode.
82
        if ( C4::Context->preference("AutoEmailOpacUser") ) {
82
        if ( C4::Context->preference("AutoEmailNewUser") ) {
83
            # Look up correct email address taking AutoEmailPrimaryAddress into account
83
            # Look up correct email address taking AutoEmailPrimaryAddress into account
84
            my $emailaddr = $patron->notice_email_address;
84
            my $emailaddr = $patron->notice_email_address;
85
            # if we manage to find a valid email address, send notice
85
            # if we manage to find a valid email address, send notice
(-)a/t/db_dependent/Context.t (-4 / +3 lines)
Lines 126-134 is($oConnection->option('async'), 1, "ZOOM connection is asynchronous"); Link Here
126
126
127
$silly_preference->delete();
127
$silly_preference->delete();
128
128
129
# AutoEmailOpacUser should be a YesNo pref
129
# AutoEmailNewUser should be a YesNo pref
130
C4::Context->set_preference('AutoEmailOpacUser', '');
130
C4::Context->set_preference('AutoEmailNewUser', '');
131
my $yesno_pref = Koha::Config::SysPrefs->find('AutoEmailOpacUser');
131
my $yesno_pref = Koha::Config::SysPrefs->find('AutoEmailNewUser');
132
is( $yesno_pref->value(), 0, 'set_preference should have set the value to 0, instead of an empty string' );
132
is( $yesno_pref->value(), 0, 'set_preference should have set the value to 0, instead of an empty string' );
133
133
134
done_testing();
134
done_testing();
135
- 

Return to bug 30237