From 0bcc2fb4314338588d46ab8135ccb012da2e64e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Holger=20Mei=C3=9Fner?= Date: Fri, 24 Jan 2014 14:00:05 +0100 Subject: [PATCH 1/5] Bug 7413: Allow OPAC renewal x days before due date MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Currently multiple renewals can be done in immediate succsession. To optionally prevent this, a new parameter "No renewals before" is introduced. This patch adds issuingrules.norenewalbefore to the database. Default value is NULL. To test: 1) Run installer/data/mysql/updatedatabase.pl. 2) Create a SQL report like: SELECT * FROM issuingrules 3) Confirm that norenewalbefore was added after renewalperiod. Sponsored-by: Hochschule für Gesundheit (hsg), Germany --- installer/data/mysql/kohastructure.sql | 1 + installer/data/mysql/updatedatabase.pl | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index 136104f..d5d0d9a 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -1155,6 +1155,7 @@ CREATE TABLE `issuingrules` ( -- circulation and fine rules `hardduedatecompare` tinyint NOT NULL default "0", -- type of hard due date (1 = after, 0 = on, -1 = before) `renewalsallowed` smallint(6) NOT NULL default "0", -- how many renewals are allowed `renewalperiod` int(4) default NULL, -- renewal period in the unit set in issuingrules.lengthunit + `norenewalbefore` int(4) default NULL, -- no renewal allowed until X days or hours before due date. In the unit set in issuingrules.lengthunit `reservesallowed` smallint(6) NOT NULL default "0", -- how many holds are allowed `branchcode` varchar(10) NOT NULL default '', -- the branch this rule is for (branches.branchcode) overduefinescap decimal(28,6) default NULL, -- the maximum amount of an overdue fine diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index f98daa7..a4bf629 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -7945,6 +7945,15 @@ if (CheckVersion($DBversion)) { SetVersion($DBversion); } +$DBversion = "3.15.00.XXX"; +if(CheckVersion($DBversion)) { + $dbh->do(q{ + ALTER TABLE issuingrules ADD norenewalbefore int(4) default NULL AFTER renewalperiod + }); + print "Upgrade to $DBversion done (Bug 7413: Allow OPAC renewal x days before due date)\n"; + SetVersion($DBversion); +} + =head1 FUNCTIONS =head2 TableExists($table) -- 1.7.10.4