Bugzilla – Attachment 193800 Details for
Bug 39658
Allow definition of non-hierarchical linked patron accounts
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 39658: DB: Add patron_account_links table and sysprefs
Bug-39658-DB-Add-patronaccountlinks-table-and-sysp.patch (text/plain), 8.43 KB, created by
Kellie Stephens
on 2026-02-24 21:13:26 UTC
(
hide
)
Description:
Bug 39658: DB: Add patron_account_links table and sysprefs
Filename:
MIME Type:
Creator:
Kellie Stephens
Created:
2026-02-24 21:13:26 UTC
Size:
8.43 KB
patch
obsolete
>From d9b820970d7183a3872c67274b71675fcfebb945 Mon Sep 17 00:00:00 2001 >From: Jacob O'Mara <Jacob.omara@openfifth.co.uk> >Date: Wed, 21 Jan 2026 15:36:16 +0000 >Subject: [PATCH] Bug 39658: DB: Add patron_account_links table and sysprefs > >Adds table and 3 sysprefs for patron account linking feature. > >Signed-off-by: Trevor Diamond <trevor.diamond@mainlib.org> >Signed-off-by: Kellie Stephens <kellie.stephens@bywatersolutions.com> >--- > .../atomicupdate/bug_39658_patron_linking.pl | 62 +++++++++++++++++++ > installer/data/mysql/kohastructure.sql | 19 ++++++ > installer/data/mysql/mandatory/sysprefs.sql | 3 + > 3 files changed, 84 insertions(+) > create mode 100755 installer/data/mysql/atomicupdate/bug_39658_patron_linking.pl > >diff --git a/installer/data/mysql/atomicupdate/bug_39658_patron_linking.pl b/installer/data/mysql/atomicupdate/bug_39658_patron_linking.pl >new file mode 100755 >index 0000000000..6ecc308aec >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_39658_patron_linking.pl >@@ -0,0 +1,62 @@ >+use Modern::Perl; >+use Koha::Installer::Output qw(say_warning say_success say_info); >+ >+return { >+ bug_number => "39658", >+ description => "Add patron account linking feature for multi-library patrons", >+ up => sub { >+ my ($args) = @_; >+ my ( $dbh, $out ) = @$args{qw(dbh out)}; >+ >+ # Create the patron_account_links table >+ unless ( TableExists('patron_account_links') ) { >+ $dbh->do( >+ q{ >+ CREATE TABLE `patron_account_links` ( >+ `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'primary key', >+ `link_group_id` int(11) NOT NULL COMMENT 'groups linked accounts together', >+ `borrowernumber` int(11) NOT NULL COMMENT 'foreign key to borrowers table', >+ `created_on` timestamp NOT NULL DEFAULT current_timestamp() COMMENT 'when the link was created', >+ PRIMARY KEY (`id`), >+ UNIQUE KEY `borrowernumber` (`borrowernumber`), >+ KEY `link_group_id` (`link_group_id`), >+ CONSTRAINT `patron_account_links_ibfk_1` FOREIGN KEY (`borrowernumber`) >+ REFERENCES `borrowers` (`borrowernumber`) ON DELETE CASCADE ON UPDATE CASCADE >+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci >+ } >+ ); >+ say_success( $out, "Added new table 'patron_account_links'" ); >+ } >+ >+ # Add system preferences >+ $dbh->do( >+ q{ >+ INSERT IGNORE INTO systempreferences (variable, value, options, explanation, type) >+ VALUES ('EnablePatronAccountLinking', '0', '', >+ 'Enable patron account linking feature for multi-library patrons in a consortium', >+ 'YesNo') >+ } >+ ); >+ say_success( $out, "Added new system preference 'EnablePatronAccountLinking'" ); >+ >+ $dbh->do( >+ q{ >+ INSERT IGNORE INTO systempreferences (variable, value, options, explanation, type) >+ VALUES ('NoIssuesChargeLinkedAccounts', '', '', >+ 'Define maximum combined amount outstanding before checkouts are blocked for all linked accounts', >+ 'Integer') >+ } >+ ); >+ say_success( $out, "Added new system preference 'NoIssuesChargeLinkedAccounts'" ); >+ >+ $dbh->do( >+ q{ >+ INSERT IGNORE INTO systempreferences (variable, value, options, explanation, type) >+ VALUES ('AllowLinkedAccountHoldPickup', '0', '', >+ 'Allow patrons to pick up holds placed on any of their linked accounts', >+ 'YesNo') >+ } >+ ); >+ say_success( $out, "Added new system preference 'AllowLinkedAccountHoldPickup'" ); >+ }, >+}; >diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql >index 1222ef6387..f2d7b991a4 100644 >--- a/installer/data/mysql/kohastructure.sql >+++ b/installer/data/mysql/kohastructure.sql >@@ -5250,6 +5250,25 @@ CREATE TABLE `overduerules_transport_types` ( > ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; > /*!40101 SET character_set_client = @saved_cs_client */; > >+-- >+-- Table structure for table `patron_account_links` >+-- >+ >+DROP TABLE IF EXISTS `patron_account_links`; >+/*!40101 SET @saved_cs_client = @@character_set_client */; >+/*!40101 SET character_set_client = utf8mb4 */; >+CREATE TABLE `patron_account_links` ( >+ `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'primary key', >+ `link_group_id` int(11) NOT NULL COMMENT 'groups linked accounts together', >+ `borrowernumber` int(11) NOT NULL COMMENT 'foreign key to borrowers table', >+ `created_on` timestamp NOT NULL DEFAULT current_timestamp() COMMENT 'when the link was created', >+ PRIMARY KEY (`id`), >+ UNIQUE KEY `borrowernumber` (`borrowernumber`), >+ KEY `link_group_id` (`link_group_id`), >+ CONSTRAINT `patron_account_links_ibfk_1` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE CASCADE ON UPDATE CASCADE >+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; >+/*!40101 SET character_set_client = @saved_cs_client */; >+ > -- > -- Table structure for table `patron_consent` > -- >diff --git a/installer/data/mysql/mandatory/sysprefs.sql b/installer/data/mysql/mandatory/sysprefs.sql >index 585d7a5d8d..79404264ee 100644 >--- a/installer/data/mysql/mandatory/sysprefs.sql >+++ b/installer/data/mysql/mandatory/sysprefs.sql >@@ -38,6 +38,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` > ('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'), > ('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'), > ('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'), >+('AllowLinkedAccountHoldPickup','0',NULL,'Allow patrons to pick up holds placed on any of their linked accounts','YesNo'), > ('AllowMultipleCovers','0',NULL,'Allow multiple cover images to be attached to each bibliographic record.','YesNo'), > ('AllowMultipleIssuesOnABiblio','1',NULL,'Allow/Don\'t allow patrons to check out multiple items from one biblio','YesNo'), > ('AllowNotForLoanOverride','0',NULL,'If ON, Koha will allow the librarian to loan a not for loan item.','YesNo'), >@@ -264,6 +265,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` > ('EnableItemGroupHolds','0',NULL,'Enable item groups holds feature','YesNo'), > ('EnableItemGroups','0',NULL,'Enable the item groups feature','YesNo'), > ('EnableOpacSearchHistory','1','YesNo','Enable or disable opac search history',''), >+('EnablePatronAccountLinking','0','','Enable patron account linking feature for multi-library patrons in a consortium','YesNo'), > ('EnablePointOfSale','0',NULL,'Enable the point of sale feature to allow anonymous transactions with the accounting system. (Requires UseCashRegisters)','YesNo'), > ('EnableSearchHistory','0',NULL,'Enable or disable search history','YesNo'), > ('EnhancedMessagingPreferences','1',NULL,'If ON, allows patrons to select to receive additional messages about items due or nearly due.','YesNo'), >@@ -445,6 +447,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` > ('noissuescharge','5',NULL,'Define maximum amount withstanding before checkouts are blocked','Integer'), > ('NoIssuesChargeGuarantees','',NULL,'Define maximum amount withstanding before checkouts are blocked','Integer'), > ('NoIssuesChargeGuarantorsWithGuarantees','',NULL,'Define maximum amount withstanding before checkouts are blocked including guarantors and their other guarantees','Integer'), >+('NoIssuesChargeLinkedAccounts','',NULL,'Define maximum combined amount outstanding before checkouts are blocked for all linked accounts','Integer'), > ('noItemTypeImages','0',NULL,'If ON, disables itemtype images in the staff interface','YesNo'), > ('NoRefundOnLostFinesPaidAge','',NULL,'Do not refund lost item fees if the fee was paid off more than this number of days ago','Integer'), > ('NoRefundOnLostReturnedItemsAge','',NULL,'Do not refund lost item fees if item is lost for more than this number of days','Integer'), >-- >2.39.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 39658
:
193344
|
193345
|
193346
|
193347
|
193348
|
193349
|
193350
|
193351
|
193352
|
193353
|
193354
|
193355
|
193356
|
193357
|
193358
|
193359
|
193462
|
193463
|
193464
|
193465
|
193466
|
193467
|
193468
|
193469
|
193470
|
193471
|
193472
|
193473
|
193474
|
193475
|
193476
|
193477
|
193478
|
193479
|
193781
|
193782
|
193783
|
193784
|
193785
|
193786
|
193787
|
193788
|
193789
|
193790
|
193791
|
193792
|
193793
|
193794
|
193795
|
193796
|
193797
|
193798
| 193800 |
193801
|
193802
|
193803
|
193804
|
193805
|
193806
|
193807
|
193808
|
193809
|
193810
|
193811
|
193812
|
193813
|
193814
|
193815
|
193816
|
193817