if no copies are allowed for the hold recipient, then we check the
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 25 Oct 2006 16:24:03 +0000 (16:24 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 25 Oct 2006 16:24:03 +0000 (16:24 +0000)
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
Open-ILS/src/javascript/backend/circ/circ_permit_hold.js
Open-ILS/web/opac/skin/default/js/holds.js

index 886eb23..a6740e1 100644 (file)
@@ -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);
 }
index e9d0ad8..a8c447e 100644 (file)
@@ -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');
+               }
        }
 }
 
index c7e42d9..ef852f4 100644 (file)
@@ -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 
        };