Bug 3150: DBRev 22.12.00.015
[koha.git] / installer / data / mysql / db_revs / 220600054.pl
1 use Modern::Perl;
2
3 return {
4     bug_number => "23538",
5     description => "Add new system preferences EmailPatronRegistrations and EmailAddressForPatronRegistrations and new OPAC_REG letter",
6     up => sub {
7         my ($args) = @_;
8         my ($dbh, $out) = @$args{qw(dbh out)};
9
10         $dbh->do(q{INSERT IGNORE INTO systempreferences (variable,value,options,explanation,type) VALUES ('EmailPatronRegistrations', '0', '0|EmailAddressForPatronRegistrations|BranchEmailAddress|KohaAdminEmailAddress', 'Choose email address that new patron registrations will be sent to: ', 'Choice'), ('EmailAddressForPatronRegistrations', '', '', ' If you choose EmailAddressForPatronRegistrations you have to enter a valid email address: ', 'free') });
11         say $out "Added new system preference 'EmailPatronRegistrations'";
12
13         $dbh->do(q{INSERT IGNORE INTO letter (`module`, `code`, `branchcode`, `name`, `is_html`, `title`, `content`, `message_transport_type`, `lang`) VALUES ( 'members', 'OPAC_REG', '', 'New OPAC self-registration submitted', 1, 'New OPAC self-registration',
14             '<h3>New OPAC self-registration</h3>
15             <p><h4>Self-registration made:</h4>
16             <ul>
17             <li>[% borrower.firstname %] [% borrower.surname %]</li>
18             [% IF borrower.cardnumber %]<li>Cardnumber: [% borrower.cardnumber %]</li>[% END %]
19             [% IF borrower.email %]<li>Email: [% borrower.email %]</li>[% END %]
20             [% IF borrower.phone %]<li>Phone: [% borrower.phone %]</li>[% END %]
21             [% IF borrower.mobile %]<li>Mobile: [% borrower.mobile %]</li>[% END %]
22             [% IF borrower.fax %]<li>Fax: [% borrower.fax %]</li>[% END %]
23             [% IF borrower.emailpro %]<li>Secondary email: [% borrower.emailpro %]</li>[% END %]
24             [% IF borrower.phonepro %]<li>Secondary phone:[% borrower.phonepro %]</li>[% END %]
25             [% IF borrower.branchcode %]<li>Home library: [% borrower.branchcode %]</li>[% END %]
26             [% IF borrower.categorycode %]<li>Patron category: [% borrower.categorycode %]</li>[% END %]
27             </ul>
28             </p>', 'email', 'default') });
29
30         say $out "Added new letter 'OPAC_REG' (email)";
31     },
32 };