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.
---
 admin/systempreferences.pl                         |    2 ++
 installer/data/mysql/en/mandatory/sysprefs.sql     |    2 ++
 .../1-Obligatoire/unimarc_standard_systemprefs.sql |    2 ++
 installer/data/mysql/updatedatabase.pl             |    8 ++++++++
 kohaversion.pl                                     |    2 +-
 5 files changed, 15 insertions(+), 1 deletions(-)

diff --git a/admin/systempreferences.pl b/admin/systempreferences.pl
index e7f5a41..0556d7c 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 5fb9c6a..163b94c 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 12f3a49..81e54e0 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 ae59105..1e75e9a 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 956817d..340b88b 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
-- 
1.5.5.GIT

_______________________________________________
Koha-patches mailing list
[email protected]
http://lists.koha.org/mailman/listinfo/koha-patches

Reply via email to