|
Lines 5717-5826
if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
Link Here
|
| 5717 |
SetVersion($DBversion); |
5717 |
SetVersion($DBversion); |
| 5718 |
} |
5718 |
} |
| 5719 |
|
5719 |
|
| 5720 |
$DBversion = '3.09.00.XXX'; |
|
|
| 5721 |
if (C4::Context->preference("Version") < TransformToNum($DBversion)) { |
| 5722 |
$dbh->do(" |
| 5723 |
CREATE TABLE IF NOT EXISTS `borrower_modifications` ( |
| 5724 |
`timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, |
| 5725 |
`verification_token` varchar(255) NOT NULL DEFAULT '', |
| 5726 |
`borrowernumber` int(11) NOT NULL DEFAULT '0', |
| 5727 |
`cardnumber` varchar(16) DEFAULT NULL, |
| 5728 |
`surname` mediumtext, |
| 5729 |
`firstname` text, |
| 5730 |
`title` mediumtext, |
| 5731 |
`othernames` mediumtext, |
| 5732 |
`initials` text, |
| 5733 |
`streetnumber` varchar(10) DEFAULT NULL, |
| 5734 |
`streettype` varchar(50) DEFAULT NULL, |
| 5735 |
`address` mediumtext, |
| 5736 |
`address2` text, |
| 5737 |
`city` mediumtext, |
| 5738 |
`state` text, |
| 5739 |
`zipcode` varchar(25) DEFAULT NULL, |
| 5740 |
`country` text, |
| 5741 |
`email` mediumtext, |
| 5742 |
`phone` text, |
| 5743 |
`mobile` varchar(50) DEFAULT NULL, |
| 5744 |
`fax` mediumtext, |
| 5745 |
`emailpro` text, |
| 5746 |
`phonepro` text, |
| 5747 |
`B_streetnumber` varchar(10) DEFAULT NULL, |
| 5748 |
`B_streettype` varchar(50) DEFAULT NULL, |
| 5749 |
`B_address` varchar(100) DEFAULT NULL, |
| 5750 |
`B_address2` text, |
| 5751 |
`B_city` mediumtext, |
| 5752 |
`B_state` text, |
| 5753 |
`B_zipcode` varchar(25) DEFAULT NULL, |
| 5754 |
`B_country` text, |
| 5755 |
`B_email` text, |
| 5756 |
`B_phone` mediumtext, |
| 5757 |
`dateofbirth` date DEFAULT NULL, |
| 5758 |
`branchcode` varchar(10) DEFAULT NULL, |
| 5759 |
`categorycode` varchar(10) DEFAULT NULL, |
| 5760 |
`dateenrolled` date DEFAULT NULL, |
| 5761 |
`dateexpiry` date DEFAULT NULL, |
| 5762 |
`gonenoaddress` tinyint(1) DEFAULT NULL, |
| 5763 |
`lost` tinyint(1) DEFAULT NULL, |
| 5764 |
`debarred` date DEFAULT NULL, |
| 5765 |
`debarredcomment` varchar(255) DEFAULT NULL, |
| 5766 |
`contactname` mediumtext, |
| 5767 |
`contactfirstname` text, |
| 5768 |
`contacttitle` text, |
| 5769 |
`guarantorid` int(11) DEFAULT NULL, |
| 5770 |
`borrowernotes` mediumtext, |
| 5771 |
`relationship` varchar(100) DEFAULT NULL, |
| 5772 |
`ethnicity` varchar(50) DEFAULT NULL, |
| 5773 |
`ethnotes` varchar(255) DEFAULT NULL, |
| 5774 |
`sex` varchar(1) DEFAULT NULL, |
| 5775 |
`password` varchar(30) DEFAULT NULL, |
| 5776 |
`flags` int(11) DEFAULT NULL, |
| 5777 |
`userid` varchar(75) DEFAULT NULL, |
| 5778 |
`opacnote` mediumtext, |
| 5779 |
`contactnote` varchar(255) DEFAULT NULL, |
| 5780 |
`sort1` varchar(80) DEFAULT NULL, |
| 5781 |
`sort2` varchar(80) DEFAULT NULL, |
| 5782 |
`altcontactfirstname` varchar(255) DEFAULT NULL, |
| 5783 |
`altcontactsurname` varchar(255) DEFAULT NULL, |
| 5784 |
`altcontactaddress1` varchar(255) DEFAULT NULL, |
| 5785 |
`altcontactaddress2` varchar(255) DEFAULT NULL, |
| 5786 |
`altcontactaddress3` varchar(255) DEFAULT NULL, |
| 5787 |
`altcontactstate` text, |
| 5788 |
`altcontactzipcode` varchar(50) DEFAULT NULL, |
| 5789 |
`altcontactcountry` text, |
| 5790 |
`altcontactphone` varchar(50) DEFAULT NULL, |
| 5791 |
`smsalertnumber` varchar(50) DEFAULT NULL, |
| 5792 |
`privacy` int(11) DEFAULT NULL, |
| 5793 |
PRIMARY KEY (`verification_token`,`borrowernumber`), |
| 5794 |
KEY `verification_token` (`verification_token`), |
| 5795 |
KEY `borrowernumber` (`borrowernumber`) |
| 5796 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8; |
| 5797 |
"); |
| 5798 |
|
| 5799 |
$dbh->do(" |
| 5800 |
INSERT INTO systempreferences (`variable`, `value`, `options`, `explanation`, `type`) VALUES |
| 5801 |
('PatronSelfRegistration', '0', NULL, 'If enabled, patrons will be able to register themselves via the OPAC.', 'YesNo'), |
| 5802 |
('PatronSelfRegistrationVerifyByEmail', '0', NULL, 'If enabled, any patron attempting to register themselves via the OPAC will be required to verify themselves via email to activate his or her account.', 'YesNo'), |
| 5803 |
('PatronSelfRegistrationDefaultCategory', '', '', 'A patron registered via the OPAC will receive a borrower category code set in this system preference.', 'free'), |
| 5804 |
('PatronSelfRegistrationExpireTemporaryAccountsDelay', '0', NULL, 'If PatronSelfRegistrationDefaultCategory is enabled, this system preference controls how long a patron can have a temporary status before the account is deleted automatically. It is an integer value representing a number of days to wait before deleting a temporary patron account. Setting it to 0 disables the deleting of temporary accounts.', 'Integer'), |
| 5805 |
('PatronSelfRegistrationBorrowerMandatoryField', 'surname|firstname', NULL , 'Choose the mandatory fields for a patron''s account, when registering via the OPAC.', 'free'), |
| 5806 |
('PatronSelfRegistrationBorrowerUnwantedField', '', NULL , 'Name the fields you don''t want to display when registering a new patron via the OPAC.', 'free'); |
| 5807 |
"); |
| 5808 |
|
| 5809 |
$dbh->do(" |
| 5810 |
INSERT INTO letter ( `module`, `code`, `branchcode`, `name`, `is_html`, `title`, `content` ) |
| 5811 |
VALUES ( 'members', 'OPAC_REG_VERIFY', '', 'Opac Self-Registration Verification Email', '1', 'Verify Your Account', 'Hello! |
| 5812 |
|
| 5813 |
Your library account has been created. Please verify your email address by clicking this link to complete the signup process: |
| 5814 |
|
| 5815 |
http://<<OPACBaseURL>>/cgi-bin/koha/opac-registration-verify.pl?token=<<borrower_modifications.verification_token>> |
| 5816 |
|
| 5817 |
If you did not initiate this request, you may safely ignore this one-time message. The request will expire shortly.' |
| 5818 |
)"); |
| 5819 |
|
| 5820 |
print "Upgrade to $DBversion done (Add Patron Self Registration)\n"; |
| 5821 |
SetVersion ($DBversion); |
| 5822 |
} |
| 5823 |
|
| 5824 |
$DBversion ="3.09.00.038"; |
5720 |
$DBversion ="3.09.00.038"; |
| 5825 |
if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { |
5721 |
if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { |
| 5826 |
$dbh->do("ALTER TABLE borrower_attributes CHANGE attribute attribute VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL"); |
5722 |
$dbh->do("ALTER TABLE borrower_attributes CHANGE attribute attribute VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL"); |
|
Lines 6285-6290
if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
Link Here
|
| 6285 |
SetVersion ($DBversion); |
6181 |
SetVersion ($DBversion); |
| 6286 |
} |
6182 |
} |
| 6287 |
|
6183 |
|
|
|
6184 |
$DBversion = '3.11.00.XXX'; |
| 6185 |
if (C4::Context->preference("Version") < TransformToNum($DBversion)) { |
| 6186 |
$dbh->do(" |
| 6187 |
CREATE TABLE IF NOT EXISTS `borrower_modifications` ( |
| 6188 |
`timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, |
| 6189 |
`verification_token` varchar(255) NOT NULL DEFAULT '', |
| 6190 |
`borrowernumber` int(11) NOT NULL DEFAULT '0', |
| 6191 |
`cardnumber` varchar(16) DEFAULT NULL, |
| 6192 |
`surname` mediumtext, |
| 6193 |
`firstname` text, |
| 6194 |
`title` mediumtext, |
| 6195 |
`othernames` mediumtext, |
| 6196 |
`initials` text, |
| 6197 |
`streetnumber` varchar(10) DEFAULT NULL, |
| 6198 |
`streettype` varchar(50) DEFAULT NULL, |
| 6199 |
`address` mediumtext, |
| 6200 |
`address2` text, |
| 6201 |
`city` mediumtext, |
| 6202 |
`state` text, |
| 6203 |
`zipcode` varchar(25) DEFAULT NULL, |
| 6204 |
`country` text, |
| 6205 |
`email` mediumtext, |
| 6206 |
`phone` text, |
| 6207 |
`mobile` varchar(50) DEFAULT NULL, |
| 6208 |
`fax` mediumtext, |
| 6209 |
`emailpro` text, |
| 6210 |
`phonepro` text, |
| 6211 |
`B_streetnumber` varchar(10) DEFAULT NULL, |
| 6212 |
`B_streettype` varchar(50) DEFAULT NULL, |
| 6213 |
`B_address` varchar(100) DEFAULT NULL, |
| 6214 |
`B_address2` text, |
| 6215 |
`B_city` mediumtext, |
| 6216 |
`B_state` text, |
| 6217 |
`B_zipcode` varchar(25) DEFAULT NULL, |
| 6218 |
`B_country` text, |
| 6219 |
`B_email` text, |
| 6220 |
`B_phone` mediumtext, |
| 6221 |
`dateofbirth` date DEFAULT NULL, |
| 6222 |
`branchcode` varchar(10) DEFAULT NULL, |
| 6223 |
`categorycode` varchar(10) DEFAULT NULL, |
| 6224 |
`dateenrolled` date DEFAULT NULL, |
| 6225 |
`dateexpiry` date DEFAULT NULL, |
| 6226 |
`gonenoaddress` tinyint(1) DEFAULT NULL, |
| 6227 |
`lost` tinyint(1) DEFAULT NULL, |
| 6228 |
`debarred` date DEFAULT NULL, |
| 6229 |
`debarredcomment` varchar(255) DEFAULT NULL, |
| 6230 |
`contactname` mediumtext, |
| 6231 |
`contactfirstname` text, |
| 6232 |
`contacttitle` text, |
| 6233 |
`guarantorid` int(11) DEFAULT NULL, |
| 6234 |
`borrowernotes` mediumtext, |
| 6235 |
`relationship` varchar(100) DEFAULT NULL, |
| 6236 |
`ethnicity` varchar(50) DEFAULT NULL, |
| 6237 |
`ethnotes` varchar(255) DEFAULT NULL, |
| 6238 |
`sex` varchar(1) DEFAULT NULL, |
| 6239 |
`password` varchar(30) DEFAULT NULL, |
| 6240 |
`flags` int(11) DEFAULT NULL, |
| 6241 |
`userid` varchar(75) DEFAULT NULL, |
| 6242 |
`opacnote` mediumtext, |
| 6243 |
`contactnote` varchar(255) DEFAULT NULL, |
| 6244 |
`sort1` varchar(80) DEFAULT NULL, |
| 6245 |
`sort2` varchar(80) DEFAULT NULL, |
| 6246 |
`altcontactfirstname` varchar(255) DEFAULT NULL, |
| 6247 |
`altcontactsurname` varchar(255) DEFAULT NULL, |
| 6248 |
`altcontactaddress1` varchar(255) DEFAULT NULL, |
| 6249 |
`altcontactaddress2` varchar(255) DEFAULT NULL, |
| 6250 |
`altcontactaddress3` varchar(255) DEFAULT NULL, |
| 6251 |
`altcontactstate` text, |
| 6252 |
`altcontactzipcode` varchar(50) DEFAULT NULL, |
| 6253 |
`altcontactcountry` text, |
| 6254 |
`altcontactphone` varchar(50) DEFAULT NULL, |
| 6255 |
`smsalertnumber` varchar(50) DEFAULT NULL, |
| 6256 |
`privacy` int(11) DEFAULT NULL, |
| 6257 |
PRIMARY KEY (`verification_token`,`borrowernumber`), |
| 6258 |
KEY `verification_token` (`verification_token`), |
| 6259 |
KEY `borrowernumber` (`borrowernumber`) |
| 6260 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8; |
| 6261 |
"); |
| 6262 |
|
| 6263 |
$dbh->do(" |
| 6264 |
INSERT INTO systempreferences (`variable`, `value`, `options`, `explanation`, `type`) VALUES |
| 6265 |
('PatronSelfRegistration', '0', NULL, 'If enabled, patrons will be able to register themselves via the OPAC.', 'YesNo'), |
| 6266 |
('PatronSelfRegistrationVerifyByEmail', '0', NULL, 'If enabled, any patron attempting to register themselves via the OPAC will be required to verify themselves via email to activate his or her account.', 'YesNo'), |
| 6267 |
('PatronSelfRegistrationDefaultCategory', '', '', 'A patron registered via the OPAC will receive a borrower category code set in this system preference.', 'free'), |
| 6268 |
('PatronSelfRegistrationExpireTemporaryAccountsDelay', '0', NULL, 'If PatronSelfRegistrationDefaultCategory is enabled, this system preference controls how long a patron can have a temporary status before the account is deleted automatically. It is an integer value representing a number of days to wait before deleting a temporary patron account. Setting it to 0 disables the deleting of temporary accounts.', 'Integer'), |
| 6269 |
('PatronSelfRegistrationBorrowerMandatoryField', 'surname|firstname', NULL , 'Choose the mandatory fields for a patron''s account, when registering via the OPAC.', 'free'), |
| 6270 |
('PatronSelfRegistrationBorrowerUnwantedField', '', NULL , 'Name the fields you don''t want to display when registering a new patron via the OPAC.', 'free'); |
| 6271 |
"); |
| 6272 |
|
| 6273 |
$dbh->do(" |
| 6274 |
INSERT INTO letter ( `module`, `code`, `branchcode`, `name`, `is_html`, `title`, `content` ) |
| 6275 |
VALUES ( 'members', 'OPAC_REG_VERIFY', '', 'Opac Self-Registration Verification Email', '1', 'Verify Your Account', 'Hello! |
| 6276 |
|
| 6277 |
Your library account has been created. Please verify your email address by clicking this link to complete the signup process: |
| 6278 |
|
| 6279 |
http://<<OPACBaseURL>>/cgi-bin/koha/opac-registration-verify.pl?token=<<borrower_modifications.verification_token>> |
| 6280 |
|
| 6281 |
If you did not initiate this request, you may safely ignore this one-time message. The request will expire shortly.' |
| 6282 |
)"); |
| 6283 |
|
| 6284 |
print "Upgrade to $DBversion done (Add Patron Self Registration)\n"; |
| 6285 |
SetVersion ($DBversion); |
| 6286 |
} |
| 6287 |
|
| 6288 |
=head1 FUNCTIONS |
6288 |
=head1 FUNCTIONS |
| 6289 |
|
6289 |
|
| 6290 |
=head2 TableExists($table) |
6290 |
=head2 TableExists($table) |
| 6291 |
- |
|
|