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

(-)a/installer/data/mysql/kohastructure.sql (+6 lines)
Lines 265-270 CREATE TABLE `borrowers` ( -- this table includes information about your patrons Link Here
265
  `altcontactphone` varchar(50) default NULL, -- the phone number for the alternate contact for the patron/borrower
265
  `altcontactphone` varchar(50) default NULL, -- the phone number for the alternate contact for the patron/borrower
266
  `smsalertnumber` varchar(50) default NULL, -- the mobile phone number where the patron/borrower would like to receive notices (if SNS turned on)
266
  `smsalertnumber` varchar(50) default NULL, -- the mobile phone number where the patron/borrower would like to receive notices (if SNS turned on)
267
  `privacy` integer(11) DEFAULT '1' NOT NULL, -- patron/borrower's privacy settings related to their reading history
267
  `privacy` integer(11) DEFAULT '1' NOT NULL, -- patron/borrower's privacy settings related to their reading history
268
  `privacy_guarantor_checkouts` tinyint(1) NOT NULL DEFAULT '0', -- controls if relatives can see this patron's checkouts
268
  UNIQUE KEY `cardnumber` (`cardnumber`),
269
  UNIQUE KEY `cardnumber` (`cardnumber`),
269
  PRIMARY KEY `borrowernumber` (`borrowernumber`),
270
  PRIMARY KEY `borrowernumber` (`borrowernumber`),
270
  KEY `categorycode` (`categorycode`),
271
  KEY `categorycode` (`categorycode`),
Lines 894-899 CREATE TABLE `deletedborrowers` ( -- stores data related to the patrons/borrower Link Here
894
  `altcontactphone` varchar(50) default NULL, -- the phone number for the alternate contact for the patron/borrower
895
  `altcontactphone` varchar(50) default NULL, -- the phone number for the alternate contact for the patron/borrower
895
  `smsalertnumber` varchar(50) default NULL, -- the mobile phone number where the patron/borrower would like to receive notices (if SNS turned on)
896
  `smsalertnumber` varchar(50) default NULL, -- the mobile phone number where the patron/borrower would like to receive notices (if SNS turned on)
896
  `privacy` integer(11) DEFAULT '1' NOT NULL, -- patron/borrower's privacy settings related to their reading history  KEY `borrowernumber` (`borrowernumber`),
897
  `privacy` integer(11) DEFAULT '1' NOT NULL, -- patron/borrower's privacy settings related to their reading history  KEY `borrowernumber` (`borrowernumber`),
898
  `privacy_guarantor_checkouts` tinyint(1) NOT NULL DEFAULT '0', -- controls if relatives can see this patron's checkouts
897
  KEY borrowernumber (borrowernumber),
899
  KEY borrowernumber (borrowernumber),
898
  KEY `cardnumber` (`cardnumber`)
900
  KEY `cardnumber` (`cardnumber`)
899
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
901
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
Lines 1140-1145 CREATE TABLE `import_items` ( Link Here
1140
1142
1141
DROP TABLE IF EXISTS `issues`;
1143
DROP TABLE IF EXISTS `issues`;
1142
CREATE TABLE `issues` ( -- information related to check outs or issues
1144
CREATE TABLE `issues` ( -- information related to check outs or issues
1145
  `issue_id` int(11) NOT NULL AUTO_INCREMENT, -- primary key for issues table
1143
  `borrowernumber` int(11), -- foreign key, linking this to the borrowers table for the patron this item was checked out to
1146
  `borrowernumber` int(11), -- foreign key, linking this to the borrowers table for the patron this item was checked out to
1144
  `itemnumber` int(11), -- foreign key, linking this to the items table for the item that was checked out
1147
  `itemnumber` int(11), -- foreign key, linking this to the items table for the item that was checked out
1145
  `date_due` datetime default NULL, -- datetime the item is due (yyyy-mm-dd hh:mm::ss)
1148
  `date_due` datetime default NULL, -- datetime the item is due (yyyy-mm-dd hh:mm::ss)
Lines 1153-1158 CREATE TABLE `issues` ( -- information related to check outs or issues Link Here
1153
  `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, -- the date and time this record was last touched
1156
  `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, -- the date and time this record was last touched
1154
  `issuedate` datetime default NULL, -- date the item was checked out or issued
1157
  `issuedate` datetime default NULL, -- date the item was checked out or issued
1155
  `onsite_checkout` int(1) NOT NULL default 0, -- in house use flag
1158
  `onsite_checkout` int(1) NOT NULL default 0, -- in house use flag
1159
  PRIMARY KEY (`issue_id`),
1156
  KEY `issuesborridx` (`borrowernumber`),
1160
  KEY `issuesborridx` (`borrowernumber`),
1157
  KEY `itemnumber_idx` (`itemnumber`),
1161
  KEY `itemnumber_idx` (`itemnumber`),
1158
  KEY `branchcode_idx` (`branchcode`),
1162
  KEY `branchcode_idx` (`branchcode`),
Lines 1614-1619 CREATE TABLE `oai_sets_biblios` ( Link Here
1614
1618
1615
DROP TABLE IF EXISTS `old_issues`;
1619
DROP TABLE IF EXISTS `old_issues`;
1616
CREATE TABLE `old_issues` ( -- lists items that were checked out and have been returned
1620
CREATE TABLE `old_issues` ( -- lists items that were checked out and have been returned
1621
  `issue_id` int(11) NOT NULL AUTO_INCREMENT, -- primary key for issues table
1617
  `borrowernumber` int(11) default NULL, -- foreign key, linking this to the borrowers table for the patron this item was checked out to
1622
  `borrowernumber` int(11) default NULL, -- foreign key, linking this to the borrowers table for the patron this item was checked out to
1618
  `itemnumber` int(11) default NULL, -- foreign key, linking this to the items table for the item that was checked out
1623
  `itemnumber` int(11) default NULL, -- foreign key, linking this to the items table for the item that was checked out
1619
  `date_due` datetime default NULL, -- date the item is due (yyyy-mm-dd)
1624
  `date_due` datetime default NULL, -- date the item is due (yyyy-mm-dd)
Lines 1627-1632 CREATE TABLE `old_issues` ( -- lists items that were checked out and have been r Link Here
1627
  `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, -- the date and time this record was last touched
1632
  `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, -- the date and time this record was last touched
1628
  `issuedate` datetime default NULL, -- date the item was checked out or issued
1633
  `issuedate` datetime default NULL, -- date the item was checked out or issued
1629
  `onsite_checkout` int(1) NOT NULL default 0, -- in house use flag
1634
  `onsite_checkout` int(1) NOT NULL default 0, -- in house use flag
1635
  PRIMARY KEY (`issue_id`),
1630
  KEY `old_issuesborridx` (`borrowernumber`),
1636
  KEY `old_issuesborridx` (`borrowernumber`),
1631
  KEY `old_issuesitemidx` (`itemnumber`),
1637
  KEY `old_issuesitemidx` (`itemnumber`),
1632
  KEY `branchcode_idx` (`branchcode`),
1638
  KEY `branchcode_idx` (`branchcode`),
(-)a/installer/data/mysql/sysprefs.sql (+2 lines)
Lines 26-37 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
26
('AllowNotForLoanOverride','0','','If ON, Koha will allow the librarian to loan a not for loan item.','YesNo'),
26
('AllowNotForLoanOverride','0','','If ON, Koha will allow the librarian to loan a not for loan item.','YesNo'),
27
('AllowOfflineCirculation','0','','If on, enables HTML5 offline circulation functionality.','YesNo'),
27
('AllowOfflineCirculation','0','','If on, enables HTML5 offline circulation functionality.','YesNo'),
28
('AllowOnShelfHolds','0','','Allow hold requests to be placed on items that are not on loan','YesNo'),
28
('AllowOnShelfHolds','0','','Allow hold requests to be placed on items that are not on loan','YesNo'),
29
('AllowPatronToSetCheckoutsVisibilityForGuarantor',  '0', NULL, 'If enabled, the patron can set checkouts to be visible to his or her guarantor',  'YesNo'),
29
('AllowPKIAuth','None','None|Common Name|emailAddress','Use the field from a client-side SSL certificate to look a user in the Koha database','Choice'),
30
('AllowPKIAuth','None','None|Common Name|emailAddress','Use the field from a client-side SSL certificate to look a user in the Koha database','Choice'),
30
('AllowPurchaseSuggestionBranchChoice','0','1','Allow user to choose branch when making a purchase suggestion','YesNo'),
31
('AllowPurchaseSuggestionBranchChoice','0','1','Allow user to choose branch when making a purchase suggestion','YesNo'),
31
('AllowRenewalIfOtherItemsAvailable','0',NULL,'If enabled, allow a patron to renew an item with unfilled holds if other available items can fill that hold.','YesNo'),
32
('AllowRenewalIfOtherItemsAvailable','0',NULL,'If enabled, allow a patron to renew an item with unfilled holds if other available items can fill that hold.','YesNo'),
32
('AllowRenewalLimitOverride','0',NULL,'if ON, allows renewal limits to be overridden on the circulation screen','YesNo'),
33
('AllowRenewalLimitOverride','0',NULL,'if ON, allows renewal limits to be overridden on the circulation screen','YesNo'),
33
('AllowReturnToBranch','anywhere','anywhere|homebranch|holdingbranch|homeorholdingbranch','Where an item may be returned','Choice'),
34
('AllowReturnToBranch','anywhere','anywhere|homebranch|holdingbranch|homeorholdingbranch','Where an item may be returned','Choice'),
34
('AllowSelfCheckReturns','0','','If enabled, patrons may return items through the Web-based Self Checkout','YesNo'),
35
('AllowSelfCheckReturns','0','','If enabled, patrons may return items through the Web-based Self Checkout','YesNo'),
36
('AllowStaffToSetCheckoutsVisibilityForGuarantor','0',NULL,'If enabled, library staff can set a patron''s checkouts to be visible to linked patrons from the opac.',  'YesNo'),
35
('AllowTooManyOverride','1','','If on, allow staff to override and check out items when the patron has reached the maximum number of allowed checkouts','YesNo'),
37
('AllowTooManyOverride','1','','If on, allow staff to override and check out items when the patron has reached the maximum number of allowed checkouts','YesNo'),
36
('alphabet','A B C D E F G H I J K L M N O P Q R S T U V W X Y Z',NULL,'Alphabet than can be expanded into browse links, e.g. on Home > Patrons','free'),
38
('alphabet','A B C D E F G H I J K L M N O P Q R S T U V W X Y Z',NULL,'Alphabet than can be expanded into browse links, e.g. on Home > Patrons','free'),
37
('AlternateHoldingsField','',NULL,'The MARC field/subfield that contains alternate holdings information for bibs taht do not have items attached (e.g. 852abchi for libraries converting from MARC Magician).','free'),
39
('AlternateHoldingsField','',NULL,'The MARC field/subfield that contains alternate holdings information for bibs taht do not have items attached (e.g. 852abchi for libraries converting from MARC Magician).','free'),
(-)a/installer/data/mysql/updatedatabase.pl (-1 / +63 lines)
Lines 37-42 use Getopt::Long; Link Here
37
use C4::Context;
37
use C4::Context;
38
use C4::Installer;
38
use C4::Installer;
39
use C4::Dates;
39
use C4::Dates;
40
use Koha::Database;
40
41
41
use MARC::Record;
42
use MARC::Record;
42
use MARC::File::XML ( BinaryEncoding => 'utf8' );
43
use MARC::File::XML ( BinaryEncoding => 'utf8' );
Lines 9608-9613 if ( CheckVersion($DBversion) ) { Link Here
9608
    SetVersion ($DBversion);
9609
    SetVersion ($DBversion);
9609
}
9610
}
9610
9611
9612
$DBversion = "3.19.00.XXX";
9613
if(CheckVersion($DBversion)) {
9614
    $dbh->do(q{
9615
        ALTER TABLE borrowers ADD privacy_guarantor_checkouts BOOLEAN NOT NULL DEFAULT '0'
9616
    });
9617
    $dbh->do(q{
9618
        ALTER TABLE deletedborrowers ADD privacy_guarantor_checkouts BOOLEAN NOT NULL DEFAULT '0'
9619
    });
9620
    $dbh->do(q{
9621
        ALTER TABLE old_issues DROP PRIMARY KEY
9622
    });
9623
    $dbh->do(q{
9624
        ALTER TABLE old_issues ADD issue_id INT( 11 ) NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST
9625
    });
9626
    $dbh->do(q{
9627
        ALTER TABLE old_issues DROP INDEX itemnumber_idx
9628
    });
9629
    $dbh->do(q{
9630
        ALTER TABLE issues DROP PRIMARY KEY
9631
    });
9632
    $dbh->do(q{
9633
        ALTER TABLE issues ADD issue_id INT( 11 ) NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST
9634
    });
9635
    $dbh->do(q{
9636
        ALTER TABLE issues DROP INDEX itemnumber_idx
9637
    });
9638
    $dbh->do(q{
9639
        ALTER TABLE issues ADD UNIQUE itemnumber_idx (itemnumber)
9640
    });
9641
    $dbh->do(qq{
9642
        UPDATE issues SET issue_id = issue_id + ( SELECT COUNT(*) FROM old_issues ) ORDER BY issue_id DESC
9643
    });
9644
9645
    my $schema = Koha::Database->new()->schema();
9646
    my $max_issue_id = $schema->resultset('Issue')->get_column('issue_id')->max();
9647
    $max_issue_id ||= $schema->resultset('OldIssue')->get_column('issue_id')->max();
9648
    $max_issue_id ||= 0;
9649
    $max_issue_id++;
9650
    $dbh->do(qq{
9651
        ALTER TABLE issues AUTO_INCREMENT = $max_issue_id
9652
    });
9653
9654
    $dbh->do(q{
9655
        INSERT INTO systempreferences (variable, value, options, explanation, type )
9656
        VALUES (
9657
            'AllowStaffToSetCheckoutsVisibilityForGuarantor',  '0', NULL,
9658
            'If enabled, library staff can set a patron''s checkouts to be visible to linked patrons from the opac.',  'YesNo'
9659
        )
9660
    });
9661
9662
    $dbh->do(q{
9663
        INSERT INTO systempreferences (variable, value, options, explanation, type )
9664
        VALUES (
9665
            'AllowPatronToSetCheckoutsVisibilityForGuarantor',  '0', NULL,
9666
            'If enabled, the patron can set checkouts to be visible to  his or her guarantor',  'YesNo'
9667
        )
9668
    });
9669
9670
    print "Upgrade to $DBversion done (Bug 9303 - relative's checkouts in the opac)\n";
9671
    SetVersion($DBversion);
9672
}
9673
9611
=head1 FUNCTIONS
9674
=head1 FUNCTIONS
9612
9675
9613
=head2 TableExists($table)
9676
=head2 TableExists($table)
9614
- 

Return to bug 9303