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

(-)a/installer/data/mysql/atomicupdate/bug_37757.pl (+20 lines)
Line 0 Link Here
1
use Modern::Perl;
2
use Koha::Installer::Output qw(say_warning say_failure say_success say_info);
3
4
return {
5
    bug_number  => "37757",
6
    description => "More robust handling of EmailFieldPrimary syspref values",
7
    up          => sub {
8
        my ($args) = @_;
9
        my ( $dbh, $out ) = @$args{qw(dbh out)};
10
11
        $dbh->do(
12
            q{
13
            UPDATE systempreferences
14
            SET value=IF(value='OFF','',value),
15
                options='|email|emailpro|B_email|cardnumber|MULTI'
16
            WHERE variable='EmailFieldPrimary';
17
        }
18
        ) == 1 && say_success( $out, "Updated system preference 'EmailFieldPrimary'" );
19
    },
20
};
(-)a/installer/data/mysql/mandatory/sysprefs.sql (-1 / +1 lines)
Lines 234-240 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
234
('EmailAddressForPatronRegistrations', '', '', ' If you choose EmailAddressForPatronRegistrations you have to enter a valid email address: ', 'free'),
234
('EmailAddressForPatronRegistrations', '', '', ' If you choose EmailAddressForPatronRegistrations you have to enter a valid email address: ', 'free'),
235
('EmailAddressForSuggestions','','',' If you choose EmailAddressForSuggestions you have to enter a valid email address: ','free'),
235
('EmailAddressForSuggestions','','',' If you choose EmailAddressForSuggestions you have to enter a valid email address: ','free'),
236
('EmailFieldPrecedence','email|emailpro|B_email','','Ordered list of patron email fields to use when AutoEmailPrimaryAddress is set to first valid','multiple'),
236
('EmailFieldPrecedence','email|emailpro|B_email','','Ordered list of patron email fields to use when AutoEmailPrimaryAddress is set to first valid','multiple'),
237
('EmailFieldPrimary','OFF','email|emailpro|B_email|cardnumber|OFF|MULTI','Defines the default email address field where patron email notices are sent.','Choice'),
237
('EmailFieldPrimary','','|email|emailpro|B_email|cardnumber|MULTI','Defines the default email address field where patron email notices are sent.','Choice'),
238
('EmailFieldSelection','','email|emailpro|B_email','Selection list of patron email fields to use whern AutoEmailPrimaryAddress is set to selected addresses','multiple'),
238
('EmailFieldSelection','','email|emailpro|B_email','Selection list of patron email fields to use whern AutoEmailPrimaryAddress is set to selected addresses','multiple'),
239
('emailLibrarianWhenHoldIsPlaced','0',NULL,'If ON, emails the librarian whenever a hold is placed','YesNo'),
239
('emailLibrarianWhenHoldIsPlaced','0',NULL,'If ON, emails the librarian whenever a hold is placed','YesNo'),
240
('EmailOverduesNoEmail','1',NULL,'Send send overdues of patrons without email address to staff','YesNo'),
240
('EmailOverduesNoEmail','1',NULL,'Send send overdues of patrons without email address to staff','YesNo'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref (-3 / +2 lines)
Lines 193-205 Patrons: Link Here
193
     -
193
     -
194
         - "Use the patron's"
194
         - "Use the patron's"
195
         - pref: EmailFieldPrimary
195
         - pref: EmailFieldPrimary
196
           default: "OFF"
196
           default: ""
197
           choices:
197
           choices:
198
               email: primary email
198
               email: primary email
199
               emailpro: secondary email
199
               emailpro: secondary email
200
               B_email: alternate email
200
               B_email: alternate email
201
               cardnumber: card number
201
               cardnumber: card number
202
               "OFF": first valid email address
202
               "": first valid email address
203
               "MULTI": selected addresses
203
               "MULTI": selected addresses
204
         - 'for sending out email notices.'
204
         - 'for sending out email notices.'
205
         - '<br><strong>NOTE:</strong> If set to "first valid", the order in which the email addresses are checked is set in <a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=EmailFieldPrecedence">EmailFieldPrecedence</a>.'
205
         - '<br><strong>NOTE:</strong> If set to "first valid", the order in which the email addresses are checked is set in <a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=EmailFieldPrecedence">EmailFieldPrecedence</a>.'
206
- 

Return to bug 37757