Bugzilla – Attachment 164762 Details for
Bug 36453
BlockExpiredPatronOpacActions should allow multiple actions options
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 36453: DB and data changes
Bug-36453-DB-and-data-changes.patch (text/plain), 7.03 KB, created by
Arthur Suzuki
on 2024-04-11 15:10:44 UTC
(
hide
)
Description:
Bug 36453: DB and data changes
Filename:
MIME Type:
Creator:
Arthur Suzuki
Created:
2024-04-11 15:10:44 UTC
Size:
7.03 KB
patch
obsolete
>From 6a19151ea132f0e0dd03211f7299593bf6d8ee61 Mon Sep 17 00:00:00 2001 >From: Pedro Amorim <pedro.amorim@ptfs-europe.com> >Date: Tue, 26 Mar 2024 17:14:05 +0000 >Subject: [PATCH] Bug 36453: DB and data changes > >- kohastructure.sql updates >- atomicupdate file >- Mandatory data installer updates > >Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com> >--- > .../data/mysql/atomicupdate/bug_36453.pl | 59 +++++++++++++++++++ > installer/data/mysql/kohastructure.sql | 2 +- > installer/data/mysql/mandatory/sysprefs.sql | 2 +- > 3 files changed, 61 insertions(+), 2 deletions(-) > create mode 100755 installer/data/mysql/atomicupdate/bug_36453.pl > >diff --git a/installer/data/mysql/atomicupdate/bug_36453.pl b/installer/data/mysql/atomicupdate/bug_36453.pl >new file mode 100755 >index 00000000000..83f0e3a1e9f >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_36453.pl >@@ -0,0 +1,59 @@ >+use Modern::Perl; >+ >+return { >+ bug_number => "36453", >+ description => "BlockExpiredPatronOpacActions should allow multiple actions options", >+ up => sub { >+ my ($args) = @_; >+ my ( $dbh, $out ) = @$args{qw(dbh out)}; >+ >+ >+ my ($BlockExpiredPatronOpacActions) = $dbh->selectrow_array( >+ q{ >+ SELECT value FROM systempreferences WHERE variable = 'BlockExpiredPatronOpacActions'; >+ } >+ ); >+ >+ if ($BlockExpiredPatronOpacActions eq 1) { >+ # Update system preference settings if 1 >+ $dbh->do( >+ "UPDATE systempreferences SET value='hold,renew' WHERE variable='BlockExpiredPatronOpacActions' and value=1" >+ ); >+ say $out "BlockExpiredPatronOpacActions system preference value updated to 'hold,renew'."; >+ }elsif ($BlockExpiredPatronOpacActions eq 0) { >+ # Update system preference settings if 0 >+ $dbh->do("UPDATE systempreferences SET value='' WHERE variable='BlockExpiredPatronOpacActions' and value=0"); >+ say $out "BlockExpiredPatronOpacActions system preference value updated to empty string."; >+ } >+ >+ # Update system preference setting to multiple instead of YesNo >+ $dbh->do( >+ "UPDATE systempreferences SET type='multiple' WHERE variable='BlockExpiredPatronOpacActions'" >+ ); >+ say $out "BlockExpiredPatronOpacActions system preference value updated to multiple."; >+ >+ # Update categories database table BlockExpiredPatronOpacActions column settings >+ $dbh->do( >+ "ALTER TABLE categories MODIFY BlockExpiredPatronOpacActions mediumtext NOT NULL DEFAULT 'follow_syspref_BlockExpiredPatronOpacActions' COMMENT 'specific actions expired patrons of this category are blocked from performing or if the BlockExpiredPatronOpacActions system preference is to be followed'" >+ ); >+ say $out "categories column BlockExpiredPatronOpacActions updated."; >+ >+ # Update patron categories using -1 >+ $dbh->do( >+ "UPDATE categories SET BlockExpiredPatronOpacActions = 'follow_syspref_BlockExpiredPatronOpacActions' WHERE BlockExpiredPatronOpacActions = '-1'" >+ ); >+ say $out >+ "Patron categories BlockExpiredPatronOpacActions = -1 have been updated to follow the syspref BlockExpiredPatronOpacActions."; >+ >+ # Update patron categories using 0 >+ $dbh->do("UPDATE categories SET BlockExpiredPatronOpacActions = '' WHERE BlockExpiredPatronOpacActions = '0'"); >+ say $out "Patron categories BlockExpiredPatronOpacActions = 0 have been updated to an empty string ('')."; >+ >+ # Update patron categories using 1 >+ $dbh->do( >+ "UPDATE categories SET BlockExpiredPatronOpacActions = 'hold,renew' WHERE BlockExpiredPatronOpacActions = '1' " >+ ); >+ say $out "Patron categories BlockExpiredPatronOpacActions = 1 have been updated to hold,renew'."; >+ >+ }, >+}; >diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql >index 3828776962c..4933bf4f12e 100644 >--- a/installer/data/mysql/kohastructure.sql >+++ b/installer/data/mysql/kohastructure.sql >@@ -1787,7 +1787,7 @@ CREATE TABLE `categories` ( > `reservefee` decimal(28,6) DEFAULT NULL COMMENT 'cost to place holds', > `hidelostitems` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'are lost items shown to this category (1 for yes, 0 for no)', > `category_type` varchar(1) NOT NULL DEFAULT 'A' COMMENT 'type of Koha patron (Adult, Child, Professional, Organizational, Statistical, Staff)', >- `BlockExpiredPatronOpacActions` tinyint(1) NOT NULL DEFAULT -1 COMMENT 'wheither or not a patron of this category can renew books or place holds once their card has expired. 0 means they can, 1 means they cannot, -1 means use syspref BlockExpiredPatronOpacActions', >+ `BlockExpiredPatronOpacActions` mediumtext NOT NULL DEFAULT 'follow_syspref_BlockExpiredPatronOpacActions' COMMENT 'specific actions expired patrons of this category are blocked from performing or if the BlockExpiredPatronOpacActions system preference is to be followed', > `default_privacy` enum('default','never','forever') NOT NULL DEFAULT 'default' COMMENT 'Default privacy setting for this patron category', > `checkprevcheckout` varchar(7) NOT NULL DEFAULT 'inherit' COMMENT 'produce a warning for this patron category if this item has previously been checked out to this patron if ''yes'', not if ''no'', defer to syspref setting if ''inherit''.', > `can_place_ill_in_opac` tinyint(1) NOT NULL DEFAULT 1 COMMENT 'can this patron category place interlibrary loan requests', >diff --git a/installer/data/mysql/mandatory/sysprefs.sql b/installer/data/mysql/mandatory/sysprefs.sql >index 0b264fb9280..a9f13802086 100644 >--- a/installer/data/mysql/mandatory/sysprefs.sql >+++ b/installer/data/mysql/mandatory/sysprefs.sql >@@ -115,7 +115,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` > ('BiblioDefaultView','normal','normal|marc|isbd','Choose the default detail view in the catalog; choose between normal, marc or isbd','Choice'), > ('BiblioItemtypeInfo','0','0','Control which itemtype info displays for biblio level itemtypes','YesNo'), > ('BibtexExportAdditionalFields', '', NULL , 'Define additional BibTex tags to export from MARC records in YAML format as an associative array with either a marc tag/subfield combination as the value, or a list of tag/subfield combinations.', 'textarea'), >-('BlockExpiredPatronOpacActions','1',NULL,'Set whether an expired patron can perform opac actions such as placing holds or renew books, can be overridden on a per patron-type basis','YesNo'), >+('BlockExpiredPatronOpacActions','','hold,renew','Specific actions expired patrons of this category are blocked from performing or if the BlockExpiredPatronOpacActions system preference is to be followed','multiple'), > ('BlockReturnOfLostItems','0','0','If enabled, items that are marked as lost cannot be returned.','YesNo'), > ('BlockReturnOfWithdrawnItems','1','0','If enabled, items that are marked as withdrawn cannot be returned.','YesNo'), > ('BorrowerMandatoryField','surname|cardnumber',NULL,'Choose the mandatory fields for a patron\'s account','free'), >-- >2.30.2
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 36453
:
164042
|
164043
|
164044
|
164045
|
164046
|
164047
|
164048
|
164762
|
164763
|
164764
|
164765
|
164766
|
164767
|
164768
|
165413
|
165414
|
165454
|
167461
|
167462
|
167463
|
167464
|
167465
|
167466
|
167467
|
167468
|
167469
|
167470
|
167471
|
167472
|
167473
|
167474
|
167475
|
167476
|
167477
|
167478
|
167479
|
167480
|
168435
|
168436