From dff9c9da876fc36fd4d5f5381611ccdf98c10cd7 Mon Sep 17 00:00:00 2001 From: Andrew Isherwood Date: Fri, 26 Apr 2019 10:58:31 +0100 Subject: [PATCH] Bug 7088: (follow-up) Modify checkbox enabling As described in comment #50, we need to only enable renewal on items that are disabled in line with which sysprefs are enabled. So we now only enable renewal of on hold items if the AllowRenewalOnHoldOverride syspref is on and we only enable renewal of all other limited items when the AllowRenewalLimitOverride syspref is on. NOTE: The test plan below has changed substantially from previous iterations Test plan (you might want to make a coffee first...): - Apply patch - Rebuild CSS - Go to the Patron Details page for a patron who has an item on loan that would fulfil an outstanding loan request. - The patron also needs to have an item on loan that cannot be renewed for some other reason, say renewal limit has been reached => TEST: Observe that it is NOT possible to select either item for renewal - Enable the "AllowRenewalLimitOverride" syspref - Return to the Patron Details page - Check the "Override renewal restrictions" checkbox => TEST: Observe that it IS possible to select the the item that has reached the renewal limit, but not the item that is on hold - Disable the "AllowRenewalLimitOverride" syspref - Enable the "AllowRenewalOnHoldOverride" syspref - Return to the Patron Details page - Check the "Override renewal restrictions" checkbox => TEST: Observe that it is NOT possible to select the the item that has reached the renewal limit, but it IS possible to select the item on hold - Enable the "AllowRenewalLimitOverride" syspref - Enable the "AllowRenewalOnHoldOverride" syspref - Return to the Patron Details page - Check the "Override renewal restrictions" checkbox => TEST: Observe that it IS possible to select the the item that has reached the renewal limit, AND it IS possible to select the item on hold - Select the item that is on hold => TEST: Observe that an additional "On hold due date" input box is displayed - De-select the item => TEST: Observe that an additional "On hold due date" input box is hidden - Select the item - In the "On hold due date" input box, select a due date for the item - Click "Renew or check in selected items" => TEST: Observe that the item is renewed as usual - In the "Renewal due date" input box, select a due date - Remove the contents of the "On hold due date" input box - Click "Renew or check in selected items" => TEST: Observe that the item is renewed by falling back to the "Renewal due date" value if a value is not specified in the "On hold due date" input box - Remove the contents of the "Renewal due date" input box - Click "Renew or check in selected items" => TEST: Observe that the standard loan period is used for the renewal period if no due date is specified in either box - In the "On hold due date" input box, select a due date for the item - In the "Renewal due date" input box, select a different due date - Click "Renew all" => TEST: Observe that all non on hold items are renewed using the value in "Renewal due date" and on hold items are renewed using the value in "On hold due date" - From the main staff client from page, choose "Circulation", then choose "Renew" - Enter the barcode of an item that you know to be on hold and submit => TEST: In the alert box that appears, observe that a date picker is displayed - Choose a due date for this item, then click "Override and renew" => TEST: In the "Item renewed" box, observe that the item has been renewed to the date specified --- koha-tmpl/intranet-tmpl/prog/js/checkouts.js | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/js/checkouts.js b/koha-tmpl/intranet-tmpl/prog/js/checkouts.js index 9fe2ebfde3..66c5f8b939 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/checkouts.js +++ b/koha-tmpl/intranet-tmpl/prog/js/checkouts.js @@ -413,7 +413,7 @@ $(document).ready(function() { + ""; span_style = "display: none"; - span_class = "renewals-allowed"; + span_class = "renewals-allowed-on_reserve"; } else if ( oObj.can_renew_error == "too_many" ) { msg += "" + NOT_RENEWABLE @@ -790,9 +790,17 @@ $(document).ready(function() { if ( AllowRenewalLimitOverride || AllowRenewalOnHoldOverride ) { $( '#override_limit' ).click( function () { if ( this.checked ) { - $( '.renewals-allowed' ).show(); $( '.renewals-disabled' ).hide(); + if ( AllowRenewalLimitOverride ) { + $( '.renewals-allowed' ).show(); + $( '.renewals-disabled' ).hide(); + } + if ( AllowRenewalOnHoldOverride ) { + $( '.renewals-allowed-on_reserve' ).show(); + } } else { - $( '.renewals-allowed' ).hide(); $( '.renewals-disabled' ).show(); + $( '.renewals-allowed' ).hide(); + $( '.renewals-allowed-on_reserve' ).hide(); + $( '.renewals-disabled' ).show(); } } ).prop('checked', false); } -- 2.11.0