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
var isRenewal = environment.isRenewal;
var isPrecat = environment.isPrecat;
var currentLocation = environment.location;
+var holdRequestLib = environment.requestLib;
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);
}
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');
+ }
}
}
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
};