From d2d22c1b262e4e738df5bc64d2464eb27ee62667 Mon Sep 17 00:00:00 2001 From: Amit Gupta Date: Thu, 3 May 2012 13:25:15 +0530 Subject: [PATCH] Bug 7970 - Allow OPAC holds per library policy without default rule By default ReservesControlBranch systempreference is not inserting in systempreferences table. For this reason we have to set up default circulation rule for all libraries all itemtypes and all patron categories. After this we have to set only circulation rule by branch wise no need to set up for all libraries, itemtypes and patron categories. To Test: 1) Go to mysql use koha database 2) mysql> select * from systempreferences where variable = 'ReservesControlBranch'; +-----------------------+-----------------+-------------------------------+--------------------------------------+--------+ | variable | value | options | explanation | type | +-----------------------+-----------------+-------------------------------+--------------------------------------+--------+ | ReservesControlBranch | ItemHomeLibrary | ItemHomeLibrary|PatronLibrary | Patron can place a hold on the item. | Choice | +-----------------------+-----------------+-------------------------------+--------------------------------------+--------+ --- installer/data/mysql/sysprefs.sql | 1 + installer/data/mysql/updatedatabase.pl | 7 +++++++ 2 files changed, 8 insertions(+), 0 deletions(-) diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql index 49debd2..2dcb1a2 100644 --- a/installer/data/mysql/sysprefs.sql +++ b/installer/data/mysql/sysprefs.sql @@ -362,3 +362,4 @@ INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES(' INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ('AutoResumeSuspendedHolds', '1', NULL , 'Allow suspended holds to be automatically resumed by a set date.', 'YesNo'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('OpacStarRatings','all',NULL,'disable|all|details','Choice'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacBrowseResults','1','Disable/enable browsing and paging search results from the OPAC detail page.',NULL,'YesNo'); +INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES ('ReservesControlBranch','ItemHomeLibrary','ItemHomeLibrary|PatronLibrary','Patron can place a hold on the item.','Choice'); diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 84f0437..5d05b86 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -5212,6 +5212,13 @@ if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { SetVersion($DBversion); } +$DBversion = "3.08.00.XXX"; +if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { + $dbh->do("INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES ('ReservesControlBranch','ItemHomeLibrary','ItemHomeLibrary|PatronLibrary','Patron can place a hold on the item.','Choice')"); + print "Upgrade to $DBversion done (Insert ReservesControlBranch systempreference into systempreferences table ))\n"; + SetVersion($DBversion); +} + =head1 FUNCTIONS =head2 TableExists($table) -- 1.6.4.2