Bugzilla – Attachment 39578 Details for
Bug 14045
Add specific quotas to on-site checkout
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 14045: DB Changes
Bug-14045-DB-Changes.patch (text/plain), 7.84 KB, created by
Nicolas Legrand
on 2015-05-27 10:37:46 UTC
(
hide
)
Description:
Bug 14045: DB Changes
Filename:
MIME Type:
Creator:
Nicolas Legrand
Created:
2015-05-27 10:37:46 UTC
Size:
7.84 KB
patch
obsolete
>From 6faf8aa99cb745a532800a7cc3c946732e030fe8 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@koha-community.org> >Date: Wed, 13 May 2015 16:51:49 +0200 >Subject: [PATCH] Bug 14045: DB Changes > >This patch is the DB changes for the feature. >It adds 5 new columns named 'maxonsiteissueqty' to the following tables: >- branch_borrower_circ_rules >- default_borrower_circ_rules >- default_branch_circ_rules >- default_circ_rules >- issuingrules > >It also adds the pref ConsiderOnSiteCheckoutsAsNormalCheckouts. > >See main patch for more details. > >Signed-off-by: Nicolas Legrand <nicolas.legrand@bulac.fr> >--- > installer/data/mysql/kohastructure.sql | 5 +++ > installer/data/mysql/sysprefs.sql | 1 + > installer/data/mysql/updatedatabase.pl | 41 ++++++++++++++++++++ > .../en/modules/admin/preferences/circulation.pref | 9 +++++ > 4 files changed, 56 insertions(+) > >diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql >index c41710c..4b0f375 100644 >--- a/installer/data/mysql/kohastructure.sql >+++ b/installer/data/mysql/kohastructure.sql >@@ -633,6 +633,7 @@ CREATE TABLE `branch_borrower_circ_rules` ( -- includes default circulation rule > `branchcode` VARCHAR(10) NOT NULL, -- the branch this rule applies to (branches.branchcode) > `categorycode` VARCHAR(10) NOT NULL, -- the patron category this rule applies to (categories.categorycode) > `maxissueqty` int(4) default NULL, -- the maximum number of checkouts this patron category can have at this branch >+ `maxonsiteissueqty` int(4) default NULL, -- the maximum number of on-site checkouts this patron category can have at this branch > PRIMARY KEY (`categorycode`, `branchcode`), > CONSTRAINT `branch_borrower_circ_rules_ibfk_1` FOREIGN KEY (`categorycode`) REFERENCES `categories` (`categorycode`) > ON DELETE CASCADE ON UPDATE CASCADE, >@@ -648,6 +649,7 @@ DROP TABLE IF EXISTS `default_borrower_circ_rules`; > CREATE TABLE `default_borrower_circ_rules` ( -- default checkout rules found under "Default checkout, hold and return policy" > `categorycode` VARCHAR(10) NOT NULL, -- patron category this rul > `maxissueqty` int(4) default NULL, >+ `maxonsiteissueqty` int(4) default NULL, > PRIMARY KEY (`categorycode`), > CONSTRAINT `borrower_borrower_circ_rules_ibfk_1` FOREIGN KEY (`categorycode`) REFERENCES `categories` (`categorycode`) > ON DELETE CASCADE ON UPDATE CASCADE >@@ -661,6 +663,7 @@ DROP TABLE IF EXISTS `default_branch_circ_rules`; > CREATE TABLE `default_branch_circ_rules` ( > `branchcode` VARCHAR(10) NOT NULL, > `maxissueqty` int(4) default NULL, >+ `maxonsiteissueqty` int(4) default NULL, > `holdallowed` tinyint(1) default NULL, > `returnbranch` varchar(15) default NULL, > PRIMARY KEY (`branchcode`), >@@ -689,6 +692,7 @@ DROP TABLE IF EXISTS `default_circ_rules`; > CREATE TABLE `default_circ_rules` ( > `singleton` enum('singleton') NOT NULL default 'singleton', > `maxissueqty` int(4) default NULL, >+ `maxonsiteissueqty` int(4) default NULL, > `holdallowed` int(1) default NULL, > `returnbranch` varchar(15) default NULL, > PRIMARY KEY (`singleton`) >@@ -1183,6 +1187,7 @@ CREATE TABLE `issuingrules` ( -- circulation and fine rules > `accountsent` int(11) default NULL, -- not used? always NULL > `chargename` varchar(100) default NULL, -- not used? always NULL > `maxissueqty` int(4) default NULL, -- total number of checkouts allowed >+ `maxonsiteissueqty` int(4) default NULL, -- total number of on-site checkouts allowed > `issuelength` int(4) default NULL, -- length of checkout in the unit set in issuingrules.lengthunit > `lengthunit` varchar(10) default 'days', -- unit of checkout length (days, hours) > `hardduedate` date default NULL, -- hard due date >diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql >index 9620d67..47e5450 100644 >--- a/installer/data/mysql/sysprefs.sql >+++ b/installer/data/mysql/sysprefs.sql >@@ -92,6 +92,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` > ('CoceProviders', NULL, 'aws,gb,ol', 'Coce providers', 'multiple'), > ('COinSinOPACResults','1','','If ON, use COinS in OPAC search results page. NOTE: this can slow down search response time significantly','YesNo'), > ('ConfirmFutureHolds','0','','Number of days for confirming future holds','Integer'), >+('ConsiderOnSiteCheckoutsAsNormalCheckouts','1',NULL,'Consider on-site checkouts as normal checkouts','YesNo'), > ('CronjobLog','0',NULL,'If ON, log information from cron jobs.','YesNo'), > ('CurrencyFormat','US','US|FR','Determines the display format of currencies. eg: \'36000\' is displayed as \'360 000,00\' in \'FR\' or \'360,000.00\' in \'US\'.','Choice'), > ('dateformat','us','metric|us|iso','Define global date format (us mm/dd/yyyy, metric dd/mm/yyy, ISO yyyy-mm-dd)','Choice'), >diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl >index 9ee74c1..ed9ae86 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/installer/data/mysql/updatedatabase.pl >@@ -10486,6 +10486,47 @@ if ( CheckVersion($DBversion) ) { > SetVersion ($DBversion); > } > >+$DBversion = "XXX"; >+if ( CheckVersion($DBversion) ) { >+ $dbh->do(q| >+ ALTER TABLE branch_borrower_circ_rules ADD COLUMN maxonsiteissueqty int(4) DEFAULT NULL AFTER maxissueqty; >+ |); >+ $dbh->do(q| >+ UPDATE branch_borrower_circ_rules SET maxonsiteissueqty = maxissueqty; >+ |); >+ $dbh->do(q| >+ ALTER TABLE default_borrower_circ_rules ADD COLUMN maxonsiteissueqty int(4) DEFAULT NULL AFTER maxissueqty; >+ |); >+ $dbh->do(q| >+ UPDATE default_borrower_circ_rules SET maxonsiteissueqty = maxissueqty; >+ |); >+ $dbh->do(q| >+ ALTER TABLE default_branch_circ_rules ADD COLUMN maxonsiteissueqty int(4) DEFAULT NULL AFTER maxissueqty; >+ |); >+ $dbh->do(q| >+ UPDATE default_branch_circ_rules SET maxonsiteissueqty = maxissueqty; >+ |); >+ $dbh->do(q| >+ ALTER TABLE default_circ_rules ADD COLUMN maxonsiteissueqty int(4) DEFAULT NULL AFTER maxissueqty; >+ |); >+ $dbh->do(q| >+ UPDATE default_circ_rules SET maxonsiteissueqty = maxissueqty; >+ |); >+ $dbh->do(q| >+ ALTER TABLE issuingrules ADD COLUMN maxonsiteissueqty int(4) DEFAULT NULL AFTER maxissueqty; >+ |); >+ $dbh->do(q| >+ UPDATE issuingrules SET maxonsiteissueqty = maxissueqty; >+ |); >+ $dbh->do(q| >+ INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) >+ VALUES ('ConsiderOnSiteCheckoutsAsNormalCheckouts','1',NULL,'Consider on-site checkouts as normal checkouts','YesNo'); >+ |); >+ >+ print "Upgrade to $DBversion done (Bug 14045: Add DB fields maxonsiteissueqty and pref ConsiderOnSiteCheckoutsAsNormalCheckouts)\n"; >+ SetVersion ($DBversion); >+} >+ > # DEVELOPER PROCESS, search for anything to execute in the db_update directory > # SEE bug 13068 > # if there is anything in the atomicupdate, read and execute it. >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref >index a16f231..c33c3c4 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref >@@ -398,6 +398,15 @@ Circulation: > yes: Enable > no: Disable > - the on-site for all cases (Even if a user is debarred, etc.). >+ - >+ - pref: ConsiderOnSiteCheckoutsAsNormalCheckouts >+ choices: >+ yes: Consider >+ no: "Don't consider" >+ - on-site checkouts as normal checkouts. >+ - If enabled, the number of checkouts allowed will be normal checkouts + on-site checkouts. >+ - If disabled, both values will be checked separately. >+ > Checkin Policy: > - > - pref: BlockReturnOfWithdrawnItems >-- >1.7.10.4
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 14045
:
39147
|
39148
|
39149
|
39150
|
39151
|
39152
|
39572
|
39573
|
39574
|
39575
|
39576
|
39577
|
39578
|
39579
|
42317
|
42318
|
42319
|
42320
|
42321
|
42322
|
43178
|
43326
|
43327
|
43328
|
43329
|
43330
|
43331
|
43332
|
43423
|
44557