[Koha-patches] [PATCH] Bug 7970 - Allow OPAC holds per library policy without default rule

root root at li149-189.members.linode.com
Thu May 3 10:11:20 CEST 2012


From: Amit Gupta <amit.gupta at osslabs.biz>

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



More information about the Koha-patches mailing list