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

(-)a/installer/data/mysql/atomicupdate/bug_39658_patron_linking.pl (+62 lines)
Line 0 Link Here
1
use Modern::Perl;
2
use Koha::Installer::Output qw(say_warning say_success say_info);
3
4
return {
5
    bug_number  => "39658",
6
    description => "Add patron account linking feature for multi-library patrons",
7
    up          => sub {
8
        my ($args) = @_;
9
        my ( $dbh, $out ) = @$args{qw(dbh out)};
10
11
        # Create the patron_account_links table
12
        unless ( TableExists('patron_account_links') ) {
13
            $dbh->do(
14
                q{
15
                CREATE TABLE `patron_account_links` (
16
                    `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'primary key',
17
                    `link_group_id` int(11) NOT NULL COMMENT 'groups linked accounts together',
18
                    `borrowernumber` int(11) NOT NULL COMMENT 'foreign key to borrowers table',
19
                    `created_on` timestamp NOT NULL DEFAULT current_timestamp() COMMENT 'when the link was created',
20
                    PRIMARY KEY (`id`),
21
                    UNIQUE KEY `borrowernumber` (`borrowernumber`),
22
                    KEY `link_group_id` (`link_group_id`),
23
                    CONSTRAINT `patron_account_links_ibfk_1` FOREIGN KEY (`borrowernumber`)
24
                        REFERENCES `borrowers` (`borrowernumber`) ON DELETE CASCADE ON UPDATE CASCADE
25
                ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci
26
            }
27
            );
28
            say_success( $out, "Added new table 'patron_account_links'" );
29
        }
30
31
        # Add system preferences
32
        $dbh->do(
33
            q{
34
            INSERT IGNORE INTO systempreferences (variable, value, options, explanation, type)
35
            VALUES ('EnablePatronAccountLinking', '0', '',
36
                'Enable patron account linking feature for multi-library patrons in a consortium',
37
                'YesNo')
38
        }
39
        );
40
        say_success( $out, "Added new system preference 'EnablePatronAccountLinking'" );
41
42
        $dbh->do(
43
            q{
44
            INSERT IGNORE INTO systempreferences (variable, value, options, explanation, type)
45
            VALUES ('NoIssuesChargeLinkedAccounts', '', '',
46
                'Define maximum combined amount outstanding before checkouts are blocked for all linked accounts',
47
                'Integer')
48
        }
49
        );
50
        say_success( $out, "Added new system preference 'NoIssuesChargeLinkedAccounts'" );
51
52
        $dbh->do(
53
            q{
54
            INSERT IGNORE INTO systempreferences (variable, value, options, explanation, type)
55
            VALUES ('AllowLinkedAccountHoldPickup', '0', '',
56
                'Allow patrons to pick up holds placed on any of their linked accounts',
57
                'YesNo')
58
        }
59
        );
60
        say_success( $out, "Added new system preference 'AllowLinkedAccountHoldPickup'" );
61
    },
62
};
(-)a/installer/data/mysql/kohastructure.sql (+19 lines)
Lines 5250-5255 CREATE TABLE `overduerules_transport_types` ( Link Here
5250
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
5250
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
5251
/*!40101 SET character_set_client = @saved_cs_client */;
5251
/*!40101 SET character_set_client = @saved_cs_client */;
5252
5252
5253
--
5254
-- Table structure for table `patron_account_links`
5255
--
5256
5257
DROP TABLE IF EXISTS `patron_account_links`;
5258
/*!40101 SET @saved_cs_client     = @@character_set_client */;
5259
/*!40101 SET character_set_client = utf8mb4 */;
5260
CREATE TABLE `patron_account_links` (
5261
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'primary key',
5262
  `link_group_id` int(11) NOT NULL COMMENT 'groups linked accounts together',
5263
  `borrowernumber` int(11) NOT NULL COMMENT 'foreign key to borrowers table',
5264
  `created_on` timestamp NOT NULL DEFAULT current_timestamp() COMMENT 'when the link was created',
5265
  PRIMARY KEY (`id`),
5266
  UNIQUE KEY `borrowernumber` (`borrowernumber`),
5267
  KEY `link_group_id` (`link_group_id`),
5268
  CONSTRAINT `patron_account_links_ibfk_1` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE CASCADE ON UPDATE CASCADE
5269
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
5270
/*!40101 SET character_set_client = @saved_cs_client */;
5271
5253
--
5272
--
5254
-- Table structure for table `patron_consent`
5273
-- Table structure for table `patron_consent`
5255
--
5274
--
(-)a/installer/data/mysql/mandatory/sysprefs.sql (-1 / +3 lines)
Lines 38-43 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
38
('AllowItemsOnHoldCheckoutSCO','0',NULL,'Do not generate RESERVE_WAITING and RESERVED warning in the SCO module when checking out items reserved to someone else. This allows self checkouts for those items.','YesNo'),
38
('AllowItemsOnHoldCheckoutSCO','0',NULL,'Do not generate RESERVE_WAITING and RESERVED warning in the SCO module when checking out items reserved to someone else. This allows self checkouts for those items.','YesNo'),
39
('AllowItemsOnHoldCheckoutSIP','0',NULL,'Do not generate RESERVED warning when checking out items reserved to someone else via SIP. This allows self checkouts for those items.','YesNo'),
39
('AllowItemsOnHoldCheckoutSIP','0',NULL,'Do not generate RESERVED warning when checking out items reserved to someone else via SIP. This allows self checkouts for those items.','YesNo'),
40
('AllowItemsOnLoanCheckoutSIP','0',NULL,'Do not generate ISSUED_TO_ANOTHER warning when checking out items already checked out to someone else via SIP. This allows self checkouts for those items.','YesNo'),
40
('AllowItemsOnLoanCheckoutSIP','0',NULL,'Do not generate ISSUED_TO_ANOTHER warning when checking out items already checked out to someone else via SIP. This allows self checkouts for those items.','YesNo'),
41
('AllowLinkedAccountHoldPickup','0',NULL,'Allow patrons to pick up holds placed on any of their linked accounts','YesNo'),
41
('AllowMultipleCovers','0',NULL,'Allow multiple cover images to be attached to each bibliographic record.','YesNo'),
42
('AllowMultipleCovers','0',NULL,'Allow multiple cover images to be attached to each bibliographic record.','YesNo'),
42
('AllowMultipleIssuesOnABiblio','1',NULL,'Allow/Don\'t allow patrons to check out multiple items from one biblio','YesNo'),
43
('AllowMultipleIssuesOnABiblio','1',NULL,'Allow/Don\'t allow patrons to check out multiple items from one biblio','YesNo'),
43
('AllowNotForLoanOverride','0',NULL,'If ON, Koha will allow the librarian to loan a not for loan item.','YesNo'),
44
('AllowNotForLoanOverride','0',NULL,'If ON, Koha will allow the librarian to loan a not for loan item.','YesNo'),
Lines 264-269 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
264
('EnableItemGroupHolds','0',NULL,'Enable item groups holds feature','YesNo'),
265
('EnableItemGroupHolds','0',NULL,'Enable item groups holds feature','YesNo'),
265
('EnableItemGroups','0',NULL,'Enable the item groups feature','YesNo'),
266
('EnableItemGroups','0',NULL,'Enable the item groups feature','YesNo'),
266
('EnableOpacSearchHistory','1','YesNo','Enable or disable opac search history',''),
267
('EnableOpacSearchHistory','1','YesNo','Enable or disable opac search history',''),
268
('EnablePatronAccountLinking','0','','Enable patron account linking feature for multi-library patrons in a consortium','YesNo'),
267
('EnablePointOfSale','0',NULL,'Enable the point of sale feature to allow anonymous transactions with the accounting system. (Requires UseCashRegisters)','YesNo'),
269
('EnablePointOfSale','0',NULL,'Enable the point of sale feature to allow anonymous transactions with the accounting system. (Requires UseCashRegisters)','YesNo'),
268
('EnableSearchHistory','0',NULL,'Enable or disable search history','YesNo'),
270
('EnableSearchHistory','0',NULL,'Enable or disable search history','YesNo'),
269
('EnhancedMessagingPreferences','1',NULL,'If ON, allows patrons to select to receive additional messages about items due or nearly due.','YesNo'),
271
('EnhancedMessagingPreferences','1',NULL,'If ON, allows patrons to select to receive additional messages about items due or nearly due.','YesNo'),
Lines 445-450 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
445
('noissuescharge','5',NULL,'Define maximum amount withstanding before checkouts are blocked','Integer'),
447
('noissuescharge','5',NULL,'Define maximum amount withstanding before checkouts are blocked','Integer'),
446
('NoIssuesChargeGuarantees','',NULL,'Define maximum amount withstanding before checkouts are blocked','Integer'),
448
('NoIssuesChargeGuarantees','',NULL,'Define maximum amount withstanding before checkouts are blocked','Integer'),
447
('NoIssuesChargeGuarantorsWithGuarantees','',NULL,'Define maximum amount withstanding before checkouts are blocked including guarantors and their other guarantees','Integer'),
449
('NoIssuesChargeGuarantorsWithGuarantees','',NULL,'Define maximum amount withstanding before checkouts are blocked including guarantors and their other guarantees','Integer'),
450
('NoIssuesChargeLinkedAccounts','',NULL,'Define maximum combined amount outstanding before checkouts are blocked for all linked accounts','Integer'),
448
('noItemTypeImages','0',NULL,'If ON, disables itemtype images in the staff interface','YesNo'),
451
('noItemTypeImages','0',NULL,'If ON, disables itemtype images in the staff interface','YesNo'),
449
('NoRefundOnLostFinesPaidAge','',NULL,'Do not refund lost item fees if the fee was paid off more than this number of days ago','Integer'),
452
('NoRefundOnLostFinesPaidAge','',NULL,'Do not refund lost item fees if the fee was paid off more than this number of days ago','Integer'),
450
('NoRefundOnLostReturnedItemsAge','',NULL,'Do not refund lost item fees if item is lost for more than this number of days','Integer'),
453
('NoRefundOnLostReturnedItemsAge','',NULL,'Do not refund lost item fees if item is lost for more than this number of days','Integer'),
451
- 

Return to bug 39658