Bugzilla – Attachment 193756 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 table
Bug-26355-Add-new-columns-to-the-patron-categories.patch (text/plain), 5.88 KB, created by
Matt Blenkinsop
on 2026-02-24 13:43:03 UTC
(
hide
)
Description:
Bug 26355: Add new columns to the patron categories table
Filename:
MIME Type:
Creator:
Matt Blenkinsop
Created:
2026-02-24 13:43:03 UTC
Size:
5.88 KB
patch
obsolete
>From a5ee3187be3634ce754e6862264c5bfc2a1c04df Mon Sep 17 00:00:00 2001 >From: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> >Date: Thu, 19 Feb 2026 13:23:45 +0000 >Subject: [PATCH] Bug 26355: Add new columns to the patron categories table > >--- > .../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..c9173475245 >--- /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( 'categories', 'self_renewal_information_message' ) ) { >+ $dbh->do( >+ q{ >+ ALTER TABLE categories ADD COLUMN `self_renewal_information_message` mediumtext DEFAULT NULL >+ COMMENT 'the message to display if self renewal is not successful' >+ AFTER `self_renewal_failure_message` >+ } >+ ); >+ >+ say_success( $out, "Added column 'self_renewal_information_message' to categories" ); >+ } >+ }, >+}; >diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql >index 1222ef6387c..261ad574a28 100644 >--- a/installer/data/mysql/kohastructure.sql >+++ b/installer/data/mysql/kohastructure.sql >@@ -1827,6 +1827,12 @@ 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', >+ `self_renewal_information_message` mediumtext DEFAULT NULL COMMENT 'the message to display before the self renewal process starts', > PRIMARY KEY (`categorycode`), > UNIQUE KEY `categorycode` (`categorycode`) > ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; >-- >2.50.1
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
|
193065
|
193066
|
193067
|
193068
|
193069
|
193070
|
193071
|
193072
|
193073
|
193074
|
193249
|
193250
|
193251
|
193252
|
193253
|
193521
|
193522
|
193523
|
193524
|
193525
|
193526
|
193527
|
193528
|
193529
|
193581
|
193635
|
193654
|
193699
|
193756
|
193757
|
193758
|
193759
|
193760
|
193761
|
193762
|
193763
|
193764
|
193765
|
193921
|
194435
|
194464
|
194465
|
194466
|
194467
|
194468
|
194469
|
194470
|
194471
|
194472
|
194473
|
194474