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/installer/data/mysql/mandatory/sysprefs.sql (-1 / +1 lines)
Lines 209-217 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
209
('ElasticsearchIndexStatus_biblios', '0', 'Biblios index status', NULL, NULL),
209
('ElasticsearchIndexStatus_biblios', '0', 'Biblios index status', NULL, NULL),
210
('ElasticsearchMARCFormat', 'ISO2709', 'ISO2709|ARRAY', 'Elasticsearch MARC format. ISO2709 format is recommended as it is faster and takes less space, whereas array is searchable.', 'Choice'),
210
('ElasticsearchMARCFormat', 'ISO2709', 'ISO2709|ARRAY', 'Elasticsearch MARC format. ISO2709 format is recommended as it is faster and takes less space, whereas array is searchable.', 'Choice'),
211
('ElasticsearchCrossFields', '1', '', 'Enable "cross_fields" option for searches using Elastic search.', 'YesNo'),
211
('ElasticsearchCrossFields', '1', '', 'Enable "cross_fields" option for searches using Elastic search.', 'YesNo'),
212
('EmailFieldPrimary','OFF','email|emailpro|B_email|cardnumber|OFF','Defines the default email address field where patron email notices are sent.','Choice'),
213
('EmailAddressForPatronRegistrations', '', '', ' If you choose EmailAddressForPatronRegistrations you have to enter a valid email address: ', 'free'),
212
('EmailAddressForPatronRegistrations', '', '', ' If you choose EmailAddressForPatronRegistrations you have to enter a valid email address: ', 'free'),
214
('EmailAddressForSuggestions','','',' If you choose EmailAddressForSuggestions you have to enter a valid email address: ','free'),
213
('EmailAddressForSuggestions','','',' If you choose EmailAddressForSuggestions you have to enter a valid email address: ','free'),
214
('EmailFieldPrimary','OFF','email|emailpro|B_email|cardnumber|OFF','Defines the default email address field where patron email notices are sent.','Choice'),
215
('emailLibrarianWhenHoldIsPlaced','0',NULL,'If ON, emails the librarian whenever a hold is placed','YesNo'),
215
('emailLibrarianWhenHoldIsPlaced','0',NULL,'If ON, emails the librarian whenever a hold is placed','YesNo'),
216
('EmailOverduesNoEmail','1',NULL,'Send send overdues of patrons without email address to staff','YesNo'),
216
('EmailOverduesNoEmail','1',NULL,'Send send overdues of patrons without email address to staff','YesNo'),
217
('EmailPatronRegistrations', '0', '0|EmailAddressForPatronRegistrations|BranchEmailAddress|KohaAdminEmailAddress', 'Choose email address that new patron registrations will be sent to: ', 'Choice'),
217
('EmailPatronRegistrations', '0', '0|EmailAddressForPatronRegistrations|BranchEmailAddress|KohaAdminEmailAddress', 'Choose email address that new patron registrations will be sent to: ', 'Choice'),
(-)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 95-101 if ( Link Here
95
95
96
        # If 'AutoEmailNewUser' syspref is on, email user their account details from the 'notice' that matches the user's branchcode.
96
        # If 'AutoEmailNewUser' syspref is on, email user their account details from the 'notice' that matches the user's branchcode.
97
        if ( C4::Context->preference("AutoEmailNewUser") ) {
97
        if ( C4::Context->preference("AutoEmailNewUser") ) {
98
            # Look up correct email address taking AutoEmailPrimaryAddress into account
98
            # Look up correct email address taking EmailFieldPrimary into account
99
            my $emailaddr = $patron->notice_email_address;
99
            my $emailaddr = $patron->notice_email_address;
100
            # if we manage to find a valid email address, send notice
100
            # if we manage to find a valid email address, send notice
101
            if ($emailaddr) {
101
            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 2176-2182 subtest 'queue_notice' => sub { Link Here
2176
    plan tests => 11;
2176
    plan tests => 11;
2177
2177
2178
    my $dbh = C4::Context->dbh;
2178
    my $dbh = C4::Context->dbh;
2179
    t::lib::Mocks::mock_preference( 'AutoEmailPrimaryAddress', 'email' );
2179
    t::lib::Mocks::mock_preference( 'EmailFieldPrimary', 'email' );
2180
    my $patron = $builder->build_object( { class => 'Koha::Patrons' } );
2180
    my $patron = $builder->build_object( { class => 'Koha::Patrons' } );
2181
    my $branch = $builder->build_object( { class => 'Koha::Libraries' } );
2181
    my $branch = $builder->build_object( { class => 'Koha::Libraries' } );
2182
    my $letter_e = $builder->build_object( {
2182
    my $letter_e = $builder->build_object( {
2183
- 

Return to bug 33192