From: Amit Gupta <[email protected]>

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

_______________________________________________
Koha-patches mailing list
[email protected]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-patches
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to