Lines 5715-5824
if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
Link Here
|
5715 |
SetVersion($DBversion); |
5715 |
SetVersion($DBversion); |
5716 |
} |
5716 |
} |
5717 |
|
5717 |
|
5718 |
$DBversion = '3.09.00.XXX'; |
|
|
5719 |
if (C4::Context->preference("Version") < TransformToNum($DBversion)) { |
5720 |
$dbh->do(" |
5721 |
CREATE TABLE IF NOT EXISTS `borrower_modifications` ( |
5722 |
`timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, |
5723 |
`verification_token` varchar(255) NOT NULL DEFAULT '', |
5724 |
`borrowernumber` int(11) NOT NULL DEFAULT '0', |
5725 |
`cardnumber` varchar(16) DEFAULT NULL, |
5726 |
`surname` mediumtext, |
5727 |
`firstname` text, |
5728 |
`title` mediumtext, |
5729 |
`othernames` mediumtext, |
5730 |
`initials` text, |
5731 |
`streetnumber` varchar(10) DEFAULT NULL, |
5732 |
`streettype` varchar(50) DEFAULT NULL, |
5733 |
`address` mediumtext, |
5734 |
`address2` text, |
5735 |
`city` mediumtext, |
5736 |
`state` text, |
5737 |
`zipcode` varchar(25) DEFAULT NULL, |
5738 |
`country` text, |
5739 |
`email` mediumtext, |
5740 |
`phone` text, |
5741 |
`mobile` varchar(50) DEFAULT NULL, |
5742 |
`fax` mediumtext, |
5743 |
`emailpro` text, |
5744 |
`phonepro` text, |
5745 |
`B_streetnumber` varchar(10) DEFAULT NULL, |
5746 |
`B_streettype` varchar(50) DEFAULT NULL, |
5747 |
`B_address` varchar(100) DEFAULT NULL, |
5748 |
`B_address2` text, |
5749 |
`B_city` mediumtext, |
5750 |
`B_state` text, |
5751 |
`B_zipcode` varchar(25) DEFAULT NULL, |
5752 |
`B_country` text, |
5753 |
`B_email` text, |
5754 |
`B_phone` mediumtext, |
5755 |
`dateofbirth` date DEFAULT NULL, |
5756 |
`branchcode` varchar(10) DEFAULT NULL, |
5757 |
`categorycode` varchar(10) DEFAULT NULL, |
5758 |
`dateenrolled` date DEFAULT NULL, |
5759 |
`dateexpiry` date DEFAULT NULL, |
5760 |
`gonenoaddress` tinyint(1) DEFAULT NULL, |
5761 |
`lost` tinyint(1) DEFAULT NULL, |
5762 |
`debarred` date DEFAULT NULL, |
5763 |
`debarredcomment` varchar(255) DEFAULT NULL, |
5764 |
`contactname` mediumtext, |
5765 |
`contactfirstname` text, |
5766 |
`contacttitle` text, |
5767 |
`guarantorid` int(11) DEFAULT NULL, |
5768 |
`borrowernotes` mediumtext, |
5769 |
`relationship` varchar(100) DEFAULT NULL, |
5770 |
`ethnicity` varchar(50) DEFAULT NULL, |
5771 |
`ethnotes` varchar(255) DEFAULT NULL, |
5772 |
`sex` varchar(1) DEFAULT NULL, |
5773 |
`password` varchar(30) DEFAULT NULL, |
5774 |
`flags` int(11) DEFAULT NULL, |
5775 |
`userid` varchar(75) DEFAULT NULL, |
5776 |
`opacnote` mediumtext, |
5777 |
`contactnote` varchar(255) DEFAULT NULL, |
5778 |
`sort1` varchar(80) DEFAULT NULL, |
5779 |
`sort2` varchar(80) DEFAULT NULL, |
5780 |
`altcontactfirstname` varchar(255) DEFAULT NULL, |
5781 |
`altcontactsurname` varchar(255) DEFAULT NULL, |
5782 |
`altcontactaddress1` varchar(255) DEFAULT NULL, |
5783 |
`altcontactaddress2` varchar(255) DEFAULT NULL, |
5784 |
`altcontactaddress3` varchar(255) DEFAULT NULL, |
5785 |
`altcontactstate` text, |
5786 |
`altcontactzipcode` varchar(50) DEFAULT NULL, |
5787 |
`altcontactcountry` text, |
5788 |
`altcontactphone` varchar(50) DEFAULT NULL, |
5789 |
`smsalertnumber` varchar(50) DEFAULT NULL, |
5790 |
`privacy` int(11) DEFAULT NULL, |
5791 |
PRIMARY KEY (`verification_token`,`borrowernumber`), |
5792 |
KEY `verification_token` (`verification_token`), |
5793 |
KEY `borrowernumber` (`borrowernumber`) |
5794 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8; |
5795 |
"); |
5796 |
|
5797 |
$dbh->do(" |
5798 |
INSERT INTO systempreferences (`variable`, `value`, `options`, `explanation`, `type`) VALUES |
5799 |
('PatronSelfRegistration', '0', NULL, 'If enabled, patrons will be able to register themselves via the OPAC.', 'YesNo'), |
5800 |
('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'), |
5801 |
('PatronSelfRegistrationDefaultCategory', '', '', 'A patron registered via the OPAC will receive a borrower category code set in this system preference.', 'free'), |
5802 |
('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'), |
5803 |
('PatronSelfRegistrationBorrowerMandatoryField', 'surname|firstname', NULL , 'Choose the mandatory fields for a patron''s account, when registering via the OPAC.', 'free'), |
5804 |
('PatronSelfRegistrationBorrowerUnwantedField', '', NULL , 'Name the fields you don''t want to display when registering a new patron via the OPAC.', 'free'); |
5805 |
"); |
5806 |
|
5807 |
$dbh->do(" |
5808 |
INSERT INTO letter ( `module`, `code`, `branchcode`, `name`, `is_html`, `title`, `content` ) |
5809 |
VALUES ( 'members', 'OPAC_REG_VERIFY', '', 'Opac Self-Registration Verification Email', '1', 'Verify Your Account', 'Hello! |
5810 |
|
5811 |
Your library account has been created. Please verify your email address by clicking this link to complete the signup process: |
5812 |
|
5813 |
http://<<OPACBaseURL>>/cgi-bin/koha/opac-registration-verify.pl?token=<<borrower_modifications.verification_token>> |
5814 |
|
5815 |
If you did not initiate this request, you may safely ignore this one-time message. The request will expire shortly.' |
5816 |
)"); |
5817 |
|
5818 |
print "Upgrade to $DBversion done (Add Patron Self Registration)\n"; |
5819 |
SetVersion ($DBversion); |
5820 |
} |
5821 |
|
5822 |
$DBversion ="3.09.00.038"; |
5718 |
$DBversion ="3.09.00.038"; |
5823 |
if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { |
5719 |
if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { |
5824 |
$dbh->do("ALTER TABLE borrower_attributes CHANGE attribute attribute VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL"); |
5720 |
$dbh->do("ALTER TABLE borrower_attributes CHANGE attribute attribute VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL"); |
Lines 6123-6128
if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
Link Here
|
6123 |
SetVersion ($DBversion); |
6019 |
SetVersion ($DBversion); |
6124 |
} |
6020 |
} |
6125 |
|
6021 |
|
|
|
6022 |
$DBversion = '3.09.00.XXX'; |
6023 |
if (C4::Context->preference("Version") < TransformToNum($DBversion)) { |
6024 |
$dbh->do(" |
6025 |
CREATE TABLE IF NOT EXISTS `borrower_modifications` ( |
6026 |
`timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, |
6027 |
`verification_token` varchar(255) NOT NULL DEFAULT '', |
6028 |
`borrowernumber` int(11) NOT NULL DEFAULT '0', |
6029 |
`cardnumber` varchar(16) DEFAULT NULL, |
6030 |
`surname` mediumtext, |
6031 |
`firstname` text, |
6032 |
`title` mediumtext, |
6033 |
`othernames` mediumtext, |
6034 |
`initials` text, |
6035 |
`streetnumber` varchar(10) DEFAULT NULL, |
6036 |
`streettype` varchar(50) DEFAULT NULL, |
6037 |
`address` mediumtext, |
6038 |
`address2` text, |
6039 |
`city` mediumtext, |
6040 |
`state` text, |
6041 |
`zipcode` varchar(25) DEFAULT NULL, |
6042 |
`country` text, |
6043 |
`email` mediumtext, |
6044 |
`phone` text, |
6045 |
`mobile` varchar(50) DEFAULT NULL, |
6046 |
`fax` mediumtext, |
6047 |
`emailpro` text, |
6048 |
`phonepro` text, |
6049 |
`B_streetnumber` varchar(10) DEFAULT NULL, |
6050 |
`B_streettype` varchar(50) DEFAULT NULL, |
6051 |
`B_address` varchar(100) DEFAULT NULL, |
6052 |
`B_address2` text, |
6053 |
`B_city` mediumtext, |
6054 |
`B_state` text, |
6055 |
`B_zipcode` varchar(25) DEFAULT NULL, |
6056 |
`B_country` text, |
6057 |
`B_email` text, |
6058 |
`B_phone` mediumtext, |
6059 |
`dateofbirth` date DEFAULT NULL, |
6060 |
`branchcode` varchar(10) DEFAULT NULL, |
6061 |
`categorycode` varchar(10) DEFAULT NULL, |
6062 |
`dateenrolled` date DEFAULT NULL, |
6063 |
`dateexpiry` date DEFAULT NULL, |
6064 |
`gonenoaddress` tinyint(1) DEFAULT NULL, |
6065 |
`lost` tinyint(1) DEFAULT NULL, |
6066 |
`debarred` date DEFAULT NULL, |
6067 |
`debarredcomment` varchar(255) DEFAULT NULL, |
6068 |
`contactname` mediumtext, |
6069 |
`contactfirstname` text, |
6070 |
`contacttitle` text, |
6071 |
`guarantorid` int(11) DEFAULT NULL, |
6072 |
`borrowernotes` mediumtext, |
6073 |
`relationship` varchar(100) DEFAULT NULL, |
6074 |
`ethnicity` varchar(50) DEFAULT NULL, |
6075 |
`ethnotes` varchar(255) DEFAULT NULL, |
6076 |
`sex` varchar(1) DEFAULT NULL, |
6077 |
`password` varchar(30) DEFAULT NULL, |
6078 |
`flags` int(11) DEFAULT NULL, |
6079 |
`userid` varchar(75) DEFAULT NULL, |
6080 |
`opacnote` mediumtext, |
6081 |
`contactnote` varchar(255) DEFAULT NULL, |
6082 |
`sort1` varchar(80) DEFAULT NULL, |
6083 |
`sort2` varchar(80) DEFAULT NULL, |
6084 |
`altcontactfirstname` varchar(255) DEFAULT NULL, |
6085 |
`altcontactsurname` varchar(255) DEFAULT NULL, |
6086 |
`altcontactaddress1` varchar(255) DEFAULT NULL, |
6087 |
`altcontactaddress2` varchar(255) DEFAULT NULL, |
6088 |
`altcontactaddress3` varchar(255) DEFAULT NULL, |
6089 |
`altcontactstate` text, |
6090 |
`altcontactzipcode` varchar(50) DEFAULT NULL, |
6091 |
`altcontactcountry` text, |
6092 |
`altcontactphone` varchar(50) DEFAULT NULL, |
6093 |
`smsalertnumber` varchar(50) DEFAULT NULL, |
6094 |
`privacy` int(11) DEFAULT NULL, |
6095 |
PRIMARY KEY (`verification_token`,`borrowernumber`), |
6096 |
KEY `verification_token` (`verification_token`), |
6097 |
KEY `borrowernumber` (`borrowernumber`) |
6098 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8; |
6099 |
"); |
6100 |
|
6101 |
$dbh->do(" |
6102 |
INSERT INTO systempreferences (`variable`, `value`, `options`, `explanation`, `type`) VALUES |
6103 |
('PatronSelfRegistration', '0', NULL, 'If enabled, patrons will be able to register themselves via the OPAC.', 'YesNo'), |
6104 |
('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'), |
6105 |
('PatronSelfRegistrationDefaultCategory', '', '', 'A patron registered via the OPAC will receive a borrower category code set in this system preference.', 'free'), |
6106 |
('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'), |
6107 |
('PatronSelfRegistrationBorrowerMandatoryField', 'surname|firstname', NULL , 'Choose the mandatory fields for a patron''s account, when registering via the OPAC.', 'free'), |
6108 |
('PatronSelfRegistrationBorrowerUnwantedField', '', NULL , 'Name the fields you don''t want to display when registering a new patron via the OPAC.', 'free'); |
6109 |
"); |
6110 |
|
6111 |
$dbh->do(" |
6112 |
INSERT INTO letter ( `module`, `code`, `branchcode`, `name`, `is_html`, `title`, `content` ) |
6113 |
VALUES ( 'members', 'OPAC_REG_VERIFY', '', 'Opac Self-Registration Verification Email', '1', 'Verify Your Account', 'Hello! |
6114 |
|
6115 |
Your library account has been created. Please verify your email address by clicking this link to complete the signup process: |
6116 |
|
6117 |
http://<<OPACBaseURL>>/cgi-bin/koha/opac-registration-verify.pl?token=<<borrower_modifications.verification_token>> |
6118 |
|
6119 |
If you did not initiate this request, you may safely ignore this one-time message. The request will expire shortly.' |
6120 |
)"); |
6121 |
|
6122 |
print "Upgrade to $DBversion done (Add Patron Self Registration)\n"; |
6123 |
SetVersion ($DBversion); |
6124 |
} |
6125 |
|
6126 |
=head1 FUNCTIONS |
6126 |
=head1 FUNCTIONS |
6127 |
|
6127 |
|
6128 |
=head2 TableExists($table) |
6128 |
=head2 TableExists($table) |
6129 |
- |
|
|