Bug 15533 [QA Followup] - Add a system preference
authorKyle M Hall <kyle@bywatersolutions.com>
Thu, 28 Apr 2016 15:32:09 +0000 (15:32 +0000)
committerKyle M Hall <kyle@bywatersolutions.com>
Fri, 29 Apr 2016 10:26:04 +0000 (10:26 +0000)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
installer/data/mysql/atomicupdate/hold_itype.sql
installer/data/mysql/sysprefs.sql
koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref
koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt

index 200dcfe..60301b6 100644 (file)
@@ -5,3 +5,6 @@ ALTER TABLE reserves ADD CONSTRAINT `reserves_ibfk_5` FOREIGN KEY (`itemtype`) R
 ALTER TABLE old_reserves ADD COLUMN itemtype VARCHAR(10) NULL DEFAULT NULL AFTER suspend_until;
 ALTER TABLE old_reserves ADD KEY `itemtype` (`itemtype`);
 ALTER TABLE old_reserves ADD CONSTRAINT `old_reserves_ibfk_4` FOREIGN KEY (`itemtype`) REFERENCES `itemtypes` (`itemtype`) ON DELETE CASCADE ON UPDATE CASCADE;
+
+INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES
+('AllowHoldItemTypeSelection','0','','If enabled, patrons and staff will be able to select the itemtype when placing a hold','YesNo');
index 9e7bc3d..fed0ed9 100644 (file)
@@ -17,6 +17,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `
 ('AllowAllMessageDeletion','0','','Allow any Library to delete any message','YesNo'),
 ('AllowFineOverride','0','0','If on, staff will be able to issue books to patrons with fines greater than noissuescharge.','YesNo'),
 ('AllowHoldDateInFuture','0','','If set a date field is displayed on the Hold screen of the Staff Interface, allowing the hold date to be set in the future.','YesNo'),
+('AllowHoldItemTypeSelection','0','','If enabled, patrons and staff will be able to select the itemtype when placing a hold','YesNo'),
 ('AllowHoldPolicyOverride','0',NULL,'Allow staff to override hold policies when placing holds','YesNo'),
 ('AllowHoldsOnDamagedItems','1','','Allow hold requests to be placed on damaged items','YesNo'),
 ('AllowHoldsOnPatronsPossessions','1',NULL,'Allow holds on records that patron have items of it','YesNo'),
index 8cdba08..37b8d57 100644 (file)
@@ -443,6 +443,12 @@ Circulation:
             - "it will be updated to the right-hand value. E.g. '-1: 0' will cause an item that was set to 'Ordered' to now be available for loan."
             - Each pair of values should be on a separate line.
     Holds Policy:
+        -
+            - pref: AllowHoldItemTypeSelection
+              choices:
+                  yes: Allow
+                  no: "Don't allow"
+            - hold fulfillment to be limited by itemtype.
         -
             - pref: AllowRenewalIfOtherItemsAvailable
               choices:
index d248206..c0cd0f9 100644 (file)
@@ -412,15 +412,17 @@ function checkMultiHold() {
         </li>
 
         [% UNLESS ( multi_hold ) %]
-            <li>
-                <label for="itemtype">Request specific item type:</label>
-                <select name="itemtype" size="1" id="itemtype">
-                    <option value="">Any item type</option>
-                    [%- FOREACH itemtype IN available_itemtypes %]
-                        <option value="[% itemtype %]">[% ItemTypes.GetDescription( itemtype ) %]</option>
-                    [%- END %]
-                </select>
-            </li>
+            [% IF Koha.Preference('AllowHoldItemTypeSelection') %]
+                <li>
+                    <label for="itemtype">Request specific item type:</label>
+                    <select name="itemtype" size="1" id="itemtype">
+                        <option value="">Any item type</option>
+                        [%- FOREACH itemtype IN available_itemtypes %]
+                            <option value="[% itemtype %]">[% ItemTypes.GetDescription( itemtype ) %]</option>
+                        [%- END %]
+                    </select>
+                </li>
+            [% END %]
         [% END %]
 
        [% IF ( reserve_in_future ) %]
index 01032cc..3b8ba6c 100644 (file)
                                                         </li>
 
                                                         [% UNLESS ( multi_hold ) %]
-                                                            <li>
-                                                                <label for="itemtype">Request specific item type:</label>
-                                                                <select name="itemtype" size="1" id="itemtype">
-                                                                    <option value="">Any item type</option>
-                                                                    [%- FOREACH itemtype IN available_itemtypes %]
-                                                                        <option value="[% itemtype %]">[% ItemTypes.GetDescription( itemtype ) %]</option>
-                                                                    [%- END %]
-                                                                </select>
-                                                            </li>
+                                                            [% IF Koha.Preference('AllowHoldItemTypeSelection') %]
+                                                                <li>
+                                                                    <label for="itemtype">Request specific item type:</label>
+                                                                    <select name="itemtype" size="1" id="itemtype">
+                                                                        <option value="">Any item type</option>
+                                                                        [%- FOREACH itemtype IN available_itemtypes %]
+                                                                            <option value="[% itemtype %]">[% ItemTypes.GetDescription( itemtype ) %]</option>
+                                                                        [%- END %]
+                                                                    </select>
+                                                                </li>
+                                                            [% END %]
                                                         [% END %]
 
                                                         [% IF ( OpacHoldNotes ) %]