From f653b9b6d75a2c1cc8fd8e54ec9864457fe83562 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 --- installer/data/mysql/atomicupdate/hold_itype.sql | 3 +++ installer/data/mysql/sysprefs.sql | 1 + .../en/modules/admin/preferences/circulation.pref | 6 ++++++ .../intranet-tmpl/prog/en/modules/reserve/request.tt | 20 +++++++++++--------- .../opac-tmpl/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 200dcfe..60301b6 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 9e7bc3d..fed0ed9 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 8cdba08..37b8d57 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 @@ -444,6 +444,12 @@ Circulation: - 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: yes: Allow 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 d248206..c0cd0f9 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 01032cc..3b8ba6c 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.1.4