bug 1710 and 1739: two new sysprefs (DB rev 092)
authorGalen Charlton <galen.charlton@liblime.com>
Fri, 20 Jun 2008 18:59:32 +0000 (13:59 -0500)
committerJoshua Ferraro <jmf@liblime.com>
Fri, 20 Jun 2008 19:14:47 +0000 (14:14 -0500)
As part of fixing hold request bugs 1710 and 1739,
two new system preferences are defined:

AllowOnShelfHolds: YesNo, default value OFF
  * if ON, allow item-level hold requests to be
    placed for available items that are not on loan

AllowHoldsOnDamagedItems: YesNo, default value ON
  * if OFF, item-level hold requests cannot
    be placed on items that are marked damaged.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
admin/systempreferences.pl
installer/data/mysql/en/mandatory/sysprefs.sql
installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql
installer/data/mysql/updatedatabase.pl
kohaversion.pl

index e7f5a41..0556d7c 100755 (executable)
@@ -150,6 +150,8 @@ my %tabsysprefs;
     $tabsysprefs{HomeOrHoldingBranch}="Circulation";
        $tabsysprefs{RandomizeHoldsQueueWeight}="Circulation";
        $tabsysprefs{StaticHoldsQueueWeight}="Circulation";
+    $tabsysprefs{AllowOnShelfHolds}="Circulation";
+    $tabsysprefs{AllowHoldsOnDamagedItems}="Circulation";
 
 # Staff Client
     $tabsysprefs{TemplateEncoding}="StaffClient";
index 5fb9c6a..163b94c 100755 (executable)
@@ -211,4 +211,6 @@ INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES
 ('XSLTDetailsDisplay','0','','Enable XSL stylesheet control over details page display on OPAC WARNING: MARC21 Only','YesNo'),
 ('XSLTResultsDisplay','0','','Enable XSL stylesheet control over results page display on OPAC WARNING: MARC21 Only','YesNo');
 INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES('AdvancedSearchTypes','itemtypes','itemtypes|ccode','Select which set of fields comprise the Type limit in the advanced search','Choice');
+INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES('AllowOnShelfHolds', '0', '', 'Allow hold requests to be placed on items that are not on loan', 'YesNo');
+INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES('AllowHoldsOnDamagedItems', '1', '', 'Allow hold requests to be placed on damaged items', 'YesNo');
 -- FIXME: add FrameworksLoaded, noOPACUserLogin, ReadingHistory ?
index 12f3a49..81e54e0 100755 (executable)
@@ -211,3 +211,5 @@ INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES
 INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES('XSLTDetailsDisplay','0','','Enable XSL stylesheet control over details page display on OPAC WARNING: MARC21 Only','YesNo');
 INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES('XSLTResultsDisplay','0','','Enable XSL stylesheet control over results page display on OPAC WARNING: MARC21 Only','YesNo');
 INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES('AdvancedSearchTypes','itemtypes','itemtypes|ccode','Select which set of fields comprise the Type limit in the advanced search','Choice');
+INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES('AllowOnShelfHolds', '0', '', 'Allow hold requests to be placed on items that are not on loan', 'YesNo');
+INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES('AllowHoldsOnDamagedItems', '1', '', 'Allow hold requests to be placed on damaged items', 'YesNo');
index ae59105..1e75e9a 100755 (executable)
@@ -1767,6 +1767,14 @@ END_SQL
     SetVersion ($DBversion);
 }
 
+$DBversion = "3.00.00.092";
+if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
+    $dbh->do("INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES('AllowOnShelfHolds', '0', '', 'Allow hold requests to be placed on items that are not on loan', 'YesNo')");
+    $dbh->do("INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES('AllowHoldsOnDamagedItems', '1', '', 'Allow hold requests to be placed on damaged items', 'YesNo')");
+       print "Upgrade to $DBversion done (added new AllowOnShelfHolds syspref)\n";
+    SetVersion ($DBversion);
+}
+
 =item DropAllForeignKeys($table)
 
   Drop all foreign keys of the table $table
index 956817d..340b88b 100644 (file)
@@ -10,7 +10,7 @@
 use strict;
 
 sub kohaversion {
-    our $VERSION = "3.00.00.091";
+    our $VERSION = "3.00.00.092";
     # version needs to be set this way
     # so that it can be picked up by Makefile.PL
     # during install