From 9a6908fdc2fd4bff4ef1f1b418f9805f7f392e03 Mon Sep 17 00:00:00 2001 From: erickson Date: Wed, 25 Oct 2006 16:24:03 +0000 Subject: [PATCH] if no copies are allowed for the hold recipient, then we check the request_lib of the hold to see if the requestor's location is within the correct hold range git-svn-id: svn://svn.open-ils.org/ILS/trunk@6507 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/src/javascript/backend/circ/circ_lib.js | 2 ++ Open-ILS/src/javascript/backend/circ/circ_permit_hold.js | 11 +++++++++-- Open-ILS/web/opac/skin/default/js/holds.js | 3 ++- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/Open-ILS/src/javascript/backend/circ/circ_lib.js b/Open-ILS/src/javascript/backend/circ/circ_lib.js index 886eb23d78..a6740e1d87 100644 --- a/Open-ILS/src/javascript/backend/circ/circ_lib.js +++ b/Open-ILS/src/javascript/backend/circ/circ_lib.js @@ -39,6 +39,7 @@ var patronFines = environment.patronFines; var isRenewal = environment.isRenewal; var isPrecat = environment.isPrecat; var currentLocation = environment.location; +var holdRequestLib = environment.requestLib; @@ -251,6 +252,7 @@ function log_vars( prefix ) { str += ' Is Renewal: ' + ( (isTrue(isRenewal)) ? "yes" : "no" ); str += ' Is Precat: ' + ( (isTrue(isPrecat)) ? "yes" : "no" ); + str += (holdRequestLib) ? ' Hold request lib is ' + holdRequestLib.shortname : ''; log_info(str); } diff --git a/Open-ILS/src/javascript/backend/circ/circ_permit_hold.js b/Open-ILS/src/javascript/backend/circ/circ_permit_hold.js index e9d0ad8d6c..a8c447e2ea 100644 --- a/Open-ILS/src/javascript/backend/circ/circ_permit_hold.js +++ b/Open-ILS/src/javascript/backend/circ/circ_permit_hold.js @@ -47,9 +47,16 @@ if( ( marcItemType == 'g' || log_info("patron and copy circ_lib share a common ancestor, hold allowed"); } else { + log_info("patron and copy circ_lib do NOT share a common ancestor"); - log_info("patron and copy circ_lib do NOT share a common ancestor, hold on this type of material not allowed"); - result.events.push('ITEM_NOT_HOLDABLE'); + if( hasCommonAncestor( copy.circ_lib.id, holdRequestLib.id, 1) ) { + log_info("request_lib and copy circ_lib DO share a common ancestor"); + + } else { + + log_info("request_lib and copy circ_lib also do NOT share a common ancestor, hold on this type of material not allowed"); + result.events.push('ITEM_NOT_HOLDABLE'); + } } } diff --git a/Open-ILS/web/opac/skin/default/js/holds.js b/Open-ILS/web/opac/skin/default/js/holds.js index c7e42d921a..ef852f467a 100644 --- a/Open-ILS/web/opac/skin/default/js/holds.js +++ b/Open-ILS/web/opac/skin/default/js/holds.js @@ -547,7 +547,8 @@ function holdsCheckPossibility(pickuplib, hold, recurse) { volume_id : holdArgs.volume, copy_id : holdArgs.copy, hold_type : holdArgs.type, - patronid : G.user.id(), + //patronid : G.user.id(), + patronid : holdArgs.recipient.id(), depth : 0, pickup_lib : pickuplib }; -- 2.11.0