3 load_lib('circ/circ_lib.js');
4 log_vars('circ_permit_hold');
6 if( isTrue(patron.barred) )
7 result.events.push('PATRON_BARRED');
10 result.events.push('ITEM_NOT_HOLDABLE');
12 if( !isTrue(copy.circulate) )
13 result.events.push('ITEM_NOT_HOLDABLE');
15 /* all STATELIB items are holdable regardless of type */
16 if( isOrgDescendent('STATELIB', copy.circ_lib.id) ) return;
18 var mod = (copy.circ_modifier) ? copy.circ_modifier.toLowerCase() : "";
20 log_info("circ-modifier = "+mod);
22 if( mod == 'bestsellernh' )
23 result.events.push('ITEM_NOT_HOLDABLE');
25 var marcItemType = getMARCItemType();
28 if( ( marcItemType == 'g' ||
29 marcItemType == 'i' ||
30 marcItemType == 'j' ||
31 mod == 'softwrlong' ||
37 isTrue(copy.deposit) ||
38 mod == 'video-long' ||
41 isAnc = hasCommonAncestor( copy.circ_lib.id, patron.home_ou.id, 1 );
44 log_info("patron and copy circ_lib share a common ancestor, hold allowed");
47 log_info("patron and copy circ_lib do NOT share a common ancestor");
49 if( hasCommonAncestor( copy.circ_lib.id, holdRequestLib.id, 1) ) {
50 log_info("request_lib and copy circ_lib DO share a common ancestor");
54 log_info("request_lib and copy circ_lib also do NOT share a common ancestor, hold on this type of material not allowed");
55 result.events.push('ITEM_NOT_HOLDABLE');