From 74b7f3c082693eef9805c13b1289ba8b01c025d8 Mon Sep 17 00:00:00 2001 From: Hayley Mapley Date: Wed, 3 Apr 2019 10:51:38 +1300 Subject: [PATCH] Bug 18450: Only allow Override for renewals according to relevant sysprefs This patch adds a conditional which refers to the system preferences AllowRenewalIfOtherItemsAvailable and AllowRenewalLimitOverride to control the display of the 'Override and renew' button, in addition to the 'Continue without renewing', when renewing an item that has been placed on hold. Test plan: --NOTE-- The following renewals must be completedd in Circulation->Renew 1) Apply the patch, and ensure the following steps work as described 2) In More->Administration->Global system preferences ensure that both the AllowRenewalLimitOverride and AllowRenewalIfOtherItemsAvailable preferences are both set to 'Don't allow' 3) Item levelOnly one available item: Try to renew an item (with item level hold on it) which belongs to a biblio with only one item. Note the only button in the yellow alert box displayed is 'Continue without renewing' 4) Record level/Only one available item: Try to renew an item (this time with a 'Next Available' hold on the record) which belongs to a biblio with only one item. Note the only button in the yellow alert box displayed is 'Continue without renewing' 5) Item level/Multiple available items: Try to renew an item (with item level hold on it) which belongs to a biblio with multiple available items of it in the catalogue. Note only the 'Continue without renewing' button is displayed 6) Record level/Multiple available items: Try to renew an item (with item level hold on it) which belongs to a biblio with multiple available items of it in the catalogue. Note only the 'Continue without renewing' button is displayed 7) Set both AllowRenewalLimitOverride and AllowRenewalIfOtherItemsAvailable system preferences to 'Allow' 8) Repeat step 3, and note only the 'Continue without renewing' button is displayed in the yellow alert box 9) Repeat step 4, and note the only button in the yellow alert box displayed is 'Continue without renewing' 10) Repeat step 5, not only the 'Continue without renewing' button is displayed (because the hold is for that specific item) 11) Repeat step 6, note the item is immediately renewed and the yellow alert box is not displayed 12) Set the AllowRenewalIfOtherItemsAvailable to 'Don't Allow' and repeat steps 3-6, and note that only the 'Continue without renewing' button is displayed 13) Set the AllowRenewalIfOtherItemsAvailable system preference back to 'Allow' and AllowRenewalLimitOverride syspref to 'Don't Allow', and repeat steps 3-5 and note only the 'Continue without renewal' button is displayed. 14) Repeat step 6 and note that the item is immediately renewed with no yellow warning box. Sponsored-by: Catalyst IT Signed-off-by: Liz Rea --- koha-tmpl/intranet-tmpl/prog/en/modules/circ/renew.tt | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/renew.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/renew.tt index c0542dbd0f..b1058ba8f3 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/renew.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/renew.tt @@ -114,12 +114,19 @@

This item is on hold for another patron.

-
- - - - -
+ [% IF ((!Koha.Preference('AllowRenewalLimitOverride')) && + ((Koha.Preference('AllowRenewalIfOtherItemsAvailable'))) && can_renew == 1) || + ((Koha.Preference('AllowRenewalLimitOverride')) && + ((Koha.Preference('AllowRenewalIfOtherItemsAvailable'))) && can_renew == 1 ) %] + +
+ + + + +
+ + [% END %] [% ELSIF error == "patron_restricted" %] -- 2.11.0