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

(-)a/installer/data/mysql/updatedatabase.pl (-105 / +104 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 6201-6206 if (C4::Context->preference("Version") < TransformToNum($DBversion)) { Link Here
6201
    SetVersion ($DBversion);
6097
    SetVersion ($DBversion);
6202
}
6098
}
6203
6099
6100
$DBversion = '3.11.00.XXX';
6101
if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
6102
    $dbh->do("
6103
        CREATE TABLE IF NOT EXISTS `borrower_modifications` (
6104
          `timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
6105
          `verification_token` varchar(255) NOT NULL DEFAULT '',
6106
          `borrowernumber` int(11) NOT NULL DEFAULT '0',
6107
          `cardnumber` varchar(16) DEFAULT NULL,
6108
          `surname` mediumtext,
6109
          `firstname` text,
6110
          `title` mediumtext,
6111
          `othernames` mediumtext,
6112
          `initials` text,
6113
          `streetnumber` varchar(10) DEFAULT NULL,
6114
          `streettype` varchar(50) DEFAULT NULL,
6115
          `address` mediumtext,
6116
          `address2` text,
6117
          `city` mediumtext,
6118
          `state` text,
6119
          `zipcode` varchar(25) DEFAULT NULL,
6120
          `country` text,
6121
          `email` mediumtext,
6122
          `phone` text,
6123
          `mobile` varchar(50) DEFAULT NULL,
6124
          `fax` mediumtext,
6125
          `emailpro` text,
6126
          `phonepro` text,
6127
          `B_streetnumber` varchar(10) DEFAULT NULL,
6128
          `B_streettype` varchar(50) DEFAULT NULL,
6129
          `B_address` varchar(100) DEFAULT NULL,
6130
          `B_address2` text,
6131
          `B_city` mediumtext,
6132
          `B_state` text,
6133
          `B_zipcode` varchar(25) DEFAULT NULL,
6134
          `B_country` text,
6135
          `B_email` text,
6136
          `B_phone` mediumtext,
6137
          `dateofbirth` date DEFAULT NULL,
6138
          `branchcode` varchar(10) DEFAULT NULL,
6139
          `categorycode` varchar(10) DEFAULT NULL,
6140
          `dateenrolled` date DEFAULT NULL,
6141
          `dateexpiry` date DEFAULT NULL,
6142
          `gonenoaddress` tinyint(1) DEFAULT NULL,
6143
          `lost` tinyint(1) DEFAULT NULL,
6144
          `debarred` date DEFAULT NULL,
6145
          `debarredcomment` varchar(255) DEFAULT NULL,
6146
          `contactname` mediumtext,
6147
          `contactfirstname` text,
6148
          `contacttitle` text,
6149
          `guarantorid` int(11) DEFAULT NULL,
6150
          `borrowernotes` mediumtext,
6151
          `relationship` varchar(100) DEFAULT NULL,
6152
          `ethnicity` varchar(50) DEFAULT NULL,
6153
          `ethnotes` varchar(255) DEFAULT NULL,
6154
          `sex` varchar(1) DEFAULT NULL,
6155
          `password` varchar(30) DEFAULT NULL,
6156
          `flags` int(11) DEFAULT NULL,
6157
          `userid` varchar(75) DEFAULT NULL,
6158
          `opacnote` mediumtext,
6159
          `contactnote` varchar(255) DEFAULT NULL,
6160
          `sort1` varchar(80) DEFAULT NULL,
6161
          `sort2` varchar(80) DEFAULT NULL,
6162
          `altcontactfirstname` varchar(255) DEFAULT NULL,
6163
          `altcontactsurname` varchar(255) DEFAULT NULL,
6164
          `altcontactaddress1` varchar(255) DEFAULT NULL,
6165
          `altcontactaddress2` varchar(255) DEFAULT NULL,
6166
          `altcontactaddress3` varchar(255) DEFAULT NULL,
6167
          `altcontactstate` text,
6168
          `altcontactzipcode` varchar(50) DEFAULT NULL,
6169
          `altcontactcountry` text,
6170
          `altcontactphone` varchar(50) DEFAULT NULL,
6171
          `smsalertnumber` varchar(50) DEFAULT NULL,
6172
          `privacy` int(11) DEFAULT NULL,
6173
          PRIMARY KEY (`verification_token`,`borrowernumber`),
6174
          KEY `verification_token` (`verification_token`),
6175
          KEY `borrowernumber` (`borrowernumber`)
6176
        ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
6177
");
6178
6179
    $dbh->do("
6180
        INSERT INTO systempreferences (`variable`, `value`, `options`, `explanation`, `type`) VALUES
6181
        ('PatronSelfRegistration', '0', NULL, 'If enabled, patrons will be able to register themselves via the OPAC.', 'YesNo'),
6182
        ('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'),
6183
        ('PatronSelfRegistrationDefaultCategory', '', '', 'A patron registered via the OPAC will receive a borrower category code set in this system preference.', 'free'),
6184
        ('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'),
6185
        ('PatronSelfRegistrationBorrowerMandatoryField',  'surname|firstname', NULL ,  'Choose the mandatory fields for a patron''s account, when registering via the OPAC.',  'free'),
6186
        ('PatronSelfRegistrationBorrowerUnwantedField',  '', NULL ,  'Name the fields you don''t want to display when registering a new patron via the OPAC.',  'free');
6187
    ");
6188
6189
    $dbh->do("
6190
    INSERT INTO  letter ( `module`, `code`, `branchcode`, `name`, `is_html`, `title`, `content` )
6191
    VALUES ( 'members', 'OPAC_REG_VERIFY', '', 'Opac Self-Registration Verification Email', '1', 'Verify Your Account', 'Hello!
6192
6193
    Your library account has been created. Please verify your email address by clicking this link to complete the signup process:
6194
6195
    http://<<OPACBaseURL>>/cgi-bin/koha/opac-registration-verify.pl?token=<<borrower_modifications.verification_token>>
6196
6197
    If you did not initiate this request, you may safely ignore this one-time message. The request will expire shortly.'
6198
    )");
6199
6200
    print "Upgrade to $DBversion done (Add Patron Self Registration)\n";
6201
    SetVersion ($DBversion);
6202
}
6203
6204
=head1 FUNCTIONS
6204
=head1 FUNCTIONS
6205
6205
6206
=head2 TableExists($table)
6206
=head2 TableExists($table)
6207
- 

Return to bug 7067