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

(-)a/C4/UsageStats.pm (-1 / +1 lines)
Lines 326-332 sub _shared_preferences { Link Here
326
        PatronSelfRegistration
326
        PatronSelfRegistration
327
        OPACShelfBrowser
327
        OPACShelfBrowser
328
        AutoEmailNewUser
328
        AutoEmailNewUser
329
        AutoEmailPrimaryAddress
329
        EmailFieldPrimary
330
        autoMemberNum
330
        autoMemberNum
331
        BorrowerRenewalPeriodBase
331
        BorrowerRenewalPeriodBase
332
        EnableBorrowerFiles
332
        EnableBorrowerFiles
(-)a/Koha/Patron.pm (-1 / +1 lines)
Lines 1400-1406 Returns the empty string if no email address. Link Here
1400
sub notice_email_address{
1400
sub notice_email_address{
1401
    my ( $self ) = @_;
1401
    my ( $self ) = @_;
1402
1402
1403
    my $which_address = C4::Context->preference("AutoEmailPrimaryAddress");
1403
    my $which_address = C4::Context->preference("EmailFieldPrimary");
1404
    # if syspref is set to 'first valid' (value == OFF), look up email address
1404
    # if syspref is set to 'first valid' (value == OFF), look up email address
1405
    if ( $which_address eq 'OFF' ) {
1405
    if ( $which_address eq 'OFF' ) {
1406
        return $self->first_valid_email_address;
1406
        return $self->first_valid_email_address;
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref (-1 / +1 lines)
Lines 174-180 Patrons: Link Here
174
         - email receipts to patrons for payments and writeoffs.
174
         - email receipts to patrons for payments and writeoffs.
175
     -
175
     -
176
         - "Use"
176
         - "Use"
177
         - pref: AutoEmailPrimaryAddress
177
         - pref: EmailFieldPrimary
178
           default: "OFF"
178
           default: "OFF"
179
           choices:
179
           choices:
180
               email: home
180
               email: home
(-)a/opac/opac-registration-verify.pl (-1 / +1 lines)
Lines 87-93 if ( Link Here
87
87
88
        # If 'AutoEmailNewUser' syspref is on, email user their account details from the 'notice' that matches the user's branchcode.
88
        # If 'AutoEmailNewUser' syspref is on, email user their account details from the 'notice' that matches the user's branchcode.
89
        if ( C4::Context->preference("AutoEmailNewUser") ) {
89
        if ( C4::Context->preference("AutoEmailNewUser") ) {
90
            # Look up correct email address taking AutoEmailPrimaryAddress into account
90
            # Look up correct email address taking EmailFieldPrimary into account
91
            my $emailaddr = $patron->notice_email_address;
91
            my $emailaddr = $patron->notice_email_address;
92
            # if we manage to find a valid email address, send notice
92
            # if we manage to find a valid email address, send notice
93
            if ($emailaddr) {
93
            if ($emailaddr) {
(-)a/t/Auth_with_shibboleth.t (-1 / +1 lines)
Lines 419-425 sub mockedPref { Link Here
419
        $return = $staffClientBaseURL;
419
        $return = $staffClientBaseURL;
420
    }
420
    }
421
421
422
    if ( $param eq 'AutoEmailPrimaryAddress' ) {
422
    if ( $param eq 'EmailFieldPrimary' ) {
423
        $return = 'OFF';
423
        $return = 'OFF';
424
    }
424
    }
425
425
(-)a/t/db_dependent/Koha/Patrons.t (-6 / +5 lines)
Lines 1066-1076 subtest 'notice_email_address' => sub { Link Here
1066
1066
1067
    my $patron = $builder->build_object({ class => 'Koha::Patrons' });
1067
    my $patron = $builder->build_object({ class => 'Koha::Patrons' });
1068
1068
1069
    t::lib::Mocks::mock_preference( 'AutoEmailPrimaryAddress', 'OFF' );
1069
    t::lib::Mocks::mock_preference( 'EmailFieldPrimary', 'OFF' );
1070
    is ($patron->notice_email_address, $patron->email, "Koha::Patron->notice_email_address returns correct value when AutoEmailPrimaryAddress is off");
1070
    is ($patron->notice_email_address, $patron->email, "Koha::Patron->notice_email_address returns correct value when EmailFieldPrimary is off");
1071
1071
1072
    t::lib::Mocks::mock_preference( 'AutoEmailPrimaryAddress', 'emailpro' );
1072
    t::lib::Mocks::mock_preference( 'EmailFieldPrimary', 'emailpro' );
1073
    is ($patron->notice_email_address, $patron->emailpro, "Koha::Patron->notice_email_address returns correct value when AutoEmailPrimaryAddress is emailpro");
1073
    is ($patron->notice_email_address, $patron->emailpro, "Koha::Patron->notice_email_address returns correct value when EmailFieldPrimary is emailpro");
1074
1074
1075
    $patron->delete;
1075
    $patron->delete;
1076
};
1076
};
Lines 2230-2236 subtest 'queue_notice' => sub { Link Here
2230
    plan tests => 11;
2230
    plan tests => 11;
2231
2231
2232
    my $dbh = C4::Context->dbh;
2232
    my $dbh = C4::Context->dbh;
2233
    t::lib::Mocks::mock_preference( 'AutoEmailPrimaryAddress', 'email' );
2233
    t::lib::Mocks::mock_preference( 'EmailFieldPrimary', 'email' );
2234
    my $patron = $builder->build_object( { class => 'Koha::Patrons' } );
2234
    my $patron = $builder->build_object( { class => 'Koha::Patrons' } );
2235
    my $branch = $builder->build_object( { class => 'Koha::Libraries' } );
2235
    my $branch = $builder->build_object( { class => 'Koha::Libraries' } );
2236
    my $letter_e = $builder->build_object( {
2236
    my $letter_e = $builder->build_object( {
2237
- 

Return to bug 33192