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

(-)a/installer/data/mysql/updatedatabase.pl (-105 / +103 lines)
Lines 5716-5825 if (C4::Context->preference("Version") < TransformToNum($DBversion)) { Link Here
5716
    SetVersion($DBversion);
5716
    SetVersion($DBversion);
5717
}
5717
}
5718
5718
5719
$DBversion = '3.09.00.XXX';
5720
if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
5721
    $dbh->do("
5722
        CREATE TABLE IF NOT EXISTS `borrower_modifications` (
5723
          `timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
5724
          `verification_token` varchar(255) NOT NULL DEFAULT '',
5725
          `borrowernumber` int(11) NOT NULL DEFAULT '0',
5726
          `cardnumber` varchar(16) DEFAULT NULL,
5727
          `surname` mediumtext,
5728
          `firstname` text,
5729
          `title` mediumtext,
5730
          `othernames` mediumtext,
5731
          `initials` text,
5732
          `streetnumber` varchar(10) DEFAULT NULL,
5733
          `streettype` varchar(50) DEFAULT NULL,
5734
          `address` mediumtext,
5735
          `address2` text,
5736
          `city` mediumtext,
5737
          `state` text,
5738
          `zipcode` varchar(25) DEFAULT NULL,
5739
          `country` text,
5740
          `email` mediumtext,
5741
          `phone` text,
5742
          `mobile` varchar(50) DEFAULT NULL,
5743
          `fax` mediumtext,
5744
          `emailpro` text,
5745
          `phonepro` text,
5746
          `B_streetnumber` varchar(10) DEFAULT NULL,
5747
          `B_streettype` varchar(50) DEFAULT NULL,
5748
          `B_address` varchar(100) DEFAULT NULL,
5749
          `B_address2` text,
5750
          `B_city` mediumtext,
5751
          `B_state` text,
5752
          `B_zipcode` varchar(25) DEFAULT NULL,
5753
          `B_country` text,
5754
          `B_email` text,
5755
          `B_phone` mediumtext,
5756
          `dateofbirth` date DEFAULT NULL,
5757
          `branchcode` varchar(10) DEFAULT NULL,
5758
          `categorycode` varchar(10) DEFAULT NULL,
5759
          `dateenrolled` date DEFAULT NULL,
5760
          `dateexpiry` date DEFAULT NULL,
5761
          `gonenoaddress` tinyint(1) DEFAULT NULL,
5762
          `lost` tinyint(1) DEFAULT NULL,
5763
          `debarred` date DEFAULT NULL,
5764
          `debarredcomment` varchar(255) DEFAULT NULL,
5765
          `contactname` mediumtext,
5766
          `contactfirstname` text,
5767
          `contacttitle` text,
5768
          `guarantorid` int(11) DEFAULT NULL,
5769
          `borrowernotes` mediumtext,
5770
          `relationship` varchar(100) DEFAULT NULL,
5771
          `ethnicity` varchar(50) DEFAULT NULL,
5772
          `ethnotes` varchar(255) DEFAULT NULL,
5773
          `sex` varchar(1) DEFAULT NULL,
5774
          `password` varchar(30) DEFAULT NULL,
5775
          `flags` int(11) DEFAULT NULL,
5776
          `userid` varchar(75) DEFAULT NULL,
5777
          `opacnote` mediumtext,
5778
          `contactnote` varchar(255) DEFAULT NULL,
5779
          `sort1` varchar(80) DEFAULT NULL,
5780
          `sort2` varchar(80) DEFAULT NULL,
5781
          `altcontactfirstname` varchar(255) DEFAULT NULL,
5782
          `altcontactsurname` varchar(255) DEFAULT NULL,
5783
          `altcontactaddress1` varchar(255) DEFAULT NULL,
5784
          `altcontactaddress2` varchar(255) DEFAULT NULL,
5785
          `altcontactaddress3` varchar(255) DEFAULT NULL,
5786
          `altcontactstate` text,
5787
          `altcontactzipcode` varchar(50) DEFAULT NULL,
5788
          `altcontactcountry` text,
5789
          `altcontactphone` varchar(50) DEFAULT NULL,
5790
          `smsalertnumber` varchar(50) DEFAULT NULL,
5791
          `privacy` int(11) DEFAULT NULL,
5792
          PRIMARY KEY (`verification_token`,`borrowernumber`),
5793
          KEY `verification_token` (`verification_token`),
5794
          KEY `borrowernumber` (`borrowernumber`)
5795
        ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
5796
");
5797
5798
    $dbh->do("
5799
        INSERT INTO systempreferences (`variable`, `value`, `options`, `explanation`, `type`) VALUES
5800
        ('PatronSelfRegistration', '0', NULL, 'If enabled, patrons will be able to register themselves via the OPAC.', 'YesNo'),
5801
        ('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'),
5802
        ('PatronSelfRegistrationDefaultCategory', '', '', 'A patron registered via the OPAC will receive a borrower category code set in this system preference.', 'free'),
5803
        ('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'),
5804
        ('PatronSelfRegistrationBorrowerMandatoryField',  'surname|firstname', NULL ,  'Choose the mandatory fields for a patron''s account, when registering via the OPAC.',  'free'),
5805
        ('PatronSelfRegistrationBorrowerUnwantedField',  '', NULL ,  'Name the fields you don''t want to display when registering a new patron via the OPAC.',  'free');
5806
    ");
5807
5808
    $dbh->do("
5809
    INSERT INTO  letter ( `module`, `code`, `branchcode`, `name`, `is_html`, `title`, `content` )
5810
    VALUES ( 'members', 'OPAC_REG_VERIFY', '', 'Opac Self-Registration Verification Email', '1', 'Verify Your Account', 'Hello!
5811
5812
    Your library account has been created. Please verify your email address by clicking this link to complete the signup process:
5813
5814
    http://<<OPACBaseURL>>/cgi-bin/koha/opac-registration-verify.pl?token=<<borrower_modifications.verification_token>>
5815
5816
    If you did not initiate this request, you may safely ignore this one-time message. The request will expire shortly.'
5817
    )");
5818
5819
    print "Upgrade to $DBversion done (Add Patron Self Registration)\n";
5820
    SetVersion ($DBversion);
5821
}
5822
5823
$DBversion ="3.09.00.038";
5719
$DBversion ="3.09.00.038";
5824
if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
5720
if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
5825
    $dbh->do("ALTER TABLE borrower_attributes CHANGE  attribute  attribute VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL");
5721
    $dbh->do("ALTER TABLE borrower_attributes CHANGE  attribute  attribute VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL");
Lines 6186-6191 if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { Link Here
6186
    print "Upgrade to $DBversion done (Bug 2832 - Add alphabet syspref)\n";
6082
    print "Upgrade to $DBversion done (Bug 2832 - Add alphabet syspref)\n";
6187
    SetVersion($DBversion);
6083
    SetVersion($DBversion);
6188
}
6084
}
6085
$DBversion = '3.11.00.XXX';
6086
if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
6087
    $dbh->do("
6088
        CREATE TABLE IF NOT EXISTS `borrower_modifications` (
6089
          `timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
6090
          `verification_token` varchar(255) NOT NULL DEFAULT '',
6091
          `borrowernumber` int(11) NOT NULL DEFAULT '0',
6092
          `cardnumber` varchar(16) DEFAULT NULL,
6093
          `surname` mediumtext,
6094
          `firstname` text,
6095
          `title` mediumtext,
6096
          `othernames` mediumtext,
6097
          `initials` text,
6098
          `streetnumber` varchar(10) DEFAULT NULL,
6099
          `streettype` varchar(50) DEFAULT NULL,
6100
          `address` mediumtext,
6101
          `address2` text,
6102
          `city` mediumtext,
6103
          `state` text,
6104
          `zipcode` varchar(25) DEFAULT NULL,
6105
          `country` text,
6106
          `email` mediumtext,
6107
          `phone` text,
6108
          `mobile` varchar(50) DEFAULT NULL,
6109
          `fax` mediumtext,
6110
          `emailpro` text,
6111
          `phonepro` text,
6112
          `B_streetnumber` varchar(10) DEFAULT NULL,
6113
          `B_streettype` varchar(50) DEFAULT NULL,
6114
          `B_address` varchar(100) DEFAULT NULL,
6115
          `B_address2` text,
6116
          `B_city` mediumtext,
6117
          `B_state` text,
6118
          `B_zipcode` varchar(25) DEFAULT NULL,
6119
          `B_country` text,
6120
          `B_email` text,
6121
          `B_phone` mediumtext,
6122
          `dateofbirth` date DEFAULT NULL,
6123
          `branchcode` varchar(10) DEFAULT NULL,
6124
          `categorycode` varchar(10) DEFAULT NULL,
6125
          `dateenrolled` date DEFAULT NULL,
6126
          `dateexpiry` date DEFAULT NULL,
6127
          `gonenoaddress` tinyint(1) DEFAULT NULL,
6128
          `lost` tinyint(1) DEFAULT NULL,
6129
          `debarred` date DEFAULT NULL,
6130
          `debarredcomment` varchar(255) DEFAULT NULL,
6131
          `contactname` mediumtext,
6132
          `contactfirstname` text,
6133
          `contacttitle` text,
6134
          `guarantorid` int(11) DEFAULT NULL,
6135
          `borrowernotes` mediumtext,
6136
          `relationship` varchar(100) DEFAULT NULL,
6137
          `ethnicity` varchar(50) DEFAULT NULL,
6138
          `ethnotes` varchar(255) DEFAULT NULL,
6139
          `sex` varchar(1) DEFAULT NULL,
6140
          `password` varchar(30) DEFAULT NULL,
6141
          `flags` int(11) DEFAULT NULL,
6142
          `userid` varchar(75) DEFAULT NULL,
6143
          `opacnote` mediumtext,
6144
          `contactnote` varchar(255) DEFAULT NULL,
6145
          `sort1` varchar(80) DEFAULT NULL,
6146
          `sort2` varchar(80) DEFAULT NULL,
6147
          `altcontactfirstname` varchar(255) DEFAULT NULL,
6148
          `altcontactsurname` varchar(255) DEFAULT NULL,
6149
          `altcontactaddress1` varchar(255) DEFAULT NULL,
6150
          `altcontactaddress2` varchar(255) DEFAULT NULL,
6151
          `altcontactaddress3` varchar(255) DEFAULT NULL,
6152
          `altcontactstate` text,
6153
          `altcontactzipcode` varchar(50) DEFAULT NULL,
6154
          `altcontactcountry` text,
6155
          `altcontactphone` varchar(50) DEFAULT NULL,
6156
          `smsalertnumber` varchar(50) DEFAULT NULL,
6157
          `privacy` int(11) DEFAULT NULL,
6158
          PRIMARY KEY (`verification_token`,`borrowernumber`),
6159
          KEY `verification_token` (`verification_token`),
6160
          KEY `borrowernumber` (`borrowernumber`)
6161
        ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
6162
");
6163
6164
    $dbh->do("
6165
        INSERT INTO systempreferences (`variable`, `value`, `options`, `explanation`, `type`) VALUES
6166
        ('PatronSelfRegistration', '0', NULL, 'If enabled, patrons will be able to register themselves via the OPAC.', 'YesNo'),
6167
        ('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'),
6168
        ('PatronSelfRegistrationDefaultCategory', '', '', 'A patron registered via the OPAC will receive a borrower category code set in this system preference.', 'free'),
6169
        ('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'),
6170
        ('PatronSelfRegistrationBorrowerMandatoryField',  'surname|firstname', NULL ,  'Choose the mandatory fields for a patron''s account, when registering via the OPAC.',  'free'),
6171
        ('PatronSelfRegistrationBorrowerUnwantedField',  '', NULL ,  'Name the fields you don''t want to display when registering a new patron via the OPAC.',  'free');
6172
    ");
6173
6174
    $dbh->do("
6175
    INSERT INTO  letter ( `module`, `code`, `branchcode`, `name`, `is_html`, `title`, `content` )
6176
    VALUES ( 'members', 'OPAC_REG_VERIFY', '', 'Opac Self-Registration Verification Email', '1', 'Verify Your Account', 'Hello!
6177
6178
    Your library account has been created. Please verify your email address by clicking this link to complete the signup process:
6179
6180
    http://<<OPACBaseURL>>/cgi-bin/koha/opac-registration-verify.pl?token=<<borrower_modifications.verification_token>>
6181
6182
    If you did not initiate this request, you may safely ignore this one-time message. The request will expire shortly.'
6183
    )");
6184
6185
    print "Upgrade to $DBversion done (Add Patron Self Registration)\n";
6186
    SetVersion ($DBversion);
6187
}
6189
6188
6190
=head1 FUNCTIONS
6189
=head1 FUNCTIONS
6191
6190
6192
- 

Return to bug 7067