From 3274d6419c02f124c17359d57f83716ea4292416 Mon Sep 17 00:00:00 2001 From: Fridolyn SOMERS Date: Thu, 11 Jul 2013 11:27:51 +0200 Subject: [PATCH 4/4] Bug 6739 - expired patrons not blocked from opac actions - Followup 3 Installer fixes : - in kohastructure.sql, category.BlockExpiredPatronOpacActions default value is -1, sets the same in updatedatabase.pl - in syspref comment, replaces "opac actions such as placing a hold or reserve" by "opac actions such as placing holds or renrw books" - A 'YesNo' does not have 'yes' as value in database, it is '1'. - corrects small typo "categori" and syspref name case --- installer/data/mysql/kohastructure.sql | 2 +- installer/data/mysql/sysprefs.sql | 2 +- installer/data/mysql/updatedatabase.pl | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index a46dc9a..e6c0589 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -441,7 +441,7 @@ CREATE TABLE `categories` ( -- this table shows information related to Koha patr `reservefee` decimal(28,6) default NULL, -- cost to place holds `hidelostitems` tinyint(1) NOT NULL default '0', -- are lost items shown to this category (1 for yes, 0 for no) `category_type` varchar(1) NOT NULL default 'A', -- type of Koha patron (Adult, Child, Professional, Organizational, Statistical, Staff) - `BlockExpiredPatronOpacActions` tinyint(1) NOT NULL default '-1', -- wheither or not a patron of this categori 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` tinyint(1) NOT NULL default '-1', -- 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 PRIMARY KEY (`categorycode`), UNIQUE KEY `categorycode` (`categorycode`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql index 1be9c15..1ea18ff 100644 --- a/installer/data/mysql/sysprefs.sql +++ b/installer/data/mysql/sysprefs.sql @@ -428,4 +428,4 @@ INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) V INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacHoldNotes',0,'Show hold notes on OPAC','','YesNo'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('CalculateFinesOnReturn','1','Switch to control if overdue fines are calculated on return or not', '', 'YesNo'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('AcqWarnOnDuplicateInvoice','0','Warn librarians when they try to create a duplicate invoice', '', 'YesNo'); -INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('BlockExpiredPatronOpacActions', 'yes', 'Set whether an expired patron can perform opac actions such as placing a hold or reserve, can be overridden on a per patron-type basis',NULL,'YesNo'); +INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('BlockExpiredPatronOpacActions', '1', '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',NULL,'YesNo'); diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index d8c6c55..c9c94b1 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -7043,12 +7043,12 @@ if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { VALUES ( 'BlockExpiredPatronOpacActions', 'yes', - 'Set whether an expired patron can perform opac actions such as placing a hold or reserve, can be overridden on a per patron-type basis', + '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', NULL, 'YesNo' ) "); - $dbh->do("ALTER TABLE `categories` ADD COLUMN `BlockExpiredPatronOpacActions` TINYINT(1) DEFAULT 0 NOT NULL"); + $dbh->do("ALTER TABLE `categories` ADD COLUMN `BlockExpiredPatronOpacActions` TINYINT(1) DEFAULT -1 NOT NULL AFTER category_type"); print "Upgraded to $DBversion done (Bug 6739 - expired patrons not blocked from opac actions)\n"; SetVersion ($DBversion); } -- 1.7.10.4