From cc7726969484222dba9a5d76aaca6c5661c24fdd Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Thu, 28 Apr 2016 15:32:09 +0000 Subject: [PATCH] Bug 15533 [QA Followup] - Add a system preference Signed-off-by: Katrin Fischer Signed-off-by: Kyle M Hall --- .../data/mysql/atomicupdate/hold_itype.sql | 3 +++ installer/data/mysql/sysprefs.sql | 1 + .../admin/preferences/circulation.pref | 6 ++++++ .../prog/en/modules/reserve/request.tt | 20 ++++++++++--------- .../bootstrap/en/modules/opac-reserve.tt | 20 ++++++++++--------- 5 files changed, 32 insertions(+), 18 deletions(-) diff --git a/installer/data/mysql/atomicupdate/hold_itype.sql b/installer/data/mysql/atomicupdate/hold_itype.sql index 200dcfe133..60301b6402 100644 --- a/installer/data/mysql/atomicupdate/hold_itype.sql +++ b/installer/data/mysql/atomicupdate/hold_itype.sql @@ -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'); diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql index 9e7bc3d425..fed0ed9819 100644 --- a/installer/data/mysql/sysprefs.sql +++ b/installer/data/mysql/sysprefs.sql @@ -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'), diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref index 8cdba081e5..37b8d57fe5 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref @@ -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: diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt index d2482065e8..c0cd0f97ab 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt @@ -412,15 +412,17 @@ function checkMultiHold() { [% UNLESS ( multi_hold ) %] -
  • - - -
  • + [% IF Koha.Preference('AllowHoldItemTypeSelection') %] +
  • + + +
  • + [% END %] [% END %] [% IF ( reserve_in_future ) %] diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt index 01032ccf8f..3b8ba6cf0a 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt @@ -250,15 +250,17 @@ [% UNLESS ( multi_hold ) %] -
  • - - -
  • + [% IF Koha.Preference('AllowHoldItemTypeSelection') %] +
  • + + +
  • + [% END %] [% END %] [% IF ( OpacHoldNotes ) %] -- 2.39.5