3 load_lib('circ/circ_lib.js');
4 load_lib('JSON_v1.js');
5 log_vars('circ_permit_hold');
9 if( isTrue(patron.barred) )
10 result.events.push('PATRON_BARRED');
12 if( isTrue(copy.ref) )
13 result.events.push('ITEM_NOT_HOLDABLE');
15 if( !isTrue(copy.circulate) )
16 result.events.push('ITEM_NOT_HOLDABLE');
19 var config = findGroupConfig(patronProfile);
23 /* see if they have too many items out */
24 var limit = config.maxHolds;
25 var count = userHoldCount(patron.id);
26 if( limit >= 0 && count >= limit ) {
27 log_info("patron has " + count + " open holds");
28 result.events.push('MAX_HOLDS');