From 5633d7a11cce4951697d0b1507b5ffbbc5ee598a Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Fri, 20 Jun 2008 13:59:32 -0500 Subject: [PATCH] bug 1710 and 1739: two new sysprefs (DB rev 092) 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 --- admin/systempreferences.pl | 2 ++ installer/data/mysql/en/mandatory/sysprefs.sql | 2 ++ .../fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql | 2 ++ installer/data/mysql/updatedatabase.pl | 8 ++++++++ kohaversion.pl | 2 +- 5 files changed, 15 insertions(+), 1 deletion(-) diff --git a/admin/systempreferences.pl b/admin/systempreferences.pl index e7f5a4101e..0556d7c144 100755 --- a/admin/systempreferences.pl +++ b/admin/systempreferences.pl @@ -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"; diff --git a/installer/data/mysql/en/mandatory/sysprefs.sql b/installer/data/mysql/en/mandatory/sysprefs.sql index 5fb9c6a665..163b94c272 100755 --- a/installer/data/mysql/en/mandatory/sysprefs.sql +++ b/installer/data/mysql/en/mandatory/sysprefs.sql @@ -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 ? diff --git a/installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql b/installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql index 12f3a494cf..81e54e085c 100755 --- a/installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql +++ b/installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql @@ -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'); diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index ae591056ea..1e75e9a2f2 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -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 diff --git a/kohaversion.pl b/kohaversion.pl index 956817d6d2..340b88b4ac 100644 --- a/kohaversion.pl +++ b/kohaversion.pl @@ -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 -- 2.39.5