Bugzilla – Attachment 191781 Details for
Bug 26355
Allow patrons to self-renew through the OPAC
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 26355: Add new columns to the patron categories and attributes tables
Bug-26355-Add-new-columns-to-the-patron-categories.patch (text/plain), 6.52 KB, created by
Matt Blenkinsop
on 2026-01-21 14:26:45 UTC
(
hide
)
Description:
Bug 26355: Add new columns to the patron categories and attributes tables
Filename:
MIME Type:
Creator:
Matt Blenkinsop
Created:
2026-01-21 14:26:45 UTC
Size:
6.52 KB
patch
obsolete
>From 2a045d8bae7133d5b54597cb1ad7f6173bcb90ec Mon Sep 17 00:00:00 2001 >From: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> >Date: Wed, 21 Jan 2026 09:36:15 +0000 >Subject: [PATCH] Bug 26355: Add new columns to the patron categories and > attributes tables > >--- > .../bug_26355-patron_self_renewal.pl | 78 +++++++++++++++++++ > installer/data/mysql/kohastructure.sql | 6 ++ > 2 files changed, 84 insertions(+) > create mode 100755 installer/data/mysql/atomicupdate/bug_26355-patron_self_renewal.pl > >diff --git a/installer/data/mysql/atomicupdate/bug_26355-patron_self_renewal.pl b/installer/data/mysql/atomicupdate/bug_26355-patron_self_renewal.pl >new file mode 100755 >index 00000000000..50be96fbbc4 >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_26355-patron_self_renewal.pl >@@ -0,0 +1,78 @@ >+use Modern::Perl; >+use Koha::Installer::Output qw(say_warning say_success say_info); >+ >+return { >+ bug_number => "26355", >+ description => "Patron self-renewal", >+ up => sub { >+ my ($args) = @_; >+ my ( $dbh, $out ) = @$args{qw(dbh out)}; >+ >+ unless ( column_exists( 'categories', 'self_renewal_enabled' ) ) { >+ $dbh->do( >+ q{ >+ ALTER TABLE categories ADD COLUMN `self_renewal_enabled` tinyint(1) NOT NULL DEFAULT 0 >+ COMMENT 'allow self renewal for this category' >+ AFTER `enforce_expiry_notice` >+ } >+ ); >+ >+ say_success( $out, "Added column 'self_renewal_enabled' to categories" ); >+ } >+ unless ( column_exists( 'categories', 'self_renewal_availability_start' ) ) { >+ $dbh->do( >+ q{ >+ ALTER TABLE categories ADD COLUMN `self_renewal_availability_start` smallint(6) DEFAULT NULL >+ COMMENT 'how long before the patron expiry date self-renewal should be made available (overrides system default of NotifyBorrowerDeparture)' >+ AFTER `self_renewal_enabled` >+ } >+ ); >+ >+ say_success( $out, "Added column 'self_renewal_availability_start' to categories" ); >+ } >+ unless ( column_exists( 'categories', 'self_renewal_fines_block' ) ) { >+ $dbh->do( >+ q{ >+ ALTER TABLE categories ADD COLUMN `self_renewal_fines_block` int(11) DEFAULT NULL >+ COMMENT 'the amount owed in fines before self renewal is blocked (overrides system default of noissuescharge)' >+ AFTER `self_renewal_availability_start` >+ } >+ ); >+ >+ say_success( $out, "Added column 'self_renewal_fines_block' to categories" ); >+ } >+ unless ( column_exists( 'categories', 'self_renewal_if_expired' ) ) { >+ $dbh->do( >+ q{ >+ ALTER TABLE categories ADD COLUMN `self_renewal_if_expired` smallint(6) DEFAULT 0 >+ COMMENT 'how long after expiry a patron can self renew their account' >+ AFTER `self_renewal_fines_block` >+ } >+ ); >+ >+ say_success( $out, "Added column 'self_renewal_if_expired' to categories" ); >+ } >+ unless ( column_exists( 'categories', 'self_renewal_failure_message' ) ) { >+ $dbh->do( >+ q{ >+ ALTER TABLE categories ADD COLUMN `self_renewal_failure_message` mediumtext DEFAULT NULL >+ COMMENT 'the message to display if self renewal is not successful' >+ AFTER `self_renewal_fines_block` >+ } >+ ); >+ >+ say_success( $out, "Added column 'self_renewal_failure_message' to categories" ); >+ } >+ unless ( column_exists( 'borrower_attribute_types', 'self_renewal_verification_check' ) ) { >+ $dbh->do( >+ q{ >+ ALTER TABLE borrower_attribute_types ADD COLUMN `self_renewal_verification_check` tinyint(1) NOT NULL DEFAULT 0 >+ COMMENT 'use this attribute as a verification step for patron self-renewal' >+ AFTER `opac_mandatory` >+ } >+ ); >+ >+ say_success( $out, "Added column 'self_renewal_verification_check' to borrower_attribute_types" ); >+ } >+ }, >+}; >diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql >index e65b2af7ca4..f07ae8de5f6 100644 >--- a/installer/data/mysql/kohastructure.sql >+++ b/installer/data/mysql/kohastructure.sql >@@ -1266,6 +1266,7 @@ CREATE TABLE `borrower_attribute_types` ( > `keep_for_pseudonymization` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'defines if this field is copied to anonymized_borrower_attributes (1 for yes, 0 for no)', > `mandatory` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'defines if the attribute is mandatory or not in the staff interface', > `opac_mandatory` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'defines if the attribute is mandatory or not in the OPAC', >+ `self_renewal_verification_check` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'use this attribute as a verification step for patron self-renewal', > PRIMARY KEY (`code`), > KEY `auth_val_cat_idx` (`authorised_value_category`), > KEY `category_code` (`category_code`), >@@ -1827,6 +1828,11 @@ CREATE TABLE `categories` ( > `noissueschargeguarantees` int(11) DEFAULT NULL COMMENT 'define maximum amount that the guarantees of a patron in this category can have outstanding before checkouts are blocked', > `noissueschargeguarantorswithguarantees` int(11) DEFAULT NULL COMMENT 'define maximum amount that the guarantors with guarantees of a patron in this category can have outstanding before checkouts are blocked', > `enforce_expiry_notice` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'enforce the patron expiry notice for this category', >+ `self_renewal_enabled` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'allow self renewal for this category', >+ `self_renewal_availability_start` smallint(6) DEFAULT NULL COMMENT 'how long before the patron expiry date self-renewal should be made available (overrides system default of NotifyBorrowerDeparture)', >+ `self_renewal_fines_block` int(11) DEFAULT NULL COMMENT 'the amount owed in fines before self renewal is blocked (overrides system default of noissuescharge)', >+ `self_renewal_if_expired` smallint(6) DEFAULT 0 COMMENT 'how long after expiry a patron can self renew their account', >+ `self_renewal_failure_message` mediumtext DEFAULT NULL COMMENT 'the message to display if self renewal is not successful', > PRIMARY KEY (`categorycode`), > UNIQUE KEY `categorycode` (`categorycode`) > ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; >-- >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 26355
:
191781
|
191782
|
191783
|
191784
|
191785
|
191786
|
191787
|
191788
|
191789
|
192440
|
192441
|
192442
|
192443
|
192444
|
192445
|
192446
|
192447
|
192448